Go to the source code of this file.
Functions | |
void | error (const char *format,...) |
Print a formated message to stderr or to the logfile if no tty exist. More... | |
int | is_strdefined (char *p) |
char * | stripfilename (char *path) |
Strip the path and return only the filename. More... | |
void | chomp (char *string) |
Removes everything from the first newline (CR|LF). More... | |
char * | trim (char *s) |
Remove leading and trailing space from the string. More... | |
char * | ltrim (char *s) |
Remove leading white space [ \t\r ] from the string. More... | |
char * | rtrim (char *s) |
Remove trailing white space [ \t\r ] from the string. More... | |
char * | trim_quotes (char *s) |
Remove any enclosing quotes ["'] from the string. More... | |
int | starts_with (char *a, char *b) |
Return TRUE if the string a starts with the string b. More... | |
void | handle_string_escapes (char *buf) |
Exchanges \escape sequences in a string. More... | |
Process_T | get_process (char *name) |
int | exist_process (char *name) |
void | printrunlist () |
Print the Runtime object. More... | |
void | printprocess (Process_T p) |
Print a process object. More... | |
void | printprocesslist () |
Print all the processes in the processlist. More... | |
pid_t | get_pid (char *pidfile) |
Open and read the pid from the given pidfile. More... | |
int | is_process_running (Process_T p) |
char * | get_RFC1123date (long *date) |
Returns a (RFC1123) Date string. More... | |
char * | get_ctime () |
Get a non terminated ctime. More... | |
char * | get_process_uptime (char *pidfile) |
Compute an uptime string for a process based on the ctime from the pidfile. More... | |
char * | get_uptime (time_t delta) |
Compute an uptime string based on the delta time in seconds. More... | |
int | set_md5sum (char **dest, char *file) |
Compute a md5 checksum for the given file and save the result in an allocated area pointed to by dest. More... | |
char * | get_md5sum (char *file) |
int | check_md5 (char *file, char *sum) |
char * | url_encode (char *uri) |
Escape an uri string converting unsafe characters to a hex (xx) representation. More... | |
char * | get_basic_authentication_header () |
char * | format (const char *s, va_list ap) |
Does printf style format line parsing. More... |
Definition in file util.c.
|
Definition at line 828 of file util.c. References get_md5sum(). |
|
Removes everything from the first newline (CR|LF).
Definition at line 133 of file util.c. Referenced by check_ftp(), check_http(), check_imap(), check_nntp(), check_pop(), check_smtp(), and get_ctime(). |
|
Print a formated message to stderr or to the logfile if no tty exist.
Definition at line 81 of file util.c. References format(), and log(). Referenced by can_http(), check_rcfile(), create_pidfile(), dstart_process(), dstop_process(), find_rcfile(), kill_daemon(), log_close(), start_httpd(), start_process(), stop_process(), xcalloc(), xmalloc(), and xresize(). |
|
Definition at line 321 of file util.c. References is, myprocess::name, myprocess::next, and processlist. Referenced by dstart_process(), and dstop_process(). |
|
Does printf style format line parsing.
Definition at line 911 of file util.c. References xmalloc(), and xresize(). Referenced by error(). |
|
Definition at line 883 of file util.c. References myrun::Auth, myrun::myautentication::defined, encode_base64(), myrun::myautentication::passwd, Run, myrun::myautentication::uname, xmalloc(), and xstrdup(). Referenced by dstart_process(), and dstop_process(). |
|
Get a non
|
|
Definition at line 781 of file util.c. References isreg_file(), and xstrdup(). Referenced by check_md5(), and set_md5sum(). |
|
Open and read the pid from the given pidfile.
Definition at line 570 of file util.c. References exist_file(), isreg_file(), log(), prog, and STRERROR. Referenced by is_process_running(). |
|
Definition at line 304 of file util.c. References is, myprocess::name, myprocess::next, and processlist. Referenced by dstart_process(), and dstop_process(). |
|
Compute an uptime string for a process based on the ctime from the pidfile. The caller must free the returned string.
Definition at line 703 of file util.c. References file_changedtime(), get_uptime(), and xstrdup(). Referenced by status(). |
|
Returns a (RFC1123) Date string. If the given date is NULL compute the date now.
Definition at line 642 of file util.c. References xstrdup(). Referenced by sendmail(). |
|
Compute an uptime string based on the delta time in seconds. The caller must free the returned string.
Definition at line 726 of file util.c. References xstrdup(). Referenced by get_process_uptime(). |
|
Exchanges \escape sequences in a string.
|
|
Definition at line 617 of file util.c. References get_pid(), and myprocess::pidfile. Referenced by dstart_process(), dstop_process(), exist_daemon(), start_process(), and stop_process(). |
|
|
|
Remove leading white space [ \t\r
Definition at line 167 of file util.c. Referenced by trim(). |
|
|
Print all the processes in the processlist.
Definition at line 545 of file util.c. References myprocess::next, printprocess(), and processlist. |
|
Print the Runtime object.
Definition at line 336 of file util.c. References myrun::Auth, myrun::bind_addr, myrun::controlfile, myrun::debug, myrun::myautentication::defined, myrun::dohttpd, myrun::dolog, myrun::doprocess, myrun::myformat::from, myrun::httpdport, myrun::isdaemon, myrun::logfile, myrun::MailFormat, myrun::mailserver, myrun::myformat::message, myrun::pidfile, myrun::polltime, Run, myrun::myformat::subject, and myrun::use_syslog. |
|
Remove trailing white space [ \t\r
Definition at line 183 of file util.c. Referenced by trim(). |
|
Compute a md5 checksum for the given file and save the result in an allocated area pointed to by dest. The caller is responsible for freeing dest.
Definition at line 765 of file util.c. References get_md5sum(). |
|
Return TRUE if the string a starts with the string b.
|
|
Strip the path and return only the filename.
Definition at line 120 of file util.c. Referenced by main(). |
|
Remove leading and trailing space from the string.
|
|
Remove any enclosing quotes ["'] from the string.
|
|
Escape an uri string converting unsafe characters to a hex (xx) representation. The caller must free the returned string.
Definition at line 853 of file util.c. References xmalloc(). |