This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | os_time_before(a, b) |
#define | os_time_sub(a, b, res) |
#define | os_malloc(s) malloc((s)) |
#define | os_realloc(p, s) realloc((p), (s)) |
#define | os_free(p) free((p)) |
#define | os_memcpy(d, s, n) memcpy((d), (s), (n)) |
#define | os_memmove(d, s, n) memmove((d), (s), (n)) |
#define | os_memset(s, c, n) memset(s, c, n) |
#define | os_memcmp(s1, s2, n) memcmp((s1), (s2), (n)) |
#define | os_strdup(s) strdup(s) |
#define | os_strlen(s) strlen(s) |
#define | os_strcasecmp(s1, s2) strcasecmp((s1), (s2)) |
#define | os_strncasecmp(s1, s2, n) strncasecmp((s1), (s2), (n)) |
#define | os_strchr(s, c) strchr((s), (c)) |
#define | os_strcmp(s1, s2) strcmp((s1), (s2)) |
#define | os_strncmp(s1, s2, n) strncmp((s1), (s2), (n)) |
#define | os_strncpy(d, s, n) strncpy((d), (s), (n)) |
#define | os_strrchr(s, c) strrchr((s), (c)) |
#define | os_strstr(h, n) strstr((h), (n)) |
#define | os_snprintf snprintf |
Typedefs | |
typedef long | os_time_t |
Functions | |
void | os_sleep (os_time_t sec, os_time_t usec) |
Sleep (sec, usec). | |
int | os_get_time (struct os_time *t) |
Get current time (sec, usec). | |
int | os_mktime (int year, int month, int day, int hour, int min, int sec, os_time_t *t) |
Convert broken-down time into seconds since 1970-01-01. | |
int | os_daemonize (const char *pid_file) |
Run in the background (detach from the controlling terminal). | |
void | os_daemonize_terminate (const char *pid_file) |
Stop running in the background (remove pid file). | |
int | os_get_random (unsigned char *buf, size_t len) |
Get cryptographically strong pseudo random data. | |
unsigned long | os_random (void) |
Get pseudo random value (not necessarily very strong). | |
char * | os_rel2abs_path (const char *rel_path) |
Get an absolute path for a file. | |
int | os_program_init (void) |
Program initialization (called at start). | |
void | os_program_deinit (void) |
Program deinitialization (called just before exit). | |
int | os_setenv (const char *name, const char *value, int overwrite) |
Set environment variable. | |
int | os_unsetenv (const char *name) |
Delete environent variable. | |
char * | os_readfile (const char *name, size_t *len) |
Read a file to an allocated memory buffer. | |
void * | os_zalloc (size_t size) |
Allocate and zero memory. |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file os.h.
|
Value: ((a)->sec < (b)->sec || \ ((a)->sec == (b)->sec && (a)->usec < (b)->usec)) |
|
Value: do { \ (res)->sec = (a)->sec - (b)->sec; \ (res)->usec = (a)->usec - (b)->usec; \ if ((res)->usec < 0) { \ (res)->sec--; \ (res)->usec += 1000000; \ } \ } while (0) |
|
Run in the background (detach from the controlling terminal).
Definition at line 74 of file os_internal.c. |
|
Stop running in the background (remove pid file).
Definition at line 93 of file os_internal.c. |
|
Get cryptographically strong pseudo random data.
Definition at line 100 of file os_internal.c. |
|
Get current time (sec, usec).
Definition at line 40 of file os_internal.c. |
|
Convert broken-down time into seconds since 1970-01-01.
Definition at line 51 of file os_internal.c. |
|
Program deinitialization (called just before exit). This function is called just before a program exists. If there are any OS specific processing, e.g., freeing resourced allocated in os_program_init(), it should be done here. It is also acceptable for this function to do nothing. Definition at line 169 of file os_internal.c. |
|
Program initialization (called at start).
Definition at line 163 of file os_internal.c. |
|
Get pseudo random value (not necessarily very strong).
Definition at line 118 of file os_internal.c. |
|
Read a file to an allocated memory buffer.
Definition at line 191 of file os_internal.c. |
|
Get an absolute path for a file.
Definition at line 124 of file os_internal.c. |
|
Set environment variable.
Definition at line 174 of file os_internal.c. |
|
Sleep (sec, usec).
Definition at line 31 of file os_internal.c. |
|
Delete environent variable.
Definition at line 180 of file os_internal.c. |
|
Allocate and zero memory.
Definition at line 217 of file os_internal.c. |