27 #ifndef _GHEX_HERAIA_INTERFACE_H_
28 #define _GHEX_HERAIA_INTERFACE_H_
30 extern gboolean
ghex_memcpy(
Heraia_Hex *gh, guint64 pos, guint len, guint endianness, guchar *result);
31 extern gboolean
ghex_get_data(GtkWidget *hex_widget, guint length, guint endianness, guchar *c);
32 extern void ghex_set_data(
doc_t *doc, guint64 position, guint rep_len, guint len, guchar *data);
34 extern gboolean
ghex_get_data_position(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness, guchar *c);
37 extern guchar *
ghex_get_data_to_hex(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness);
53 extern gboolean
ghex_find_forward(
doc_t *doc, guchar *search_buffer, guint buffer_size, guint64 *position);
65 #define is_displayable(c) (((c) >= 0x20) && ((c) < 0x7f))
guchar * ghex_get_data_to_hex(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness)
Gets data from a defined position and formats it in an hex displayable form.
This is the main structure.
gchar * heraia_hex_document_get_filename(Heraia_Document *hex_doc)
Retrieves the filename of a document which ever it is !
gboolean ghex_memcpy(Heraia_Hex *gh, guint64 pos, guint len, guint endianness, guchar *result)
Returns 'len' number of bytes located at 'pos' in the Heraia_Hex document and puts it in the result v...
HERAIA_ERROR heraia_hex_document_save_as(doc_t *current_doc, gchar *filename)
Saves an opened and edited document to a new file.
gboolean ghex_find_forward(doc_t *doc, guchar *search_buffer, guint buffer_size, guint64 *position)
Wrapper to the hex_document_find_forward function Tries to find search_buffer in doc.
void ghex_set_cursor_position(GtkWidget *hex_widget, guint64 position)
Sets the cursor at the defined position in the hexwidget.
Proposal for a structure that will group all informations about a single document.
GtkHex Heraia_Hex
Abstract layer this may be usefull if we decide to leave Heraia_Hex and use something else ! ...
A structure to manage a single selection.
gboolean ghex_get_data(GtkWidget *hex_widget, guint length, guint endianness, guchar *c)
Gets the data from the hexwidget under the cursor, a wrapper to the ghex_memcpy function.
void close_doc_t(doc_t *current_doc)
Closes a previously malloced doc_t structure.
doc_t * new_doc_t(Heraia_Document *hex_doc, GtkWidget *hex_widget)
Inits a doc_t structure.
HERAIA_ERROR heraia_hex_document_save(doc_t *current_doc)
gchar * doc_t_document_get_filename(doc_t *doc)
Retrieves from a doc_t * document it's filename, which ever it is.
gint ghex_compare_data(doc_t *doc, guchar *string, guint buffer_size, guint64 position)
Wrapper to the hex_document_compare_data function Compares data from string to the one contained in d...
gboolean ghex_get_data_position(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness, guchar *c)
Gets the data from the hexwidget, a wrapper to the ghex_memcpy function.
gchar *(* DecodeFunc)(guchar *, gpointer)
Templates for the decoding functions.
gint HERAIA_ERROR
Defines heraia error type (this should be used !)
selection_t * ghex_get_selection(GtkWidget *hex_widget)
Retrieves the selection made (if any) in the hex widget.
guchar * ghex_get_data_to_ascii(GtkWidget *hex_widget, guint64 pos, guint length, guint endianness)
Gets data from a defined position and formats it in an ascii displayable form.
HexDocument Heraia_Document
Abstract layer this may be usefull if we decide to leave Heraia_Hex and use something else ! ...
void ghex_set_data(doc_t *doc, guint64 position, guint rep_len, guint len, guchar *data)
Wrapper to the hex_document_set_data function.
gboolean ghex_find_backward(doc_t *doc, guchar *search_buffer, guint buffer_size, guint64 *position)
Wrapper to the hex_document_find_backward function Tries to find search_buffer in doc...
doc_t * heraia_hex_document_new(heraia_struct_t *main_struct, char *filename)
Removes the old document if it exists and adds a new one from the filename 'filename'.
guint64 ghex_file_size(Heraia_Hex *gh)
Returns the file size of an opened Heraia_Hex document.
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)
Wrappers to the functions that will do the search (here it has nothing to do with ghex in fact)...
guint64 ghex_get_cursor_position(GtkWidget *hex_widget)
Retrieves the cursor's position from the current hexwidget.
Used to pass decoding options to the functions.