aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libnpass/gpg.c8
-rw-r--r--src/libnpass/libnpass.c24
-rw-r--r--src/npass/npass.c20
3 files changed, 26 insertions, 26 deletions
diff --git a/src/libnpass/gpg.c b/src/libnpass/gpg.c
index 9e3bb7a..f193363 100644
--- a/src/libnpass/gpg.c
+++ b/src/libnpass/gpg.c
@@ -18,10 +18,10 @@
static gpgme_ctx_t ctx = NULL;
static gpgme_key_t key = NULL;
-int gpg_init(void);
-void gpg_cleanup(void);
+static int gpg_init(void);
+static void gpg_cleanup(void);
-int gpg_init(void)
+static int gpg_init(void)
{
gpgme_error_t err;
const char *local = setlocale(LC_ALL, "");
@@ -40,7 +40,7 @@ int gpg_init(void)
return 0;
}
-void gpg_cleanup(void)
+static void gpg_cleanup(void)
{
if (ctx)
gpgme_key_release(key);
diff --git a/src/libnpass/libnpass.c b/src/libnpass/libnpass.c
index 6e4c874..bc1d774 100644
--- a/src/libnpass/libnpass.c
+++ b/src/libnpass/libnpass.c
@@ -33,10 +33,10 @@ const char *pass_gen_set[] = {
"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
};
-int set_pass_dir(void);
-int is_storeobj(struct dirent *dir);
+static int set_pass_dir(void);
+static int is_storeobj(struct dirent *dir);
-int set_pass_dir(void) {
+static int set_pass_dir(void) {
const char *env;
env = getenv("PASSWORD_STORE_DIR");
@@ -62,15 +62,7 @@ int set_pass_dir(void) {
return 1;
}
-int pass_store_cmp(const void *vp1, const void *vp2) {
- struct store *sp1, *sp2;
-
- sp1 = (struct store *) vp1;
- sp2 = (struct store *) vp2;
- return strcmp(sp1->name, sp2->name);
-}
-
-int is_storeobj(struct dirent *dir) {
+static int is_storeobj(struct dirent *dir) {
int r;
char *s;
@@ -96,6 +88,14 @@ int is_storeobj(struct dirent *dir) {
}
}
+int pass_store_cmp(const void *vp1, const void *vp2) {
+ struct store *sp1, *sp2;
+
+ sp1 = (struct store *) vp1;
+ sp2 = (struct store *) vp2;
+ return strcmp(sp1->name, sp2->name);
+}
+
pass_store_t pass_store_type(const char *spath) {
int r;
struct stat sbuf;
diff --git a/src/npass/npass.c b/src/npass/npass.c
index dce293c..54ab664 100644
--- a/src/npass/npass.c
+++ b/src/npass/npass.c
@@ -19,13 +19,13 @@ typedef enum {
DEPTH_NOT_OVER = 1,
} depth_state_t;
-void print_usage(void);
-int cat(const char *path);
-int add(const char *path);
-int gen(int argc, char *argv[]);
-int ls(const char *path, size_t depth);
+static void print_usage(void);
+static int cat(const char *path);
+static int add(const char *path);
+static int gen(int argc, char *argv[]);
+static int ls(const char *path, size_t depth);
-void print_usage(void)
+static void print_usage(void)
{
printf("Usage: pass COMMAND\n\n"
@@ -46,7 +46,7 @@ void print_usage(void)
" Show this help\n");
}
-int cat(const char *path)
+static int cat(const char *path)
{
int r;
@@ -57,7 +57,7 @@ int cat(const char *path)
return r;
}
-int ls(const char *path, size_t depth) {
+static int ls(const char *path, size_t depth) {
void *p;
char *prefix;
int i, j, len;
@@ -112,7 +112,7 @@ int ls(const char *path, size_t depth) {
return 0;
}
-int add(const char *path)
+static int add(const char *path)
{
char *p1 = NULL, *p2 = NULL;
FILE *in;
@@ -158,7 +158,7 @@ int add(const char *path)
return r;
}
-int gen(int argc, char *argv[]) {
+static int gen(int argc, char *argv[]) {
char *pass;
int opt, r = 0;
size_t len = 30;