comparison util.h @ 51:07b6887d3557

pasterd: split into individual pages While here add a similar mini.css theme as in imgup.
author David Demelier <markand@malikania.fr>
date Mon, 21 Dec 2020 18:22:44 +0100
parents f455893bf0b0
children fba88439ec0a
comparison
equal deleted inserted replaced
50:520f57836ff3 51:07b6887d3557
17 */ 17 */
18 18
19 #ifndef PASTER_UTIL_H 19 #ifndef PASTER_UTIL_H
20 #define PASTER_UTIL_H 20 #define PASTER_UTIL_H
21 21
22 #include <stddef.h>
22 #include <stdnoreturn.h> 23 #include <stdnoreturn.h>
24 #include <time.h>
25
26 #define NELEM(x) (sizeof (x) / sizeof (x)[0])
23 27
24 struct tm; 28 struct tm;
29
30 extern const char *languages[];
31 extern const size_t languagesz;
25 32
26 noreturn void 33 noreturn void
27 die(const char *, ...); 34 die(const char *, ...);
28 35
29 char * 36 char *
33 bprintf(const char *, ...); 40 bprintf(const char *, ...);
34 41
35 const char * 42 const char *
36 bstrftime(const char *, const struct tm *); 43 bstrftime(const char *, const struct tm *);
37 44
45 const char *
46 path(const char *);
47
48 void
49 replace(char **, const char *);
50
51 const char *
52 ttl(time_t, long long int);
53
38 #endif /* !PASTER_UTIL_H */ 54 #endif /* !PASTER_UTIL_H */