shithub: scc

Download patch

ref: 0e0241ec76a8e8c87d092e9ea592d856bb010275
parent: 9b0b7035bdc207bebd8cb011544d29d26b8c8a1d
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Nov 20 06:47:44 EST 2017

[lib/scc] Hide struct alloc definition

This definition is not needed to be public. It also
helps to hide the union hdr definition.

--- a/inc/scc.h
+++ b/inc/scc.h
@@ -21,18 +21,6 @@
 
 typedef struct alloc Alloc;
 
-struct arena;
-union hdr;
-
-struct alloc {
-	size_t size;
-	size_t nmemb;
-	size_t padding;
-	struct arena *arena;
-	union hdr *freep;
-};
-
-
 extern void die(const char *fmt, ...);
 extern void dbg(const char *fmt, ...);
 extern void newitem(struct items *items, char *item);
--- a/lib/scc/alloc.c
+++ b/lib/scc/alloc.c
@@ -34,6 +34,14 @@
 	union hdr *array;
 };
 
+struct alloc {
+	size_t size;
+	size_t nmemb;
+	size_t padding;
+	struct arena *arena;
+	union hdr *freep;
+};
+
 static void
 newarena(Alloc *allocp)
 {