util.h (493B)
1 #ifndef GEMINI_UTIL_H 2 #define GEMINI_UTIL_H 3 #include <stdio.h> 4 #include <sys/types.h> 5 6 struct pathspec { 7 const char *var; 8 const char *path; 9 }; 10 11 char *trim_ws(char *in); 12 char *getpath(const struct pathspec *paths, size_t npaths); 13 void posix_dirname(char *path, char *dname); 14 int mkdirs(char *path, mode_t mode); 15 int print_resp_file(bool end_with_nl, struct gemini_response resp, FILE *out); 16 int print_resp(bool end_with_nl, struct gemini_response resp, const char *path, 17 char *url); 18 19 #endif