|
|
@ -18,7 +18,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
const char *cgit_version = CGIT_VERSION;
|
|
|
|
const char *cgit_version = CGIT_VERSION;
|
|
|
|
|
|
|
|
|
|
|
|
void add_mimetype(const char *name, const char *value)
|
|
|
|
static void add_mimetype(const char *name, const char *value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct string_list_item *item;
|
|
|
|
struct string_list_item *item;
|
|
|
|
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ void add_mimetype(const char *name, const char *value)
|
|
|
|
item->util = xstrdup(value);
|
|
|
|
item->util = xstrdup(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
|
|
|
|
static struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct cgit_filter *f;
|
|
|
|
struct cgit_filter *f;
|
|
|
|
int args_size = 0;
|
|
|
|
int args_size = 0;
|
|
|
@ -58,7 +58,7 @@ struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
|
|
|
|
|
|
|
|
|
|
|
|
static void process_cached_repolist(const char *path);
|
|
|
|
static void process_cached_repolist(const char *path);
|
|
|
|
|
|
|
|
|
|
|
|
void repo_config(struct cgit_repo *repo, const char *name, const char *value)
|
|
|
|
static void repo_config(struct cgit_repo *repo, const char *name, const char *value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct string_list_item *item;
|
|
|
|
struct string_list_item *item;
|
|
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void config_cb(const char *name, const char *value)
|
|
|
|
static void config_cb(const char *name, const char *value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
|
|
|
|
if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
|
|
|
|
ctx.cfg.section = xstrdup(value);
|
|
|
|
ctx.cfg.section = xstrdup(value);
|
|
|
@ -333,7 +333,7 @@ static void querystring_cb(const char *name, const char *value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *xstrdupn(const char *str)
|
|
|
|
static char *xstrdupn(const char *str)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (str ? xstrdup(str) : NULL);
|
|
|
|
return (str ? xstrdup(str) : NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -414,7 +414,7 @@ struct refmatch {
|
|
|
|
int match;
|
|
|
|
int match;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int find_current_ref(const char *refname, const unsigned char *sha1,
|
|
|
|
static int find_current_ref(const char *refname, const unsigned char *sha1,
|
|
|
|
int flags, void *cb_data)
|
|
|
|
int flags, void *cb_data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct refmatch *info;
|
|
|
|
struct refmatch *info;
|
|
|
@ -427,7 +427,7 @@ int find_current_ref(const char *refname, const unsigned char *sha1,
|
|
|
|
return info->match;
|
|
|
|
return info->match;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *find_default_branch(struct cgit_repo *repo)
|
|
|
|
static char *find_default_branch(struct cgit_repo *repo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct refmatch info;
|
|
|
|
struct refmatch info;
|
|
|
|
char *ref;
|
|
|
|
char *ref;
|
|
|
@ -569,13 +569,13 @@ static void process_request(void *cbdata)
|
|
|
|
cgit_print_docend();
|
|
|
|
cgit_print_docend();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int cmp_repos(const void *a, const void *b)
|
|
|
|
static int cmp_repos(const void *a, const void *b)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const struct cgit_repo *ra = a, *rb = b;
|
|
|
|
const struct cgit_repo *ra = a, *rb = b;
|
|
|
|
return strcmp(ra->url, rb->url);
|
|
|
|
return strcmp(ra->url, rb->url);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *build_snapshot_setting(int bitmap)
|
|
|
|
static char *build_snapshot_setting(int bitmap)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const struct cgit_snapshot_format *f;
|
|
|
|
const struct cgit_snapshot_format *f;
|
|
|
|
char *result = xstrdup("");
|
|
|
|
char *result = xstrdup("");
|
|
|
@ -595,7 +595,7 @@ char *build_snapshot_setting(int bitmap)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *get_first_line(char *txt)
|
|
|
|
static char *get_first_line(char *txt)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char *t = xstrdup(txt);
|
|
|
|
char *t = xstrdup(txt);
|
|
|
|
char *p = strchr(t, '\n');
|
|
|
|
char *p = strchr(t, '\n');
|
|
|
@ -604,7 +604,7 @@ char *get_first_line(char *txt)
|
|
|
|
return t;
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void print_repo(FILE *f, struct cgit_repo *repo)
|
|
|
|
static void print_repo(FILE *f, struct cgit_repo *repo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(f, "repo.url=%s\n", repo->url);
|
|
|
|
fprintf(f, "repo.url=%s\n", repo->url);
|
|
|
|
fprintf(f, "repo.name=%s\n", repo->name);
|
|
|
|
fprintf(f, "repo.name=%s\n", repo->name);
|
|
|
@ -649,7 +649,7 @@ void print_repo(FILE *f, struct cgit_repo *repo)
|
|
|
|
fprintf(f, "\n");
|
|
|
|
fprintf(f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void print_repolist(FILE *f, struct cgit_repolist *list, int start)
|
|
|
|
static void print_repolist(FILE *f, struct cgit_repolist *list, int start)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|