cgit

commit 8f208794318f83826e98168b8b430f2d9a68bcce

Author: John Keeping <john@keeping.me.uk>

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>

 html.c | 1 +
 html.h | 2 +-
 scan-tree.c | 1 +
 ui-atom.c | 1 +
 ui-blob.c | 1 +
 ui-clone.c | 1 +
 ui-commit.c | 1 +
 ui-diff.c | 1 +
 ui-diff.h | 3 ---
 ui-log.c | 1 +
 ui-patch.c | 1 +
 ui-plain.c | 1 +
 ui-refs.c | 1 +
 ui-repolist.c | 1 +
 ui-shared.c | 1 +
 ui-shared.h | 2 --
 ui-snapshot.c | 1 +
 ui-ssdiff.c | 2 +-
 ui-stats.c | 2 +-
 ui-summary.c | 1 +
 ui-tag.c | 1 +
 ui-tree.c | 1 +


diff --git a/html.c b/html.c
index d60a41ffd45859e748588f488f2ac8f38f9119ad..1104f97faeec025f19ecf0a27f6b00a3af8b0de1 100644
--- a/html.c
+++ b/html.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>




diff --git a/html.h b/html.h
index 20e1dc21b09dfb12e5c420bac4a9f8748a81c6f0..bb36f37689496d07d2abf1499270c2a638adb5c0 100644
--- a/html.h
+++ b/html.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);




diff --git a/scan-tree.c b/scan-tree.c
index 10d90f49a5debc4361162b2b873dfd645bc13d6f..0d3e0ade7d0be88e7b7b612fbf7ee1ba69f9f023 100644
--- a/scan-tree.c
+++ b/scan-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"
 




diff --git a/ui-atom.c b/ui-atom.c
index 15540889976df5521381a6d5853698a195b540f4..2a1eb595314248a364d9cedc1efdf5bf5db3e60d 100644
--- a/ui-atom.c
+++ b/ui-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"
 




diff --git a/ui-blob.c b/ui-blob.c
index 7aec0b17c8124eeff685aa4be1b3ea55884b5f17..1da43c81519927f99b7f67a8c08d7df0eee34359 100644
--- a/ui-blob.c
+++ b/ui-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"
 




diff --git a/ui-clone.c b/ui-clone.c
index fdea24f3fdf070b883f13357ce003d4ac4da892e..30d020e447223705dc799c8e1eafca518e136b49 100644
--- a/ui-clone.c
+++ b/ui-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"
 




diff --git a/ui-commit.c b/ui-commit.c
index 5a552a19cfa381e2b7cfb685d39de9cc46c08813..8310ce6667ae288baeed9a1ca201367395ada705 100644
--- a/ui-commit.c
+++ b/ui-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"




diff --git a/ui-diff.c b/ui-diff.c
index 7de7802bad6e87f0553d2b4d81dd264d5a3ca8f9..11155185f831b20a09de3224f61ddde3bf959119 100644
--- a/ui-diff.c
+++ b/ui-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"




diff --git a/ui-diff.h b/ui-diff.h
index 0161ffb27b6d6f44376b0182b3974d4b6c8e03c2..25a92969c76353e1457787714697a30f9ae58d1a 100644
--- a/ui-diff.h
+++ b/ui-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);
 




diff --git a/ui-log.c b/ui-log.c
index 8d8b2351b1dd6e4a0c34a3b9f5e8a5d5da5e2fca..8592843cea8f943552650145deb76450988343dc 100644
--- a/ui-log.c
+++ b/ui-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"




diff --git a/ui-patch.c b/ui-patch.c
index 12abe10282f2d8d5b8f40d7f21712f4ee8360dfd..66def3c9075f9379b4830eeb9109b05d70d31db2 100644
--- a/ui-patch.c
+++ b/ui-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"
 




diff --git a/ui-plain.c b/ui-plain.c
index 8ef4ec6ba525351a6ec6d906e5e3e5e795139c6b..4397a59e3809da6cf71c84ddd5b2c7d3afe94b2e 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -8,6 +8,7 @@  */
 
 #include <stdio.h>
 #include "cgit.h"
+#include "ui-plain.h"
 #include "html.h"
 #include "ui-shared.h"
 




diff --git a/ui-refs.c b/ui-refs.c
index 45db2ac1dbc976fbca8bfa899b9cf8349c693cdd..5bebed1e7521490c5ae8d04157e2a8b5695f6337 100644
--- a/ui-refs.c
+++ b/ui-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"
 




diff --git a/ui-repolist.c b/ui-repolist.c
index a9751f6ff0af6cc4fc18eedb302c306673b6c07e..76fe71a9a4bfca98c8340deba3b8ee68cb69b9c3 100644
--- a/ui-repolist.c
+++ b/ui-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>




diff --git a/ui-shared.c b/ui-shared.c
index 7a726c194f9ba29c85db3931f6d82f2eb2cd022d..945d560a300780083e9dabc3f024d2a0dc6eaf5d 100644
--- a/ui-shared.c
+++ b/ui-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"
 




diff --git a/ui-shared.h b/ui-shared.h
index 0666388457a363f2a4b637e2b0f64f12a01c5a44..5f8b6295937dfc24a201c556897a71364f7db3d3 100644
--- a/ui-shared.h
+++ b/ui-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,




diff --git a/ui-snapshot.c b/ui-snapshot.c
index e199a92d644d7084a0ca9564e0fc3afa124fc4ab..9be5dbef808526b3b0dd9d518163b206ead37b9f 100644
--- a/ui-snapshot.c
+++ b/ui-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"
 




diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index 3d3dad6806b5e43b1e8f3426f6f4513e3783d31f..cbe60bd6da0709b53a355d6d775b9ced0e1cd968 100644
--- a/ui-ssdiff.c
+++ b/ui-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;
 




diff --git a/ui-stats.c b/ui-stats.c
index 480c8eec33734d71787b17aa30b019e553a79e6d..52e9b91bba6a4a3c4a6ca3c1f59925ead5863da7 100644
--- a/ui-stats.c
+++ b/ui-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"




diff --git a/ui-summary.c b/ui-summary.c
index 0754bb7f99b8eee1f5febdb902b49e2c57470c82..bd123ef4b81c78dd265fc0116f1ba8e00871b044 100644
--- a/ui-summary.c
+++ b/ui-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"




diff --git a/ui-tag.c b/ui-tag.c
index 4d340d4bfca6c832637ec91fa320b865da063e60..5a22696a0b159accd0e239ee8bab2c8c72debb28 100644
--- a/ui-tag.c
+++ b/ui-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"
 




diff --git a/ui-tree.c b/ui-tree.c
index b692b563a850421dd30fc24dc6174f0ed81d3363..d7135532baf8c6f69da6fe2b5c01599f75b351ee 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -8,6 +8,7 @@  */
 
 #include <ctype.h>
 #include "cgit.h"
+#include "ui-tree.h"
 #include "html.h"
 #include "ui-shared.h"