commit 34f30c93c7c96fba1ad860e2e6dd125b6e79d381
parent b4e2f0235a9b4b77862747d0e3a3c17ea1985507
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Sat, 27 Feb 2021 14:09:09 -0600
move macros to common.h
Diffstat:
8 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/alt.c b/alt.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <unistd.h>
+#include "common.h"
#include "pkg.h"
#include "alt.h"
#include "util.h"
diff --git a/alt.h b/alt.h
@@ -1,6 +1,3 @@
-#define ALT_MAX 256
-#define KISS_CHOICES "/var/db/kiss/choices"
-
struct alt_t {
char name[PKG_NAME_MAX];
char path[PATH_LEN];
diff --git a/common.h b/common.h
@@ -0,0 +1,16 @@
+#ifndef _COMMON_H
+#define _COMMON_H
+
+#define HASH_LEN 32
+#define KISS_PATH_MAX 2048
+#define PKG_VERSION_MAX 256
+#define PKG_SOURCES_MAX 64
+#define PKG_COUNT_MAX 1024
+#define PKG_NAME_MAX 64
+#define PATH_LEN 512
+#define URL_LEN 2048
+#define ALT_MAX 256
+#define KISS_INSTALLED "/var/db/kiss/installed"
+#define KISS_CHOICES "/var/db/kiss/choices"
+
+#endif
diff --git a/http.c b/http.c
@@ -13,6 +13,7 @@
#include <tls.h>
#include <unistd.h>
+#include "common.h"
#include "util.h"
#define READ_BUF_SIZ 16384
diff --git a/kiss.c b/kiss.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
+#include "common.h"
#include "pkg.h"
#include "alt.h"
#include "util.h"
diff --git a/pkg.c b/pkg.c
@@ -8,6 +8,7 @@
#include <string.h>
#include <unistd.h>
+#include "common.h"
#include "http.h"
#include "pkg.h"
#include "sha256.h"
diff --git a/pkg.h b/pkg.h
@@ -1,12 +1,3 @@
-#define HASH_LEN 32
-#define KISS_INSTALLED "/var/db/kiss/installed"
-#define PKG_VERSION_MAX 256
-#define PKG_SOURCES_MAX 64
-#define PKG_COUNT_MAX 1024
-#define PKG_NAME_MAX 64
-#define PATH_LEN 512
-#define URL_LEN 2048
-
struct source_t {
char git;
char local;
diff --git a/util.c b/util.c
@@ -11,6 +11,7 @@
#include <tls.h>
#include <unistd.h>
+#include "common.h"
#include "util.h"
static void