roken.h.in
来自「samba最新软件」· IN 代码 · 共 707 行 · 第 1/2 页
IN
707 行
/* -*- C -*- *//* * Copyright (c) 1995-2005 Kungliga Tekniska H鰃skolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *//* $Id: roken.h.in,v 1.182 2006/10/19 16:35:16 lha Exp $ */#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#ifdef HAVE_STDINT_H#include <stdint.h>#endif#include <string.h>#include <signal.h>#ifdef _AIXstruct ether_addr;struct sockaddr_dl;#endif#ifdef HAVE_SYS_PARAM_H#include <sys/param.h>#endif#ifdef HAVE_INTTYPES_H#include <inttypes.h>#endif#ifdef HAVE_SYS_TYPES_H#include <sys/types.h>#endif#ifdef HAVE_SYS_BITYPES_H#include <sys/bitypes.h>#endif#ifdef HAVE_BIND_BITYPES_H#include <bind/bitypes.h>#endif#ifdef HAVE_NETINET_IN6_MACHTYPES_H#include <netinet/in6_machtypes.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#ifdef HAVE_SYS_SOCKET_H#include <sys/socket.h>#endif#ifdef HAVE_SYS_UIO_H#include <sys/uio.h>#endif#ifdef HAVE_GRP_H#include <grp.h>#endif#ifdef HAVE_SYS_STAT_H#include <sys/stat.h>#endif#ifdef HAVE_NETINET_IN_H#include <netinet/in.h>#endif#ifdef HAVE_NETINET_IN6_H#include <netinet/in6.h>#endif#ifdef HAVE_NETINET6_IN6_H#include <netinet6/in6.h>#endif#ifdef HAVE_ARPA_INET_H#include <arpa/inet.h>#endif#ifdef HAVE_NETDB_H#include <netdb.h>#endif#ifdef HAVE_ARPA_NAMESER_H#include <arpa/nameser.h>#endif#ifdef HAVE_RESOLV_H#include <resolv.h>#endif#ifdef HAVE_SYSLOG_H#include <syslog.h>#endif#ifdef HAVE_FCNTL_H#include <fcntl.h>#endif#ifdef HAVE_ERRNO_H#include <errno.h>#endif#include <err.h>#ifdef HAVE_TERMIOS_H#include <termios.h>#endif#if defined(HAVE_SYS_IOCTL_H) && SunOS != 40#include <sys/ioctl.h>#endif#ifdef TIME_WITH_SYS_TIME#include <sys/time.h>#include <time.h>#elif defined(HAVE_SYS_TIME_H)#include <sys/time.h>#else#include <time.h>#endif#ifdef HAVE_STRINGS_H#include <strings.h>#endif#ifdef HAVE_PATHS_H#include <paths.h>#endif#ifndef HAVE_SSIZE_Ttypedef int ssize_t;#endif#include <roken-common.h>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_PUTENVint ROKEN_LIB_FUNCTION putenv(const char *);#endif#if !defined(HAVE_SETENV) || defined(NEED_SETENV_PROTO)int ROKEN_LIB_FUNCTION setenv(const char *, const char *, int);#endif#if !defined(HAVE_UNSETENV) || defined(NEED_UNSETENV_PROTO)void ROKEN_LIB_FUNCTION unsetenv(const char *);#endif#if !defined(HAVE_GETUSERSHELL) || defined(NEED_GETUSERSHELL_PROTO)char * ROKEN_LIB_FUNCTION getusershell(void);void ROKEN_LIB_FUNCTION endusershell(void);#endif#if !defined(HAVE_SNPRINTF) || defined(NEED_SNPRINTF_PROTO)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 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 ROKEN_LIB_FUNCTION asprintf (char **, const char *, ...) __attribute__ ((format (printf, 2, 3)));#endif#if !defined(HAVE_VASPRINTF) || defined(NEED_VASPRINTF_PROTO)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 ROKEN_LIB_FUNCTION asnprintf (char **, size_t, const char *, ...) __attribute__ ((format (printf, 3, 4)));#endif#if !defined(HAVE_VASNPRINTF) || defined(NEED_VASNPRINTF_PROTO)int ROKEN_LIB_FUNCTION vasnprintf (char **, size_t, const char *, va_list) __attribute__((format (printf, 3, 0)));#endif#ifndef HAVE_STRDUPchar * ROKEN_LIB_FUNCTION strdup(const char *);#endif#if !defined(HAVE_STRNDUP) || defined(NEED_STRNDUP_PROTO)char * ROKEN_LIB_FUNCTION strndup(const char *, size_t);#endif#ifndef HAVE_STRLWRchar * ROKEN_LIB_FUNCTION strlwr(char *);#endif#ifndef HAVE_STRNLENsize_t ROKEN_LIB_FUNCTION strnlen(const char*, size_t);#endif#if !defined(HAVE_STRSEP) || defined(NEED_STRSEP_PROTO)char * ROKEN_LIB_FUNCTION strsep(char**, const char*);#endif#if !defined(HAVE_STRSEP_COPY) || defined(NEED_STRSEP_COPY_PROTO)ssize_t ROKEN_LIB_FUNCTION strsep_copy(const char**, const char*, char*, size_t);#endif#ifndef HAVE_STRCASECMPint ROKEN_LIB_FUNCTION strcasecmp(const char *, const char *);#endif#ifdef NEED_FCLOSE_PROTOint ROKEN_LIB_FUNCTION fclose(FILE *);#endif#ifdef NEED_STRTOK_R_PROTOchar * ROKEN_LIB_FUNCTION strtok_r(char *, const char *, char **);#endif#ifndef HAVE_STRUPRchar * ROKEN_LIB_FUNCTION strupr(char *);#endif#ifndef HAVE_STRLCPYsize_t ROKEN_LIB_FUNCTION strlcpy (char *, const char *, size_t);#endif#ifndef HAVE_STRLCATsize_t ROKEN_LIB_FUNCTION strlcat (char *, const char *, size_t);#endif#ifndef HAVE_GETDTABLESIZEint ROKEN_LIB_FUNCTION getdtablesize(void);#endif#if !defined(HAVE_STRERROR) && !defined(strerror)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 * ROKEN_LIB_FUNCTION hstrerror(int);#endif#endif#if !HAVE_DECL_H_ERRNOextern int h_errno;#endif#if !defined(HAVE_INET_ATON) || defined(NEED_INET_ATON_PROTO)int ROKEN_LIB_FUNCTION inet_aton(const char *, struct in_addr *);#endif#ifndef HAVE_INET_NTOPconst char * ROKEN_LIB_FUNCTIONinet_ntop(int af, const void *src, char *dst, size_t size);#endif#ifndef HAVE_INET_PTONint ROKEN_LIB_FUNCTIONinet_pton(int, const char *, void *);#endif#if !defined(HAVE_GETCWD)char* ROKEN_LIB_FUNCTION getcwd(char *, size_t);#endif#ifdef HAVE_PWD_H#include <pwd.h>struct passwd * ROKEN_LIB_FUNCTION k_getpwnam (const char *);struct passwd * ROKEN_LIB_FUNCTION k_getpwuid (uid_t);#endifconst char * ROKEN_LIB_FUNCTION get_default_username (void);#ifndef HAVE_SETEUIDint ROKEN_LIB_FUNCTION seteuid(uid_t);#endif#ifndef HAVE_SETEGIDint ROKEN_LIB_FUNCTION setegid(gid_t);#endif#ifndef HAVE_LSTATint ROKEN_LIB_FUNCTION lstat(const char *, struct stat *);#endif#if !defined(HAVE_MKSTEMP) || defined(NEED_MKSTEMP_PROTO)int ROKEN_LIB_FUNCTION mkstemp(char *);#endif#ifndef HAVE_CGETENTint ROKEN_LIB_FUNCTION cgetent(char **, char **, const char *);int ROKEN_LIB_FUNCTION cgetstr(char *, const char *, char **);#endif#ifndef HAVE_INITGROUPSint ROKEN_LIB_FUNCTION initgroups(const char *, gid_t);#endif#ifndef HAVE_FCHOWNint ROKEN_LIB_FUNCTION fchown(int, uid_t, gid_t);#endif#if !defined(HAVE_DAEMON) || defined(NEED_DAEMON_PROTO)int ROKEN_LIB_FUNCTION daemon(int, int);#endif#ifndef HAVE_INNETGRint ROKEN_LIB_FUNCTION innetgr(const char *, const char *, const char *, const char *);#endif#ifndef HAVE_CHOWNint ROKEN_LIB_FUNCTION chown(const char *, uid_t, gid_t);#endif#ifndef HAVE_RCMDint ROKEN_LIB_FUNCTION rcmd(char **, unsigned short, const char *, const char *, const char *, int *);#endif#if !defined(HAVE_INNETGR) || defined(NEED_INNETGR_PROTO)int ROKEN_LIB_FUNCTION innetgr(const char*, const char*, const char*, const char*);#endif#ifndef HAVE_IRUSEROKint ROKEN_LIB_FUNCTION iruserok(unsigned, int, const char *, const char *);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?