git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/6] archive: declare struct archiver where it's needed

From
Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Jul 25, 2008, 10:41 UTC
Message-ID
<1216982486-5887-4-git-send-email-rene.scharfe@lsrfire.ath.cx>
In-Reply-To
<1216982486-5887-3-git-send-email-rene.scharfe@lsrfire.ath.cx>

Move the declaration of struct archiver to archive.c, as this is the only file left where it is used.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 archive.c |    6 +++++-
 archive.h |    6 ------
 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/archive.c b/archive.c
index c4662a2..f834b5f 100644
--- a/archive.c
+++ b/archive.c
@@ -9,7 +9,11 @@ static const char archive_usage[] = \
 
 #define USES_ZLIB_COMPRESSION 1
 
-const struct archiver archivers[] = {
+const struct archiver {
+	const char *name;
+	write_archive_fn_t write_archive;
+	unsigned int flags;
+} archivers[] = {
 	{ "tar", write_tar_archive },
 	{ "zip", write_zip_archive, USES_ZLIB_COMPRESSION },
 };
diff --git a/archive.h b/archive.h
index 929368d..0b15b35 100644
--- a/archive.h
+++ b/archive.h
@@ -17,12 +17,6 @@ typedef int (*write_archive_fn_t)(struct archiver_args *);
 
 typedef int (*write_archive_entry_fn_t)(struct archiver_args *args, const unsigned char *sha1, const char *path, size_t pathlen, unsigned int mode, void *buffer, unsigned long size);
 
-struct archiver {
-	const char *name;
-	write_archive_fn_t write_archive;
-	unsigned int flags;
-};
-
 /*
  * Archive-format specific backends.
  */
-- 
1.6.0.rc0.42.g186458
Previous: Rene ScharfeNext: Rene Scharfe
Message 4 of 10 in “archive: add write_archive()”
  1. 1/6 archive: add write_archive()Rene Scharfe, Jul 25, 2008
  2. 2/6 archive: move parameter parsing code to archive.cRene Scharfe, Jul 25, 2008
  3. 3/6 archive: define MAX_ARGS where it's neededRene Scharfe, Jul 25, 2008
  4. 4/6 archive: declare struct archiver where it's neededRene Scharfe, Jul 25, 2008
  5. 5/6 archive: allow --exec and --remote without equal signRene Scharfe, Jul 25, 2008
  6. 5/6 archive: allow --exec and --remote without equal signRene Scharfe, Jul 25, 2008
  7. René ScharfeJul 25, 2008
  8. Junio C HamanoJul 26, 2008
  9. René ScharfeJul 26, 2008
  10. Junio C HamanoJul 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.