1/* -*- C -*- */ 2/* 3 * Copyright (c) 1995-2005 Kungliga Tekniska H�gskolan 4 * (Royal Institute of Technology, Stockholm, Sweden). 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * 3. Neither the name of the Institute nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 */ 34 35/* $Id: roken.h.in 18612 2006-10-19 16:35:16Z lha $ */ 36 37#include <stdio.h> 38#include <stdlib.h> 39#include <stdarg.h> 40#ifdef HAVE_STDINT_H 41#include <stdint.h> 42#endif 43#include <string.h> 44#include <signal.h> 45 46#ifdef _AIX 47struct ether_addr; 48struct sockaddr_dl; 49#endif 50#ifdef HAVE_SYS_PARAM_H 51#include <sys/param.h> 52#endif 53#ifdef HAVE_INTTYPES_H 54#include <inttypes.h> 55#endif 56#ifdef HAVE_SYS_TYPES_H 57#include <sys/types.h> 58#endif 59#ifdef HAVE_SYS_BITYPES_H 60#include <sys/bitypes.h> 61#endif 62#ifdef HAVE_BIND_BITYPES_H 63#include <bind/bitypes.h> 64#endif 65#ifdef HAVE_NETINET_IN6_MACHTYPES_H 66#include <netinet/in6_machtypes.h> 67#endif 68#ifdef HAVE_UNISTD_H 69#include <unistd.h> 70#endif 71#ifdef HAVE_SYS_SOCKET_H 72#include <sys/socket.h> 73#endif 74#ifdef HAVE_SYS_UIO_H 75#include <sys/uio.h> 76#endif 77#ifdef HAVE_GRP_H 78#include <grp.h> 79#endif 80#ifdef HAVE_SYS_STAT_H 81#include <sys/stat.h> 82#endif 83#ifdef HAVE_NETINET_IN_H 84#include <netinet/in.h> 85#endif 86#ifdef HAVE_NETINET_IN6_H 87#include <netinet/in6.h> 88#endif 89#ifdef HAVE_NETINET6_IN6_H 90#include <netinet6/in6.h> 91#endif 92#ifdef HAVE_ARPA_INET_H 93#include <arpa/inet.h> 94#endif 95#ifdef HAVE_NETDB_H 96#include <netdb.h> 97#endif 98#ifdef HAVE_ARPA_NAMESER_H 99#include <arpa/nameser.h> 100#endif 101#ifdef HAVE_RESOLV_H 102#include <resolv.h> 103#endif 104#ifdef HAVE_SYSLOG_H 105#include <syslog.h> 106#endif 107#ifdef HAVE_FCNTL_H 108#include <fcntl.h> 109#endif 110#ifdef HAVE_ERRNO_H 111#include <errno.h> 112#endif 113#include <err.h> 114#ifdef HAVE_TERMIOS_H 115#include <termios.h> 116#endif 117#if defined(HAVE_SYS_IOCTL_H) && SunOS != 40 118#include <sys/ioctl.h> 119#endif 120#ifdef TIME_WITH_SYS_TIME 121#include <sys/time.h> 122#include <time.h> 123#elif defined(HAVE_SYS_TIME_H) 124#include <sys/time.h> 125#else 126#include <time.h> 127#endif 128#ifdef HAVE_STRINGS_H 129#include <strings.h> 130#endif 131 132#ifdef HAVE_PATHS_H 133#include <paths.h> 134#endif 135 136#ifndef HAVE_SSIZE_T 137typedef int ssize_t; 138#endif 139 140#include <roken-common.h> 141 142ROKEN_CPP_START 143 144#ifdef HAVE_UINTPTR_T 145#define rk_UNCONST(x) ((void *)(uintptr_t)(const void *)(x)) 146#else 147#define rk_UNCONST(x) ((void *)(unsigned long)(const void *)(x)) 148#endif 149 150#if !defined(HAVE_SETSID) && defined(HAVE__SETSID) 151#define setsid _setsid 152#endif 153 154#ifndef HAVE_PUTENV 155int ROKEN_LIB_FUNCTION putenv(const char *); 156#endif 157 158#if !defined(HAVE_SETENV) || defined(NEED_SETENV_PROTO) 159int ROKEN_LIB_FUNCTION setenv(const char *, const char *, int); 160#endif 161 162#if !defined(HAVE_UNSETENV) || defined(NEED_UNSETENV_PROTO) 163void ROKEN_LIB_FUNCTION unsetenv(const char *); 164#endif 165 166#if !defined(HAVE_GETUSERSHELL) || defined(NEED_GETUSERSHELL_PROTO) 167char * ROKEN_LIB_FUNCTION getusershell(void); 168void ROKEN_LIB_FUNCTION endusershell(void); 169#endif 170 171#if !defined(HAVE_SNPRINTF) || defined(NEED_SNPRINTF_PROTO) 172int ROKEN_LIB_FUNCTION snprintf (char *, size_t, const char *, ...) 173 __attribute__ ((format (printf, 3, 4))); 174#endif 175 176#if !defined(HAVE_VSNPRINTF) || defined(NEED_VSNPRINTF_PROTO) 177int ROKEN_LIB_FUNCTION 178 vsnprintf (char *, size_t, const char *, va_list) 179 __attribute__((format (printf, 3, 0))); 180#endif 181 182#if !defined(HAVE_ASPRINTF) || defined(NEED_ASPRINTF_PROTO) 183int ROKEN_LIB_FUNCTION 184 asprintf (char **, const char *, ...) 185 __attribute__ ((format (printf, 2, 3))); 186#endif 187 188#if !defined(HAVE_VASPRINTF) || defined(NEED_VASPRINTF_PROTO) 189int ROKEN_LIB_FUNCTION 190 vasprintf (char **, const char *, va_list) 191 __attribute__((format (printf, 2, 0))); 192#endif 193 194#if !defined(HAVE_ASNPRINTF) || defined(NEED_ASNPRINTF_PROTO) 195int ROKEN_LIB_FUNCTION 196 asnprintf (char **, size_t, const char *, ...) 197 __attribute__ ((format (printf, 3, 4))); 198#endif 199 200#if !defined(HAVE_VASNPRINTF) || defined(NEED_VASNPRINTF_PROTO) 201int ROKEN_LIB_FUNCTION 202 vasnprintf (char **, size_t, const char *, va_list) 203 __attribute__((format (printf, 3, 0))); 204#endif 205 206#ifndef HAVE_STRDUP 207char * ROKEN_LIB_FUNCTION strdup(const char *); 208#endif 209 210#if !defined(HAVE_STRNDUP) || defined(NEED_STRNDUP_PROTO) 211char * ROKEN_LIB_FUNCTION strndup(const char *, size_t); 212#endif 213 214#ifndef HAVE_STRLWR 215char * ROKEN_LIB_FUNCTION strlwr(char *); 216#endif 217 218#ifndef HAVE_STRNLEN 219size_t ROKEN_LIB_FUNCTION strnlen(const char*, size_t); 220#endif 221 222#if !defined(HAVE_STRSEP) || defined(NEED_STRSEP_PROTO) 223char * ROKEN_LIB_FUNCTION strsep(char**, const char*); 224#endif 225 226#if !defined(HAVE_STRSEP_COPY) || defined(NEED_STRSEP_COPY_PROTO) 227ssize_t ROKEN_LIB_FUNCTION strsep_copy(const char**, const char*, char*, size_t); 228#endif 229 230#ifndef HAVE_STRCASECMP 231int ROKEN_LIB_FUNCTION strcasecmp(const char *, const char *); 232#endif 233 234#ifdef NEED_FCLOSE_PROTO 235int ROKEN_LIB_FUNCTION fclose(FILE *); 236#endif 237 238#ifdef NEED_STRTOK_R_PROTO 239char * ROKEN_LIB_FUNCTION strtok_r(char *, const char *, char **); 240#endif 241 242#ifndef HAVE_STRUPR 243char * ROKEN_LIB_FUNCTION strupr(char *); 244#endif 245 246#ifndef HAVE_STRLCPY 247size_t ROKEN_LIB_FUNCTION strlcpy (char *, const char *, size_t); 248#endif 249 250#ifndef HAVE_STRLCAT 251size_t ROKEN_LIB_FUNCTION strlcat (char *, const char *, size_t); 252#endif 253 254#ifndef HAVE_GETDTABLESIZE 255int ROKEN_LIB_FUNCTION getdtablesize(void); 256#endif 257 258#if !defined(HAVE_STRERROR) && !defined(strerror) 259char * ROKEN_LIB_FUNCTION strerror(int); 260#endif 261 262#if !defined(HAVE_HSTRERROR) || defined(NEED_HSTRERROR_PROTO) 263/* This causes a fatal error under Psoriasis */ 264#if !(defined(SunOS) && (SunOS >= 50)) 265const char * ROKEN_LIB_FUNCTION hstrerror(int); 266#endif 267#endif 268 269#if !HAVE_DECL_H_ERRNO 270extern int h_errno; 271#endif 272 273#if !defined(HAVE_INET_ATON) || defined(NEED_INET_ATON_PROTO) 274int ROKEN_LIB_FUNCTION inet_aton(const char *, struct in_addr *); 275#endif 276 277#ifndef HAVE_INET_NTOP 278const char * ROKEN_LIB_FUNCTION 279inet_ntop(int af, const void *src, char *dst, size_t size); 280#endif 281 282#ifndef HAVE_INET_PTON 283int ROKEN_LIB_FUNCTION 284inet_pton(int, const char *, void *); 285#endif 286 287#if !defined(HAVE_GETCWD) 288char* ROKEN_LIB_FUNCTION getcwd(char *, size_t); 289#endif 290 291#ifdef HAVE_PWD_H 292#include <pwd.h> 293struct passwd * ROKEN_LIB_FUNCTION k_getpwnam (const char *); 294struct passwd * ROKEN_LIB_FUNCTION k_getpwuid (uid_t); 295#endif 296 297const char * ROKEN_LIB_FUNCTION get_default_username (void); 298 299#ifndef HAVE_SETEUID 300int ROKEN_LIB_FUNCTION seteuid(uid_t); 301#endif 302 303#ifndef HAVE_SETEGID 304int ROKEN_LIB_FUNCTION setegid(gid_t); 305#endif 306 307#ifndef HAVE_LSTAT 308int ROKEN_LIB_FUNCTION lstat(const char *, struct stat *); 309#endif 310 311#if !defined(HAVE_MKSTEMP) || defined(NEED_MKSTEMP_PROTO) 312int ROKEN_LIB_FUNCTION mkstemp(char *); 313#endif 314 315#ifndef HAVE_CGETENT 316int ROKEN_LIB_FUNCTION cgetent(char **, char **, const char *); 317int ROKEN_LIB_FUNCTION cgetstr(char *, const char *, char **); 318#endif 319 320#ifndef HAVE_INITGROUPS 321int ROKEN_LIB_FUNCTION initgroups(const char *, gid_t); 322#endif 323 324#ifndef HAVE_FCHOWN 325int ROKEN_LIB_FUNCTION fchown(int, uid_t, gid_t); 326#endif 327 328#if !defined(HAVE_DAEMON) || defined(NEED_DAEMON_PROTO) 329int ROKEN_LIB_FUNCTION daemon(int, int); 330#endif 331 332#ifndef HAVE_INNETGR 333int ROKEN_LIB_FUNCTION innetgr(const char *, const char *, 334 const char *, const char *); 335#endif 336 337#ifndef HAVE_CHOWN 338int ROKEN_LIB_FUNCTION chown(const char *, uid_t, gid_t); 339#endif 340 341#ifndef HAVE_RCMD 342int ROKEN_LIB_FUNCTION 343 rcmd(char **, unsigned short, const char *, 344 const char *, const char *, int *); 345#endif 346 347#if !defined(HAVE_INNETGR) || defined(NEED_INNETGR_PROTO) 348int ROKEN_LIB_FUNCTION innetgr(const char*, const char*, 349 const char*, const char*); 350#endif 351 352#ifndef HAVE_IRUSEROK 353int ROKEN_LIB_FUNCTION iruserok(unsigned, int, 354 const char *, const char *); 355#endif 356 357#if !defined(HAVE_GETHOSTNAME) || defined(NEED_GETHOSTNAME_PROTO) 358int ROKEN_LIB_FUNCTION gethostname(char *, int); 359#endif 360 361#ifndef HAVE_WRITEV 362ssize_t ROKEN_LIB_FUNCTION 363writev(int, const struct iovec *, int); 364#endif 365 366#ifndef HAVE_READV 367ssize_t ROKEN_LIB_FUNCTION 368readv(int, const struct iovec *, int); 369#endif 370 371#ifndef HAVE_MKSTEMP 372int ROKEN_LIB_FUNCTION 373mkstemp(char *); 374#endif 375 376#ifndef HAVE_PIDFILE 377void ROKEN_LIB_FUNCTION pidfile (const char*); 378#endif 379 380#ifndef HAVE_BSWAP32 381unsigned int ROKEN_LIB_FUNCTION bswap32(unsigned int); 382#endif 383 384#ifndef HAVE_BSWAP16 385unsigned short ROKEN_LIB_FUNCTION bswap16(unsigned short); 386#endif 387 388#ifndef HAVE_FLOCK 389#ifndef LOCK_SH 390#define LOCK_SH 1 /* Shared lock */ 391#endif 392#ifndef LOCK_EX 393#define LOCK_EX 2 /* Exclusive lock */ 394#endif 395#ifndef LOCK_NB 396#define LOCK_NB 4 /* Don't block when locking */ 397#endif 398#ifndef LOCK_UN 399#define LOCK_UN 8 /* Unlock */ 400#endif 401 402int flock(int fd, int operation); 403#endif /* HAVE_FLOCK */ 404 405time_t ROKEN_LIB_FUNCTION tm2time (struct tm, int); 406 407int ROKEN_LIB_FUNCTION unix_verify_user(char *, char *); 408 409int ROKEN_LIB_FUNCTION roken_concat (char *, size_t, ...); 410 411size_t ROKEN_LIB_FUNCTION roken_mconcat (char **, size_t, ...); 412 413int ROKEN_LIB_FUNCTION roken_vconcat (char *, size_t, va_list); 414 415size_t ROKEN_LIB_FUNCTION 416 roken_vmconcat (char **, size_t, va_list); 417 418ssize_t ROKEN_LIB_FUNCTION net_write (int, const void *, size_t); 419 420ssize_t ROKEN_LIB_FUNCTION net_read (int, void *, size_t); 421 422int ROKEN_LIB_FUNCTION issuid(void); 423 424#ifndef HAVE_STRUCT_WINSIZE 425struct winsize { 426 unsigned short ws_row, ws_col; 427 unsigned short ws_xpixel, ws_ypixel; 428}; 429#endif 430 431int ROKEN_LIB_FUNCTION get_window_size(int fd, struct winsize *); 432 433#ifndef HAVE_VSYSLOG 434void ROKEN_LIB_FUNCTION vsyslog(int, const char *, va_list); 435#endif 436 437#if !HAVE_DECL_OPTARG 438extern char *optarg; 439#endif 440#if !HAVE_DECL_OPTIND 441extern int optind; 442#endif 443#if !HAVE_DECL_OPTERR 444extern int opterr; 445#endif 446 447#if !HAVE_DECL_ENVIRON 448extern char **environ; 449#endif 450 451#ifndef HAVE_GETIPNODEBYNAME 452struct hostent * ROKEN_LIB_FUNCTION 453getipnodebyname (const char *, int, int, int *); 454#endif 455 456#ifndef HAVE_GETIPNODEBYADDR 457struct hostent * ROKEN_LIB_FUNCTION 458getipnodebyaddr (const void *, size_t, int, int *); 459#endif 460 461#ifndef HAVE_FREEHOSTENT 462void ROKEN_LIB_FUNCTION 463freehostent (struct hostent *); 464#endif 465 466#ifndef HAVE_COPYHOSTENT 467struct hostent * ROKEN_LIB_FUNCTION 468copyhostent (const struct hostent *); 469#endif 470 471#ifndef HAVE_SOCKLEN_T 472typedef int socklen_t; 473#endif 474 475#ifndef HAVE_STRUCT_SOCKADDR_STORAGE 476 477#ifndef HAVE_SA_FAMILY_T 478typedef unsigned short sa_family_t; 479#endif 480 481#ifdef HAVE_IPV6 482#define _SS_MAXSIZE sizeof(struct sockaddr_in6) 483#else 484#define _SS_MAXSIZE sizeof(struct sockaddr_in) 485#endif 486 487#define _SS_ALIGNSIZE sizeof(unsigned long) 488 489#if HAVE_STRUCT_SOCKADDR_SA_LEN 490 491typedef unsigned char roken_sa_family_t; 492 493#define _SS_PAD1SIZE ((2 * _SS_ALIGNSIZE - sizeof (roken_sa_family_t) - sizeof(unsigned char)) % _SS_ALIGNSIZE) 494#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (roken_sa_family_t) + sizeof(unsigned char) + _SS_PAD1SIZE + _SS_ALIGNSIZE)) 495 496struct sockaddr_storage { 497 unsigned char ss_len; 498 roken_sa_family_t ss_family; 499 char __ss_pad1[_SS_PAD1SIZE]; 500 unsigned long __ss_align[_SS_PAD2SIZE / sizeof(unsigned long) + 1]; 501}; 502 503#else /* !HAVE_STRUCT_SOCKADDR_SA_LEN */ 504 505typedef unsigned short roken_sa_family_t; 506 507#define _SS_PAD1SIZE ((2 * _SS_ALIGNSIZE - sizeof (roken_sa_family_t)) % _SS_ALIGNSIZE) 508#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (roken_sa_family_t) + _SS_PAD1SIZE + _SS_ALIGNSIZE)) 509 510struct sockaddr_storage { 511 roken_sa_family_t ss_family; 512 char __ss_pad1[_SS_PAD1SIZE]; 513 unsigned long __ss_align[_SS_PAD2SIZE / sizeof(unsigned long) + 1]; 514}; 515 516#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */ 517 518#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ 519 520#ifndef HAVE_STRUCT_ADDRINFO 521struct addrinfo { 522 int ai_flags; 523 int ai_family; 524 int ai_socktype; 525 int ai_protocol; 526 size_t ai_addrlen; 527 char *ai_canonname; 528 struct sockaddr *ai_addr; 529 struct addrinfo *ai_next; 530}; 531#endif 532 533#ifndef HAVE_GETADDRINFO 534int ROKEN_LIB_FUNCTION 535getaddrinfo(const char *, 536 const char *, 537 const struct addrinfo *, 538 struct addrinfo **); 539#endif 540 541#ifndef HAVE_GETNAMEINFO 542int ROKEN_LIB_FUNCTION 543getnameinfo(const struct sockaddr *, socklen_t, 544 char *, size_t, 545 char *, size_t, 546 int); 547#endif 548 549#ifndef HAVE_FREEADDRINFO 550void ROKEN_LIB_FUNCTION 551freeaddrinfo(struct addrinfo *); 552#endif 553 554#ifndef HAVE_GAI_STRERROR 555const char * ROKEN_LIB_FUNCTION 556gai_strerror(int); 557#endif 558 559int ROKEN_LIB_FUNCTION 560getnameinfo_verified(const struct sockaddr *, socklen_t, 561 char *, size_t, 562 char *, size_t, 563 int); 564 565int ROKEN_LIB_FUNCTION 566roken_getaddrinfo_hostspec(const char *, int, struct addrinfo **); 567int ROKEN_LIB_FUNCTION 568roken_getaddrinfo_hostspec2(const char *, int, int, struct addrinfo **); 569 570#ifndef HAVE_STRFTIME 571size_t ROKEN_LIB_FUNCTION 572strftime (char *, size_t, const char *, const struct tm *); 573#endif 574 575#ifndef HAVE_STRPTIME 576char * ROKEN_LIB_FUNCTION 577strptime (const char *, const char *, struct tm *); 578#endif 579 580#ifndef HAVE_EMALLOC 581void * ROKEN_LIB_FUNCTION emalloc (size_t); 582#endif 583#ifndef HAVE_ECALLOC 584void * ROKEN_LIB_FUNCTION ecalloc(size_t, size_t); 585#endif 586#ifndef HAVE_EREALLOC 587void * ROKEN_LIB_FUNCTION erealloc (void *, size_t); 588#endif 589#ifndef HAVE_ESTRDUP 590char * ROKEN_LIB_FUNCTION estrdup (const char *); 591#endif 592 593/* 594 * kludges and such 595 */ 596 597#if 1 598int ROKEN_LIB_FUNCTION 599roken_gethostby_setup(const char*, const char*); 600struct hostent* ROKEN_LIB_FUNCTION 601roken_gethostbyname(const char*); 602struct hostent* ROKEN_LIB_FUNCTION 603roken_gethostbyaddr(const void*, size_t, int); 604#else 605#ifdef GETHOSTBYNAME_PROTO_COMPATIBLE 606#define roken_gethostbyname(x) gethostbyname(x) 607#else 608#define roken_gethostbyname(x) gethostbyname((char *)x) 609#endif 610 611#ifdef GETHOSTBYADDR_PROTO_COMPATIBLE 612#define roken_gethostbyaddr(a, l, t) gethostbyaddr(a, l, t) 613#else 614#define roken_gethostbyaddr(a, l, t) gethostbyaddr((char *)a, l, t) 615#endif 616#endif 617 618#ifdef GETSERVBYNAME_PROTO_COMPATIBLE 619#define roken_getservbyname(x,y) getservbyname(x,y) 620#else 621#define roken_getservbyname(x,y) getservbyname((char *)x, (char *)y) 622#endif 623 624#ifdef OPENLOG_PROTO_COMPATIBLE 625#define roken_openlog(a,b,c) openlog(a,b,c) 626#else 627#define roken_openlog(a,b,c) openlog((char *)a,b,c) 628#endif 629 630#ifdef GETSOCKNAME_PROTO_COMPATIBLE 631#define roken_getsockname(a,b,c) getsockname(a,b,c) 632#else 633#define roken_getsockname(a,b,c) getsockname(a, b, (void*)c) 634#endif 635 636#ifndef HAVE_SETPROGNAME 637void ROKEN_LIB_FUNCTION setprogname(const char *); 638#endif 639 640#ifndef HAVE_GETPROGNAME 641const char * ROKEN_LIB_FUNCTION getprogname(void); 642#endif 643 644#if !defined(HAVE_SETPROGNAME) && !defined(HAVE_GETPROGNAME) && !HAVE_DECL___PROGNAME 645extern const char *__progname; 646#endif 647 648void ROKEN_LIB_FUNCTION mini_inetd_addrinfo (struct addrinfo*); 649void ROKEN_LIB_FUNCTION mini_inetd (int); 650 651#ifndef HAVE_LOCALTIME_R 652struct tm * ROKEN_LIB_FUNCTION 653localtime_r(const time_t *, struct tm *); 654#endif 655 656#if !defined(HAVE_STRSVIS) || defined(NEED_STRSVIS_PROTO) 657int ROKEN_LIB_FUNCTION 658strsvis(char *, const char *, int, const char *); 659#endif 660 661#if !defined(HAVE_STRUNVIS) || defined(NEED_STRUNVIS_PROTO) 662int ROKEN_LIB_FUNCTION 663strunvis(char *, const char *); 664#endif 665 666#if !defined(HAVE_STRVIS) || defined(NEED_STRVIS_PROTO) 667int ROKEN_LIB_FUNCTION 668strvis(char *, const char *, int); 669#endif 670 671#if !defined(HAVE_STRVISX) || defined(NEED_STRVISX_PROTO) 672int ROKEN_LIB_FUNCTION 673strvisx(char *, const char *, size_t, int); 674#endif 675 676#if !defined(HAVE_SVIS) || defined(NEED_SVIS_PROTO) 677char * ROKEN_LIB_FUNCTION 678svis(char *, int, int, int, const char *); 679#endif 680 681#if !defined(HAVE_UNVIS) || defined(NEED_UNVIS_PROTO) 682int ROKEN_LIB_FUNCTION 683unvis(char *, int, int *, int); 684#endif 685 686#if !defined(HAVE_VIS) || defined(NEED_VIS_PROTO) 687char * ROKEN_LIB_FUNCTION 688vis(char *, int, int, int); 689#endif 690 691#if !defined(HAVE_CLOSEFROM) 692int ROKEN_LIB_FUNCTION 693closefrom(int); 694#endif 695 696#if !defined(HAVE_TIMEGM) 697#define timegm rk_timegm 698time_t ROKEN_LIB_FUNCTION 699rk_timegm(struct tm *tm); 700#endif 701 702#ifdef SOCKET_WRAPPER_REPLACE 703#include <socket_wrapper.h> 704#endif 705 706ROKEN_CPP_END 707