ghex_heraia_interface.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*
00003   ghex_heraia_interface.h
00004   heraia - an hexadecimal file editor and analyser based on ghex
00005 
00006   (C) Copyright 2005 - 2011 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  * @file ghex_heraia_interface.h
00025  * Header file providing an interface to Heraia_Hex
00026  */
00027 #ifndef _GHEX_HERAIA_INTERFACE_H_
00028 #define _GHEX_HERAIA_INTERFACE_H_
00029 
00030 extern gboolean ghex_memcpy(Heraia_Hex *gh, guint64 pos, guint len, guint endianness, guchar *result);
00031 extern gboolean ghex_get_data(GtkWidget *hex_widget, guint length, guint endianness, guchar *c);
00032 extern void ghex_set_data(doc_t *doc, guint64 position, guint rep_len, guint len, guchar *data);
00033 
00034 extern gboolean ghex_get_data_position(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness, guchar *c);
00035 
00036 extern guchar *ghex_get_data_to_ascii(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness);
00037 extern guchar *ghex_get_data_to_hex(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness);
00038 
00039 extern gint ghex_compare_data(doc_t *doc, guchar *string,  guint buffer_size, guint64 position);
00040 
00041 extern doc_t *heraia_hex_document_new(heraia_struct_t *main_struct, char *filename);
00042 extern HERAIA_ERROR heraia_hex_document_save(doc_t *current_doc);
00043 extern HERAIA_ERROR heraia_hex_document_save_as(doc_t *current_doc, gchar *filename);
00044 
00045 extern gchar *heraia_hex_document_get_filename(Heraia_Document *hex_doc);
00046 extern gchar *doc_t_document_get_filename(doc_t *doc);
00047 
00048 extern guint64 ghex_file_size(Heraia_Hex *gh);
00049 
00050 extern guint64 ghex_get_cursor_position(GtkWidget *hex_widget);
00051 extern void ghex_set_cursor_position(GtkWidget *hex_widget, guint64 position);
00052 
00053 extern gboolean ghex_find_forward(doc_t *doc, guchar *search_buffer, guint buffer_size, guint64 *position);
00054 extern gboolean ghex_find_backward(doc_t *doc, guchar *search_buffer, guint buffer_size, guint64 *position);
00055 
00056 extern selection_t *ghex_get_selection(GtkWidget *hex_widget);
00057 
00058 extern doc_t *new_doc_t(Heraia_Document *hex_doc, GtkWidget *hex_widget);
00059 extern void close_doc_t(doc_t *current_doc);
00060 
00061 gboolean ghex_find_decode(gint direction, doc_t *doc, DecodeFunc decode_it, decode_parameters_t *decode_parameters, guint data_size, gchar *search_buffer, guint64 *position);
00062 
00063 
00064 /* From libgtkhex */
00065 #define is_displayable(c) (((c) >= 0x20) && ((c) < 0x7f))
00066 
00067 #endif /* _GHEX_HERAIA_INTERFACE_H_ */
Generated on Mon May 2 21:04:49 2011 for Heraia by  doxygen 1.6.3