-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
47 lines (32 loc) · 1.79 KB
/
README
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
37
38
39
40
41
42
43
44
45
46
47
cmccabe-daemon-utils
==============================================================================
These are some utility routines I developed to make it easier to write UNIX
daemons.
The stuff in the util/ directory can be linked into anything, including
libraries. Stuff in the core/ directory makes use of globals, so it should only
be linked into daemons, but not into libraries. The jorm/ directory contains
some macros that can be used to automatically serialize and deserialize JSON
data to C structures.
core/fast_log: a fast log intended to be used to "always-on" debugging. Log
messages go to a circular buffer. Normally, you would create one fast_log
buffer per thread. Log messages can be dumped to a file in the signal handler.
core/glitch_log: a slow log which is intended to be used to log serious warning
messages and errors.
core/pid_file: routines for managing a pid file.
core/signal: routines for managing signals. This integrates with fast_log and
glitch_log.
util/compiler.h: macros for making use of compiler-specific features
util/run_cmd: utilities for running external commands.
util/safe_io: utility functions for writing to a raw file descriptor while
properly handling EINTR.
util/str_to_int: a stricter version of atoi and atoll.
util/string: some handy string manipulation routines.
util/tempfile: some routines for manipulating temporary directories.
json: as mentioned before, this directory contains code used to serialize and
deserialize JSON data to C structures. These structures are defined in .jorm
files, and the C code to handle them is generated by #include directives. See
jorm_unit for an example of how to use this.
I am releasing this code under the Apache 2.0 license, in hopes that it will be
useful to you. See LICENSE.txt for details.
Have fun.
Colin Patrick McCabe