gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

commit 626ff28b68ef2c1886d75aa577eb3adc0a1195f3
parent 82464a65c9f60359137991abf9964721dff22141
Author: Chris Bracken <chris@bracken.jp>
Date:   Mon, 15 Dec 2025 11:07:22 +0900

Move source under src directory

This makes operating on gout source code with find, grep, and other
tools much more convenient with fewer flags required.

Diffstat:
M.gn | 1+
MBUILD.gn | 74++++++++++++--------------------------------------------------------------
Dgit/BUILD.gn | 29-----------------------------
Asrc/BUILD.gn | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Rformat.c -> src/format.c | 0
Rformat.h -> src/format.h | 0
Rformat_tests.c -> src/format_tests.c | 0
Asrc/git/BUILD.gn | 29+++++++++++++++++++++++++++++
Rgit/commit.c -> src/git/commit.c | 0
Rgit/commit.h -> src/git/commit.h | 0
Rgit/delta.c -> src/git/delta.c | 0
Rgit/delta.h -> src/git/delta.h | 0
Rgit/file.c -> src/git/file.c | 0
Rgit/file.h -> src/git/file.h | 0
Rgit/git.c -> src/git/git.c | 0
Rgit/git.h -> src/git/git.h | 0
Rgit/internal.h -> src/git/internal.h | 0
Rgit/reference.c -> src/git/reference.c | 0
Rgit/reference.h -> src/git/reference.h | 0
Rgit/repo.c -> src/git/repo.c | 0
Rgit/repo.h -> src/git/repo.h | 0
Rgout.c -> src/gout.c | 0
Rgout.h -> src/gout.h | 0
Rgout_index.c -> src/gout_index.c | 0
Rgout_index.h -> src/gout_index.h | 0
Rgout_index_main.c -> src/gout_index_main.c | 0
Rgout_main.c -> src/gout_main.c | 0
Rgout_tests.c -> src/gout_tests.c | 0
Rgout_tests_main.c -> src/gout_tests_main.c | 0
Rsecurity.c -> src/security.c | 0
Rsecurity.h -> src/security.h | 0
Rutils.c -> src/utils.c | 0
Rutils.h -> src/utils.h | 0
Rutils_tests.c -> src/utils_tests.c | 0
Asrc/writer/BUILD.gn | 25+++++++++++++++++++++++++
Asrc/writer/atom/BUILD.gn | 12++++++++++++
Rwriter/atom/atom.c -> src/writer/atom/atom.c | 0
Rwriter/atom/atom.h -> src/writer/atom/atom.h | 0
Asrc/writer/cache/BUILD.gn | 9+++++++++
Rwriter/cache/cache.c -> src/writer/cache/cache.c | 0
Rwriter/cache/cache.h -> src/writer/cache/cache.h | 0
Asrc/writer/gopher/BUILD.gn | 41+++++++++++++++++++++++++++++++++++++++++
Rwriter/gopher/commit.c -> src/writer/gopher/commit.c | 0
Rwriter/gopher/commit.h -> src/writer/gopher/commit.h | 0
Rwriter/gopher/fileblob.c -> src/writer/gopher/fileblob.c | 0
Rwriter/gopher/fileblob.h -> src/writer/gopher/fileblob.h | 0
Rwriter/gopher/files.c -> src/writer/gopher/files.c | 0
Rwriter/gopher/files.h -> src/writer/gopher/files.h | 0
Rwriter/gopher/index_writer.c -> src/writer/gopher/index_writer.c | 0
Rwriter/gopher/index_writer.h -> src/writer/gopher/index_writer.h | 0
Rwriter/gopher/log.c -> src/writer/gopher/log.c | 0
Rwriter/gopher/log.h -> src/writer/gopher/log.h | 0
Rwriter/gopher/page.c -> src/writer/gopher/page.c | 0
Rwriter/gopher/page.h -> src/writer/gopher/page.h | 0
Rwriter/gopher/refs.c -> src/writer/gopher/refs.c | 0
Rwriter/gopher/refs.h -> src/writer/gopher/refs.h | 0
Rwriter/gopher/repo_index.c -> src/writer/gopher/repo_index.c | 0
Rwriter/gopher/repo_index.h -> src/writer/gopher/repo_index.h | 0
Rwriter/gopher/repo_writer.c -> src/writer/gopher/repo_writer.c | 0
Rwriter/gopher/repo_writer.h -> src/writer/gopher/repo_writer.h | 0
Asrc/writer/html/BUILD.gn | 41+++++++++++++++++++++++++++++++++++++++++
Rwriter/html/commit.c -> src/writer/html/commit.c | 0
Rwriter/html/commit.h -> src/writer/html/commit.h | 0
Rwriter/html/fileblob.c -> src/writer/html/fileblob.c | 0
Rwriter/html/fileblob.h -> src/writer/html/fileblob.h | 0
Rwriter/html/files.c -> src/writer/html/files.c | 0
Rwriter/html/files.h -> src/writer/html/files.h | 0
Rwriter/html/index_writer.c -> src/writer/html/index_writer.c | 0
Rwriter/html/index_writer.h -> src/writer/html/index_writer.h | 0
Rwriter/html/log.c -> src/writer/html/log.c | 0
Rwriter/html/log.h -> src/writer/html/log.h | 0
Rwriter/html/page.c -> src/writer/html/page.c | 0
Rwriter/html/page.h -> src/writer/html/page.h | 0
Rwriter/html/refs.c -> src/writer/html/refs.c | 0
Rwriter/html/refs.h -> src/writer/html/refs.h | 0
Rwriter/html/repo_index.c -> src/writer/html/repo_index.c | 0
Rwriter/html/repo_index.h -> src/writer/html/repo_index.h | 0
Rwriter/html/repo_writer.c -> src/writer/html/repo_writer.c | 0
Rwriter/html/repo_writer.h -> src/writer/html/repo_writer.h | 0
Rwriter/index_writer.c -> src/writer/index_writer.c | 0
Rwriter/index_writer.h -> src/writer/index_writer.h | 0
Rwriter/repo_writer.c -> src/writer/repo_writer.c | 0
Rwriter/repo_writer.h -> src/writer/repo_writer.h | 0
Dwriter/BUILD.gn | 25-------------------------
Dwriter/atom/BUILD.gn | 12------------
Dwriter/cache/BUILD.gn | 9---------
Dwriter/gopher/BUILD.gn | 41-----------------------------------------
Dwriter/html/BUILD.gn | 41-----------------------------------------
88 files changed, 221 insertions(+), 219 deletions(-)

