summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-11-24 10:23:10 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-11-24 10:23:10 (GMT)
commitf58a0e41b2c7266f5e6b521485a9d62246efbb6d (patch)
treec19e18b83f08930b0262387c02150c79dbda320d
parentd7aa3b671b83640006e00e853a439937c0c34dc0 (diff)
Rename the function used to find section range by name.
-rw-r--r--plugins/pe/format.c6
-rw-r--r--plugins/pychrysalide/format/program.c44
-rw-r--r--src/format/program-int.h4
-rw-r--r--src/format/program.c6
-rw-r--r--src/format/program.h2
5 files changed, 31 insertions, 31 deletions
diff --git a/plugins/pe/format.c b/plugins/pe/format.c
index ab9106d..11bc116 100644
--- a/plugins/pe/format.c
+++ b/plugins/pe/format.c
@@ -76,7 +76,7 @@ static bool g_pe_format_get_main_address(GPeFormat *, vmpa2t *);
static bool g_pe_format_refine_portions(GPeFormat *);
/* Fournit l'emplacement d'une section donnée. */
-static bool g_pe_format_get_section_range_by_name(const GPeFormat *, const char *, mrange_t *);
+static bool g_pe_format_find_section_range_by_name(const GPeFormat *, const char *, mrange_t *);
@@ -170,7 +170,7 @@ static void g_pe_format_class_init(GPeFormatClass *klass)
prgm = G_PROGRAM_FORMAT_CLASS(klass);
prgm->get_endian = (program_get_endian_fc)g_pe_format_get_endianness;
- prgm->get_range_by_name = (get_range_by_name_fc)g_pe_format_get_section_range_by_name;
+ prgm->find_range_by_name = (find_range_by_name_fc)g_pe_format_find_section_range_by_name;
exe = G_EXECUTABLE_FORMAT_CLASS(klass);
@@ -695,7 +695,7 @@ static SourceEndian g_pe_format_get_endianness(const GPeFormat *format)
* *
******************************************************************************/
-static bool g_pe_format_get_section_range_by_name(const GPeFormat *format, const char *name, mrange_t *range)
+static bool g_pe_format_find_section_range_by_name(const GPeFormat *format, const char *name, mrange_t *range)
{
bool result; /* Bilan à retourner */
uint16_t i; /* Boucle de parcours */
diff --git a/plugins/pychrysalide/format/program.c b/plugins/pychrysalide/format/program.c
index 28c1540..01b9703 100644
--- a/plugins/pychrysalide/format/program.c
+++ b/plugins/pychrysalide/format/program.c
@@ -66,7 +66,7 @@ static int py_program_format_init(PyObject *, PyObject *, PyObject *);
static SourceEndian py_program_format_get_endianness_wrapper(const GProgramFormat *);
/* Fournit l'emplacement d'une section donnée. */
-static bool py_program_format_get_section_range_by_name_wrapper(const GProgramFormat *, const char *, mrange_t *);
+static bool py_program_format_find_section_range_by_name_wrapper(const GProgramFormat *, const char *, mrange_t *);
@@ -86,7 +86,7 @@ static PyObject *py_program_format_has_flag(PyObject *, PyObject *);
/* Fournit l'emplacement d'une section donnée. */
-static PyObject *py_program_format_get_section_range_by_name(PyObject *, PyObject *);
+static PyObject *py_program_format_find_section_range_by_name(PyObject *, PyObject *);
#if 0
@@ -154,7 +154,7 @@ static PyObject *py_program_format_get_errors(PyObject *, void *);
static void py_program_format_init_gclass(GProgramFormatClass *class, gpointer unused)
{
class->get_endian = py_program_format_get_endianness_wrapper;
- class->get_range_by_name = py_program_format_get_section_range_by_name_wrapper;
+ class->find_range_by_name = py_program_format_find_section_range_by_name_wrapper;
}
@@ -188,7 +188,7 @@ static int py_program_format_init(PyObject *self, PyObject *args, PyObject *kwds
"* pychrysalide.format.ProgramFormat._get_endianness().\n" \
"\n" \
"Other optional method may be defined for new classes:\n" \
- "* pychrysalide.format.ProgramFormat._get_section_range_by_name().\n" \
+ "* pychrysalide.format.ProgramFormat._find_section_range_by_name().\n" \
"\n" \
"Calls to the *__init__* constructor of this abstract object expect" \
" only one argument: a binary content, provided as a" \
@@ -295,7 +295,7 @@ static SourceEndian py_program_format_get_endianness_wrapper(const GProgramForma
* *
******************************************************************************/
-static bool py_program_format_get_section_range_by_name_wrapper(const GProgramFormat *format, const char *name, mrange_t *range)
+static bool py_program_format_find_section_range_by_name_wrapper(const GProgramFormat *format, const char *name, mrange_t *range)
{
bool result; /* Bilan à retourner */
PyGILState_STATE gstate; /* Sauvegarde d'environnement */
@@ -303,15 +303,15 @@ static bool py_program_format_get_section_range_by_name_wrapper(const GProgramFo
PyObject *pyret; /* Valeur retournée */
int ret; /* Bilan d'une conversion */
-#define PROGRAM_FORMAT_GET_SECTION_RANGE_BY_NAME_WRAPPER PYTHON_WRAPPER_DEF \
-( \
- _get_section_range_by_name_wrapper, "$self, name", \
- METH_VARARGS, \
- "Abstract method used to compute the area of a section identified by" \
- " its name.\n" \
- "\n" \
- "The expected returned value is a pychrysalide.arch.mrange instance or" \
- " *None* in case of failure." \
+#define PROGRAM_FORMAT_FIND_SECTION_RANGE_BY_NAME_WRAPPER PYTHON_WRAPPER_DEF \
+( \
+ _find_section_range_by_name_wrapper, "$self, name", \
+ METH_VARARGS, \
+ "Abstract method used to compute the area of a section identified by" \
+ " its name.\n" \
+ "\n" \
+ "The expected returned value is a pychrysalide.arch.mrange instance or" \
+ " *None* in case of failure." \
)
result = false;
@@ -320,9 +320,9 @@ static bool py_program_format_get_section_range_by_name_wrapper(const GProgramFo
pyobj = pygobject_new(G_OBJECT(format));
- if (has_python_method(pyobj, "_get_section_range_by_name"))
+ if (has_python_method(pyobj, "_find_section_range_by_name"))
{
- pyret = run_python_method(pyobj, "_get_section_range_by_name", NULL);
+ pyret = run_python_method(pyobj, "_find_section_range_by_name", NULL);
if (pyret != NULL)
{
@@ -520,7 +520,7 @@ static PyObject *py_program_format_has_flag(PyObject *self, PyObject *args)
* *
******************************************************************************/
-static PyObject *py_program_format_get_section_range_by_name(PyObject *self, PyObject *args)
+static PyObject *py_program_format_find_section_range_by_name(PyObject *self, PyObject *args)
{
PyObject *result; /* Emplacement à retourner */
const char *name; /* Nom de section ciblée */
@@ -529,9 +529,9 @@ static PyObject *py_program_format_get_section_range_by_name(PyObject *self, PyO
mrange_t range; /* Emplacement obtenu ? */
bool status; /* Bilan de l'opération */
-#define PROGRAM_FORMAT_GET_SECTION_RANGE_BY_NAME_METHOD PYTHON_METHOD_DEF \
+#define PROGRAM_FORMAT_FIND_SECTION_RANGE_BY_NAME_METHOD PYTHON_METHOD_DEF \
( \
- get_section_range_by_name, "$self, name, /", \
+ find_section_range_by_name, "$self, name, /", \
METH_VARARGS, py_program_format, \
"Compute the area of a section identified by its name.\n" \
"\n" \
@@ -546,7 +546,7 @@ static PyObject *py_program_format_get_section_range_by_name(PyObject *self, PyO
format = G_PROGRAM_FORMAT(pygobject_get(self));
- status = g_program_format_get_section_range_by_name(format, name, &range);
+ status = g_program_format_find_section_range_by_name(format, name, &range);
if (status)
result = build_from_internal_mrange(&range);
@@ -1194,8 +1194,8 @@ PyTypeObject *get_python_program_format_type(void)
{
static PyMethodDef py_program_format_methods[] = {
PROGRAM_FORMAT_GET_ENDIANNESS_WRAPPER,
- PROGRAM_FORMAT_GET_SECTION_RANGE_BY_NAME_WRAPPER,
- PROGRAM_FORMAT_GET_SECTION_RANGE_BY_NAME_METHOD,
+ PROGRAM_FORMAT_FIND_SECTION_RANGE_BY_NAME_WRAPPER,
+ PROGRAM_FORMAT_FIND_SECTION_RANGE_BY_NAME_METHOD,
/*
PROGRAM_FORMAT_SET_FLAG_METHOD,
PROGRAM_FORMAT_UNSET_FLAG_METHOD,
diff --git a/src/format/program-int.h b/src/format/program-int.h
index 1549a0a..8464fe4 100644
--- a/src/format/program-int.h
+++ b/src/format/program-int.h
@@ -36,7 +36,7 @@
typedef SourceEndian (* program_get_endian_fc) (const GProgramFormat *);
/* Fournit l'emplacement d'une section donnée. */
-typedef bool (* get_range_by_name_fc) (const GProgramFormat *, const char *, mrange_t *);
+typedef bool (* find_range_by_name_fc) (const GProgramFormat *, const char *, mrange_t *);
/* Format de programme générique (instance) */
@@ -52,7 +52,7 @@ struct _GProgramFormatClass
GKnownFormatClass parent; /* A laisser en premier */
program_get_endian_fc get_endian; /* Boutisme employé */
- get_range_by_name_fc get_range_by_name; /* Emplacement de sections */
+ find_range_by_name_fc find_range_by_name; /* Emplacement de sections */
};
diff --git a/src/format/program.c b/src/format/program.c
index d44f988..9b9df81 100644
--- a/src/format/program.c
+++ b/src/format/program.c
@@ -480,18 +480,18 @@ SourceEndian g_program_format_get_endianness(const GProgramFormat *format)
* *
******************************************************************************/
-bool g_program_format_get_section_range_by_name(const GProgramFormat *format, const char *name, mrange_t *range)
+bool g_program_format_find_section_range_by_name(const GProgramFormat *format, const char *name, mrange_t *range)
{
bool result; /* Bilan à retourner */
GProgramFormatClass *class; /* Classe de l'instance */
class = G_PROGRAM_FORMAT_GET_CLASS(format);
- if (class->get_range_by_name == NULL)
+ if (class->find_range_by_name == NULL)
result = false;
else
- result = class->get_range_by_name(format, name, range);
+ result = class->find_range_by_name(format, name, range);
return result;
diff --git a/src/format/program.h b/src/format/program.h
index 0eb26ae..12b095c 100644
--- a/src/format/program.h
+++ b/src/format/program.h
@@ -43,7 +43,7 @@ DECLARE_GTYPE(GProgramFormat, g_program_format, G, PROGRAM_FORMAT);
SourceEndian g_program_format_get_endianness(const GProgramFormat *);
/* Fournit l'emplacement d'une section donnée. */
-bool g_program_format_get_section_range_by_name(const GProgramFormat *, const char *, mrange_t *);
+bool g_program_format_find_section_range_by_name(const GProgramFormat *, const char *, mrange_t *);