| 1 | #ifndef COMMON_H |
| 2 | #define COMMON_H |
| 3 | |
| 4 | #include <signal.h> |
| 5 | #include <stdio.h> |
| 6 | #include <string.h> |
| 7 | #include <stdlib.h> |
| 8 | #include <stdbool.h> |
| 9 | #include <sys/stat.h> |
| 10 | #include <errno.h> |
| 11 | |
| 12 | #include <gpgme.h> |
| 13 | |
| 14 | typedef struct Node { |
| 15 | char *data; |
| 16 | struct Node *next; |
| 17 | } Node; |
| 18 | |
| 19 | typedef struct { |
| 20 | Node *head; |
| 21 | Node *tail; |
| 22 | size_t size; |
| 23 | } List; |
| 24 | |
| 25 | char *getbasedir(int trailing); |
| 26 | char *getlang(); |
| 27 | int mkdir_r(const char *path, mode_t mode); |
| 28 | int tmpcopy(const char *inpath, const char *outpath); |
| 29 | void scanDir(const char *dpath, const char *rpath, List *fpaths, |
| 30 | List *fullpaths, List *dispaths); |
| 31 | void handle_sigint(int sig); |
| 32 | |
| 33 | |
| 34 | void initList(List *list); |
| 35 | void addElement(List *list, const char *data); |
| 36 | char *getElement(List *list, size_t idx); |
| 37 | void rmElement(List *list, size_t idx); |
| 38 | void freeList(List *list); |
| 39 | |
| 40 | #endif |