define ROKEN_LIB_FUNCTION on all exported functions

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14773 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-04-12 11:29:18 +00:00
parent 9d25af4667
commit 709aa58c74
135 changed files with 632 additions and 443 deletions

View File

@@ -8,6 +8,7 @@ CLEANFILES = roken.h make-roken.c $(XHEADERS)
lib_LTLIBRARIES = libroken.la
libroken_la_LDFLAGS = -version-info 17:0:1
libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB
noinst_PROGRAMS = make-roken snprintf-test resolve-test

View File

@@ -52,7 +52,7 @@ pos(char c)
return -1;
}
int
int ROKEN_LIB_FUNCTION
base64_encode(const void *data, int size, char **str)
{
char *s, *p;
@@ -114,7 +114,7 @@ token_decode(const char *token)
return (marker << 24) | val;
}
int
int ROKEN_LIB_FUNCTION
base64_decode(const char *str, void *data)
{
const char *p;

View File

@@ -36,7 +36,18 @@
#ifndef _BASE64_H_
#define _BASE64_H_
int base64_encode(const void *data, int size, char **str);
int base64_decode(const char *str, void *data);
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
int ROKEN_LIB_FUNCTION
base64_encode(const void *data, int size, char **str);
int ROKEN_LIB_FUNCTION
base64_decode(const char *str, void *data);
#endif

View File

@@ -40,7 +40,7 @@ RCSID("$Id$");
#ifndef HAVE_BSWAP32
unsigned int
unsigned int ROKEN_LIB_FUNCTION
bswap32 (unsigned int val)
{
return (val & 0xff) << 24 |
@@ -52,7 +52,7 @@ bswap32 (unsigned int val)
#ifndef HAVE_BSWAP16
unsigned short
unsigned short ROKEN_LIB_FUNCTION
bswap16 (unsigned short val)
{
return (val & 0xff) << 8 |

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
chown(const char *path, uid_t owner, gid_t group)
{
return 0;

View File

@@ -37,7 +37,7 @@ RCSID("$Id$");
#endif
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
roken_concat (char *s, size_t len, ...)
{
int ret;
@@ -49,7 +49,7 @@ roken_concat (char *s, size_t len, ...)
return ret;
}
int
int ROKEN_LIB_FUNCTION
roken_vconcat (char *s, size_t len, va_list args)
{
const char *a;
@@ -67,7 +67,7 @@ roken_vconcat (char *s, size_t len, va_list args)
return 0;
}
size_t
size_t ROKEN_LIB_FUNCTION
roken_vmconcat (char **s, size_t max_len, va_list args)
{
const char *a;
@@ -99,7 +99,7 @@ roken_vmconcat (char **s, size_t max_len, va_list args)
return len;
}
size_t
size_t ROKEN_LIB_FUNCTION
roken_mconcat (char **s, size_t max_len, ...)
{
int ret;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
* return a malloced copy of `h'
*/
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
copyhostent (const struct hostent *h)
{
struct hostent *res;

View File

@@ -51,7 +51,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
daemon(int nochdir, int noclose)
{
int fd;

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like calloc but never fails.
*/
void *
void * ROKEN_LIB_FUNCTION
ecalloc (size_t number, size_t size)
{
void *tmp = calloc (number, size);

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like malloc but never fails.
*/
void *
void * ROKEN_LIB_FUNCTION
emalloc (size_t sz)
{
void *tmp = malloc (sz);

View File

@@ -46,7 +46,7 @@ RCSID("$Id$");
* list of malloced strings in `env'
*/
int
int ROKEN_LIB_FUNCTION
read_environment(const char *file, char ***env)
{
int i, k;

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like read but never fails (and never returns partial data).
*/
ssize_t
ssize_t ROKEN_LIB_FUNCTION
eread (int fd, void *buf, size_t nbytes)
{
ssize_t ret;

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like realloc but never fails.
*/
void *
void * ROKEN_LIB_FUNCTION
erealloc (void *ptr, size_t sz)
{
void *tmp = realloc (ptr, sz);

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "err.h"
void
void ROKEN_LIB_FUNCTION
err(int eval, const char *fmt, ...)
{
va_list ap;

View File

@@ -46,21 +46,43 @@
#define __attribute__(x)
#endif
void verr(int eval, const char *fmt, va_list ap)
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
void ROKEN_LIB_FUNCTION
verr(int eval, const char *fmt, va_list ap)
__attribute__ ((noreturn, format (printf, 2, 0)));
void err(int eval, const char *fmt, ...)
void ROKEN_LIB_FUNCTION
err(int eval, const char *fmt, ...)
__attribute__ ((noreturn, format (printf, 2, 3)));
void verrx(int eval, const char *fmt, va_list ap)
void ROKEN_LIB_FUNCTION
verrx(int eval, const char *fmt, va_list ap)
__attribute__ ((noreturn, format (printf, 2, 0)));
void errx(int eval, const char *fmt, ...)
void ROKEN_LIB_FUNCTION
errx(int eval, const char *fmt, ...)
__attribute__ ((noreturn, format (printf, 2, 3)));
void vwarn(const char *fmt, va_list ap)
void ROKEN_LIB_FUNCTION
vwarn(const char *fmt, va_list ap)
__attribute__ ((format (printf, 1, 0)));
void warn(const char *fmt, ...)
void ROKEN_LIB_FUNCTION
warn(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
void vwarnx(const char *fmt, va_list ap)
void ROKEN_LIB_FUNCTION
vwarnx(const char *fmt, va_list ap)
__attribute__ ((format (printf, 1, 0)));
void warnx(const char *fmt, ...)
void ROKEN_LIB_FUNCTION
warnx(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
#endif /* __ERR_H__ */

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "err.h"
void
void ROKEN_LIB_FUNCTION
errx(int eval, const char *fmt, ...)
{
va_list ap;

View File

@@ -40,7 +40,7 @@ RCSID("$Id$");
#include <err.h>
void
void ROKEN_LIB_FUNCTION
esetenv(const char *var, const char *val, int rewrite)
{
if (setenv ((char *)var, (char *)val, rewrite))

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like strdup but never fails.
*/
char *
char * ROKEN_LIB_FUNCTION
estrdup (const char *str)
{
char *tmp = strdup (str);

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
* Like write but never fails (and never returns partial data).
*/
ssize_t
ssize_t ROKEN_LIB_FUNCTION
ewrite (int fd, const void *buf, size_t nbytes)
{
ssize_t ret;

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
fchown(int fd, uid_t owner, gid_t group)
{
return 0;

View File

@@ -43,7 +43,7 @@ RCSID("$Id$");
#define OP_MASK (LOCK_SH | LOCK_EX | LOCK_UN)
int
int ROKEN_LIB_FUNCTION
flock(int fd, int operation)
{
#if defined(HAVE_FCNTL) && defined(F_SETLK)

View File

@@ -52,7 +52,7 @@ static char rcsid[] = "$NetBSD: fnmatch.c,v 1.11 1995/02/27 03:43:06 cgd Exp $";
static const char *rangematch (const char *, int, int);
int
int ROKEN_LIB_FUNCTION
fnmatch(const char *pattern, const char *string, int flags)
{
const char *stringstart;

View File

@@ -34,12 +34,21 @@
#ifndef _FNMATCH_H_
#define _FNMATCH_H_
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
#define FNM_NOMATCH 1 /* Match failed. */
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
int fnmatch (const char *, const char *, int);
int ROKEN_LIB_FUNCTION
fnmatch (const char *, const char *, int);
#endif /* !_FNMATCH_H_ */

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
* free the list of `struct addrinfo' starting at `ai'
*/
void
void ROKEN_LIB_FUNCTION
freeaddrinfo(struct addrinfo *ai)
{
struct addrinfo *tofree;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
* free a malloced hostent
*/
void
void ROKEN_LIB_FUNCTION
freehostent (struct hostent *h)
{
char **p;

View File

@@ -65,7 +65,7 @@ static struct gai_error {
*
*/
char *
char * ROKEN_LIB_FUNCTION
gai_strerror(int ecode)
{
struct gai_error *g;

View File

@@ -43,7 +43,7 @@ RCSID("$Id$");
* NULL if we can't guess at all.
*/
const char *
const char * ROKEN_LIB_FUNCTION
get_default_username (void)
{
const char *user;

View File

@@ -60,7 +60,7 @@ RCSID("$Id$");
#include <roken.h>
int
int ROKEN_LIB_FUNCTION
get_window_size(int fd, struct winsize *wp)
{
int ret = -1;

View File

@@ -368,7 +368,7 @@ get_nodes (const char *nodename,
* };
*/
int
int ROKEN_LIB_FUNCTION
getaddrinfo(const char *nodename,
const char *servname,
const struct addrinfo *hints,

View File

@@ -40,7 +40,7 @@ RCSID("$Id$");
/* getaddrinfo via string specifying host and port */
int
int ROKEN_LIB_FUNCTION
roken_getaddrinfo_hostspec2(const char *hostspec,
int socktype,
int port,
@@ -95,7 +95,7 @@ roken_getaddrinfo_hostspec2(const char *hostspec,
return getaddrinfo (host, portstr, &hints, ai);
}
int
int ROKEN_LIB_FUNCTION
roken_getaddrinfo_hostspec(const char *hostspec,
int port,
struct addrinfo **ai)

View File

@@ -198,7 +198,7 @@ check_column(FILE *f, int col, int len, int columns)
return col;
}
void
void ROKEN_LIB_FUNCTION
arg_printusage (struct getargs *args,
size_t num_args,
const char *progname,
@@ -523,7 +523,7 @@ arg_match_short (struct getargs *args, size_t num_args,
return 0;
}
int
int ROKEN_LIB_FUNCTION
getarg(struct getargs *args, size_t num_args,
int argc, char **argv, int *goptind)
{
@@ -559,7 +559,7 @@ getarg(struct getargs *args, size_t num_args,
return ret;
}
void
void ROKEN_LIB_FUNCTION
free_getarg_strings (getarg_strings *s)
{
free (s->strings);

View File

@@ -78,14 +78,17 @@ typedef struct getarg_collect_info {
void *data;
} getarg_collect_info;
int getarg(struct getargs *args, size_t num_args,
int ROKEN_LIB_FUNCTION
getarg(struct getargs *args, size_t num_args,
int argc, char **argv, int *goptind);
void arg_printusage (struct getargs *args,
void ROKEN_LIB_FUNCTION
arg_printusage (struct getargs *args,
size_t num_args,
const char *progname,
const char *extra_string);
void free_getarg_strings (getarg_strings *);
void ROKEN_LIB_FUNCTION
free_getarg_strings (getarg_strings *);
#endif /* __GETARG_H__ */

View File

@@ -80,24 +80,24 @@ static int getent (char **, size_t *, char **, int, const char *, int, char *);
static int nfcmp (char *, char *);
int cgetset(const char *ent);
char *cgetcap(char *buf, const char *cap, int type);
int cgetent(char **buf, char **db_array, const char *name);
int cgetmatch(const char *buf, const char *name);
int cgetclose(void);
int ROKEN_LIB_FUNCTION cgetset(const char *ent);
char *ROKEN_LIB_FUNCTION cgetcap(char *buf, const char *cap, int type);
int ROKEN_LIB_FUNCTION cgetent(char **buf, char **db_array, const char *name);
int ROKEN_LIB_FUNCTION cgetmatch(const char *buf, const char *name);
int ROKEN_LIB_FUNCTION cgetclose(void);
#if 0
int cgetfirst(char **buf, char **db_array);
int cgetnext(char **bp, char **db_array);
#endif
int cgetstr(char *buf, const char *cap, char **str);
int cgetustr(char *buf, const char *cap, char **str);
int cgetnum(char *buf, const char *cap, long *num);
int ROKEN_LIB_FUNCTION cgetstr(char *buf, const char *cap, char **str);
int ROKEN_LIB_FUNCTION cgetustr(char *buf, const char *cap, char **str);
int ROKEN_LIB_FUNCTION cgetnum(char *buf, const char *cap, long *num);
/*
* Cgetset() allows the addition of a user specified buffer to be added
* to the database array, in effect "pushing" the buffer on top of the
* virtual database. 0 is returned on success, -1 on failure.
*/
int
int ROKEN_LIB_FUNCTION
cgetset(const char *ent)
{
const char *source, *check;
@@ -150,7 +150,7 @@ cgetset(const char *ent)
* If (cap, '@') or (cap, terminator, '@') is found before (cap, terminator)
* return NULL.
*/
char *
char * ROKEN_LIB_FUNCTION
cgetcap(char *buf, const char *cap, int type)
{
char *bp;
@@ -201,7 +201,7 @@ cgetcap(char *buf, const char *cap, int type)
* encountered (couldn't open/read a file, etc.), and -3 if a potential
* reference loop is detected.
*/
int
int ROKEN_LIB_FUNCTION
cgetent(char **buf, char **db_array, const char *name)
{
size_t dummy;
@@ -695,7 +695,7 @@ static FILE *pfp;
static int slash;
static char **dbp;
int
int ROKEN_LIB_FUNCTION
cgetclose(void)
{
if (pfp != NULL) {
@@ -842,7 +842,7 @@ cgetnext(char **bp, char **db_array)
* couldn't be found, -2 if a system error was encountered (storage
* allocation failure).
*/
int
int ROKEN_LIB_FUNCTION
cgetstr(char *buf, const char *cap, char **str)
{
u_int m_room;
@@ -966,7 +966,7 @@ cgetstr(char *buf, const char *cap, char **str)
* -1 if the requested string capability couldn't be found, -2 if a system
* error was encountered (storage allocation failure).
*/
int
int ROKEN_LIB_FUNCTION
cgetustr(char *buf, const char *cap, char **str)
{
u_int m_room;
@@ -1035,7 +1035,7 @@ cgetustr(char *buf, const char *cap, char **str)
* the long pointed to by num. 0 is returned on success, -1 if the requested
* numeric capability couldn't be found.
*/
int
int ROKEN_LIB_FUNCTION
cgetnum(char *buf, const char *cap, long *num)
{
long n;

View File

@@ -45,7 +45,7 @@ RCSID("$Id$");
#include "roken.h"
char*
char* ROKEN_LIB_FUNCTION
getcwd(char *path, size_t size)
{
char xxx[MaxPathLen];

View File

@@ -64,7 +64,8 @@ RCSID("$Id$");
#include <sys/sysctl.h>
#endif
int getdtablesize(void)
int ROKEN_LIB_FUNCTION
getdtablesize(void)
{
int files = -1;
#if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)

View File

@@ -40,7 +40,8 @@
RCSID("$Id$");
int getegid(void)
int ROKEN_LIB_FUNCTION
getegid(void)
{
return getgid();
}

View File

@@ -40,7 +40,8 @@
RCSID("$Id$");
int geteuid(void)
int ROKEN_LIB_FUNCTION
geteuid(void)
{
return getuid();
}

View File

@@ -40,7 +40,8 @@
RCSID("$Id$");
int getgid(void)
int ROKEN_LIB_FUNCTION
getgid(void)
{
return 17;
}

View File

@@ -49,7 +49,7 @@
* interface is identical to gethostname(2).)
*/
int
int ROKEN_LIB_FUNCTION
gethostname(char *name, int namelen)
{
#if defined(HAVE_UNAME)

View File

@@ -466,7 +466,8 @@ nl_open(void)
}
/* ====================================================================== */
int getifaddrs(struct ifaddrs **ifap)
int ROKEN_LIB_FUNCTION
getifaddrs(struct ifaddrs **ifap)
{
int sd;
struct nlmsg_list *nlmsg_list, *nlmsg_end, *nlm;
@@ -819,7 +820,7 @@ int getifaddrs(struct ifaddrs **ifap)
}
/* ---------------------------------------------------------------------- */
void
void ROKEN_LIB_FUNCTION
freeifaddrs(struct ifaddrs *ifa)
{
free(ifa);
@@ -1082,7 +1083,7 @@ getlifaddrs2(struct ifaddrs **ifap,
}
#endif /* defined(HAVE_IPV6) && defined(SIOCGLIFCONF) && defined(SIOCGLIFFLAGS) */
int
int ROKEN_LIB_FUNCTION
getifaddrs(struct ifaddrs **ifap)
{
int ret = -1;
@@ -1110,7 +1111,7 @@ getifaddrs(struct ifaddrs **ifap)
return ret;
}
void
void ROKEN_LIB_FUNCTION
freeifaddrs(struct ifaddrs *ifp)
{
struct ifaddrs *p, *q;

View File

@@ -43,7 +43,7 @@ RCSID("$Id$");
* to a malloced struct hostent or NULL.
*/
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
getipnodebyaddr (const void *src, size_t len, int af, int *error_num)
{
struct hostent *tmp;

View File

@@ -47,7 +47,7 @@ static int h_errno = NO_RECOVERY;
* to a malloced struct hostent or NULL.
*/
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
getipnodebyname (const char *name, int af, int flags, int *error_num)
{
struct hostent *tmp;

View File

@@ -94,7 +94,7 @@ doit (int af,
*
*/
int
int ROKEN_LIB_FUNCTION
getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen,
char *serv, size_t servlen,

View File

@@ -46,7 +46,7 @@ RCSID("$Id$");
* NI_NAMEREQD flag is set or return the numeric address as a string.
*/
int
int ROKEN_LIB_FUNCTION
getnameinfo_verified(const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen,
char *serv, size_t servlen,

View File

@@ -51,7 +51,7 @@ char *optarg; /* argument associated with option */
#define BADARG (int)':'
#define EMSG ""
int
int ROKEN_LIB_FUNCTION
getopt(nargc, nargv, ostr)
int nargc;
char * const *nargv;

View File

@@ -43,7 +43,7 @@ const char *__progname;
#endif
#ifndef HAVE_GETPROGNAME
const char *
const char * ROKEN_LIB_FUNCTION
getprogname(void)
{
return __progname;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
/*
* Simple gettimeofday that only returns seconds.
*/
int
int ROKEN_LIB_FUNCTION
gettimeofday (struct timeval *tp, void *ignore)
{
time_t t;

View File

@@ -40,7 +40,8 @@
RCSID("$Id$");
int getuid(void)
int ROKEN_LIB_FUNCTION
getuid(void)
{
return 17;
}

View File

@@ -84,7 +84,7 @@ static char **initshells (void);
/*
* Get a list of shells from _PATH_SHELLS, if it exists.
*/
char *
char * ROKEN_LIB_FUNCTION
getusershell()
{
char *ret;
@@ -97,7 +97,7 @@ getusershell()
return (ret);
}
void
void ROKEN_LIB_FUNCTION
endusershell()
{
if (shells != NULL)
@@ -109,7 +109,7 @@ endusershell()
curshell = NULL;
}
void
void ROKEN_LIB_FUNCTION
setusershell()
{
curshell = initshells();

View File

@@ -166,7 +166,7 @@ static int match (Char *, Char *, Char *);
static void qprintf (const char *, Char *);
#endif
int
int ROKEN_LIB_FUNCTION
glob(const char *pattern,
int flags,
int (*errfunc)(const char *, int),
@@ -741,7 +741,7 @@ match(Char *name, Char *pat, Char *patend)
}
/* Free allocated data belonging to a glob_t structure. */
void
void ROKEN_LIB_FUNCTION
globfree(glob_t *pglob)
{
int i;

View File

@@ -79,7 +79,10 @@ typedef struct {
#define GLOB_NOSPACE (-1) /* Malloc call failed. */
#define GLOB_ABEND (-2) /* Unignored error. */
int glob (const char *, int, int (*)(const char *, int), glob_t *);
void globfree (glob_t *);
int ROKEN_LIB_FUNCTION
glob (const char *, int, int (*)(const char *, int), glob_t *);
void ROKEN_LIB_FUNCTION
globfree (glob_t *);
#endif /* !_GLOB_H_ */

View File

@@ -53,7 +53,7 @@ pos(char c)
return -1;
}
ssize_t
ssize_t ROKEN_LIB_FUNCTION
hex_encode(const void *data, size_t size, char **str)
{
const unsigned char *q = data;
@@ -79,7 +79,7 @@ hex_encode(const void *data, size_t size, char **str)
return i * 2;
}
ssize_t
ssize_t ROKEN_LIB_FUNCTION
hex_decode(const char *str, void *data, size_t len)
{
size_t l;

View File

@@ -36,10 +36,20 @@
#ifndef _rk_HEX_H_
#define _rk_HEX_H_ 1
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
#define hex_encode rk_hex_encode
#define hex_decode rk_hex_decode
ssize_t hex_encode(const void *, size_t, char **);
ssize_t hex_decode(const char *, void *, size_t);
ssize_t ROKEN_LIB_FUNCTION
hex_encode(const void *, size_t, char **);
ssize_t ROKEN_LIB_FUNCTION
hex_decode(const char *, void *, size_t);
#endif /* _rk_HEX_H_ */

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
* Try to find a fqdn (with `.') in he if possible, else return h_name
*/
const char *
const char * ROKEN_LIB_FUNCTION
hostent_find_fqdn (const struct hostent *he)
{
const char *ret = he->h_name;

View File

@@ -67,7 +67,7 @@ extern int h_nerr;
#endif
const char *
const char * ROKEN_LIB_FUNCTION
hstrerror(int herr)
{
if (0 <= herr && herr < h_nerr)

View File

@@ -36,6 +36,14 @@
#ifndef __ifaddrs_h__
#define __ifaddrs_h__
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
/*
* the interface is defined in terms of the fields below, and this is
* sometimes #define'd, so there seems to be no simple way of solving
@@ -57,8 +65,10 @@ struct ifaddrs {
#define ifa_broadaddr ifa_dstaddr
#endif
int getifaddrs(struct ifaddrs**);
int ROKEN_LIB_FUNCTION
getifaddrs(struct ifaddrs**);
void freeifaddrs(struct ifaddrs*);
void ROKEN_LIB_FUNCTION
freeifaddrs(struct ifaddrs*);
#endif /* __ifaddrs_h__ */

View File

@@ -41,7 +41,7 @@ RCSID("$Id$");
/* Minimal implementation of inet_aton.
* Cannot distinguish between failure and a local broadcast address. */
int
int ROKEN_LIB_FUNCTION
inet_aton(const char *cp, struct in_addr *addr)
{
addr->s_addr = inet_addr(cp);

View File

@@ -116,7 +116,7 @@ inet_ntop_v6 (const void *src, char *dst, size_t size)
}
#endif /* HAVE_IPV6 */
const char *
const char * ROKEN_LIB_FUNCTION
inet_ntop(int af, const void *src, char *dst, size_t size)
{
switch (af) {

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include <roken.h>
int
int ROKEN_LIB_FUNCTION
inet_pton(int af, const char *src, void *dst)
{
if (af != AF_INET) {

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
initgroups(const char *name, gid_t basegid)
{
return 0;

View File

@@ -39,7 +39,7 @@
RCSID("$Id$");
int
int ROKEN_LIB_FUNCTION
innetgr(const char *netgroup, const char *machine,
const char *user, const char *domain)
{

View File

@@ -217,7 +217,7 @@ __ivaliduser(FILE *hostf, unsigned raddr, const char *luser,
*
* Returns 0 if ok, -1 if not ok.
*/
int
int ROKEN_LIB_FUNCTION
iruserok(unsigned raddr, int superuser, const char *ruser, const char *luser)
{
char *cp;

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
issuid(void)
{
#if defined(HAVE_ISSETUGID)

View File

@@ -41,7 +41,7 @@ RCSID("$Id$");
#include <shadow.h>
#endif
struct passwd *
struct passwd * ROKEN_LIB_FUNCTION
k_getpwnam (const char *user)
{
struct passwd *p;

View File

@@ -41,7 +41,7 @@ RCSID("$Id$");
#include <shadow.h>
#endif
struct passwd *
struct passwd * ROKEN_LIB_FUNCTION
k_getpwuid (uid_t uid)
{
struct passwd *p;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
#ifndef HAVE_LOCALTIME_R
struct tm *
struct tm * ROKEN_LIB_FUNCTION
localtime_r(const time_t *timer, struct tm *result)
{
struct tm *tm;

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
lstat(const char *path, struct stat *buf)
{
return stat(path, buf);

View File

@@ -44,7 +44,8 @@ RCSID("$Id$");
#include <sys/types.h>
#endif
void* memmove(void *s1, const void *s2, size_t n)
void* ROKEN_LIB_FUNCTION
memmove(void *s1, const void *s2, size_t n)
{
char *s=(char*)s2, *d=(char*)s1;

View File

@@ -62,7 +62,7 @@ accept_it (int s)
* Listen on a specified port, emulating inetd.
*/
void
void ROKEN_LIB_FUNCTION
mini_inetd_addrinfo (struct addrinfo *ai)
{
int ret;
@@ -124,7 +124,7 @@ mini_inetd_addrinfo (struct addrinfo *ai)
abort ();
}
void
void ROKEN_LIB_FUNCTION
mini_inetd (int port)
{
int error;

View File

@@ -48,7 +48,7 @@ RCSID("$Id$");
#ifndef HAVE_MKSTEMP
int
int ROKEN_LIB_FUNCTION
mkstemp(char *template)
{
int start, i;

View File

@@ -63,7 +63,7 @@ static DBC *cursor;
#define D(X) ((DB*)(X))
void
void ROKEN_LIB_FUNCTION
dbm_close (DBM *db)
{
#ifdef HAVE_DB3
@@ -74,7 +74,7 @@ dbm_close (DBM *db)
#endif
}
int
int ROKEN_LIB_FUNCTION
dbm_delete (DBM *db, datum dkey)
{
DBT key;
@@ -129,19 +129,19 @@ dbm_get (DB *db, int flags)
#define DB_KEYEXIST 1
#endif
datum
datum ROKEN_LIB_FUNCTION
dbm_firstkey (DBM *db)
{
return dbm_get(D(db), DB_FIRST);
}
datum
datum ROKEN_LIB_FUNCTION
dbm_nextkey (DBM *db)
{
return dbm_get(D(db), DB_NEXT);
}
DBM*
DBM* ROKEN_LIB_FUNCTION
dbm_open (const char *file, int flags, mode_t mode)
{
DB *db;
@@ -184,7 +184,7 @@ dbm_open (const char *file, int flags, mode_t mode)
return (DBM*)db;
}
int
int ROKEN_LIB_FUNCTION
dbm_store (DBM *db, datum dkey, datum dvalue, int flags)
{
int ret;
@@ -204,13 +204,13 @@ dbm_store (DBM *db, datum dkey, datum dvalue, int flags)
RETURN(ret);
}
int
int ROKEN_LIB_FUNCTION
dbm_error (DBM *db)
{
return 0;
}
int
int ROKEN_LIB_FUNCTION
dbm_clearerr (DBM *db)
{
return 0;

View File

@@ -39,6 +39,14 @@
#include <stdio.h>
#include <sys/types.h>
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
#ifndef dbm_rename
#define dbm_rename(X) __roken_ ## X
#endif
@@ -70,14 +78,14 @@ typedef struct {
} DBM;
#endif
int dbm_clearerr (DBM*);
void dbm_close (DBM*);
int dbm_delete (DBM*, datum);
int dbm_error (DBM*);
datum dbm_fetch (DBM*, datum);
datum dbm_firstkey (DBM*);
datum dbm_nextkey (DBM*);
DBM* dbm_open (const char*, int, mode_t);
int dbm_store (DBM*, datum, datum, int);
int ROKEN_LIB_FUNCTION dbm_clearerr (DBM*);
void ROKEN_LIB_FUNCTION dbm_close (DBM*);
int ROKEN_LIB_FUNCTION dbm_delete (DBM*, datum);
int ROKEN_LIB_FUNCTION dbm_error (DBM*);
datum ROKEN_LIB_FUNCTION dbm_fetch (DBM*, datum);
datum ROKEN_LIB_FUNCTION dbm_firstkey (DBM*);
datum ROKEN_LIB_FUNCTION dbm_nextkey (DBM*);
DBM* ROKEN_LIB_FUNCTION dbm_open (const char*, int, mode_t);
int ROKEN_LIB_FUNCTION dbm_store (DBM*, datum, datum, int);
#endif /* __ndbm_wrap_h__ */

View File

@@ -46,7 +46,7 @@ RCSID("$Id$");
* Like read but never return partial data.
*/
ssize_t
ssize_t ROKEN_LIB_FUNCTION
net_read (int fd, void *buf, size_t nbytes)
{
char *cbuf = (char *)buf;

View File

@@ -46,7 +46,7 @@ RCSID("$Id$");
* Like write but never return partial data.
*/
ssize_t
ssize_t ROKEN_LIB_FUNCTION
net_write (int fd, const void *buf, size_t nbytes)
{
const char *cbuf = (const char *)buf;

View File

@@ -59,19 +59,19 @@ static struct units bytes_short_units[] = {
{ NULL, 0 }
};
int
int ROKEN_LIB_FUNCTION
parse_bytes (const char *s, const char *def_unit)
{
return parse_units (s, bytes_units, def_unit);
}
int
int ROKEN_LIB_FUNCTION
unparse_bytes (int t, char *s, size_t len)
{
return unparse_units (t, bytes_units, s, len);
}
int
int ROKEN_LIB_FUNCTION
unparse_bytes_short (int t, char *s, size_t len)
{
return unparse_units_approx (t, bytes_short_units, s, len);

View File

@@ -53,25 +53,25 @@ static struct units time_units[] = {
{NULL, 0},
};
int
int ROKEN_LIB_FUNCTION
parse_time (const char *s, const char *def_unit)
{
return parse_units (s, time_units, def_unit);
}
size_t
size_t ROKEN_LIB_FUNCTION
unparse_time (int t, char *s, size_t len)
{
return unparse_units (t, time_units, s, len);
}
size_t
size_t ROKEN_LIB_FUNCTION
unparse_time_approx (int t, char *s, size_t len)
{
return unparse_units_approx (t, time_units, s, len);
}
void
void ROKEN_LIB_FUNCTION
print_time_table (FILE *f)
{
print_units_table (time_units, f);

View File

@@ -36,6 +36,14 @@
#ifndef __PARSE_TIME_H__
#define __PARSE_TIME_H__
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
int
parse_time (const char *s, const char *def_unit);

View File

@@ -152,7 +152,7 @@ acc_units(int res, int val, unsigned mult)
return res + val * mult;
}
int
int ROKEN_LIB_FUNCTION
parse_units (const char *s, const struct units *units,
const char *def_unit)
{
@@ -178,7 +178,7 @@ acc_flags(int res, int val, unsigned mult)
return -1;
}
int
int ROKEN_LIB_FUNCTION
parse_flags (const char *s, const struct units *units,
int orig)
{
@@ -248,7 +248,7 @@ update_unit_approx (int in, unsigned mult)
return update_unit (in, mult);
}
int
int ROKEN_LIB_FUNCTION
unparse_units (int num, const struct units *units, char *s, size_t len)
{
return unparse_something (num, units, s, len,
@@ -257,7 +257,7 @@ unparse_units (int num, const struct units *units, char *s, size_t len)
"0");
}
int
int ROKEN_LIB_FUNCTION
unparse_units_approx (int num, const struct units *units, char *s, size_t len)
{
return unparse_something (num, units, s, len,
@@ -266,7 +266,7 @@ unparse_units_approx (int num, const struct units *units, char *s, size_t len)
"0");
}
void
void ROKEN_LIB_FUNCTION
print_units_table (const struct units *units, FILE *f)
{
const struct units *u, *u2;
@@ -311,7 +311,7 @@ update_flag (int in, unsigned mult)
return in - mult;
}
int
int ROKEN_LIB_FUNCTION
unparse_flags (int num, const struct units *units, char *s, size_t len)
{
return unparse_something (num, units, s, len,
@@ -320,7 +320,7 @@ unparse_flags (int num, const struct units *units, char *s, size_t len)
"");
}
void
void ROKEN_LIB_FUNCTION
print_flags_table (const struct units *units, FILE *f)
{
const struct units *u;

View File

@@ -39,33 +39,41 @@
#include <stdio.h>
#include <stddef.h>
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
struct units {
const char *name;
unsigned mult;
};
int
int ROKEN_LIB_FUNCTION
parse_units (const char *s, const struct units *units,
const char *def_unit);
void
void ROKEN_LIB_FUNCTION
print_units_table (const struct units *units, FILE *f);
int
int ROKEN_LIB_FUNCTION
parse_flags (const char *s, const struct units *units,
int orig);
int
int ROKEN_LIB_FUNCTION
unparse_units (int num, const struct units *units, char *s, size_t len);
int
int ROKEN_LIB_FUNCTION
unparse_units_approx (int num, const struct units *units, char *s,
size_t len);
int
int ROKEN_LIB_FUNCTION
unparse_flags (int num, const struct units *units, char *s, size_t len);
void
void ROKEN_LIB_FUNCTION
print_flags_table (const struct units *units, FILE *f);
#endif /* __PARSE_UNITS_H__ */

View File

@@ -39,7 +39,7 @@ RCSID("$Id$");
#include "print_version.h"
void
void ROKEN_LIB_FUNCTION
print_version(const char *progname)
{
const char *arg[] = VERSIONLIST;

View File

@@ -48,7 +48,7 @@ extern char **environ;
* value by altering an existing variable or creating a new one.
*/
int
int ROKEN_LIB_FUNCTION
putenv(const char *string)
{
int i;

View File

@@ -39,7 +39,7 @@ RCSID("$Id$");
#include "roken.h"
#include <stdio.h>
int
int ROKEN_LIB_FUNCTION
rcmd(char **ahost,
unsigned short inport,
const char *locuser,

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
ssize_t
ssize_t ROKEN_LIB_FUNCTION
readv(int d, const struct iovec *iov, int iovcnt)
{
ssize_t ret, nb;

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
ssize_t
ssize_t ROKEN_LIB_FUNCTION
recvmsg(int s, struct msghdr *msg, int flags)
{
ssize_t ret, nb;

View File

@@ -77,7 +77,7 @@ static struct stot{
int _resolve_debug = 0;
int
int ROKEN_LIB_FUNCTION
dns_string_to_type(const char *name)
{
struct stot *p = stot;
@@ -87,7 +87,7 @@ dns_string_to_type(const char *name)
return -1;
}
const char *
const char * ROKEN_LIB_FUNCTION
dns_type_to_string(int type)
{
struct stot *p = stot;
@@ -99,7 +99,7 @@ dns_type_to_string(int type)
#if (defined(HAVE_RES_SEARCH) || defined(HAVE_RES_NSEARCH)) && defined(HAVE_DN_EXPAND)
void
void ROKEN_LIB_FUNCTION
dns_free_data(struct dns_reply *r)
{
struct resource_record *rr;
@@ -550,7 +550,7 @@ dns_lookup_int(const char *domain, int rr_class, int rr_type)
return r;
}
struct dns_reply *
struct dns_reply * ROKEN_LIB_FUNCTION
dns_lookup(const char *domain, const char *type_name)
{
int type;
@@ -580,7 +580,7 @@ compare_srv(const void *a, const void *b)
#endif
/* try to rearrange the srv-records by the algorithm in RFC2782 */
void
void ROKEN_LIB_FUNCTION
dns_srv_order(struct dns_reply *r)
{
struct resource_record **srvs, **ss, **headp;
@@ -671,18 +671,18 @@ dns_srv_order(struct dns_reply *r)
#else /* NOT defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) */
struct dns_reply *
struct dns_reply * ROKEN_LIB_FUNCTION
dns_lookup(const char *domain, const char *type_name)
{
return NULL;
}
void
void ROKEN_LIB_FUNCTION
dns_free_data(struct dns_reply *r)
{
}
void
void ROKEN_LIB_FUNCTION
dns_srv_order(struct dns_reply *r)
{
}

View File

@@ -36,6 +36,14 @@
#ifndef __RESOLVE_H__
#define __RESOLVE_H__
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
typedef enum {
rk_ns_t_invalid = 0, /* Cookie. */
rk_ns_t_a = 1, /* Host address. */
@@ -276,10 +284,15 @@ struct dns_reply{
};
struct dns_reply* dns_lookup(const char *, const char *);
void dns_free_data(struct dns_reply *);
int dns_string_to_type(const char *name);
const char *dns_type_to_string(int type);
void dns_srv_order(struct dns_reply*);
struct dns_reply* ROKEN_LIB_FUNCTION
dns_lookup(const char *, const char *);
void ROKEN_LIB_FUNCTION
dns_free_data(struct dns_reply *);
int ROKEN_LIB_FUNCTION
dns_string_to_type(const char *name);
const char *ROKEN_LIB_FUNCTION
dns_type_to_string(int type);
void ROKEN_LIB_FUNCTION
dns_srv_order(struct dns_reply*);
#endif /* __RESOLVE_H__ */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995 - 2002 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995 - 2005 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -36,6 +36,14 @@
#ifndef __ROKEN_COMMON_H__
#define __ROKEN_COMMON_H__
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
#ifdef __cplusplus
#define ROKEN_CPP_START extern "C" {
#define ROKEN_CPP_END }
@@ -259,88 +267,113 @@ SigAction signal(int iSig, SigAction pAction); /* BSD compatible */
#endif
#endif
int ROKEN_LIB_FUNCTION simple_execve(const char*, char*const[], char*const[]);
int ROKEN_LIB_FUNCTION simple_execve_timed(const char *, char *const[],
int ROKEN_LIB_FUNCTION
simple_execve(const char*, char*const[], char*const[]);
int ROKEN_LIB_FUNCTION
simple_execve_timed(const char *, char *const[],
char *const [], time_t (*)(void *),
void *, time_t);
int ROKEN_LIB_FUNCTION simple_execvp(const char*, char *const[]);
int ROKEN_LIB_FUNCTION simple_execvp_timed(const char *, char *const[],
int ROKEN_LIB_FUNCTION
simple_execvp(const char*, char *const[]);
int ROKEN_LIB_FUNCTION
simple_execvp_timed(const char *, char *const[],
time_t (*)(void *), void *, time_t);
int ROKEN_LIB_FUNCTION simple_execlp(const char*, ...);
int ROKEN_LIB_FUNCTION simple_execle(const char*, ...);
int ROKEN_LIB_FUNCTION simple_execl(const char *file, ...);
int ROKEN_LIB_FUNCTION
simple_execlp(const char*, ...);
int ROKEN_LIB_FUNCTION wait_for_process(pid_t);
int ROKEN_LIB_FUNCTION wait_for_process_timed(pid_t, time_t (*)(void *),
int ROKEN_LIB_FUNCTION
simple_execle(const char*, ...);
int ROKEN_LIB_FUNCTION
simple_execl(const char *file, ...);
int ROKEN_LIB_FUNCTION
wait_for_process(pid_t);
int ROKEN_LIB_FUNCTION
wait_for_process_timed(pid_t, time_t (*)(void *),
void *, time_t);
int ROKEN_LIB_FUNCTION pipe_execv(FILE**, FILE**, FILE**, const char*, ...);
int ROKEN_LIB_FUNCTION
pipe_execv(FILE**, FILE**, FILE**, const char*, ...);
void ROKEN_LIB_FUNCTION print_version(const char *);
void ROKEN_LIB_FUNCTION
print_version(const char *);
ssize_t ROKEN_LIB_FUNCTION eread (int fd, void *buf, size_t nbytes);
ssize_t ROKEN_LIB_FUNCTION ewrite (int fd, const void *buf, size_t nbytes);
ssize_t ROKEN_LIB_FUNCTION
eread (int fd, void *buf, size_t nbytes);
ssize_t ROKEN_LIB_FUNCTION
ewrite (int fd, const void *buf, size_t nbytes);
struct hostent;
const char *
const char * ROKEN_LIB_FUNCTION
hostent_find_fqdn (const struct hostent *he);
void
void ROKEN_LIB_FUNCTION
esetenv(const char *var, const char *val, int rewrite);
void
void ROKEN_LIB_FUNCTION
socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port);
size_t
size_t ROKEN_LIB_FUNCTION
socket_addr_size (const struct sockaddr *sa);
void
void ROKEN_LIB_FUNCTION
socket_set_any (struct sockaddr *sa, int af);
size_t
size_t ROKEN_LIB_FUNCTION
socket_sockaddr_size (const struct sockaddr *sa);
void *
void * ROKEN_LIB_FUNCTION
socket_get_address (struct sockaddr *sa);
int
int ROKEN_LIB_FUNCTION
socket_get_port (const struct sockaddr *sa);
void
void ROKEN_LIB_FUNCTION
socket_set_port (struct sockaddr *sa, int port);
void
void ROKEN_LIB_FUNCTION
socket_set_portrange (int sock, int restr, int af);
void
void ROKEN_LIB_FUNCTION
socket_set_debug (int sock);
void
void ROKEN_LIB_FUNCTION
socket_set_tos (int sock, int tos);
void
void ROKEN_LIB_FUNCTION
socket_set_reuseaddr (int sock, int val);
void
socket_set_no_ipsec(int sock);
char **
char ** ROKEN_LIB_FUNCTION
vstrcollect(va_list *ap);
char **
char ** ROKEN_LIB_FUNCTION
strcollect(char *first, ...);
void timevalfix(struct timeval *t1);
void timevaladd(struct timeval *t1, const struct timeval *t2);
void timevalsub(struct timeval *t1, const struct timeval *t2);
void ROKEN_LIB_FUNCTION
timevalfix(struct timeval *t1);
char *pid_file_write (const char *progname);
void pid_file_delete (char **);
void ROKEN_LIB_FUNCTION
timevaladd(struct timeval *t1, const struct timeval *t2);
int
void ROKEN_LIB_FUNCTION
timevalsub(struct timeval *t1, const struct timeval *t2);
char *ROKEN_LIB_FUNCTION
pid_file_write (const char *progname);
void ROKEN_LIB_FUNCTION
pid_file_delete (char **);
int ROKEN_LIB_FUNCTION
read_environment(const char *file, char ***env);
void warnerr(int doerrno, const char *fmt, va_list ap)
void ROKEN_LIB_FUNCTION
warnerr(int doerrno, const char *fmt, va_list ap)
__attribute__ ((format (printf, 2, 0)));
ROKEN_CPP_END

View File

@@ -1,6 +1,6 @@
/* -*- C -*- */
/*
* Copyright (c) 1995-2004 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995-2005 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -129,17 +129,6 @@ struct sockaddr_dl;
#include <paths.h>
#endif
#ifndef ROKEN_LIB_FUNCTION
#if defined(__BORLANDC__)
#define ROKEN_LIB_FUNCTION /* not-ready-definition-yet */
#elif defined(_MSC_VER)
#define ROKEN_LIB_FUNCTION /* not-ready-definition-yet2 */
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
#ifndef HAVE_SSIZE_T
typedef int ssize_t;
#endif
@@ -153,112 +142,117 @@ ROKEN_CPP_START
#endif
#ifndef HAVE_PUTENV
int putenv(const char *string);
int ROKEN_LIB_FUNCTION putenv(const char *string);
#endif
#if !defined(HAVE_SETENV) || defined(NEED_SETENV_PROTO)
int setenv(const char *var, const char *val, int rewrite);
int ROKEN_LIB_FUNCTION setenv(const char *var, const char *val, int rewrite);
#endif
#if !defined(HAVE_UNSETENV) || defined(NEED_UNSETENV_PROTO)
void unsetenv(const char *name);
void ROKEN_LIB_FUNCTION unsetenv(const char *name);
#endif
#if !defined(HAVE_GETUSERSHELL) || defined(NEED_GETUSERSHELL_PROTO)
char *getusershell(void);
void endusershell(void);
char * ROKEN_LIB_FUNCTION getusershell(void);
void ROKEN_LIB_FUNCTION endusershell(void);
#endif
#if !defined(HAVE_SNPRINTF) || defined(NEED_SNPRINTF_PROTO)
int snprintf (char *str, size_t sz, const char *format, ...)
int ROKEN_LIB_FUNCTION snprintf (char *str, size_t sz, const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
#endif
#if !defined(HAVE_VSNPRINTF) || defined(NEED_VSNPRINTF_PROTO)
int vsnprintf (char *str, size_t sz, const char *format, va_list ap)
int ROKEN_LIB_FUNCTION
vsnprintf (char *str, size_t sz, const char *format, va_list ap)
__attribute__((format (printf, 3, 0)));
#endif
#if !defined(HAVE_ASPRINTF) || defined(NEED_ASPRINTF_PROTO)
int asprintf (char **ret, const char *format, ...)
int ROKEN_LIB_FUNCTION
asprintf (char **ret, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
#endif
#if !defined(HAVE_VASPRINTF) || defined(NEED_VASPRINTF_PROTO)
int vasprintf (char **ret, const char *format, va_list ap)
int ROKEN_LIB_FUNCTION
vasprintf (char **ret, const char *format, va_list ap)
__attribute__((format (printf, 2, 0)));
#endif
#if !defined(HAVE_ASNPRINTF) || defined(NEED_ASNPRINTF_PROTO)
int asnprintf (char **ret, size_t max_sz, const char *format, ...)
int ROKEN_LIB_FUNCTION
asnprintf (char **ret, size_t max_sz, const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
#endif
#if !defined(HAVE_VASNPRINTF) || defined(NEED_VASNPRINTF_PROTO)
int vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
int ROKEN_LIB_FUNCTION
vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
__attribute__((format (printf, 3, 0)));
#endif
#ifndef HAVE_STRDUP
char * strdup(const char *old);
char * ROKEN_LIB_FUNCTION strdup(const char *old);
#endif
#if !defined(HAVE_STRNDUP) || defined(NEED_STRNDUP_PROTO)
char * strndup(const char *old, size_t sz);
char * ROKEN_LIB_FUNCTION strndup(const char *old, size_t sz);
#endif
#ifndef HAVE_STRLWR
char * strlwr(char *);
char * ROKEN_LIB_FUNCTION strlwr(char *);
#endif
#ifndef HAVE_STRNLEN
size_t strnlen(const char*, size_t);
size_t ROKEN_LIB_FUNCTION strnlen(const char*, size_t);
#endif
#if !defined(HAVE_STRSEP) || defined(NEED_STRSEP_PROTO)
char *strsep(char**, const char*);
char * ROKEN_LIB_FUNCTION strsep(char**, const char*);
#endif
#if !defined(HAVE_STRSEP_COPY) || defined(NEED_STRSEP_COPY_PROTO)
ssize_t strsep_copy(const char**, const char*, char*, size_t);
ssize_t ROKEN_LIB_FUNCTION strsep_copy(const char**, const char*, char*, size_t);
#endif
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *s1, const char *s2);
int ROKEN_LIB_FUNCTION strcasecmp(const char *s1, const char *s2);
#endif
#ifdef NEED_FCLOSE_PROTO
int fclose(FILE *);
int ROKEN_LIB_FUNCTION fclose(FILE *);
#endif
#ifdef NEED_STRTOK_R_PROTO
char *strtok_r(char *s1, const char *s2, char **lasts);
char * ROKEN_LIB_FUNCTION strtok_r(char *s1, const char *s2, char **lasts);
#endif
#ifndef HAVE_STRUPR
char * strupr(char *);
char * ROKEN_LIB_FUNCTION strupr(char *);
#endif
#ifndef HAVE_STRLCPY
size_t strlcpy (char *dst, const char *src, size_t dst_sz);
size_t ROKEN_LIB_FUNCTION strlcpy (char *dst, const char *src, size_t dst_sz);
#endif
#ifndef HAVE_STRLCAT
size_t strlcat (char *dst, const char *src, size_t dst_sz);
size_t ROKEN_LIB_FUNCTION strlcat (char *dst, const char *src, size_t dst_sz);
#endif
#ifndef HAVE_GETDTABLESIZE
int getdtablesize(void);
int ROKEN_LIB_FUNCTION getdtablesize(void);
#endif
#if !defined(HAVE_STRERROR) && !defined(strerror)
char *strerror(int eno);
char * ROKEN_LIB_FUNCTION strerror(int eno);
#endif
#if !defined(HAVE_HSTRERROR) || defined(NEED_HSTRERROR_PROTO)
/* This causes a fatal error under Psoriasis */
#if !(defined(SunOS) && (SunOS >= 50))
const char *hstrerror(int herr);
const char * ROKEN_LIB_FUNCTION hstrerror(int herr);
#endif
#endif
@@ -267,116 +261,118 @@ extern int h_errno;
#endif
#if !defined(HAVE_INET_ATON) || defined(NEED_INET_ATON_PROTO)
int inet_aton(const char *cp, struct in_addr *adr);
int ROKEN_LIB_FUNCTION inet_aton(const char *cp, struct in_addr *adr);
#endif
#ifndef HAVE_INET_NTOP
const char *
const char * ROKEN_LIB_FUNCTION
inet_ntop(int af, const void *src, char *dst, size_t size);
#endif
#ifndef HAVE_INET_PTON
int
int ROKEN_LIB_FUNCTION
inet_pton(int af, const char *src, void *dst);
#endif
#if !defined(HAVE_GETCWD)
char* getcwd(char *path, size_t size);
char* ROKEN_LIB_FUNCTION getcwd(char *path, size_t size);
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
struct passwd *k_getpwnam (const char *user);
struct passwd *k_getpwuid (uid_t uid);
struct passwd * ROKEN_LIB_FUNCTION k_getpwnam (const char *user);
struct passwd * ROKEN_LIB_FUNCTION k_getpwuid (uid_t uid);
#endif
const char *get_default_username (void);
const char * ROKEN_LIB_FUNCTION get_default_username (void);
#ifndef HAVE_SETEUID
int seteuid(uid_t euid);
int ROKEN_LIB_FUNCTION seteuid(uid_t euid);
#endif
#ifndef HAVE_SETEGID
int setegid(gid_t egid);
int ROKEN_LIB_FUNCTION setegid(gid_t egid);
#endif
#ifndef HAVE_LSTAT
int lstat(const char *path, struct stat *buf);
int ROKEN_LIB_FUNCTION lstat(const char *path, struct stat *buf);
#endif
#if !defined(HAVE_MKSTEMP) || defined(NEED_MKSTEMP_PROTO)
int mkstemp(char *);
int ROKEN_LIB_FUNCTION mkstemp(char *);
#endif
#ifndef HAVE_CGETENT
int cgetent(char **buf, char **db_array, const char *name);
int cgetstr(char *buf, const char *cap, char **str);
int ROKEN_LIB_FUNCTION cgetent(char **buf, char **db_array, const char *name);
int ROKEN_LIB_FUNCTION cgetstr(char *buf, const char *cap, char **str);
#endif
#ifndef HAVE_INITGROUPS
int initgroups(const char *name, gid_t basegid);
int ROKEN_LIB_FUNCTION initgroups(const char *name, gid_t basegid);
#endif
#ifndef HAVE_FCHOWN
int fchown(int fd, uid_t owner, gid_t group);
int ROKEN_LIB_FUNCTION fchown(int fd, uid_t owner, gid_t group);
#endif
#ifndef HAVE_DAEMON
int daemon(int nochdir, int noclose);
int ROKEN_LIB_FUNCTION daemon(int nochdir, int noclose);
#endif
#ifndef HAVE_INNETGR
int innetgr(const char *netgroup, const char *machine,
int ROKEN_LIB_FUNCTION innetgr(const char *netgroup, const char *machine,
const char *user, const char *domain);
#endif
#ifndef HAVE_CHOWN
int chown(const char *path, uid_t owner, gid_t group);
int ROKEN_LIB_FUNCTION chown(const char *path, uid_t owner, gid_t group);
#endif
#ifndef HAVE_RCMD
int rcmd(char **ahost, unsigned short inport, const char *locuser,
int ROKEN_LIB_FUNCTION
rcmd(char **ahost, unsigned short inport, const char *locuser,
const char *remuser, const char *cmd, int *fd2p);
#endif
#if !defined(HAVE_INNETGR) || defined(NEED_INNETGR_PROTO)
int innetgr(const char*, const char*, const char*, const char*);
int ROKEN_LIB_FUNCTION innetgr(const char*, const char*,
const char*, const char*);
#endif
#ifndef HAVE_IRUSEROK
int iruserok(unsigned raddr, int superuser, const char *ruser,
const char *luser);
int ROKEN_LIB_FUNCTION iruserok(unsigned raddr, int superuser,
const char *ruser, const char *luser);
#endif
#if !defined(HAVE_GETHOSTNAME) || defined(NEED_GETHOSTNAME_PROTO)
int gethostname(char *name, int namelen);
int ROKEN_LIB_FUNCTION gethostname(char *name, int namelen);
#endif
#ifndef HAVE_WRITEV
ssize_t
ssize_t ROKEN_LIB_FUNCTION
writev(int d, const struct iovec *iov, int iovcnt);
#endif
#ifndef HAVE_READV
ssize_t
ssize_t ROKEN_LIB_FUNCTION
readv(int d, const struct iovec *iov, int iovcnt);
#endif
#ifndef HAVE_MKSTEMP
int
int ROKEN_LIB_FUNCTION
mkstemp(char *template);
#endif
#ifndef HAVE_PIDFILE
void pidfile (const char*);
void ROKEN_LIB_FUNCTION pidfile (const char*);
#endif
#ifndef HAVE_BSWAP32
unsigned int bswap32(unsigned int);
unsigned int ROKEN_LIB_FUNCTION bswap32(unsigned int);
#endif
#ifndef HAVE_BSWAP16
unsigned short bswap16(unsigned short);
unsigned short ROKEN_LIB_FUNCTION bswap16(unsigned short);
#endif
#ifndef HAVE_FLOCK
@@ -396,23 +392,24 @@ unsigned short bswap16(unsigned short);
int flock(int fd, int operation);
#endif /* HAVE_FLOCK */
time_t tm2time (struct tm tm, int local);
time_t ROKEN_LIB_FUNCTION tm2time (struct tm tm, int local);
int unix_verify_user(char *user, char *password);
int ROKEN_LIB_FUNCTION unix_verify_user(char *user, char *password);
int roken_concat (char *s, size_t len, ...);
int ROKEN_LIB_FUNCTION roken_concat (char *s, size_t len, ...);
size_t roken_mconcat (char **s, size_t max_len, ...);
size_t ROKEN_LIB_FUNCTION roken_mconcat (char **s, size_t max_len, ...);
int roken_vconcat (char *s, size_t len, va_list args);
int ROKEN_LIB_FUNCTION roken_vconcat (char *s, size_t len, va_list args);
size_t roken_vmconcat (char **s, size_t max_len, va_list args);
size_t ROKEN_LIB_FUNCTION
roken_vmconcat (char **s, size_t max_len, va_list args);
ssize_t net_write (int fd, const void *buf, size_t nbytes);
ssize_t ROKEN_LIB_FUNCTION net_write (int fd, const void *buf, size_t nbytes);
ssize_t net_read (int fd, void *buf, size_t nbytes);
ssize_t ROKEN_LIB_FUNCTION net_read (int fd, void *buf, size_t nbytes);
int issuid(void);
int ROKEN_LIB_FUNCTION issuid(void);
#ifndef HAVE_STRUCT_WINSIZE
struct winsize {
@@ -421,10 +418,10 @@ struct winsize {
};
#endif
int get_window_size(int fd, struct winsize *);
int ROKEN_LIB_FUNCTION get_window_size(int fd, struct winsize *);
#ifndef HAVE_VSYSLOG
void vsyslog(int pri, const char *fmt, va_list ap);
void ROKEN_LIB_FUNCTION vsyslog(int pri, const char *fmt, va_list ap);
#endif
#if !HAVE_DECL_OPTARG
@@ -442,22 +439,22 @@ extern char **environ;
#endif
#ifndef HAVE_GETIPNODEBYNAME
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
getipnodebyname (const char *name, int af, int flags, int *error_num);
#endif
#ifndef HAVE_GETIPNODEBYADDR
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
getipnodebyaddr (const void *src, size_t len, int af, int *error_num);
#endif
#ifndef HAVE_FREEHOSTENT
void
void ROKEN_LIB_FUNCTION
freehostent (struct hostent *h);
#endif
#ifndef HAVE_COPYHOSTENT
struct hostent *
struct hostent * ROKEN_LIB_FUNCTION
copyhostent (const struct hostent *h);
#endif
@@ -524,7 +521,7 @@ struct addrinfo {
#endif
#ifndef HAVE_GETADDRINFO
int
int ROKEN_LIB_FUNCTION
getaddrinfo(const char *nodename,
const char *servname,
const struct addrinfo *hints,
@@ -532,53 +529,56 @@ getaddrinfo(const char *nodename,
#endif
#ifndef HAVE_GETNAMEINFO
int getnameinfo(const struct sockaddr *sa, socklen_t salen,
int ROKEN_LIB_FUNCTION
getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen,
char *serv, size_t servlen,
int flags);
#endif
#ifndef HAVE_FREEADDRINFO
void
void ROKEN_LIB_FUNCTION
freeaddrinfo(struct addrinfo *ai);
#endif
#ifndef HAVE_GAI_STRERROR
char *
char * ROKEN_LIB_FUNCTION
gai_strerror(int ecode);
#endif
int
int ROKEN_LIB_FUNCTION
getnameinfo_verified(const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen,
char *serv, size_t servlen,
int flags);
int roken_getaddrinfo_hostspec(const char *, int, struct addrinfo **);
int roken_getaddrinfo_hostspec2(const char *, int, int, struct addrinfo **);
int ROKEN_LIB_FUNCTION
roken_getaddrinfo_hostspec(const char *, int, struct addrinfo **);
int ROKEN_LIB_FUNCTION
roken_getaddrinfo_hostspec2(const char *, int, int, struct addrinfo **);
#ifndef HAVE_STRFTIME
size_t
size_t ROKEN_LIB_FUNCTION
strftime (char *buf, size_t maxsize, const char *format,
const struct tm *tm);
#endif
#ifndef HAVE_STRPTIME
char *
char * ROKEN_LIB_FUNCTION
strptime (const char *buf, const char *format, struct tm *timeptr);
#endif
#ifndef HAVE_EMALLOC
void *emalloc (size_t);
void * ROKEN_LIB_FUNCTION emalloc (size_t);
#endif
#ifndef HAVE_ECALLOC
void *ecalloc(size_t num, size_t sz);
void * ROKEN_LIB_FUNCTION ecalloc(size_t num, size_t sz);
#endif
#ifndef HAVE_EREALLOC
void *erealloc (void *, size_t);
void * ROKEN_LIB_FUNCTION erealloc (void *, size_t);
#endif
#ifndef HAVE_ESTRDUP
char *estrdup (const char *);
char * ROKEN_LIB_FUNCTION estrdup (const char *);
#endif
/*
@@ -586,9 +586,12 @@ char *estrdup (const char *);
*/
#if 1
int roken_gethostby_setup(const char*, const char*);
struct hostent* roken_gethostbyname(const char*);
struct hostent* roken_gethostbyaddr(const void*, size_t, int);
int ROKEN_LIB_FUNCTION
roken_gethostby_setup(const char*, const char*);
struct hostent* ROKEN_LIB_FUNCTION
roken_gethostbyname(const char*);
struct hostent* ROKEN_LIB_FUNCTION
roken_gethostbyaddr(const void*, size_t, int);
#else
#ifdef GETHOSTBYNAME_PROTO_COMPATIBLE
#define roken_gethostbyname(x) gethostbyname(x)
@@ -622,57 +625,57 @@ struct hostent* roken_gethostbyaddr(const void*, size_t, int);
#endif
#ifndef HAVE_SETPROGNAME
void setprogname(const char *argv0);
void ROKEN_LIB_FUNCTION setprogname(const char *argv0);
#endif
#ifndef HAVE_GETPROGNAME
const char *getprogname(void);
const char * ROKEN_LIB_FUNCTION getprogname(void);
#endif
#if !defined(HAVE_SETPROGNAME) && !defined(HAVE_GETPROGNAME) && !HAVE_DECL___PROGNAME
extern const char *__progname;
#endif
void mini_inetd_addrinfo (struct addrinfo*);
void mini_inetd (int port);
void ROKEN_LIB_FUNCTION mini_inetd_addrinfo (struct addrinfo*);
void ROKEN_LIB_FUNCTION mini_inetd (int port);
#ifndef HAVE_LOCALTIME_R
struct tm *
struct tm * ROKEN_LIB_FUNCTION
localtime_r(const time_t *timer, struct tm *result);
#endif
#if !defined(HAVE_STRSVIS) || defined(NEED_STRSVIS_PROTO)
int
int ROKEN_LIB_FUNCTION
strsvis(char *dst, const char *src, int flag, const char *extra);
#endif
#if !defined(HAVE_STRUNVIS) || defined(NEED_STRUNVIS_PROTO)
int
int ROKEN_LIB_FUNCTION
strunvis(char *dst, const char *src);
#endif
#if !defined(HAVE_STRVIS) || defined(NEED_STRVIS_PROTO)
int
int ROKEN_LIB_FUNCTION
strvis(char *dst, const char *src, int flag);
#endif
#if !defined(HAVE_STRVISX) || defined(NEED_STRVISX_PROTO)
int
int ROKEN_LIB_FUNCTION
strvisx(char *dst, const char *src, size_t len, int flag);
#endif
#if !defined(HAVE_SVIS) || defined(NEED_SVIS_PROTO)
char *
char * ROKEN_LIB_FUNCTION
svis(char *dst, int c, int flag, int nextc, const char *extra);
#endif
#if !defined(HAVE_UNVIS) || defined(NEED_UNVIS_PROTO)
int
int ROKEN_LIB_FUNCTION
unvis(char *cp, int c, int *astate, int flag);
#endif
#if !defined(HAVE_VIS) || defined(NEED_VIS_PROTO)
char *
char * ROKEN_LIB_FUNCTION
vis(char *dst, int c, int flag, int nextc);
#endif

View File

@@ -107,7 +107,7 @@ split_spec(const char *spec, char **host, int *port, char **path, int def_port)
}
int
int ROKEN_LIB_FUNCTION
roken_gethostby_setup(const char *proxy_spec, const char *dns_spec)
{
char *proxy_host = NULL;
@@ -220,7 +220,7 @@ roken_gethostbyname(const char *hostname)
return roken_gethostby(hostname);
}
struct hostent*
struct hostent* ROKEN_LIB_FUNCTION
roken_gethostbyaddr(const void *addr, size_t len, int type)
{
struct in_addr a;

View File

@@ -61,19 +61,19 @@ struct rtbl_data {
char *column_separator;
};
rtbl_t
rtbl_t ROKEN_LIB_FUNCTION
rtbl_create (void)
{
return calloc (1, sizeof (struct rtbl_data));
}
void
void ROKEN_LIB_FUNCTION
rtbl_set_flags (rtbl_t table, unsigned int flags)
{
table->flags = flags;
}
unsigned int
unsigned int ROKEN_LIB_FUNCTION
rtbl_get_flags (rtbl_t table)
{
return table->flags;
@@ -99,7 +99,7 @@ rtbl_get_column (rtbl_t table, const char *column)
return NULL;
}
void
void ROKEN_LIB_FUNCTION
rtbl_destroy (rtbl_t table)
{
int i, j;
@@ -121,7 +121,7 @@ rtbl_destroy (rtbl_t table)
free (table);
}
int
int ROKEN_LIB_FUNCTION
rtbl_add_column_by_id (rtbl_t table, unsigned int id,
const char *header, unsigned int flags)
{
@@ -150,13 +150,13 @@ rtbl_add_column_by_id (rtbl_t table, unsigned int id,
return 0;
}
int
int ROKEN_LIB_FUNCTION
rtbl_add_column (rtbl_t table, const char *header, unsigned int flags)
{
return rtbl_add_column_by_id(table, 0, header, flags);
}
int
int ROKEN_LIB_FUNCTION
rtbl_new_row(rtbl_t table)
{
size_t max_rows = 0;
@@ -196,7 +196,7 @@ column_compute_width (rtbl_t table, struct column_data *column)
}
/* DEPRECATED */
int
int ROKEN_LIB_FUNCTION
rtbl_set_prefix (rtbl_t table, const char *prefix)
{
if (table->column_prefix)
@@ -207,7 +207,7 @@ rtbl_set_prefix (rtbl_t table, const char *prefix)
return 0;
}
int
int ROKEN_LIB_FUNCTION
rtbl_set_separator (rtbl_t table, const char *separator)
{
if (table->column_separator)
@@ -218,7 +218,7 @@ rtbl_set_separator (rtbl_t table, const char *separator)
return 0;
}
int
int ROKEN_LIB_FUNCTION
rtbl_set_column_prefix (rtbl_t table, const char *column,
const char *prefix)
{
@@ -234,7 +234,7 @@ rtbl_set_column_prefix (rtbl_t table, const char *column,
return 0;
}
int
int ROKEN_LIB_FUNCTION
rtbl_set_column_affix_by_id(rtbl_t table, unsigned int id,
const char *prefix, const char *suffix)
{
@@ -303,7 +303,7 @@ add_column_entry (struct column_data *c, const char *data)
return 0;
}
int
int ROKEN_LIB_FUNCTION
rtbl_add_column_entry_by_id (rtbl_t table, unsigned int id, const char *data)
{
struct column_data *c = rtbl_get_column_by_id (table, id);
@@ -314,7 +314,7 @@ rtbl_add_column_entry_by_id (rtbl_t table, unsigned int id, const char *data)
return add_column_entry(c, data);
}
int
int ROKEN_LIB_FUNCTION
rtbl_add_column_entry (rtbl_t table, const char *column, const char *data)
{
struct column_data *c = rtbl_get_column (table, column);
@@ -325,7 +325,7 @@ rtbl_add_column_entry (rtbl_t table, const char *column, const char *data)
return add_column_entry(c, data);
}
int
int ROKEN_LIB_FUNCTION
rtbl_format (rtbl_t table, FILE * f)
{
int i, j;

View File

@@ -35,6 +35,14 @@
#ifndef __rtbl_h__
#define __rtbl_h__
#ifndef ROKEN_LIB_FUNCTION
#ifdef _WIN32
#define ROKEN_LIB_FUNCTION _stdcall
#else
#define ROKEN_LIB_FUNCTION
#endif
#endif
struct rtbl_data;
typedef struct rtbl_data *rtbl_t;
@@ -44,32 +52,46 @@ typedef struct rtbl_data *rtbl_t;
/* flags */
#define RTBL_HEADER_STYLE_NONE 1
int rtbl_add_column (rtbl_t, const char*, unsigned int);
int ROKEN_LIB_FUNCTION
rtbl_add_column (rtbl_t, const char*, unsigned int);
int rtbl_add_column_by_id (rtbl_t, unsigned int, const char*, unsigned int);
int ROKEN_LIB_FUNCTION
rtbl_add_column_by_id (rtbl_t, unsigned int, const char*, unsigned int);
int rtbl_add_column_entry (rtbl_t, const char*, const char*);
int ROKEN_LIB_FUNCTION
rtbl_add_column_entry (rtbl_t, const char*, const char*);
int rtbl_add_column_entry_by_id (rtbl_t, unsigned int, const char*);
int ROKEN_LIB_FUNCTION
rtbl_add_column_entry_by_id (rtbl_t, unsigned int, const char*);
rtbl_t rtbl_create (void);
rtbl_t ROKEN_LIB_FUNCTION
rtbl_create (void);
void rtbl_destroy (rtbl_t);
void ROKEN_LIB_FUNCTION
rtbl_destroy (rtbl_t);
int rtbl_format (rtbl_t, FILE*);
int ROKEN_LIB_FUNCTION
rtbl_format (rtbl_t, FILE*);
unsigned int rtbl_get_flags (rtbl_t);
unsigned int ROKEN_LIB_FUNCTION
rtbl_get_flags (rtbl_t);
int rtbl_new_row (rtbl_t);
int ROKEN_LIB_FUNCTION
rtbl_new_row (rtbl_t);
int rtbl_set_column_affix_by_id (rtbl_t, unsigned int, const char*, const char*);
int ROKEN_LIB_FUNCTION
rtbl_set_column_affix_by_id (rtbl_t, unsigned int, const char*, const char*);
int rtbl_set_column_prefix (rtbl_t, const char*, const char*);
int ROKEN_LIB_FUNCTION
rtbl_set_column_prefix (rtbl_t, const char*, const char*);
void rtbl_set_flags (rtbl_t, unsigned int);
void ROKEN_LIB_FUNCTION
rtbl_set_flags (rtbl_t, unsigned int);
int rtbl_set_prefix (rtbl_t, const char*);
int ROKEN_LIB_FUNCTION
rtbl_set_prefix (rtbl_t, const char*);
int rtbl_set_separator (rtbl_t, const char*);
int ROKEN_LIB_FUNCTION
rtbl_set_separator (rtbl_t, const char*);
#endif /* __rtbl_h__ */

View File

@@ -38,7 +38,7 @@ RCSID("$Id$");
#include "roken.h"
ssize_t
ssize_t ROKEN_LIB_FUNCTION
sendmsg(int s, const struct msghdr *msg, int flags)
{
ssize_t ret;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
setegid(gid_t egid)
{
#ifdef HAVE_SETREGID

View File

@@ -47,7 +47,7 @@ RCSID("$Id$");
* anyway.
*/
int
int ROKEN_LIB_FUNCTION
setenv(const char *var, const char *val, int rewrite)
{
char *t;

View File

@@ -42,7 +42,7 @@ RCSID("$Id$");
#include "roken.h"
int
int ROKEN_LIB_FUNCTION
seteuid(uid_t euid)
{
#ifdef HAVE_SETREUID

View File

@@ -43,7 +43,7 @@ extern const char *__progname;
#endif
#ifndef HAVE_SETPROGNAME
void
void ROKEN_LIB_FUNCTION
setprogname(const char *argv0)
{
#ifndef HAVE___PROGNAME

View File

@@ -50,7 +50,7 @@ RCSID("$Id$");
* Do we need any extra hacks for SIGCLD and/or SIGCHLD?
*/
SigAction
SigAction ROKEN_LIB_FUNCTION
signal(int iSig, SigAction pAction)
{
struct sigaction saNew, saOld;

View File

@@ -81,7 +81,7 @@ sigtimeout(int sig)
SIGRETURN(0);
}
int
int ROKEN_LIB_FUNCTION
wait_for_process_timed(pid_t pid, time_t (*func)(void *),
void *ptr, time_t timeout)
{
@@ -137,13 +137,13 @@ wait_for_process_timed(pid_t pid, time_t (*func)(void *),
return ret;
}
int
int ROKEN_LIB_FUNCTION
wait_for_process(pid_t pid)
{
return wait_for_process_timed(pid, NULL, NULL, 0);
}
int
int ROKEN_LIB_FUNCTION
pipe_execv(FILE **stdin_fd, FILE **stdout_fd, FILE **stderr_fd,
const char *file, ...)
{
@@ -230,7 +230,7 @@ pipe_execv(FILE **stdin_fd, FILE **stdout_fd, FILE **stderr_fd,
return pid;
}
int
int ROKEN_LIB_FUNCTION
simple_execvp_timed(const char *file, char *const args[],
time_t (*func)(void *), void *ptr, time_t timeout)
{
@@ -246,14 +246,14 @@ simple_execvp_timed(const char *file, char *const args[],
}
}
int
int ROKEN_LIB_FUNCTION
simple_execvp(const char *file, char *const args[])
{
return simple_execvp_timed(file, args, NULL, NULL, 0);
}
/* gee, I'd like a execvpe */
int
int ROKEN_LIB_FUNCTION
simple_execve_timed(const char *file, char *const args[], char *const envp[],
time_t (*func)(void *), void *ptr, time_t timeout)
{
@@ -269,13 +269,13 @@ simple_execve_timed(const char *file, char *const args[], char *const envp[],
}
}
int
int ROKEN_LIB_FUNCTION
simple_execve(const char *file, char *const args[], char *const envp[])
{
return simple_execve_timed(file, args, envp, NULL, NULL, 0);
}
int
int ROKEN_LIB_FUNCTION
simple_execlp(const char *file, ...)
{
va_list ap;
@@ -292,7 +292,7 @@ simple_execlp(const char *file, ...)
return ret;
}
int
int ROKEN_LIB_FUNCTION
simple_execle(const char *file, ... /* ,char *const envp[] */)
{
va_list ap;
@@ -311,7 +311,7 @@ simple_execle(const char *file, ... /* ,char *const envp[] */)
return ret;
}
int
int ROKEN_LIB_FUNCTION
simple_execl(const char *file, ...)
{
va_list ap;

View File

@@ -530,7 +530,7 @@ xyzprintf (struct snprintf_state *state, const char *char_format, va_list ap)
}
#if !defined(HAVE_SNPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
snprintf (char *str, size_t sz, const char *format, ...)
{
va_list args;
@@ -563,7 +563,7 @@ snprintf (char *str, size_t sz, const char *format, ...)
#endif
#if !defined(HAVE_ASPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
asprintf (char **ret, const char *format, ...)
{
va_list args;
@@ -595,7 +595,7 @@ asprintf (char **ret, const char *format, ...)
#endif
#if !defined(HAVE_ASNPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
asnprintf (char **ret, size_t max_sz, const char *format, ...)
{
va_list args;
@@ -625,7 +625,7 @@ asnprintf (char **ret, size_t max_sz, const char *format, ...)
#endif
#if !defined(HAVE_VASPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
vasprintf (char **ret, const char *format, va_list args)
{
return vasnprintf (ret, 0, format, args);
@@ -634,7 +634,7 @@ vasprintf (char **ret, const char *format, va_list args)
#if !defined(HAVE_VASNPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
{
int st;
@@ -673,7 +673,7 @@ vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
#endif
#if !defined(HAVE_VSNPRINTF) || defined(TEST_SNPRINTF)
int
int ROKEN_LIB_FUNCTION
vsnprintf (char *str, size_t sz, const char *format, va_list args)
{
struct snprintf_state state;

View File

@@ -43,7 +43,7 @@ RCSID("$Id$");
* Set `sa' to the unitialized address of address family `af'
*/
void
void ROKEN_LIB_FUNCTION
socket_set_any (struct sockaddr *sa, int af)
{
switch (af) {
@@ -77,7 +77,7 @@ socket_set_any (struct sockaddr *sa, int af)
* set `sa' to (`ptr', `port')
*/
void
void ROKEN_LIB_FUNCTION
socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port)
{
switch (sa->sa_family) {
@@ -111,7 +111,7 @@ socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port)
* Return the size of an address of the type in `sa'
*/
size_t
size_t ROKEN_LIB_FUNCTION
socket_addr_size (const struct sockaddr *sa)
{
switch (sa->sa_family) {
@@ -131,7 +131,7 @@ socket_addr_size (const struct sockaddr *sa)
* Return the size of a `struct sockaddr' in `sa'.
*/
size_t
size_t ROKEN_LIB_FUNCTION
socket_sockaddr_size (const struct sockaddr *sa)
{
switch (sa->sa_family) {
@@ -151,7 +151,7 @@ socket_sockaddr_size (const struct sockaddr *sa)
* Return the binary address of `sa'.
*/
void *
void * ROKEN_LIB_FUNCTION
socket_get_address (struct sockaddr *sa)
{
switch (sa->sa_family) {
@@ -175,7 +175,7 @@ socket_get_address (struct sockaddr *sa)
* Return the port number from `sa'.
*/
int
int ROKEN_LIB_FUNCTION
socket_get_port (const struct sockaddr *sa)
{
switch (sa->sa_family) {
@@ -199,7 +199,7 @@ socket_get_port (const struct sockaddr *sa)
* Set the port in `sa' to `port'.
*/
void
void ROKEN_LIB_FUNCTION
socket_set_port (struct sockaddr *sa, int port)
{
switch (sa->sa_family) {
@@ -224,7 +224,7 @@ socket_set_port (struct sockaddr *sa, int port)
/*
* Set the range of ports to use when binding with port = 0.
*/
void
void ROKEN_LIB_FUNCTION
socket_set_portrange (int sock, int restr, int af)
{
#if defined(IP_PORTRANGE)
@@ -250,7 +250,7 @@ socket_set_portrange (int sock, int restr, int af)
* Enable debug on `sock'.
*/
void
void ROKEN_LIB_FUNCTION
socket_set_debug (int sock)
{
#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT)
@@ -265,7 +265,7 @@ socket_set_debug (int sock)
* Set the type-of-service of `sock' to `tos'.
*/
void
void ROKEN_LIB_FUNCTION
socket_set_tos (int sock, int tos)
{
#if defined(IP_TOS) && defined(HAVE_SETSOCKOPT)
@@ -279,7 +279,7 @@ socket_set_tos (int sock, int tos)
* set the reuse of addresses on `sock' to `val'.
*/
void
void ROKEN_LIB_FUNCTION
socket_set_reuseaddr (int sock, int val)
{
#if defined(SO_REUSEADDR) && defined(HAVE_SETSOCKOPT)

Some files were not shown because too many files have changed in this diff Show More