00001 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */ 00002 /* 00003 decode.h 00004 heraia - an hexadecimal file editor and analyser based on ghex 00005 00006 (C) Copyright 2005 - 2007 Olivier Delhomme 00007 e-mail : heraia@delhomme.org 00008 URL : http://heraia.tuxfamily.org 00009 00010 This program is free software; you can redistribute it and/or modify 00011 it under the terms of the GNU General Public License as published by 00012 the Free Software Foundation; either version 2, or (at your option) 00013 any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00023 00024 00025 #ifndef _DECODE_H_ 00026 #define _DECODE_H_ 00027 /* templates */ 00028 typedef gchar *(* DecodeFunc) (guchar *); /* Decode gunction template for numbers*/ 00029 typedef gchar *(* DecodeDateFunc) (guchar *, date_and_time_t *mydate); /* Decode function template for dates */ 00030 00031 /* bits */ 00032 extern gchar *decode_to_bits(guchar *data); 00033 00034 /* dates */ 00035 extern gchar *decode_dos_date(guchar *data, date_and_time_t *mydate); 00036 extern gchar *decode_filetime_date(guchar *data, date_and_time_t *mydate); 00037 extern gchar *decode_C_date(guchar *data, date_and_time_t *mydate); 00038 extern gchar *decode_HFS_date(guchar *data, date_and_time_t *mydate); 00039 00040 /* bcd */ 00041 extern gchar *decode_packed_BCD(guchar *data); 00042 00043 /* numbers */ 00044 extern gchar *decode_8bits_signed(guchar *data); 00045 extern gchar *decode_8bits_unsigned(guchar *data); 00046 extern gchar *decode_16bits_signed(guchar *data); 00047 extern gchar *decode_16bits_unsigned(guchar *data); 00048 extern gchar *decode_32bits_signed(guchar *data); 00049 extern gchar *decode_32bits_unsigned(guchar *data); 00050 extern gchar *decode_64bits_signed(guchar *data); 00051 extern gchar *decode_64bits_unsigned(guchar *data); 00052 00053 /* Utils */ 00054 extern gboolean swap_bytes(guchar *to_swap, guint first, guint last); 00055 extern void reverse_byte_order(guchar *to_reverse); 00056 #endif /* _DECODE_H_ */