]> saetta.ns0.it Git - zakjukebox/commitdiff
First build.
authorAndrea Zagli <azagli@libero.it>
Thu, 21 Sep 2017 19:02:24 +0000 (21:02 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 23 Sep 2017 07:23:04 +0000 (09:23 +0200)
src/Makefile.am
src/commons.h
src/index.c
src/main.c

index b03cec5d046ae25627a542383101536918c17ff7..c2f2ddd56fbfce62d0054be42318d167c0a1178b 100644 (file)
@@ -3,7 +3,7 @@ ctpldir = $(datadir)/$(PACKAGE)/ctpl
 formdir = $(datadir)/$(PACKAGE)/form
 imagesdir = $(datadir)/$(PACKAGE)/images
 
-AM_CPPFLAGS = $(CONCORSIFE_CFLAGS) \
+AM_CPPFLAGS = $(ZAKJUKEBOX_CFLAGS) \
               -DCONFIGDIR=\""$(configdir)"\" \
               -DCTPLDIR=\""$(ctpldir)"\" \
               -DFORMDIR=\""$(formdir)"\" \
@@ -15,7 +15,7 @@ LIBS = $(ZAKJUKEBOX_LIBS) \
 bin_PROGRAMS = zakjukebox
 
 zakjukebox_SOURCES = \
-                   commons.c \
+                   commons.h \
                    index.c \
                    index.h \
                    main.c
index 932502fd4981e561c2f41fe7d43fcf9e8aa4f6cb..fe20ba0cc13ecc7e8a3226d461b82cfae6c9c4bd 100644 (file)
@@ -36,6 +36,12 @@ typedef struct
 
                ZakConfi *confi;
 
+               ZakCgiMain *zcgi_main;
+               ZakCgiSession *zcgi_session;
+
+               GString *header;
+               GString *out;
+
                gchar *root;
        } Commons;
 
index 7e47551b15893b799474440f6890cb4717933d0d..b28df34ac1c1a9f2e781210b7781925c45f35abd 100644 (file)
 void
 index_index (GMatchInfo *minfo, gpointer user_data)
 {
-       CtplEnviron *env;
+       /* CtplEnviron *env; */
 
        gchar *filename;
-       gchar *contente;
+       gchar *content;
 
        Commons *commons = (Commons *)user_data;
 
-       env = ctpl_environ_new ();
+       /* env = ctpl_environ_new (); */
 
        filename = g_build_filename (commons->ctpldir, "index_index.ctpl", NULL);
        /* content = solipa_ctpl_get_filled (commons->solipa_ctpl, filename, env); */
        g_free (filename);
 
-       env = ctpl_environ_new ();
-       ctpl_environ_push_string (env, "head", "");
-       ctpl_environ_push_string (env, "body_tag", "");
-       ctpl_environ_push_string (env, "body", content);
+       /* env = ctpl_environ_new (); */
+       /* ctpl_environ_push_string (env, "head", ""); */
+       /* ctpl_environ_push_string (env, "body_tag", ""); */
+       /* ctpl_environ_push_string (env, "body", content); */
 
        filename = g_build_filename (commons->ctpldir, "template.ctpl", NULL);
        /* g_string_printf (commons->out, "%s", */
index 62695bb35cb64a7fb48e6c4607d6dd070ddd2270..31b8ec39a886de3d59fee735234297f2c1dbde30 100644 (file)
@@ -63,6 +63,8 @@ main (int argc, char *argv[])
        commons->header = g_string_new ("");
        commons->out = g_string_new ("");
 
+       commons->zcgi_session = zak_cgi_session_new (commons->zcgi_main, "/zakjukebox", NULL);
+
        /* Routing */
        zcgi_url = zak_cgi_url_new (commons->zcgi_main);
 
@@ -76,9 +78,9 @@ main (int argc, char *argv[])
        if (g_strcmp0 (commons->header->str, "") == 0)
                {
                        g_string_printf (commons->header,
-                                                        "%s\n%s",
-                                                        ZAK_CGI_STANDARD_HEADER_HTML,
-                                                        zak_cgi_session_get_header (commons->zcgi_session));
+                                        "%s\n%s",
+                                        ZAK_CGI_STANDARD_HEADER_HTML,
+                                        zak_cgi_session_get_header (commons->zcgi_session));
                }
        zak_cgi_main_out_not_null_term (commons->header->str, commons->out->str, commons->out->len);