summaryrefslogtreecommitdiff
path: root/navit/atom.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-01-02 17:27:24 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-01-02 17:27:24 +0000
commitf462d2e593890e7ab8125840fff09c09f17e2323 (patch)
tree4a9d325381b50501522df88fdc66ceb5210234e3 /navit/atom.c
parent1c9e6e9d27939eadae47b32876193388d69bdbce (diff)
downloadnavit-f462d2e593890e7ab8125840fff09c09f17e2323.tar.gz
Add:Core:Added support for atoms
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1878 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/atom.c')
-rw-r--r--navit/atom.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/navit/atom.c b/navit/atom.c
new file mode 100644
index 000000000..d22579759
--- /dev/null
+++ b/navit/atom.c
@@ -0,0 +1,27 @@
+#include <glib.h>
+#include "atom.h"
+
+static GHashTable *atom_hash;
+
+char *
+atom_lookup(char *name)
+{
+ return g_hash_table_lookup(atom_hash,name);
+}
+
+char *
+atom(char *name)
+{
+ char *id=atom_lookup(name);
+ if (id)
+ return id;
+ id=g_strdup(name);
+ g_hash_table_insert(atom_hash, id, id);
+ return id;
+}
+
+void
+atom_init(void)
+{
+ atom_hash=g_hash_table_new(g_str_hash, g_str_equal);
+}