14ecbd6dmarkm/*
233f661cstas * Copyright (c) 1995 - 2005 Kungliga Tekniska H��gskolan
34ecbd6dmarkm * (Royal Institute of Technology, Stockholm, Sweden).
44ecbd6dmarkm * All rights reserved.
533f661cstas *
64ecbd6dmarkm * Redistribution and use in source and binary forms, with or without
74ecbd6dmarkm * modification, are permitted provided that the following conditions
84ecbd6dmarkm * are met:
933f661cstas *
104ecbd6dmarkm * 1. Redistributions of source code must retain the above copyright
114ecbd6dmarkm *    notice, this list of conditions and the following disclaimer.
1233f661cstas *
134ecbd6dmarkm * 2. Redistributions in binary form must reproduce the above copyright
144ecbd6dmarkm *    notice, this list of conditions and the following disclaimer in the
154ecbd6dmarkm *    documentation and/or other materials provided with the distribution.
1633f661cstas *
174ecbd6dmarkm * 3. Neither the name of the Institute nor the names of its contributors
184ecbd6dmarkm *    may be used to endorse or promote products derived from this software
194ecbd6dmarkm *    without specific prior written permission.
2033f661cstas *
214ecbd6dmarkm * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
224ecbd6dmarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
234ecbd6dmarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
244ecbd6dmarkm * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
254ecbd6dmarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
264ecbd6dmarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
274ecbd6dmarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
284ecbd6dmarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
294ecbd6dmarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
304ecbd6dmarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
314ecbd6dmarkm * SUCH DAMAGE.
324ecbd6dmarkm */
334ecbd6dmarkm
3433f661cstas/* $Id$ */
354ecbd6dmarkm
364ecbd6dmarkm#ifndef __ROKEN_COMMON_H__
374ecbd6dmarkm#define __ROKEN_COMMON_H__
384ecbd6dmarkm
3951b6601dfr#ifndef ROKEN_LIB_FUNCTION
4051b6601dfr#ifdef _WIN32
4133f661cstas#define ROKEN_LIB_FUNCTION
4233f661cstas#define ROKEN_LIB_CALL     __cdecl
4351b6601dfr#else
4451b6601dfr#define ROKEN_LIB_FUNCTION
4533f661cstas#define ROKEN_LIB_CALL
4651b6601dfr#endif
4751b6601dfr#endif
4851b6601dfr
49ebfe6dcassar#ifdef __cplusplus
50ebfe6dcassar#define ROKEN_CPP_START	extern "C" {
51ebfe6dcassar#define ROKEN_CPP_END	}
52ebfe6dcassar#else
53ebfe6dcassar#define ROKEN_CPP_START
54ebfe6dcassar#define ROKEN_CPP_END
55ebfe6dcassar#endif
56ebfe6dcassar
574ecbd6dmarkm#ifndef INADDR_NONE
584ecbd6dmarkm#define INADDR_NONE 0xffffffff
594ecbd6dmarkm#endif
604ecbd6dmarkm
614ecbd6dmarkm#ifndef INADDR_LOOPBACK
624ecbd6dmarkm#define INADDR_LOOPBACK 0x7f000001
634ecbd6dmarkm#endif
644ecbd6dmarkm
654ecbd6dmarkm#ifndef SOMAXCONN
664ecbd6dmarkm#define SOMAXCONN 5
674ecbd6dmarkm#endif
684ecbd6dmarkm
694ecbd6dmarkm#ifndef STDIN_FILENO
704ecbd6dmarkm#define STDIN_FILENO 0
714ecbd6dmarkm#endif
724ecbd6dmarkm
734ecbd6dmarkm#ifndef STDOUT_FILENO
744ecbd6dmarkm#define STDOUT_FILENO 1
754ecbd6dmarkm#endif
764ecbd6dmarkm
774ecbd6dmarkm#ifndef STDERR_FILENO
784ecbd6dmarkm#define STDERR_FILENO 2
794ecbd6dmarkm#endif
804ecbd6dmarkm
814ecbd6dmarkm#ifndef max
824ecbd6dmarkm#define max(a,b) (((a)>(b))?(a):(b))
834ecbd6dmarkm#endif
844ecbd6dmarkm
854ecbd6dmarkm#ifndef min
864ecbd6dmarkm#define min(a,b) (((a)<(b))?(a):(b))
874ecbd6dmarkm#endif
884ecbd6dmarkm
894ecbd6dmarkm#ifndef TRUE
904ecbd6dmarkm#define TRUE 1
914ecbd6dmarkm#endif
924ecbd6dmarkm
934ecbd6dmarkm#ifndef FALSE
944ecbd6dmarkm#define FALSE 0
954ecbd6dmarkm#endif
964ecbd6dmarkm
974ecbd6dmarkm#ifndef LOG_DAEMON
984ecbd6dmarkm#define openlog(id,option,facility) openlog((id),(option))
994ecbd6dmarkm#define	LOG_DAEMON	0
1004ecbd6dmarkm#endif
1014ecbd6dmarkm#ifndef LOG_ODELAY
1024ecbd6dmarkm#define LOG_ODELAY 0
1034ecbd6dmarkm#endif
1044ecbd6dmarkm#ifndef LOG_NDELAY
1054ecbd6dmarkm#define LOG_NDELAY 0x08
1064ecbd6dmarkm#endif
1074ecbd6dmarkm#ifndef LOG_CONS
1084ecbd6dmarkm#define LOG_CONS 0
1094ecbd6dmarkm#endif
1104ecbd6dmarkm#ifndef LOG_AUTH
1114ecbd6dmarkm#define LOG_AUTH 0
1124ecbd6dmarkm#endif
1134ecbd6dmarkm#ifndef LOG_AUTHPRIV
1144ecbd6dmarkm#define LOG_AUTHPRIV LOG_AUTH
1154ecbd6dmarkm#endif
1164ecbd6dmarkm
1174ecbd6dmarkm#ifndef F_OK
1184ecbd6dmarkm#define F_OK 0
1194ecbd6dmarkm#endif
1204ecbd6dmarkm
1214ecbd6dmarkm#ifndef O_ACCMODE
1224ecbd6dmarkm#define O_ACCMODE	003
1234ecbd6dmarkm#endif
1244ecbd6dmarkm
12533f661cstas#ifndef _WIN32
12633f661cstas
127fa8b1a9markm#ifndef _PATH_DEV
128fa8b1a9markm#define _PATH_DEV "/dev/"
129fa8b1a9markm#endif
130fa8b1a9markm
1314ecbd6dmarkm#ifndef _PATH_DEVNULL
1324ecbd6dmarkm#define _PATH_DEVNULL "/dev/null"
1334ecbd6dmarkm#endif
1344ecbd6dmarkm
1354ecbd6dmarkm#ifndef _PATH_HEQUIV
1364ecbd6dmarkm#define _PATH_HEQUIV "/etc/hosts.equiv"
1374ecbd6dmarkm#endif
1384ecbd6dmarkm
139ebfe6dcassar#ifndef _PATH_VARRUN
140ebfe6dcassar#define _PATH_VARRUN "/var/run/"
141ebfe6dcassar#endif
142ebfe6dcassar
143ebfe6dcassar#ifndef _PATH_BSHELL
144ebfe6dcassar#define _PATH_BSHELL "/bin/sh"
145ebfe6dcassar#endif
146ebfe6dcassar
1474ecbd6dmarkm#ifndef MAXPATHLEN
1484ecbd6dmarkm#define MAXPATHLEN (1024+4)
1494ecbd6dmarkm#endif
1504ecbd6dmarkm
15133f661cstas#endif	/* !_WIN32 */
15233f661cstas
15333f661cstas#ifndef PATH_MAX
15433f661cstas#define PATH_MAX MAX_PATH
15533f661cstas#endif
15633f661cstas
15733f661cstas#ifndef RETSIGTYPE
15833f661cstas#define RETSIGTYPE void
15933f661cstas#endif
16033f661cstas
1614ecbd6dmarkm#ifndef SIG_ERR
162ebfe6dcassar#define SIG_ERR ((RETSIGTYPE (*)(int))-1)
1634ecbd6dmarkm#endif
1644ecbd6dmarkm
1654ecbd6dmarkm/*
1664ecbd6dmarkm * error code for getipnodeby{name,addr}
1674ecbd6dmarkm */
1684ecbd6dmarkm
1694ecbd6dmarkm#ifndef HOST_NOT_FOUND
1704ecbd6dmarkm#define HOST_NOT_FOUND 1
1714ecbd6dmarkm#endif
1724ecbd6dmarkm
1734ecbd6dmarkm#ifndef TRY_AGAIN
1744ecbd6dmarkm#define TRY_AGAIN 2
1754ecbd6dmarkm#endif
1764ecbd6dmarkm
1774ecbd6dmarkm#ifndef NO_RECOVERY
1784ecbd6dmarkm#define NO_RECOVERY 3
1794ecbd6dmarkm#endif
1804ecbd6dmarkm
1814ecbd6dmarkm#ifndef NO_DATA
1824ecbd6dmarkm#define NO_DATA 4
1834ecbd6dmarkm#endif
1844ecbd6dmarkm
1854ecbd6dmarkm#ifndef NO_ADDRESS
1864ecbd6dmarkm#define NO_ADDRESS NO_DATA
1874ecbd6dmarkm#endif
1884ecbd6dmarkm
1894ecbd6dmarkm/*
1904ecbd6dmarkm * error code for getaddrinfo
1914ecbd6dmarkm */
1924ecbd6dmarkm
1934ecbd6dmarkm#ifndef EAI_NOERROR
1944ecbd6dmarkm#define EAI_NOERROR	0	/* no error */
1954ecbd6dmarkm#endif
1964ecbd6dmarkm
197bfc5316nectar#ifndef EAI_NONAME
1984ecbd6dmarkm
1994ecbd6dmarkm#define EAI_ADDRFAMILY	1	/* address family for nodename not supported */
2004ecbd6dmarkm#define EAI_AGAIN	2	/* temporary failure in name resolution */
2014ecbd6dmarkm#define EAI_BADFLAGS	3	/* invalid value for ai_flags */
2024ecbd6dmarkm#define EAI_FAIL	4	/* non-recoverable failure in name resolution */
2034ecbd6dmarkm#define EAI_FAMILY	5	/* ai_family not supported */
2044ecbd6dmarkm#define EAI_MEMORY	6	/* memory allocation failure */
2054ecbd6dmarkm#define EAI_NODATA	7	/* no address associated with nodename */
2064ecbd6dmarkm#define EAI_NONAME	8	/* nodename nor servname provided, or not known */
2074ecbd6dmarkm#define EAI_SERVICE	9	/* servname not supported for ai_socktype */
2084ecbd6dmarkm#define EAI_SOCKTYPE   10	/* ai_socktype not supported */
2094ecbd6dmarkm#define EAI_SYSTEM     11	/* system error returned in errno */
2104ecbd6dmarkm
211bfc5316nectar#endif /* EAI_NONAME */
2124ecbd6dmarkm
2134ecbd6dmarkm/* flags for getaddrinfo() */
2144ecbd6dmarkm
2154ecbd6dmarkm#ifndef AI_PASSIVE
2164ecbd6dmarkm#define AI_PASSIVE	0x01
2174ecbd6dmarkm#define AI_CANONNAME	0x02
2184ecbd6dmarkm#endif /* AI_PASSIVE */
2194ecbd6dmarkm
220a77dba0nectar#ifndef AI_NUMERICHOST
221a77dba0nectar#define AI_NUMERICHOST	0x04
222a77dba0nectar#endif
223a77dba0nectar
22433f661cstas#ifndef AI_NUMERICSERV
22533f661cstas#define AI_NUMERICSERV  0x08
22633f661cstas#endif
22733f661cstas
2284ecbd6dmarkm/* flags for getnameinfo() */
2294ecbd6dmarkm
2304ecbd6dmarkm#ifndef NI_DGRAM
2314ecbd6dmarkm#define NI_DGRAM	0x01
2324ecbd6dmarkm#define NI_NAMEREQD	0x02
2334ecbd6dmarkm#define NI_NOFQDN	0x04
2344ecbd6dmarkm#define NI_NUMERICHOST	0x08
2354ecbd6dmarkm#define NI_NUMERICSERV	0x10
2364ecbd6dmarkm#endif
2374ecbd6dmarkm
2384ecbd6dmarkm/*
2394ecbd6dmarkm * constants for getnameinfo
2404ecbd6dmarkm */
2414ecbd6dmarkm
2424ecbd6dmarkm#ifndef NI_MAXHOST
2434ecbd6dmarkm#define NI_MAXHOST  1025
2444ecbd6dmarkm#define NI_MAXSERV    32
2454ecbd6dmarkm#endif
2464ecbd6dmarkm
2474ecbd6dmarkm/*
2484ecbd6dmarkm * constants for inet_ntop
2494ecbd6dmarkm */
2504ecbd6dmarkm
2514ecbd6dmarkm#ifndef INET_ADDRSTRLEN
2524ecbd6dmarkm#define INET_ADDRSTRLEN    16
2534ecbd6dmarkm#endif
2544ecbd6dmarkm
2554ecbd6dmarkm#ifndef INET6_ADDRSTRLEN
2564ecbd6dmarkm#define INET6_ADDRSTRLEN   46
2574ecbd6dmarkm#endif
2584ecbd6dmarkm
2594ecbd6dmarkm/*
2604ecbd6dmarkm * for shutdown(2)
2614ecbd6dmarkm */
2624ecbd6dmarkm
2634ecbd6dmarkm#ifndef SHUT_RD
2644ecbd6dmarkm#define SHUT_RD 0
2654ecbd6dmarkm#endif
2664ecbd6dmarkm
2674ecbd6dmarkm#ifndef SHUT_WR
2684ecbd6dmarkm#define SHUT_WR 1
2694ecbd6dmarkm#endif
2704ecbd6dmarkm
2714ecbd6dmarkm#ifndef SHUT_RDWR
2724ecbd6dmarkm#define SHUT_RDWR 2
2734ecbd6dmarkm#endif
2744ecbd6dmarkm
2754ecbd6dmarkm#ifndef HAVE___ATTRIBUTE__
2764ecbd6dmarkm#define __attribute__(x)
2774ecbd6dmarkm#endif
2784ecbd6dmarkm
279ebfe6dcassarROKEN_CPP_START
280ebfe6dcassar
2818707f88nectar#ifndef IRIX4 /* fix for compiler bug */
28233f661cstas#ifndef _WIN32
2834ecbd6dmarkm#ifdef RETSIGTYPE
284ebfe6dcassartypedef RETSIGTYPE (*SigAction)(int);
2854ecbd6dmarkmSigAction signal(int iSig, SigAction pAction); /* BSD compatible */
2864ecbd6dmarkm#endif
2874ecbd6dmarkm#endif
28833f661cstas#endif
28933f661cstas
29033f661cstas#define SE_E_UNSPECIFIED (-1)
29133f661cstas#define SE_E_FORKFAILED  (-2)
29233f661cstas#define SE_E_WAITPIDFAILED (-3)
29333f661cstas#define SE_E_EXECTIMEOUT (-4)
29433f661cstas#define SE_E_NOEXEC   126
29533f661cstas#define SE_E_NOTFOUND 127
2964ecbd6dmarkm
29733f661cstas#define SE_PROCSTATUS(st) (((st) >= 0 && (st) < 126)? st: -1)
29833f661cstas#define SE_PROCSIGNAL(st) (((st) >= 128)? (st) - 128: -1)
29933f661cstas#define SE_IS_ERROR(st) ((st) < 0 || (st) >= 126)
30033f661cstas
30133f661cstas
30233f661cstas#define simple_execve rk_simple_execve
30333f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
30451b6601dfrsimple_execve(const char*, char*const[], char*const[]);
30551b6601dfr
30633f661cstas#define simple_execve_timed rk_simple_execve_timed
30733f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
30833f661cstassimple_execve_timed(const char *, char *const[],
30933f661cstas		    char *const [], time_t (*)(void *),
31051b6601dfr		    void *, time_t);
31133f661cstas
31233f661cstas#define simple_execvp rk_simple_execvp
31333f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
31451b6601dfrsimple_execvp(const char*, char *const[]);
31551b6601dfr
31633f661cstas#define simple_execvp_timed rk_simple_execvp_timed
31733f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
31833f661cstassimple_execvp_timed(const char *, char *const[],
31951b6601dfr		    time_t (*)(void *), void *, time_t);
32033f661cstas
32133f661cstas#define simple_execlp rk_simple_execlp
32233f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
32351b6601dfrsimple_execlp(const char*, ...);
3244ecbd6dmarkm
32533f661cstas#define simple_execle rk_simple_execle
32633f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
32751b6601dfrsimple_execle(const char*, ...);
3284ecbd6dmarkm
32933f661cstas#define wait_for_process rk_wait_for_process
33033f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
33151b6601dfrwait_for_process(pid_t);
33251b6601dfr
33333f661cstas#define wait_for_process_timed rk_wait_for_process_timed
33433f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
33533f661cstaswait_for_process_timed(pid_t, time_t (*)(void *),
33633f661cstas		       void *, time_t);
33733f661cstas
33833f661cstas#define pipe_execv rk_pipe_execv
33933f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
34051b6601dfrpipe_execv(FILE**, FILE**, FILE**, const char*, ...);
34151b6601dfr
34233f661cstas#define print_version rk_print_version
34333f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
34451b6601dfrprint_version(const char *);
34551b6601dfr
34633f661cstas#define eread rk_eread
34733f661cstasROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
34851b6601dfreread (int fd, void *buf, size_t nbytes);
34951b6601dfr
35033f661cstas#define ewrite rk_ewrite
35133f661cstasROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
35251b6601dfrewrite (int fd, const void *buf, size_t nbytes);
3534ecbd6dmarkm
35469a91benectarstruct hostent;
35569a91benectar
35633f661cstas#define hostent_find_fqdn rk_hostent_find_fqdn
35733f661cstasROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL
35851b6601dfrhostent_find_fqdn (const struct hostent *);
35951b6601dfr
36033f661cstas#define esetenv rk_esetenv
36133f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
36251b6601dfresetenv(const char *, const char *, int);
36369a91benectar
36433f661cstas#define socket_set_address_and_port rk_socket_set_address_and_port
36533f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
36651b6601dfrsocket_set_address_and_port (struct sockaddr *, const void *, int);
367ebfe6dcassar
36833f661cstas#define socket_addr_size rk_socket_addr_size
36933f661cstasROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
37051b6601dfrsocket_addr_size (const struct sockaddr *);
3714ecbd6dmarkm
37233f661cstas#define socket_set_any rk_socket_set_any
37333f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
37451b6601dfrsocket_set_any (struct sockaddr *, int);
3754ecbd6dmarkm
37633f661cstas#define socket_sockaddr_size rk_socket_sockaddr_size
37733f661cstasROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
37851b6601dfrsocket_sockaddr_size (const struct sockaddr *);
3794ecbd6dmarkm
38033f661cstas#define socket_get_address rk_socket_get_address
38133f661cstasROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
38233f661cstassocket_get_address (const struct sockaddr *);
3834ecbd6dmarkm
38433f661cstas#define socket_get_port rk_socket_get_port
38533f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
38651b6601dfrsocket_get_port (const struct sockaddr *);
3874ecbd6dmarkm
38833f661cstas#define socket_set_port rk_socket_set_port
38933f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
39051b6601dfrsocket_set_port (struct sockaddr *, int);
3914ecbd6dmarkm
39233f661cstas#define socket_set_portrange rk_socket_set_portrange
39333f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
39433f661cstassocket_set_portrange (rk_socket_t, int, int);
3954ecbd6dmarkm
39633f661cstas#define socket_set_debug rk_socket_set_debug
39733f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
39833f661cstassocket_set_debug (rk_socket_t);
39969a91benectar
40033f661cstas#define socket_set_tos rk_socket_set_tos
40133f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
40233f661cstassocket_set_tos (rk_socket_t, int);
4034ecbd6dmarkm
40433f661cstas#define socket_set_reuseaddr rk_socket_set_reuseaddr
40533f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
40633f661cstassocket_set_reuseaddr (rk_socket_t, int);
4074ecbd6dmarkm
40833f661cstas#define socket_set_ipv6only rk_socket_set_ipv6only
40933f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
41033f661cstassocket_set_ipv6only (rk_socket_t, int);
41133f661cstas
41233f661cstas#define socket_to_fd rk_socket_to_fd
41333f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
41433f661cstassocket_to_fd(rk_socket_t, int);
4154ecbd6dmarkm
41633f661cstas#define vstrcollect rk_vstrcollect
41733f661cstasROKEN_LIB_FUNCTION char ** ROKEN_LIB_CALL
418fa8b1a9markmvstrcollect(va_list *ap);
419fa8b1a9markm
42033f661cstas#define strcollect rk_strcollect
42133f661cstasROKEN_LIB_FUNCTION char ** ROKEN_LIB_CALL
422fa8b1a9markmstrcollect(char *first, ...);
423fa8b1a9markm
42433f661cstas#define timevalfix rk_timevalfix
42533f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
42651b6601dfrtimevalfix(struct timeval *t1);
427ebfe6dcassar
42833f661cstas#define timevaladd rk_timevaladd
42933f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
43051b6601dfrtimevaladd(struct timeval *t1, const struct timeval *t2);
431ebfe6dcassar
43233f661cstas#define timevalsub rk_timevalsub
43333f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
43451b6601dfrtimevalsub(struct timeval *t1, const struct timeval *t2);
43551b6601dfr
43633f661cstas#define pid_file_write rk_pid_file_write
43733f661cstasROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
43851b6601dfrpid_file_write (const char *progname);
43951b6601dfr
44033f661cstas#define pid_file_delete rk_pid_file_delete
44133f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
44251b6601dfrpid_file_delete (char **);
44351b6601dfr
44433f661cstas#define read_environment rk_read_environment
44533f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
446ebfe6dcassarread_environment(const char *file, char ***env);
447ebfe6dcassar
44833f661cstas#define free_environment rk_free_environment
44933f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
45051b6601dfrfree_environment(char **);
45151b6601dfr
45233f661cstas#define warnerr rk_warnerr
45333f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
45433f661cstasrk_warnerr(int doerrno, const char *fmt, va_list ap)
455ebfe6dcassar    __attribute__ ((format (printf, 2, 0)));
456ebfe6dcassar
45733f661cstasROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
45851b6601dfrrk_realloc(void *, size_t);
45951b6601dfr
46051b6601dfrstruct rk_strpool;
46151b6601dfr
46233f661cstasROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
46351b6601dfrrk_strpoolcollect(struct rk_strpool *);
46451b6601dfr
46533f661cstasROKEN_LIB_FUNCTION struct rk_strpool * ROKEN_LIB_CALL
46651b6601dfrrk_strpoolprintf(struct rk_strpool *, const char *, ...)
46751b6601dfr    __attribute__ ((format (printf, 2, 3)));
46851b6601dfr
46933f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
47051b6601dfrrk_strpoolfree(struct rk_strpool *);
47151b6601dfr
47233f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
47351b6601dfrrk_dumpdata (const char *, const void *, size_t);
47451b6601dfr
47533f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
47633f661cstasrk_undumpdata (const char *, void **, size_t *);
47733f661cstas
47833f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
47933f661cstasrk_xfree (void *);
48033f661cstas
48133f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
48233f661cstasrk_cloexec(int);
48333f661cstas
48433f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
48533f661cstasrk_cloexec_file(FILE *);
48633f661cstas
48733f661cstasROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
48833f661cstasrk_cloexec_dir(DIR *);
48933f661cstas
49033f661cstasROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
49133f661cstasct_memcmp(const void *, const void *, size_t);
49233f661cstas
49333f661cstasvoid ROKEN_LIB_FUNCTION
49433f661cstasrk_random_init(void);
49533f661cstas
496ebfe6dcassarROKEN_CPP_END
49769414e2markm
4984ecbd6dmarkm#endif /* __ROKEN_COMMON_H__ */
499