X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=src%2Fmain.c;h=da3cae3357679660d08577d7bd3e5ea643178351;hb=1f8359dbd303ff4bc9f532f4f050a799d296a453;hp=673c702a1a934ed8486801780d3fa4c91d2f7b17;hpb=98b5910dddf087c1f58951decf5908258f294708;p=cascardo%2Fatompub.git diff --git a/src/main.c b/src/main.c index 673c702..da3cae3 100644 --- a/src/main.c +++ b/src/main.c @@ -24,24 +24,27 @@ #include extern void cgi_serve_request (AtomCtx *ctx); -extern AtomBackend * giochannel_backend (void); +extern AtomBackend * gio_backend (void); +extern AtomFrontend * cgi_frontend (void); +extern AtomConfig * gkeyfile_atom_config_init (AtomCtx *, char *); int main (int argc, char **argv) { AtomCtx *ctx; - IRI *iri; AtomError *error; g_type_init (); ctx = atom_ctx_new (); - atom_config_init (ctx); - atom_backend_set (ctx, giochannel_backend ()); + atom_config_set (ctx, gkeyfile_atom_config_init (ctx, "atompub.conf")); + atom_backend_set (ctx, gio_backend ()); + atom_frontend_set (ctx, cgi_frontend ()); if ((error = atom_error_get (ctx)) != NULL) { - g_message ("%s\n", atom_error_message (error)); - exit (1); + atom_handle_error (ctx); + exit (0); } - cgi_serve_request (ctx); + atom_backend_enumerate_entries (ctx, NULL, NULL, NULL); + atom_serve_request (ctx); atom_ctx_delete (ctx); return 0; }