From 809700c0054c4d0afc399e1a58e51f3afedee14a Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 21 Dec 2011 06:53:18 +0000 Subject: [PATCH] Kill glib --- index.c | 9 +++++---- mkfile | 3 --- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/index.c b/index.c index 32423a3..f078d0a 100644 --- a/index.c +++ b/index.c @@ -1,4 +1,5 @@ -#include +#include +#include #include "html.h" const char desc[] = @@ -39,7 +40,7 @@ int main(int argc, char **argv) { print_header(); - const gchar *name = g_getenv("PATH_INFO"); + const char *name = getenv("PATH_INFO"); if (name == NULL || name[0] == '\0' || name[1] == '\0') return print_page(index), 0; @@ -47,12 +48,12 @@ int main(int argc, char **argv) for (int i = 0; everything[i]; i++) for (int j = 0; everything[i][j].link; j++) { const page_t *page = &everything[i][j]; - if (g_str_equal(name+1, page->link)) + if (!strcmp(name+1, page->link)) return print_page(page), 0; } /* Print sitemap by itself */ - if (g_str_equal(name+1, "sitemap.xml")) + if (!strcmp(name+1, "sitemap.xml")) return print_sitemap(everything), 0; /* 404 */ diff --git a/mkfile b/mkfile index 317ad45..dc18067 100644 --- a/mkfile +++ b/mkfile @@ -1,9 +1,6 @@ CT=/scratch/ct/ct CFLAGS='--std=c99 -Wall' -PKG_FLAGS=`{pkg-config --cflags glib-2.0} -PKG_LIBS=`{pkg-config --libs glib-2.0} - index.cgi: index.o html.o gcc $CFLAGS -o $target $prereq $PKG_LIBS -- 2.43.2