#define FCGI_stdout stdout
#define FCGI_stderr stderr
#define logstream stderr
-#endif //SERVER
+#endif /*SERVER*/
boxlist_param_t * gene_boxlist()
{
if( !boxlist)
boxlist = gene_boxlist();
insert_box_into_list( box, boxlist);
- }while( pos < offset+length);
+ }while( pos < (int)(offset+length));
return boxlist;
}
char *boxtype;
box_param_t *box;
- // read LBox and TBox
+ /* read LBox and TBox*/
if(!(data = fetch_bytes( fd, offset, 8))){
fprintf( FCGI_stderr, "Error: error in gene_boxbyOffset( %d, %lld)\n", fd, offset);
return NULL;
boxlen = (Byte8_t)big4(data);
boxtype = (char *)(data+4);
- // box type constraint
+ /* box type constraint*/
if( !isalpha(boxtype[0]) || !isalpha(boxtype[1]) ||
- (!isalnum(boxtype[2])&&!isblank(boxtype[2])) ||
- (!isalpha(boxtype[3])&&!isblank(boxtype[3]))){
+ (!isalnum(boxtype[2])&&!isspace(boxtype[2])) ||
+ (!isalpha(boxtype[3])&&!isspace(boxtype[3]))){
free( data);
return NULL;
}
if( boxlen == 1){
Byte_t *data2;
headlen = 16;
- // read XLBox
+ /* read XLBox*/
if((data2 = fetch_bytes( fd, offset+8, 8))){
boxlen = big8(data2);
free(data2);
char *boxtype;
box_param_t *box;
- // read LBox and TBox
+ /* read LBox and TBox*/
headlen = 8;
boxlen = (Byte8_t)big4( stream);
boxtype = (char *)( stream+4);
- // box type constraint
+ /* box type constraint*/
if( !isalpha(boxtype[0]) || !isalpha(boxtype[1]) ||
- (!isalnum(boxtype[2])&&!isblank(boxtype[2])) ||
- (!isalpha(boxtype[3])&&!isblank(boxtype[3]))){
+ (!isalnum(boxtype[2])&&!isspace(boxtype[2])) ||
+ (!isalpha(boxtype[3])&&!isspace(boxtype[3]))){
return NULL;
}
if( boxlen == 1){
headlen = 16;
- boxlen = big8( stream+8); // read XLBox
+ boxlen = big8( stream+8); /* read XLBox*/
}
box = (box_param_t *)malloc( sizeof( box_param_t));
box->fd = -1;
box_param_t *foundbox;
- if( length==0){ // set the max length
+ if( length==0){ /* set the max length*/
if( (length = get_filesize( fd) - offset) <= 0)
return NULL;
}
pos = offset;
- while( pos < offset+length-7){ // LBox+TBox-1=7
+ while( pos < offset+length-7){ /* LBox+TBox-1=7*/
- // read LBox and TBox
+ /* read LBox and TBox*/
if((data = fetch_bytes( fd, pos, 8))){
headlen = 8;
boxlen = (Byte8_t)big4(data);
if( boxlen == 1){
Byte_t *data2;
headlen = 16;
- // read XLBox
+ /* read XLBox*/
if((data2 = fetch_bytes( fd, pos+8, 8))){
boxlen = big8(data2);
free(data2);
box_param_t *foundbox;
- if( length<=0){ // set the max length
+ if( length<=0){ /* set the max length*/
fprintf( FCGI_stderr, "func gene_boxbyTypeinStream(), max length must be more than 0\n");
return NULL;
}
pos = offset;
- while( pos < offset+length-7){ // LBox+TBox-1=7
+ while( pos < offset+length-7){ /* LBox+TBox-1=7*/
- // read LBox and TBox
+ /* read LBox and TBox*/
data = stream + pos;
headlen = 8;
boxlen = (Byte8_t)big4(data);
boxtype = (char *)(data+4);
if( boxlen == 1){
- // read XLBox
+ /* read XLBox*/
headlen = 16;
boxlen = big8( data+8);
}