all repos — cgit @ 8f208794318f83826e98168b8b430f2d9a68bcce

a hyperfast web frontend for git written in c

Always #include corresponding .h in .c files

While doing this, remove declarations from header files where the
corresponding definition is declared "static" in order to avoid build
errors.

Also re-order existing headers in ui-*.c so that the file-specific
header always comes immediately after "cgit.h", helping with future
consistency.

Signed-off-by: John Keeping <john@keeping.me.uk>
John Keeping john@keeping.me.uk
Sat, 06 Apr 2013 11:37:59 +0100
commit

8f208794318f83826e98168b8b430f2d9a68bcce

parent

a5e4ad2d8b9c6bcfc7029894d3a3837166996b35

M html.chtml.c

@@ -6,6 +6,7 @@ * Licensed under GNU General Public License v2

* (see COPYING for full license text) */ +#include "html.h" #include <unistd.h> #include <stdio.h> #include <stdlib.h>
M html.hhtml.h

@@ -1,7 +1,7 @@

#ifndef HTML_H #define HTML_H -extern int htmlfd; +#include <stddef.h> extern void html_raw(const char *txt, size_t size); extern void html(const char *txt);
M scan-tree.cscan-tree.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "scan-tree.h" #include "configfile.h" #include "html.h"
M ui-atom.cui-atom.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-atom.h" #include "html.h" #include "ui-shared.h"
M ui-blob.cui-blob.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-blob.h" #include "html.h" #include "ui-shared.h"
M ui-clone.cui-clone.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-clone.h" #include "html.h" #include "ui-shared.h"
M ui-commit.cui-commit.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-commit.h" #include "html.h" #include "ui-shared.h" #include "ui-diff.h"
M ui-diff.cui-diff.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-diff.h" #include "html.h" #include "ui-shared.h" #include "ui-ssdiff.h"
M ui-diff.hui-diff.h

@@ -3,9 +3,6 @@ #define UI_DIFF_H

extern void cgit_print_diff_ctrls(); -extern void cgit_print_diffstat(const unsigned char *old_sha1, - const unsigned char *new_sha1); - extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix, int show_ctrls);
M ui-log.cui-log.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-log.h" #include "html.h" #include "ui-shared.h" #include "vector.h"
M ui-patch.cui-patch.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-patch.h" #include "html.h" #include "ui-shared.h"
M ui-plain.cui-plain.c

@@ -8,6 +8,7 @@ */

#include <stdio.h> #include "cgit.h" +#include "ui-plain.h" #include "html.h" #include "ui-shared.h"
M ui-refs.cui-refs.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-refs.h" #include "html.h" #include "ui-shared.h"
M ui-repolist.cui-repolist.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-repolist.h" #include "html.h" #include "ui-shared.h" #include <strings.h>
M ui-shared.cui-shared.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-shared.h" #include "cmd.h" #include "html.h"
M ui-shared.hui-shared.h

@@ -47,8 +47,6 @@ const char *path, int toggle_ssdiff);

extern void cgit_stats_link(const char *name, const char *title, const char *class, const char *head, const char *path); -extern void cgit_self_link(char *name, const char *title, - const char *class, struct cgit_context *ctx); extern void cgit_object_link(struct object *obj); extern void cgit_submodule_link(const char *class, char *path,
M ui-snapshot.cui-snapshot.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-snapshot.h" #include "html.h" #include "ui-shared.h"
M ui-ssdiff.cui-ssdiff.c

@@ -1,8 +1,8 @@

#include "cgit.h" +#include "ui-ssdiff.h" #include "html.h" #include "ui-shared.h" #include "ui-diff.h" -#include "ui-ssdiff.h" extern int use_ssdiff;
M ui-stats.cui-stats.c

@@ -1,7 +1,7 @@

#include "cgit.h" +#include "ui-stats.h" #include "html.h" #include "ui-shared.h" -#include "ui-stats.h" #ifdef NO_C99_FORMAT #define SZ_FMT "%u"
M ui-summary.cui-summary.c

@@ -8,6 +8,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-summary.h" #include "html.h" #include "ui-log.h" #include "ui-refs.h"
M ui-tag.cui-tag.c

@@ -7,6 +7,7 @@ * (see COPYING for full license text)

*/ #include "cgit.h" +#include "ui-tag.h" #include "html.h" #include "ui-shared.h"
M ui-tree.cui-tree.c

@@ -8,6 +8,7 @@ */

#include <ctype.h> #include "cgit.h" +#include "ui-tree.h" #include "html.h" #include "ui-shared.h"