forked from owntracks/recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.h
36 lines (31 loc) · 1.11 KB
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _UTIL_H_INCL_
# define _UTIL_H_INCL_
#ifndef TRUE
# define TRUE (1)
# define FALSE (0)
#endif
#include <time.h>
#include <syslog.h>
#include "json.h"
#include "utstring.h"
#define UB(x) utstring_body(x)
int mkpath(char *path);
int is_directory(char *path);
const char *isotime(time_t t);
char *slurp_file(char *filename, int fold_newlines);
int json_copy_to_object(JsonNode *obj, JsonNode * object_or_array, int clobber);
int json_copy_element_to_object(JsonNode *obj, char *key, JsonNode *node);
int json_copy_from_file(JsonNode * obj, char *filename);
int splitter(char *s, char *sep, char **parts);
JsonNode *json_splitter(char *s, char *sep);
int syslog_facility_code(char *facility);
const char *yyyymm(time_t t);
int tac(char *filename, long lines, int (*func)(char *, void *), void *param);
int cat(char *filename, int (*func)(char *, void *), void *param);
FILE *pathn(char *mode, char *prefix, UT_string *user, UT_string *device, char *suffix);
int safewrite(char *filename, char *buf);
void olog(int level, char *fmt, ...);
void geohash_setprec(int precision);
int geohash_prec(void);
void lowercase(char *s);
#endif