decode.h File Reference


Detailed Description

Header for decoding things (numbers, dates, binary, .

..)

Definition in file decode.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

gchar * decode_8bits_unsigned (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 1 byte data stream and convert it as if it is an 8 bits unsigned number
gchar * decode_8bits_signed (guchar *data, gpointer data_struct)
 General purpose of this function is to take a 1 byte data stream and convert it as if it is an 8 bits signed number.
gchar * decode_16bits_signed (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 2 byte data stream and convert it as if it is a 16 bits signed number
gchar * decode_16bits_unsigned (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 2 byte data stream and convert it as if it is a 16 bits unsigned number
gchar * decode_32bits_signed (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a 32 bits signed number
gchar * decode_32bits_unsigned (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a 32 bits unsigned number
gchar * decode_64bits_signed (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 8 byte data stream and convert it as if it is a 64 bits signed number
gchar * decode_64bits_unsigned (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 8 byte data stream and convert it as if it is a 64 bits unsigned number
gchar * decode_float_normal (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a float number normal notation
gchar * decode_float_scientific (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a float number normal notation
gchar * decode_double_normal (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 8 byte data stream and convert it as if it is a float number normal notation
gchar * decode_double_scientific (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 8 byte data stream and convert it as if it is a float number normal notation
gchar * decode_to_bits (guchar *data, gpointer data_struct)
 decodes the stream represented by *data (one byte) to a string containing eight 0 or 1 (Little Endian style)
gchar * decode_dos_date (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a dos date.
gchar * decode_filetime_date (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 8 byte data stream and convert it as if it is a filetime date.
gchar * decode_C_date (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a C date.
gchar * decode_HFS_date (guchar *data, gpointer data_struct)
 general purpose of this function is to take a 4 byte data stream and convert it as if it is a HFS date.
gchar * decode_packed_BCD (guchar *data, gpointer data_struct)
 Decode one byte as a Packed BCD (Binary Coded Decimal) and return a gchar* that may be freed when no longer needed.
gboolean swap_bytes (guchar *to_swap, guint first, guint last)
 Swap bytes from the buffer to_swap.
void reverse_byte_order (guchar *to_reverse)
 Reverse the byte order LSB -> MSB in MSB -> LSB 12345678 in 87654321.
decode_parameters_tnew_decode_parameters_t (guint endianness, guint stream_size)
 Make an new decode_parameters_t in order to pass to the functions.
decode_tnew_decode_t (DecodeFunc decode_func, GtkWidget *entry)
 Make a new decode_t structure.
decode_generic_tnew_decode_generic_t (gchar *label, guint data_size, gboolean fixed_size, guint nb_cols,...)
 Make a new decode_generic_t structure and creates the associated widgets.


Function Documentation

gchar* decode_16bits_signed ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 2 byte data stream and convert it as if it is a 16 bits signed number

Parameters:
data : 2 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 95 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_16bits_unsigned ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 2 byte data stream and convert it as if it is a 16 bits unsigned number

Parameters:
data : 2 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 118 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_32bits_signed ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a 32 bits signed number

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 141 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_32bits_unsigned ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a 32 bits unsigned number

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 164 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_64bits_signed ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 8 byte data stream and convert it as if it is a 64 bits signed number

Parameters:
data : 8 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 186 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_64bits_unsigned ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 8 byte data stream and convert it as if it is a 64 bits unsigned number

Parameters:
data : 8 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 209 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_8bits_signed ( guchar *  data,
gpointer  data_struct 
)

General purpose of this function is to take a 1 byte data stream and convert it as if it is an 8 bits signed number.

Parameters:
data : 1 guchar
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 48 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_8bits_unsigned ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 1 byte data stream and convert it as if it is an 8 bits unsigned number

Parameters:
data : 1 guchar
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 71 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_C_date ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a C date.

If it is not, the result may be funny ! Counting seconds from 01/01/1970

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

< date resulting of interpretation

< text that is the result of date interpretation

Definition at line 655 of file decode.c.

References date_printf(), and make_date_and_time().

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* decode_dos_date ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a dos date.

If it is not, the result may be funny !

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

< date resulting of interpretation

< text that is the result of date interpretation

Definition at line 559 of file decode.c.

References date_printf(), date_and_time_t::day, date_and_time_t::hour, date_and_time_t::minutes, date_and_time_t::month, date_and_time_t::seconds, and date_and_time_t::year.

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* decode_double_normal ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 8 byte data stream and convert it as if it is a float number normal notation

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 276 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_double_scientific ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 8 byte data stream and convert it as if it is a float number normal notation

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 298 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_filetime_date ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 8 byte data stream and convert it as if it is a filetime date.

If it is not, the result may be funny ! Counting 100th of nanoseconds from 01/01/1601

Parameters:
data : 8 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

< date resulting of interpretation

< text that is the result of date interpretation

Definition at line 624 of file decode.c.

References date_printf(), and make_date_and_time().

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* decode_float_normal ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a float number normal notation

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 232 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_float_scientific ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a float number normal notation

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that may be freed when no longer needed

Definition at line 254 of file decode.c.

Referenced by add_default_tabs().

Here is the caller graph for this function:

gchar* decode_HFS_date ( guchar *  data,
gpointer  data_struct 
)

general purpose of this function is to take a 4 byte data stream and convert it as if it is a HFS date.

If it is not, the result may be funny ! Counting seconds 01/01/1904

Parameters:
data : 4 guchars
data_struct a pointer to a user defined data structure
Returns:
returns a gchar* that may be freed when no longer needed

< date resulting of interpretation

< text that is the result of date interpretation

Definition at line 685 of file decode.c.

References date_printf(), and make_date_and_time().

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* decode_packed_BCD ( guchar *  data,
gpointer  data_struct 
)

Decode one byte as a Packed BCD (Binary Coded Decimal) and return a gchar* that may be freed when no longer needed.

Parameters:
data : stream to decode as 1 guchar
data_struct a pointer to a user defined data structure
Returns:
returns a gchar * that contain the packed BCD interpretation

Definition at line 908 of file decode.c.

References decode_parameters_t::stream_size, and transform_bcd_to_human().

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* decode_to_bits ( guchar *  data,
gpointer  data_struct 
)

decodes the stream represented by *data (one byte) to a string containing eight 0 or 1 (Little Endian style)

Parameters:
data : 1 guchar
data_struct a pointer to a user defined data structure
Returns:
n*9 gchars that are either '1' or '0' or ' ' (as a separator), the string may be freed when no longer needed

Definition at line 717 of file decode.c.

References decode_parameters_t::stream_size.

Referenced by add_default_tabs().

Here is the caller graph for this function:

decode_generic_t* new_decode_generic_t ( gchar *  label,
guint  data_size,
gboolean  fixed_size,
guint  nb_cols,
  ... 
)

Make a new decode_generic_t structure and creates the associated widgets.

Parameters:
label : the label for this row
data_size : a default data_size
fixed_size : TRUE if the size is fixed and should not be updated, FALSE otherwise
nb_cols : number of decoding columns we want
... : va_list of functions to fill in the columns (you MUST have the same number of columns and functions you passes here as arguments)
Returns:
returns a newly allocated decode_generic_t structure filled with the right parameters

< va_list arguments : decoding function names

structure to be initialized and returned

Entry and associated function

< one decoding function

< entry associated to the decoding function

< To keep track of those couples

Definition at line 1048 of file decode.c.

References decode_generic_t::data_size, decode_generic_t::decode_array, decode_generic_t::fixed_size, decode_generic_t::label, and new_decode_t().

Referenced by add_default_tabs().

Here is the call graph for this function:

Here is the caller graph for this function:

decode_parameters_t* new_decode_parameters_t ( guint  endianness,
guint  stream_size 
)

Make an new decode_parameters_t in order to pass to the functions.

Parameters:
endianness : endianness as setup in data interpertor's window
stream_size : stream size as setup with the spin button
Returns:
returns a newly allocated decode_parameters_t structure which may be freed when no longer needed

Definition at line 995 of file decode.c.

References decode_parameters_t::endianness, and decode_parameters_t::stream_size.

Referenced by refresh_data_interpretor_window().

Here is the caller graph for this function:

decode_t* new_decode_t ( DecodeFunc  decode_func,
GtkWidget *  entry 
)

Make a new decode_t structure.

Parameters:
decode_func : pointer to a function that may decode a stream this function must follow DecodeFunc prototype
entry : A GtkWidget entry that will receive the result of the decoding function
Returns:
returns a newly allocated decode_t structure filled with the two parameters.

Definition at line 1017 of file decode.c.

References decode_t::entry, and decode_t::func.

Referenced by new_decode_generic_t().

Here is the caller graph for this function:

void reverse_byte_order ( guchar *  to_reverse  ) 

Reverse the byte order LSB -> MSB in MSB -> LSB 12345678 in 87654321.

Parameters:
[in,out] to_reverse : one guchar to be reversed

Definition at line 970 of file decode.c.

Referenced by change_endianness().

Here is the caller graph for this function:

gboolean swap_bytes ( guchar *  to_swap,
guint  first,
guint  last 
)

Swap bytes from the buffer to_swap.

Warning:
recursive function !! Call with first = 0 and last = last byte of buffer to swap
Parameters:
[in,out] to_swap : buffer to swap
first : first byte in the buffer to swap
last : last byte in the buffer to swap
Returns:
returns TRUE when first is >= to last and this end recursivity

Definition at line 948 of file decode.c.

References swap_bytes().

Referenced by change_endianness(), and swap_bytes().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sat Mar 14 13:44:43 2009 for Heraia by  doxygen 1.5.6