From 59831e558edccc86338d0fb24d28025ec6159cc1 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 6 Apr 2024 18:06:58 +0530 Subject: meson: split ./include --- include/gpg.h | 6 ------ include/libnpass.h | 7 ------- include/libnpass/gpg.h | 6 ++++++ include/libnpass/libnpass.h | 7 +++++++ include/libnpass/util.h | 5 +++++ include/util.h | 10 ---------- src/libnpass/gpg.c | 4 ++-- src/libnpass/libnpass.c | 6 ++++-- src/libnpass/util.c | 1 + src/npass/npass.c | 2 +- 10 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 include/gpg.h delete mode 100644 include/libnpass.h create mode 100644 include/libnpass/gpg.h create mode 100644 include/libnpass/libnpass.h create mode 100644 include/libnpass/util.h diff --git a/include/gpg.h b/include/gpg.h deleted file mode 100644 index f5053bf..0000000 --- a/include/gpg.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include - -int gpg_key_validate(const char *fpr); -int gpg_decrypt(FILE *pass_out, const char *pass_path); -int gpg_encrypt(FILE *stream, const char *fpr, const char *pass, size_t n); diff --git a/include/libnpass.h b/include/libnpass.h deleted file mode 100644 index d4b7fb4..0000000 --- a/include/libnpass.h +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int pass_init(const char *fpr); -int pass_cat(FILE *out, const char *path); -int pass_add(const char *path, const char *pass, size_t n); -int pass_rm(const char *path); -ssize_t pass_getpass(char **lineptr, size_t *n, FILE *stream); diff --git a/include/libnpass/gpg.h b/include/libnpass/gpg.h new file mode 100644 index 0000000..f5053bf --- /dev/null +++ b/include/libnpass/gpg.h @@ -0,0 +1,6 @@ +#include +#include + +int gpg_key_validate(const char *fpr); +int gpg_decrypt(FILE *pass_out, const char *pass_path); +int gpg_encrypt(FILE *stream, const char *fpr, const char *pass, size_t n); diff --git a/include/libnpass/libnpass.h b/include/libnpass/libnpass.h new file mode 100644 index 0000000..d4b7fb4 --- /dev/null +++ b/include/libnpass/libnpass.h @@ -0,0 +1,7 @@ +#include + +int pass_init(const char *fpr); +int pass_cat(FILE *out, const char *path); +int pass_add(const char *path, const char *pass, size_t n); +int pass_rm(const char *path); +ssize_t pass_getpass(char **lineptr, size_t *n, FILE *stream); diff --git a/include/libnpass/util.h b/include/libnpass/util.h new file mode 100644 index 0000000..ebe97b1 --- /dev/null +++ b/include/libnpass/util.h @@ -0,0 +1,5 @@ +#include + +int r_mkdir(const char *path, mode_t mode); +int r_rmdir(const char *prefix_path, char *rm_path); +void util_strtrim(char *s); diff --git a/include/util.h b/include/util.h index f36965a..b6c64e0 100644 --- a/include/util.h +++ b/include/util.h @@ -1,7 +1,4 @@ -#ifndef UTIL_H - #include -#include #define err_die(r, ...) {\ fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \ @@ -9,10 +6,3 @@ fputc('\n', stderr); \ return r; \ } - -int r_mkdir(const char *path, mode_t mode); -int r_rmdir(const char *prefix_path, char *rm_path); -void util_strtrim(char *s); - -#define UTIL_H -#endif diff --git a/src/libnpass/gpg.c b/src/libnpass/gpg.c index 574a492..0b90b33 100644 --- a/src/libnpass/gpg.c +++ b/src/libnpass/gpg.c @@ -4,8 +4,8 @@ #include -#include "gpg.h" -#include "util.h" +#include "libnpass/gpg.h" +#include "libnpass/util.h" #define fail_if_err(err) \ if (err) { \ diff --git a/src/libnpass/libnpass.c b/src/libnpass/libnpass.c index 72e51df..14f4737 100644 --- a/src/libnpass/libnpass.c +++ b/src/libnpass/libnpass.c @@ -8,9 +8,11 @@ #include #include -#include "libnpass.h" +#include "libnpass/libnpass.h" +#include "libnpass/gpg.h" +#include "libnpass/util.h" + #include "util.h" -#include "gpg.h" #define DEF_PASS_DIR "pass" #define FPR_MAX 256 diff --git a/src/libnpass/util.c b/src/libnpass/util.c index 8e3a108..9164354 100644 --- a/src/libnpass/util.c +++ b/src/libnpass/util.c @@ -6,6 +6,7 @@ #include #include +#include "libnpass/util.h" #include "util.h" int r_mkdir(const char *path, mode_t mode) diff --git a/src/npass/npass.c b/src/npass/npass.c index 8aacc14..bde34de 100644 --- a/src/npass/npass.c +++ b/src/npass/npass.c @@ -4,7 +4,7 @@ #include #include -#include "libnpass.h" +#include "libnpass/libnpass.h" #include "util.h" void print_usage(void); -- cgit v1.2.3