@ -187,7 +187,7 @@ struct _Magic
gulong offset ;
gulong offset ;
guint data_size ;
guint data_size ;
MagicCheckType magic_check ;
MagicCheckType magic_check ;
guint32 data_ tq mask;
guint32 data_ mask;
MagicData value ;
MagicData value ;
guint read_string : 1 ;
guint read_string : 1 ;
guint read_size : 1 ;
guint read_size : 1 ;
@ -364,16 +364,16 @@ magic_parse_type (Magic *magic,
{
{
string + = 1 ;
string + = 1 ;
if ( string [ 0 ] = = ' 0 ' )
if ( string [ 0 ] = = ' 0 ' )
magic - > data_ tq mask = strtol ( string , & f , string [ 1 ] = = ' x ' ? 16 : 8 ) ;
magic - > data_ mask = strtol ( string , & f , string [ 1 ] = = ' x ' ? 16 : 8 ) ;
else
else
magic - > data_ tq mask = strtol ( string , & f , 10 ) ;
magic - > data_ mask = strtol ( string , & f , 10 ) ;
if ( f & & * f ! = 0 )
if ( f & & * f ! = 0 )
return FALSE ;
return FALSE ;
while ( * string )
while ( * string )
string + + ;
string + + ;
}
}
else
else
magic - > data_ tq mask = 0xffffffff ;
magic - > data_ mask = 0xffffffff ;
return * string = = 0 ;
return * string = = 0 ;
}
}
@ -464,31 +464,31 @@ magic_check_data (Magic *magic,
cmp = 1 ;
cmp = 1 ;
break ;
break ;
case MAGIC_CHECK_INT_EQUAL :
case MAGIC_CHECK_INT_EQUAL :
data - > v_int32 & = magic - > data_ tq mask;
data - > v_int32 & = magic - > data_ mask;
cmp = data - > v_int32 = = magic - > value . v_int32 ;
cmp = data - > v_int32 = = magic - > value . v_int32 ;
break ;
break ;
case MAGIC_CHECK_INT_GREATER :
case MAGIC_CHECK_INT_GREATER :
data - > v_int32 & = magic - > data_ tq mask;
data - > v_int32 & = magic - > data_ mask;
cmp = data - > v_int32 > magic - > value . v_int32 ;
cmp = data - > v_int32 > magic - > value . v_int32 ;
break ;
break ;
case MAGIC_CHECK_INT_SMALLER :
case MAGIC_CHECK_INT_SMALLER :
data - > v_int32 & = magic - > data_ tq mask;
data - > v_int32 & = magic - > data_ mask;
cmp = data - > v_int32 < magic - > value . v_int32 ;
cmp = data - > v_int32 < magic - > value . v_int32 ;
break ;
break ;
case MAGIC_CHECK_UINT_GREATER :
case MAGIC_CHECK_UINT_GREATER :
data - > v_uint32 & = magic - > data_ tq mask;
data - > v_uint32 & = magic - > data_ mask;
cmp = data - > v_uint32 > magic - > value . v_uint32 ;
cmp = data - > v_uint32 > magic - > value . v_uint32 ;
break ;
break ;
case MAGIC_CHECK_UINT_SMALLER :
case MAGIC_CHECK_UINT_SMALLER :
data - > v_uint32 & = magic - > data_ tq mask;
data - > v_uint32 & = magic - > data_ mask;
cmp = data - > v_uint32 < magic - > value . v_uint32 ;
cmp = data - > v_uint32 < magic - > value . v_uint32 ;
break ;
break ;
case MAGIC_CHECK_UINT_ZEROS :
case MAGIC_CHECK_UINT_ZEROS :
data - > v_uint32 & = magic - > data_ tq mask;
data - > v_uint32 & = magic - > data_ mask;
cmp = ( data - > v_int32 & magic - > value . v_int32 ) = = 0 ;
cmp = ( data - > v_int32 & magic - > value . v_int32 ) = = 0 ;
break ;
break ;
case MAGIC_CHECK_UINT_ONES :
case MAGIC_CHECK_UINT_ONES :
data - > v_uint32 & = magic - > data_ tq mask;
data - > v_uint32 & = magic - > data_ mask;
cmp = ( data - > v_int32 & magic - > value . v_int32 ) = = magic - > value . v_int32 ;
cmp = ( data - > v_int32 & magic - > value . v_int32 ) = = magic - > value . v_int32 ;
break ;
break ;
case MAGIC_CHECK_STRING_EQUAL :
case MAGIC_CHECK_STRING_EQUAL :