diff --git a/.gn b/.gn @@ -11,6 +11,7 @@ export_compile_commands = [ "//*", ] +# TODO(cbracken): remove personal include, lib dirs. # Edit as appropriate for the host system. default_args = { system_include_dirs = [ diff --git a/BUILD.gn b/BUILD.gn @@ -1,6 +1,5 @@ -# TODO(cbracken): remove personal include, lib dirs. config("gout_config") { - include_dirs = [ "//" ] + system_include_dirs + include_dirs = [ "//", "//src" ] + system_include_dirs lib_dirs = [] + system_lib_dirs defines = [ "_XOPEN_SOURCE=700", @@ -37,83 +36,34 @@ group("default") { ] } executable("gout") { - sources = [ "gout_main.c" ] + sources = [ "src/gout_main.c" ] configs += [ ":gout_config" ] deps = [ - ":format", - ":gout_srcs", - ":utils", + "//src:format", + "//src:gout_srcs", + "//src:utils", ] } executable("gout_index") { - sources = [ "gout_index_main.c" ] + sources = [ "src/gout_index_main.c" ] configs += [ ":gout_config" ] - deps = [ ":gout_index_srcs" ] + deps = [ "//src:gout_index_srcs" ] } executable("gout_tests") { testonly = true sources = [ - "format_tests.c", - "gout_tests.c", - "gout_tests_main.c", - "utils_tests.c", + "src/format_tests.c", + "src/gout_tests.c", + "src/gout_tests_main.c", + "src/utils_tests.c", ] deps = [ - ":gout_srcs", + "//src:gout_srcs", "//third_party/utest:utest_headers", ] } -source_set("format") { - sources = [ - "format.c", - "format.h", - ] - configs += [ ":gout_config" ] -} - -source_set("gout_index_srcs") { - sources = [ - "gout_index.c", - "gout_index.h", - ] - configs += [ ":gout_config" ] - deps = [ - ":security", - "//git", - "//writer:index_writer", - ] -} -source_set("gout_srcs") { - sources = [ - "gout.c", - "gout.h", - ] - configs += [ ":gout_config" ] - deps = [ - ":security", - "//git", - "//writer:repo_writer", - ] -} - -source_set("security") { - sources = [ - "security.c", - "security.h", - ] - configs += [ ":gout_config" ] -} - -source_set("utils") { - sources = [ - "utils.c", - "utils.h", - ] - configs += [ ":gout_config" ] - deps = [ "//third_party/openbsd" ] -} diff --git a/git/BUILD.gn b/git/BUILD.gn @@ -1,29 +0,0 @@ -source_set("internal") { - visibility = [ ":*" ] - sources = [ "internal.h" ] - configs += [ "//:gout_config" ] - include_dirs = [ "//git" ] -} - -source_set("git") { - sources = [ - "commit.c", - "commit.h", - "delta.c", - "delta.h", - "file.c", - "file.h", - "git.c", - "git.h", - "reference.c", - "reference.h", - "repo.c", - "repo.h", - ] - configs += [ "//:gout_config" ] - deps = [ - ":internal", - "//:utils", - "//third_party/openbsd", - ] -} diff --git a/src/BUILD.gn b/src/BUILD.gn @@ -0,0 +1,50 @@ +source_set("format") { + sources = [ + "format.c", + "format.h", + ] + configs += [ "//:gout_config" ] +} + +source_set("gout_index_srcs") { + sources = [ + "gout_index.c", + "gout_index.h", + ] + configs += [ "//:gout_config" ] + deps = [ + ":security", + "//src/git", + "//src/writer:index_writer", + ] +} + +source_set("gout_srcs") { + sources = [ + "gout.c", + "gout.h", + ] + configs += [ "//:gout_config" ] + deps = [ + ":security", + "//src/git", + "//src/writer:repo_writer", + ] +} + +source_set("security") { + sources = [ + "security.c", + "security.h", + ] + configs += [ "//:gout_config" ] +} + +source_set("utils") { + sources = [ + "utils.c", + "utils.h", + ] + configs += [ "//:gout_config" ] + deps = [ "//third_party/openbsd" ] +} +\ No newline at end of file diff --git a/format.c b/src/format.c diff --git a/format.h b/src/format.h diff --git a/format_tests.c b/src/format_tests.c diff --git a/src/git/BUILD.gn b/src/git/BUILD.gn @@ -0,0 +1,29 @@ +source_set("internal") { + visibility = [ ":*" ] + sources = [ "internal.h" ] + configs += [ "//:gout_config" ] + include_dirs = [ "//src/git" ] +} + +source_set("git") { + sources = [ + "commit.c", + "commit.h", + "delta.c", + "delta.h", + "file.c", + "file.h", + "git.c", + "git.h", + "reference.c", + "reference.h", + "repo.c", + "repo.h", + ] + configs += [ "//:gout_config" ] + deps = [ + ":internal", + "//src:utils", + "//third_party/openbsd", + ] +} diff --git a/git/commit.c b/src/git/commit.c diff --git a/git/commit.h b/src/git/commit.h diff --git a/git/delta.c b/src/git/delta.c diff --git a/git/delta.h b/src/git/delta.h diff --git a/git/file.c b/src/git/file.c diff --git a/git/file.h b/src/git/file.h diff --git a/git/git.c b/src/git/git.c diff --git a/git/git.h b/src/git/git.h diff --git a/git/internal.h b/src/git/internal.h diff --git a/git/reference.c b/src/git/reference.c diff --git a/git/reference.h b/src/git/reference.h diff --git a/git/repo.c b/src/git/repo.c diff --git a/git/repo.h b/src/git/repo.h diff --git a/gout.c b/src/gout.c diff --git a/gout.h b/src/gout.h diff --git a/gout_index.c b/src/gout_index.c diff --git a/gout_index.h b/src/gout_index.h diff --git a/gout_index_main.c b/src/gout_index_main.c diff --git a/gout_main.c b/src/gout_main.c diff --git a/gout_tests.c b/src/gout_tests.c diff --git a/gout_tests_main.c b/src/gout_tests_main.c diff --git a/security.c b/src/security.c diff --git a/security.h b/src/security.h diff --git a/utils.c b/src/utils.c diff --git a/utils.h b/src/utils.h diff --git a/utils_tests.c b/src/utils_tests.c diff --git a/src/writer/BUILD.gn b/src/writer/BUILD.gn @@ -0,0 +1,25 @@ +source_set("index_writer") { + sources = [ + "index_writer.c", + "index_writer.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src/writer/gopher:index_writer", + "//src/writer/html:index_writer", + ] + public_deps = [ "//src/git" ] +} + +source_set("repo_writer") { + sources = [ + "repo_writer.c", + "repo_writer.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src/writer/gopher:repo_writer", + "//src/writer/html:repo_writer", + ] + public_deps = [ "//src/git" ] +} diff --git a/src/writer/atom/BUILD.gn b/src/writer/atom/BUILD.gn @@ -0,0 +1,12 @@ +source_set("atom") { + sources = [ + "atom.c", + "atom.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src:format", + "//src:utils", + ] + public_deps = [ "//src/git" ] +} diff --git a/writer/atom/atom.c b/src/writer/atom/atom.c diff --git a/writer/atom/atom.h b/src/writer/atom/atom.h diff --git a/src/writer/cache/BUILD.gn b/src/writer/cache/BUILD.gn @@ -0,0 +1,9 @@ +source_set("cache") { + sources = [ + "cache.c", + "cache.h", + ] + configs += [ "//:gout_config" ] + deps = [ "//src:utils" ] + public_deps = [ "//src/git" ] +} diff --git a/writer/cache/cache.c b/src/writer/cache/cache.c diff --git a/writer/cache/cache.h b/src/writer/cache/cache.h diff --git a/src/writer/gopher/BUILD.gn b/src/writer/gopher/BUILD.gn @@ -0,0 +1,41 @@ +source_set("index_writer") { + sources = [ + "index_writer.c", + "index_writer.h", + "repo_index.c", + "repo_index.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src:format", + "//src:utils", + ] + public_deps = [ "//src/git" ] +} + +source_set("repo_writer") { + sources = [ + "commit.c", + "commit.h", + "fileblob.c", + "fileblob.h", + "files.c", + "files.h", + "log.c", + "log.h", + "page.c", + "page.h", + "refs.c", + "refs.h", + "repo_writer.c", + "repo_writer.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src:format", + "//src:utils", + "//src/writer/atom", + "//src/writer/cache", + ] + public_deps = [ "//src/git" ] +} diff --git a/writer/gopher/commit.c b/src/writer/gopher/commit.c diff --git a/writer/gopher/commit.h b/src/writer/gopher/commit.h diff --git a/writer/gopher/fileblob.c b/src/writer/gopher/fileblob.c diff --git a/writer/gopher/fileblob.h b/src/writer/gopher/fileblob.h diff --git a/writer/gopher/files.c b/src/writer/gopher/files.c diff --git a/writer/gopher/files.h b/src/writer/gopher/files.h diff --git a/writer/gopher/index_writer.c b/src/writer/gopher/index_writer.c diff --git a/writer/gopher/index_writer.h b/src/writer/gopher/index_writer.h diff --git a/writer/gopher/log.c b/src/writer/gopher/log.c diff --git a/writer/gopher/log.h b/src/writer/gopher/log.h diff --git a/writer/gopher/page.c b/src/writer/gopher/page.c diff --git a/writer/gopher/page.h b/src/writer/gopher/page.h diff --git a/writer/gopher/refs.c b/src/writer/gopher/refs.c diff --git a/writer/gopher/refs.h b/src/writer/gopher/refs.h diff --git a/writer/gopher/repo_index.c b/src/writer/gopher/repo_index.c diff --git a/writer/gopher/repo_index.h b/src/writer/gopher/repo_index.h diff --git a/writer/gopher/repo_writer.c b/src/writer/gopher/repo_writer.c diff --git a/writer/gopher/repo_writer.h b/src/writer/gopher/repo_writer.h diff --git a/src/writer/html/BUILD.gn b/src/writer/html/BUILD.gn @@ -0,0 +1,41 @@ +source_set("index_writer") { + sources = [ + "index_writer.c", + "index_writer.h", + "repo_index.c", + "repo_index.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src:format", + "//src:utils", + ] + public_deps = [ "//src/git" ] +} + +source_set("repo_writer") { + sources = [ + "commit.c", + "commit.h", + "fileblob.c", + "fileblob.h", + "files.c", + "files.h", + "log.c", + "log.h", + "page.c", + "page.h", + "refs.c", + "refs.h", + "repo_writer.c", + "repo_writer.h", + ] + configs += [ "//:gout_config" ] + deps = [ + "//src:format", + "//src:utils", + "//src/writer/atom", + "//src/writer/cache", + ] + public_deps = [ "//src/git" ] +} diff --git a/writer/html/commit.c b/src/writer/html/commit.c diff --git a/writer/html/commit.h b/src/writer/html/commit.h diff --git a/writer/html/fileblob.c b/src/writer/html/fileblob.c diff --git a/writer/html/fileblob.h b/src/writer/html/fileblob.h diff --git a/writer/html/files.c b/src/writer/html/files.c diff --git a/writer/html/files.h b/src/writer/html/files.h diff --git a/writer/html/index_writer.c b/src/writer/html/index_writer.c diff --git a/writer/html/index_writer.h b/src/writer/html/index_writer.h diff --git a/writer/html/log.c b/src/writer/html/log.c diff --git a/writer/html/log.h b/src/writer/html/log.h diff --git a/writer/html/page.c b/src/writer/html/page.c diff --git a/writer/html/page.h b/src/writer/html/page.h diff --git a/writer/html/refs.c b/src/writer/html/refs.c diff --git a/writer/html/refs.h b/src/writer/html/refs.h diff --git a/writer/html/repo_index.c b/src/writer/html/repo_index.c diff --git a/writer/html/repo_index.h b/src/writer/html/repo_index.h diff --git a/writer/html/repo_writer.c b/src/writer/html/repo_writer.c diff --git a/writer/html/repo_writer.h b/src/writer/html/repo_writer.h diff --git a/writer/index_writer.c b/src/writer/index_writer.c diff --git a/writer/index_writer.h b/src/writer/index_writer.h diff --git a/writer/repo_writer.c b/src/writer/repo_writer.c diff --git a/writer/repo_writer.h b/src/writer/repo_writer.h diff --git a/writer/BUILD.gn b/writer/BUILD.gn @@ -1,25 +0,0 @@ -source_set("index_writer") { - sources = [ - "index_writer.c", - "index_writer.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//writer/gopher:index_writer", - "//writer/html:index_writer", - ] - public_deps = [ "//git" ] -} - -source_set("repo_writer") { - sources = [ - "repo_writer.c", - "repo_writer.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//writer/gopher:repo_writer", - "//writer/html:repo_writer", - ] - public_deps = [ "//git" ] -} diff --git a/writer/atom/BUILD.gn b/writer/atom/BUILD.gn @@ -1,12 +0,0 @@ -source_set("atom") { - sources = [ - "atom.c", - "atom.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//:format", - "//:utils", - ] - public_deps = [ "//git" ] -} diff --git a/writer/cache/BUILD.gn b/writer/cache/BUILD.gn @@ -1,9 +0,0 @@ -source_set("cache") { - sources = [ - "cache.c", - "cache.h", - ] - configs += [ "//:gout_config" ] - deps = [ "//:utils" ] - public_deps = [ "//git" ] -} diff --git a/writer/gopher/BUILD.gn b/writer/gopher/BUILD.gn @@ -1,41 +0,0 @@ -source_set("index_writer") { - sources = [ - "index_writer.c", - "index_writer.h", - "repo_index.c", - "repo_index.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//:format", - "//:utils", - ] - public_deps = [ "//git" ] -} - -source_set("repo_writer") { - sources = [ - "commit.c", - "commit.h", - "fileblob.c", - "fileblob.h", - "files.c", - "files.h", - "log.c", - "log.h", - "page.c", - "page.h", - "refs.c", - "refs.h", - "repo_writer.c", - "repo_writer.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//:format", - "//:utils", - "//writer/atom", - "//writer/cache", - ] - public_deps = [ "//git" ] -} diff --git a/writer/html/BUILD.gn b/writer/html/BUILD.gn @@ -1,41 +0,0 @@ -source_set("index_writer") { - sources = [ - "index_writer.c", - "index_writer.h", - "repo_index.c", - "repo_index.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//:format", - "//:utils", - ] - public_deps = [ "//git" ] -} - -source_set("repo_writer") { - sources = [ - "commit.c", - "commit.h", - "fileblob.c", - "fileblob.h", - "files.c", - "files.h", - "log.c", - "log.h", - "page.c", - "page.h", - "refs.c", - "refs.h", - "repo_writer.c", - "repo_writer.h", - ] - configs += [ "//:gout_config" ] - deps = [ - "//:format", - "//:utils", - "//writer/atom", - "//writer/cache", - ] - public_deps = [ "//git" ] -}