pkginclude_HEADERS = atom.h config.h ctx.h entry.h person.h error.h feed.h \
id.h iri.h backend.h atom-glib.h error-glib.h atom-xml.h \
- entry-xml.h person-xml.h feed-xml.h globals.h resource.h
+ entry-xml.h person-xml.h feed-xml.h globals.h resource.h \
+ map.h
--- /dev/null
+/*
+ * Copyright (C) 2008 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+#ifndef ATOMPUB_MAP_H
+#define ATOMPUB_MAP_H
+
+#include <atompub/ctx.h>
+#include <atompub/entry.h>
+
+void atom_map_backend_requests (AtomCtx *, char **, AtomEntry **, size_t);
+
+#endif
AtomError *error;
gpointer config_data;
AtomBackend *backend;
+ GHashTable *bemap;
};
AtomCtx *
ctx->error = NULL;
ctx->config_data = NULL;
ctx->backend = NULL;
+ ctx->bemap = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, g_free);
return ctx;
}
atom_error_delete (ctx->error);
if (ctx->backend)
atom_backend_delete (ctx->backend);
+ if (ctx->bemap)
+ g_hash_table_destroy (ctx->bemap);
g_slice_free (AtomCtx, ctx);
}
{
ctx->backend = backend;
}
+
+void
+atom_map_backend_requests (AtomCtx *ctx, char **reqs,
+ AtomEntry **entries, size_t len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ {
+ char *key = g_strdup (atom_entry_id (entries[i]));
+ char *val = g_strdup (reqs[i]);
+ g_hash_table_replace (ctx->bemap, key, val);
+ }
+}