struct _atom_ctx
{
AtomError *error;
- gpointer config_data;
+ AtomConfig *config;
AtomBackend *backend;
AtomFrontend *frontend;
GHashTable *bemap;
AtomCtx *ctx;
ctx = g_slice_new (AtomCtx);
ctx->error = NULL;
- ctx->config_data = NULL;
+ ctx->config = NULL;
ctx->backend = NULL;
ctx->frontend = NULL;
ctx->bemap = g_hash_table_new_full (g_str_hash, g_str_equal,
return ctx->error;
}
-void *
-atom_config_data (AtomCtx *ctx)
+AtomConfig *
+atom_config (AtomCtx *ctx)
{
- return ctx->config_data;
+ return ctx->config;
}
void
-atom_config_data_set (AtomCtx *ctx, void *data)
+atom_config_set (AtomCtx *ctx, AtomConfig *config)
{
- ctx->config_data = data;
+ ctx->config = config;
}
AtomBackend *
g_hash_table_replace (ctx->femap, key, val);
}
}
+
+AtomID *
+atom_id_new_from_frontend (AtomCtx *ctx, char * req)
+{
+ char *id;
+ if (g_hash_table_lookup_extended (ctx->femap, req, NULL, &id))
+ return atom_id_new (id);
+ return NULL;
+}
+
+char *
+atom_id_to_backend (AtomCtx *ctx, AtomID *id)
+{
+ char *key = atom_id_string (id);
+ char *val;
+ if (g_hash_table_lookup_extended (ctx->bemap, key, NULL, &val))
+ return val;
+ return NULL;
+}