X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/44923f8953c66dc9b852316b655ab3b5aec9478e..a1a79998f22fe8279be51fc1d31bfcf14031c109:/shared.c?ds=sidebyside diff --git a/shared.c b/shared.c index c58a2ff..5f2a5ce 100644 --- a/shared.c +++ b/shared.c @@ -1,3 +1,11 @@ +/* shared.c: global vars + some callback functions + * + * Copyright (C) 2006 Lars Hjemli + * + * Licensed under GNU General Public License v2 + * (see COPYING for full license text) + */ + #include "cgit.h" char *cgit_root = "/usr/src/git"; @@ -28,6 +36,7 @@ char *cgit_query_repo = NULL; char *cgit_query_page = NULL; char *cgit_query_head = NULL; char *cgit_query_sha1 = NULL; +int cgit_query_ofs = 0; int htmlfd = 0; @@ -59,16 +68,18 @@ void cgit_repo_config_cb(const char *name, const char *value) void cgit_querystring_cb(const char *name, const char *value) { - if (!strcmp(name,"r")) + if (!strcmp(name,"r")) { cgit_query_repo = xstrdup(value); - else if (!strcmp(name, "p")) + } else if (!strcmp(name, "p")) { cgit_query_page = xstrdup(value); - else if (!strcmp(name, "h")) { + } else if (!strcmp(name, "h")) { cgit_query_head = xstrdup(value); cgit_query_has_symref = 1; } else if (!strcmp(name, "id")) { cgit_query_sha1 = xstrdup(value); cgit_query_has_sha1 = 1; + } else if (!strcmp(name, "ofs")) { + cgit_query_ofs = atoi(value); } }