aboutsummaryrefslogtreecommitdiff
path: root/spm.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-12-17 09:41:52 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-12-17 09:41:52 -0500
commitfa992c8655f2fe27a97fe0e6768800a356de3744 (patch)
tree7fc38d4bd3ff47abe6b76ded773450b9b65d11b8 /spm.h
parentfcf0e9159b76be699bc8560f853ece8bb2c7ff2e (diff)
downloadspmc-fa992c8655f2fe27a97fe0e6768800a356de3744.tar.gz
Dependencies are finally installable
Diffstat (limited to 'spm.h')
-rw-r--r--spm.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/spm.h b/spm.h
index d78fb63..f8eab43 100644
--- a/spm.h
+++ b/spm.h
@@ -4,6 +4,7 @@
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
+#include <fts.h>
#include <glob.h>
#include <stdio.h>
#include <stdlib.h>
@@ -40,6 +41,20 @@
#define SHELL_BENCHMARK 1 << 2
typedef struct {
+ char *root;
+ char **dirs;
+ size_t dirs_length;
+ char **files;
+ size_t files_length;
+} FSTree;
+
+typedef struct {
+ size_t __size; // Count of allocated records
+ size_t records; // Count of usable records
+ char **list; // Array of dependencies
+} Dependencies;
+
+typedef struct {
char *key;
char *value;
size_t key_length;
@@ -111,12 +126,10 @@ char *gen_rpath(const char *_filename);
int set_rpath(const char *filename, char *_rpath);
void walkdir(char *dirpath, Dirwalk **result, unsigned int dirs);
-char **fstree(const char *path, unsigned int get_dir_flag);
long int get_file_size(const char *filename);
int mkdirs(const char *_path, mode_t mode);
-int rmdirs(const char *_path);
char *dirname(const char *_path);
-char *basename(const char *_path);
+char *basename(char *path);
char *get_user_conf_dir(void);
char *get_user_config_file(void);
@@ -142,4 +155,19 @@ ConfigItem *config_get(ConfigItem **item, const char *key);
void config_free(ConfigItem **item);
void config_test(void);
+// deps.c
+int exists(const char *filename);
+int dep_seen(Dependencies **deps, const char *name);
+int dep_init(Dependencies **deps);
+void dep_free(Dependencies **deps);
+int dep_append(Dependencies **deps, char *name);
+int dep_solve(Dependencies **deps, const char *filename);
+void dep_show(Dependencies **deps);
+
+// fstree.c
+int _fstree_compare(const FTSENT **a, const FTSENT **b);
+void fstree_free(FSTree *fsdata);
+FSTree *fstree(const char *_path);
+int rmdirs(const char *_path);
+
#endif //SPM_SPM_H