EXTRA_DIST = navit.xml
noinst_LTLIBRARIES = libnavit.la
-libnavit_la_SOURCES = attr.c cache.c callback.c compass.c coord.c country.c cursor.c data_window.c debug.c \
+libnavit_la_SOURCES = atom.c attr.c cache.c callback.c compass.c coord.c country.c cursor.c data_window.c debug.c \
event.c event_glib.h file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
mapset.c maptype.c menu.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
profile.c projection.c route.c search.c speech.c transform.c track.c \
- util.c vehicle.c xmlconfig.c attr.h attr_def.h cache.h callback.h color.h compass.h coord.h country.h \
+ util.c vehicle.c xmlconfig.c atom.h attr.h attr_def.h cache.h callback.h color.h compass.h coord.h country.h \
cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
file.h graphics.h gtkext.h gui.h item.h item_def.h keys.h log.h layer.h layout.h main.h map-share.h map.h\
map_data.h mapset.h maptype.h menu.h navigation.h navit.h osd.h \
--- /dev/null
+#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);
+}