diff options
| author | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
| commit | 0febbff19e05cb1a6c2613eee76ad46a669c96cd (patch) | |
| tree | b6442d01348e2ba6404d0fd6abcc4eb6d6cc1390 /src/lib/openjpip/manfbox_manager.c | |
| parent | bede1568b197021bb576b935422af6c1d0a79e21 (diff) | |
processed all c/h files through astyle with opj_astyle.cfgcodingstyle
Diffstat (limited to 'src/lib/openjpip/manfbox_manager.c')
| -rw-r--r-- | src/lib/openjpip/manfbox_manager.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/lib/openjpip/manfbox_manager.c b/src/lib/openjpip/manfbox_manager.c index 66269577..14be3a58 100644 --- a/src/lib/openjpip/manfbox_manager.c +++ b/src/lib/openjpip/manfbox_manager.c @@ -44,72 +44,72 @@ manfbox_param_t * gene_manfbox( box_param_t *box) { - manfbox_param_t *manf; /* manifest parameters */ - boxheader_param_t *bh; /* current box pointer */ - boxheader_param_t *last; /* last boxheader pointer of the list */ - OPJ_OFF_T pos; /* current position in manf_box contents; */ - - manf = ( manfbox_param_t *)malloc( sizeof( manfbox_param_t)); - - pos = 0; - manf->first = last = NULL; - - while( (OPJ_SIZE_T)pos < get_DBoxlen( box)){ - - bh = gene_childboxheader( box, pos); - pos += bh->headlen; - - /* insert into the list */ - if( manf->first) - last->next = bh; - else - manf->first = bh; - last = bh; - } - return manf; + manfbox_param_t *manf; /* manifest parameters */ + boxheader_param_t *bh; /* current box pointer */ + boxheader_param_t *last; /* last boxheader pointer of the list */ + OPJ_OFF_T pos; /* current position in manf_box contents; */ + + manf = ( manfbox_param_t *)malloc( sizeof( manfbox_param_t)); + + pos = 0; + manf->first = last = NULL; + + while( (OPJ_SIZE_T)pos < get_DBoxlen( box)) { + + bh = gene_childboxheader( box, pos); + pos += bh->headlen; + + /* insert into the list */ + if( manf->first) + last->next = bh; + else + manf->first = bh; + last = bh; + } + return manf; } void delete_manfbox( manfbox_param_t **manf) { - boxheader_param_t *bhPtr, *bhNext; - - bhPtr = (*manf)->first; - while( bhPtr != NULL){ - bhNext = bhPtr->next; + boxheader_param_t *bhPtr, *bhNext; + + bhPtr = (*manf)->first; + while( bhPtr != NULL) { + bhNext = bhPtr->next; #ifndef SERVER - /* fprintf( logstream, "local log: boxheader %.4s deleted!\n", bhPtr->type); */ + /* fprintf( logstream, "local log: boxheader %.4s deleted!\n", bhPtr->type); */ #endif - free(bhPtr); - bhPtr = bhNext; - } - free( *manf); + free(bhPtr); + bhPtr = bhNext; + } + free( *manf); } void print_manfbox( manfbox_param_t *manf) { - boxheader_param_t *ptr; + boxheader_param_t *ptr; - ptr = manf->first; - while( ptr != NULL){ - print_boxheader( ptr); - ptr=ptr->next; - } + ptr = manf->first; + while( ptr != NULL) { + print_boxheader( ptr); + ptr=ptr->next; + } } boxheader_param_t * search_boxheader( const char type[], manfbox_param_t *manf) { - boxheader_param_t *found; - - found = manf->first; - - while( found != NULL){ - - if( strncmp( type, found->type, 4) == 0) - return found; - - found = found->next; - } - fprintf( FCGI_stderr, "Error: Boxheader %s not found\n", type); - - return NULL; + boxheader_param_t *found; + + found = manf->first; + + while( found != NULL) { + + if( strncmp( type, found->type, 4) == 0) + return found; + + found = found->next; + } + fprintf( FCGI_stderr, "Error: Boxheader %s not found\n", type); + + return NULL; } |
