]> ruderich.org/simon Gitweb - nsscash/nsscash.git/commitdiff
nss: merge cash.h into file.h
authorSimon Ruderich <simon@ruderich.org>
Mon, 10 Jun 2019 20:26:00 +0000 (22:26 +0200)
committerSimon Ruderich <simon@ruderich.org>
Mon, 10 Jun 2019 20:26:00 +0000 (22:26 +0200)
file.h is a more logical place anyway and this gets rid of a useless
header file.

nss/cash.h [deleted file]
nss/file.h
nss/gr.c
nss/pw.c

diff --git a/nss/cash.h b/nss/cash.h
deleted file mode 100644 (file)
index d227655..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * General header of nsscash
- *
- * Copyright (C) 2019  Simon Ruderich
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-
-#ifndef CASH_H
-#define CASH_H
-
-#include <stdint.h>
-
-
-// Global constants
-
-#define MAGIC "NSS-CASH"
-
-// Defined in Makefile
-#ifndef NSSCASH_PASSWD_FILE
-# define NSSCASH_PASSWD_FILE "/etc/passwd.nsscash"
-#endif
-#ifndef NSSCASH_GROUP_FILE
-# define NSSCASH_GROUP_FILE "/etc/group.nsscash"
-#endif
-
-
-// Global structs
-
-struct header {
-    char magic[8]; // magic string
-    uint64_t version; // also doubles as byte-order check
-
-    uint64_t count;
-
-    // All offsets are relative to data
-    uint64_t off_orig_index;
-    uint64_t off_id_index;
-    uint64_t off_name_index;
-    uint64_t off_data;
-
-    char data[];
-} __attribute__((packed));
-
-#endif
index 7aac37ccc33c14e31c23da97724e30aa08b6e524..539d219f6b8b5c17d856600c32a6cbda0674b1c2 100644 (file)
 #include <stdint.h>
 #include <stdlib.h>
 
 #include <stdint.h>
 #include <stdlib.h>
 
-#include "cash.h"
 
 
+#define MAGIC "NSS-CASH"
+
+// Defined in Makefile
+#ifndef NSSCASH_PASSWD_FILE
+# define NSSCASH_PASSWD_FILE "/etc/passwd.nsscash"
+#endif
+#ifndef NSSCASH_GROUP_FILE
+# define NSSCASH_GROUP_FILE "/etc/group.nsscash"
+#endif
+
+
+struct header {
+    char magic[8]; // magic string
+    uint64_t version; // also doubles as byte-order check
+
+    uint64_t count;
+
+    // All offsets are relative to data
+    uint64_t off_orig_index;
+    uint64_t off_id_index;
+    uint64_t off_name_index;
+    uint64_t off_data;
+
+    char data[];
+} __attribute__((packed));
 
 struct file {
     int fd;
 
 struct file {
     int fd;
index c49ef4799be15db6e4996b4c01042eb5965d8a75..fbfd02fed3bdcdafcf1526e08d41de673a636a07 100644 (file)
--- a/nss/gr.c
+++ b/nss/gr.c
@@ -25,7 +25,6 @@
 
 #include <pthread.h>
 
 
 #include <pthread.h>
 
-#include "cash.h"
 #include "cash_nss.h"
 #include "file.h"
 #include "search.h"
 #include "cash_nss.h"
 #include "file.h"
 #include "search.h"
index 1dd9d3b5c05279195af7ccbc2497035305735565..e4f99aadcfa7422c3e61efeae95d318df0d9b3b9 100644 (file)
--- a/nss/pw.c
+++ b/nss/pw.c
@@ -25,7 +25,6 @@
 
 #include <pthread.h>
 
 
 #include <pthread.h>
 
-#include "cash.h"
 #include "cash_nss.h"
 #include "file.h"
 #include "search.h"
 #include "cash_nss.h"
 #include "file.h"
 #include "search.h"