recorder/util.h

34 lines
1.1 KiB
C
Raw Normal View History

2015-08-22 06:52:39 -07:00
#ifndef _UTIL_H_INCL_
# define _UTIL_H_INCL_
2015-08-25 09:00:31 -07:00
#ifndef TRUE
# define TRUE (1)
# define FALSE (0)
#endif
2015-08-22 06:52:39 -07:00
#include <time.h>
2015-09-03 23:06:53 -07:00
#include <syslog.h>
2015-08-25 09:00:31 -07:00
#include "json.h"
2015-09-01 08:15:00 -07:00
#include "utstring.h"
2015-08-22 06:52:39 -07:00
2015-09-01 08:15:00 -07:00
int mkpath(char *path);
2015-09-01 05:05:02 -07:00
int is_directory(char *path);
2015-08-22 06:52:39 -07:00
const char *isotime(time_t t);
2015-08-25 09:00:31 -07:00
char *slurp_file(char *filename, int fold_newlines);
2015-08-29 13:45:03 -07:00
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);
2015-08-25 09:00:31 -07:00
int json_copy_from_file(JsonNode * obj, char *filename);
int splitter(char *s, char *sep, char **parts);
2015-08-26 10:38:20 -07:00
JsonNode *json_splitter(char *s, char *sep);
2015-08-28 09:21:20 -07:00
int syslog_facility_code(char *facility);
2015-08-29 05:59:46 -07:00
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);
2015-09-01 08:15:00 -07:00
FILE *pathn(char *mode, char *prefix, UT_string *user, UT_string *device, char *suffix);
int safewrite(char *filename, char *buf);
2015-09-03 23:06:53 -07:00
void olog(int level, char *fmt, ...);
void geohash_setprec(int precision);
int geohash_prec(void);
2015-08-22 06:52:39 -07:00
#endif