diff options
Diffstat (limited to 'crypto/heimdal/lib/roken/roken.h.in')
-rw-r--r-- | crypto/heimdal/lib/roken/roken.h.in | 342 |
1 files changed, 183 insertions, 159 deletions
diff --git a/crypto/heimdal/lib/roken/roken.h.in b/crypto/heimdal/lib/roken/roken.h.in index 16fc6d8..cf2ee9e 100644 --- a/crypto/heimdal/lib/roken/roken.h.in +++ b/crypto/heimdal/lib/roken/roken.h.in @@ -1,6 +1,6 @@ /* -*- C -*- */ /* - * 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. * @@ -32,11 +32,14 @@ * SUCH DAMAGE. */ -/* $Id: roken.h.in,v 1.169 2002/08/26 21:43:38 assar Exp $ */ +/* $Id: roken.h.in 18612 2006-10-19 16:35:16Z lha $ */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif #include <string.h> #include <signal.h> @@ -107,9 +110,7 @@ struct sockaddr_dl; #ifdef HAVE_ERRNO_H #include <errno.h> #endif -#ifdef HAVE_ERR_H #include <err.h> -#endif #ifdef HAVE_TERMIOS_H #include <termios.h> #endif @@ -124,22 +125,14 @@ struct sockaddr_dl; #else #include <time.h> #endif +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif #ifdef HAVE_PATHS_H #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 @@ -148,235 +141,248 @@ typedef int ssize_t; ROKEN_CPP_START +#ifdef HAVE_UINTPTR_T +#define rk_UNCONST(x) ((void *)(uintptr_t)(const void *)(x)) +#else +#define rk_UNCONST(x) ((void *)(unsigned long)(const void *)(x)) +#endif + #if !defined(HAVE_SETSID) && defined(HAVE__SETSID) #define setsid _setsid #endif #ifndef HAVE_PUTENV -int putenv(const char *string); +int ROKEN_LIB_FUNCTION putenv(const char *); #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 *, const char *, int); #endif #if !defined(HAVE_UNSETENV) || defined(NEED_UNSETENV_PROTO) -void unsetenv(const char *name); +void ROKEN_LIB_FUNCTION unsetenv(const char *); #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 *, size_t, const char *, ...) __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 *, size_t, const char *, va_list) __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 **, const char *, ...) __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 **, const char *, va_list) __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 **, size_t, const char *, ...) __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 **, size_t, const char *, va_list) __attribute__((format (printf, 3, 0))); #endif #ifndef HAVE_STRDUP -char * strdup(const char *old); +char * ROKEN_LIB_FUNCTION strdup(const char *); #endif #if !defined(HAVE_STRNDUP) || defined(NEED_STRNDUP_PROTO) -char * strndup(const char *old, size_t sz); +char * ROKEN_LIB_FUNCTION strndup(const char *, size_t); #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 *, const char *); #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 *, const char *, char **); #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 *, const char *, size_t); #endif #ifndef HAVE_STRLCAT -size_t strlcat (char *dst, const char *src, size_t dst_sz); +size_t ROKEN_LIB_FUNCTION strlcat (char *, const char *, size_t); #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); #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); #endif #endif -#ifndef HAVE_H_ERRNO_DECLARATION +#if !HAVE_DECL_H_ERRNO 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 *, struct in_addr *); #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 -inet_pton(int af, const char *src, void *dst); +int ROKEN_LIB_FUNCTION +inet_pton(int, const char *, void *); #endif #if !defined(HAVE_GETCWD) -char* getcwd(char *path, size_t size); +char* ROKEN_LIB_FUNCTION getcwd(char *, size_t); #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 *); +struct passwd * ROKEN_LIB_FUNCTION k_getpwuid (uid_t); #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); #endif #ifndef HAVE_SETEGID -int setegid(gid_t egid); +int ROKEN_LIB_FUNCTION setegid(gid_t); #endif #ifndef HAVE_LSTAT -int lstat(const char *path, struct stat *buf); +int ROKEN_LIB_FUNCTION lstat(const char *, struct stat *); #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 **, char **, const char *); +int ROKEN_LIB_FUNCTION cgetstr(char *, const char *, char **); #endif #ifndef HAVE_INITGROUPS -int initgroups(const char *name, gid_t basegid); +int ROKEN_LIB_FUNCTION initgroups(const char *, gid_t); #endif #ifndef HAVE_FCHOWN -int fchown(int fd, uid_t owner, gid_t group); +int ROKEN_LIB_FUNCTION fchown(int, uid_t, gid_t); #endif -#ifndef HAVE_DAEMON -int daemon(int nochdir, int noclose); +#if !defined(HAVE_DAEMON) || defined(NEED_DAEMON_PROTO) +int ROKEN_LIB_FUNCTION daemon(int, int); #endif #ifndef HAVE_INNETGR -int innetgr(const char *netgroup, const char *machine, - const char *user, const char *domain); +int ROKEN_LIB_FUNCTION innetgr(const char *, const char *, + const char *, const char *); #endif #ifndef HAVE_CHOWN -int chown(const char *path, uid_t owner, gid_t group); +int ROKEN_LIB_FUNCTION chown(const char *, uid_t, gid_t); #endif #ifndef HAVE_RCMD -int rcmd(char **ahost, unsigned short inport, const char *locuser, - const char *remuser, const char *cmd, int *fd2p); +int ROKEN_LIB_FUNCTION + rcmd(char **, unsigned short, const char *, + const char *, const char *, int *); #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, int, + const char *, const char *); #endif #if !defined(HAVE_GETHOSTNAME) || defined(NEED_GETHOSTNAME_PROTO) -int gethostname(char *name, int namelen); +int ROKEN_LIB_FUNCTION gethostname(char *, int); #endif #ifndef HAVE_WRITEV -ssize_t -writev(int d, const struct iovec *iov, int iovcnt); +ssize_t ROKEN_LIB_FUNCTION +writev(int, const struct iovec *, int); #endif #ifndef HAVE_READV -ssize_t -readv(int d, const struct iovec *iov, int iovcnt); +ssize_t ROKEN_LIB_FUNCTION +readv(int, const struct iovec *, int); #endif #ifndef HAVE_MKSTEMP -int -mkstemp(char *template); +int ROKEN_LIB_FUNCTION +mkstemp(char *); #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 +402,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, int); -int unix_verify_user(char *user, char *password); +int ROKEN_LIB_FUNCTION unix_verify_user(char *, char *); -int roken_concat (char *s, size_t len, ...); +int ROKEN_LIB_FUNCTION roken_concat (char *, size_t, ...); -size_t roken_mconcat (char **s, size_t max_len, ...); +size_t ROKEN_LIB_FUNCTION roken_mconcat (char **, size_t, ...); -int roken_vconcat (char *s, size_t len, va_list args); +int ROKEN_LIB_FUNCTION roken_vconcat (char *, size_t, va_list); -size_t roken_vmconcat (char **s, size_t max_len, va_list args); +size_t ROKEN_LIB_FUNCTION + roken_vmconcat (char **, size_t, va_list); -ssize_t net_write (int fd, const void *buf, size_t nbytes); +ssize_t ROKEN_LIB_FUNCTION net_write (int, const void *, size_t); -ssize_t net_read (int fd, void *buf, size_t nbytes); +ssize_t ROKEN_LIB_FUNCTION net_read (int, void *, size_t); -int issuid(void); +int ROKEN_LIB_FUNCTION issuid(void); #ifndef HAVE_STRUCT_WINSIZE struct winsize { @@ -421,48 +428,44 @@ 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, const char *, va_list); #endif -#ifndef HAVE_OPTARG_DECLARATION +#if !HAVE_DECL_OPTARG extern char *optarg; #endif -#ifndef HAVE_OPTIND_DECLARATION +#if !HAVE_DECL_OPTIND extern int optind; #endif -#ifndef HAVE_OPTERR_DECLARATION +#if !HAVE_DECL_OPTERR extern int opterr; #endif -#ifndef HAVE___PROGNAME_DECLARATION -extern const char *__progname; -#endif - -#ifndef HAVE_ENVIRON_DECLARATION +#if !HAVE_DECL_ENVIRON extern char **environ; #endif #ifndef HAVE_GETIPNODEBYNAME -struct hostent * -getipnodebyname (const char *name, int af, int flags, int *error_num); +struct hostent * ROKEN_LIB_FUNCTION +getipnodebyname (const char *, int, int, int *); #endif #ifndef HAVE_GETIPNODEBYADDR -struct hostent * -getipnodebyaddr (const void *src, size_t len, int af, int *error_num); +struct hostent * ROKEN_LIB_FUNCTION +getipnodebyaddr (const void *, size_t, int, int *); #endif #ifndef HAVE_FREEHOSTENT -void -freehostent (struct hostent *h); +void ROKEN_LIB_FUNCTION +freehostent (struct hostent *); #endif #ifndef HAVE_COPYHOSTENT -struct hostent * -copyhostent (const struct hostent *h); +struct hostent * ROKEN_LIB_FUNCTION +copyhostent (const struct hostent *); #endif #ifndef HAVE_SOCKLEN_T @@ -528,61 +531,63 @@ struct addrinfo { #endif #ifndef HAVE_GETADDRINFO -int -getaddrinfo(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct addrinfo **res); +int ROKEN_LIB_FUNCTION +getaddrinfo(const char *, + const char *, + const struct addrinfo *, + struct addrinfo **); #endif #ifndef HAVE_GETNAMEINFO -int getnameinfo(const struct sockaddr *sa, socklen_t salen, - char *host, size_t hostlen, - char *serv, size_t servlen, - int flags); +int ROKEN_LIB_FUNCTION +getnameinfo(const struct sockaddr *, socklen_t, + char *, size_t, + char *, size_t, + int); #endif #ifndef HAVE_FREEADDRINFO -void -freeaddrinfo(struct addrinfo *ai); +void ROKEN_LIB_FUNCTION +freeaddrinfo(struct addrinfo *); #endif #ifndef HAVE_GAI_STRERROR -char * -gai_strerror(int ecode); +const char * ROKEN_LIB_FUNCTION +gai_strerror(int); #endif -int -getnameinfo_verified(const struct sockaddr *sa, socklen_t salen, - char *host, size_t hostlen, - char *serv, size_t servlen, - int flags); +int ROKEN_LIB_FUNCTION +getnameinfo_verified(const struct sockaddr *, socklen_t, + char *, size_t, + char *, size_t, + int); -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 -strftime (char *buf, size_t maxsize, const char *format, - const struct tm *tm); +size_t ROKEN_LIB_FUNCTION +strftime (char *, size_t, const char *, const struct tm *); #endif #ifndef HAVE_STRPTIME -char * -strptime (const char *buf, const char *format, struct tm *timeptr); +char * ROKEN_LIB_FUNCTION +strptime (const char *, const char *, struct tm *); #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, size_t); #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 /* @@ -590,9 +595,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) @@ -626,57 +634,73 @@ 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 *); #endif #ifndef HAVE_GETPROGNAME -const char *getprogname(void); +const char * ROKEN_LIB_FUNCTION getprogname(void); #endif -void mini_inetd_addrinfo (struct addrinfo*); -void mini_inetd (int port); +#if !defined(HAVE_SETPROGNAME) && !defined(HAVE_GETPROGNAME) && !HAVE_DECL___PROGNAME +extern const char *__progname; +#endif -void set_progname(char *argv0); -const char *get_progname(void); +void ROKEN_LIB_FUNCTION mini_inetd_addrinfo (struct addrinfo*); +void ROKEN_LIB_FUNCTION mini_inetd (int); #ifndef HAVE_LOCALTIME_R -struct tm * -localtime_r(const time_t *timer, struct tm *result); +struct tm * ROKEN_LIB_FUNCTION +localtime_r(const time_t *, struct tm *); #endif #if !defined(HAVE_STRSVIS) || defined(NEED_STRSVIS_PROTO) -int -strsvis(char *dst, const char *src, int flag, const char *extra); +int ROKEN_LIB_FUNCTION +strsvis(char *, const char *, int, const char *); #endif #if !defined(HAVE_STRUNVIS) || defined(NEED_STRUNVIS_PROTO) -int -strunvis(char *dst, const char *src); +int ROKEN_LIB_FUNCTION +strunvis(char *, const char *); #endif #if !defined(HAVE_STRVIS) || defined(NEED_STRVIS_PROTO) -int -strvis(char *dst, const char *src, int flag); +int ROKEN_LIB_FUNCTION +strvis(char *, const char *, int); #endif #if !defined(HAVE_STRVISX) || defined(NEED_STRVISX_PROTO) -int -strvisx(char *dst, const char *src, size_t len, int flag); +int ROKEN_LIB_FUNCTION +strvisx(char *, const char *, size_t, int); #endif #if !defined(HAVE_SVIS) || defined(NEED_SVIS_PROTO) -char * -svis(char *dst, int c, int flag, int nextc, const char *extra); +char * ROKEN_LIB_FUNCTION +svis(char *, int, int, int, const char *); #endif #if !defined(HAVE_UNVIS) || defined(NEED_UNVIS_PROTO) -int -unvis(char *cp, int c, int *astate, int flag); +int ROKEN_LIB_FUNCTION +unvis(char *, int, int *, int); #endif #if !defined(HAVE_VIS) || defined(NEED_VIS_PROTO) -char * -vis(char *dst, int c, int flag, int nextc); +char * ROKEN_LIB_FUNCTION +vis(char *, int, int, int); +#endif + +#if !defined(HAVE_CLOSEFROM) +int ROKEN_LIB_FUNCTION +closefrom(int); +#endif + +#if !defined(HAVE_TIMEGM) +#define timegm rk_timegm +time_t ROKEN_LIB_FUNCTION +rk_timegm(struct tm *tm); +#endif + +#ifdef SOCKET_WRAPPER_REPLACE +#include <socket_wrapper.h> #endif ROKEN_CPP_END |