summaryrefslogtreecommitdiff
path: root/src/glibext/gnhash.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-11-12 22:13:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-11-12 22:13:21 (GMT)
commitae8cf6257c8d929de1b7ee86e29fcb45ab4af91c (patch)
tree59fa356b2f83020e23df4cf6975ca5d97567df4d /src/glibext/gnhash.c
parentabaf85fdc0edb2bfe67d07d52ae734d50c6fbf61 (diff)
Changed the display of the pseudo registers by using an index.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@192 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gnhash.c')
-rw-r--r--src/glibext/gnhash.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/glibext/gnhash.c b/src/glibext/gnhash.c
new file mode 100644
index 0000000..cdd4dd1
--- /dev/null
+++ b/src/glibext/gnhash.c
@@ -0,0 +1,52 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * gnhash.c - nouvelle fonction offrant une empreinte constante
+ *
+ * Copyright (C) 2010 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "gnhash.h"
+
+
+
+/******************************************************************************
+* *
+* Paramètres : v = pointeur quelconque. *
+* *
+* Description : Convertit un pointeur en une empreinte constante. *
+* *
+* Retour : 2. *
+* *
+* Remarques : L'algorithme actuel (12/11/10) de la GLib impose qu'une *
+* même empreinte impose une même clef. Deux clefs distinctes, *
+* pourtant égales, ont deux empreintes distinctes, donc on *
+* définit une seule empreinte possible. Pas terrible, mais *
+* cela répond au besoin (association simple clef <-> valeur). *
+* *
+******************************************************************************/
+
+guint g_constant_hash(gconstpointer v)
+{
+ /**
+ * La valeur doit être supérieure à 1 pour ne
+ * pas être totalement inéfficace.
+ */
+ return 2;
+
+}