📄 includes.h
字号:
#ifndef _INCLUDES_H#define _INCLUDES_H/* Unix SMB/CIFS implementation. Machine customisation and include handling Copyright (C) Andrew Tridgell 1994-1998 Copyright (C) 2002 by Martin Pool <mbp@samba.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef NO_CONFIG_H /* for some tests */#include "config.h"#endif#ifndef __cplusplus#define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES/* allow to build with newer heimdal releases *//* #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES */#define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define protected #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define delete #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#define friend #error DONT_USE_CPLUSPLUS_RESERVED_NAMES#endif#include "local.h"#ifdef AIX#define DEFAULT_PRINTING PRINT_AIX#define PRINTCAP_NAME "/etc/qconfig"#endif#ifdef HPUX#define DEFAULT_PRINTING PRINT_HPUX#endif#ifdef QNX#define DEFAULT_PRINTING PRINT_QNX#endif#ifdef SUNOS4/* on SUNOS4 termios.h conflicts with sys/ioctl.h */#undef HAVE_TERMIOS_H#endif#if (__GNUC__ >= 3 ) && (__GNUC_MINOR__ >= 1 )/** Use gcc attribute to check printf fns. a1 is the 1-based index of * the parameter containing the format, and a2 the index of the first * argument. Note that some gcc 2.x versions don't handle this * properly **/#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))#else#define PRINTF_ATTRIBUTE(a1, a2)#endif#if defined(__GNUC__) && !defined(__cplusplus)/** gcc attribute used on function parameters so that it does not emit * warnings about them being unused. **/# define UNUSED(param) param __attribute__ ((unused))#else# define UNUSED(param) param/** Feel free to add definitions for other compilers here. */#endif#ifdef RELIANTUNIX/* * <unistd.h> has to be included before any other to get * large file support on Reliant UNIX. Yes, it's broken :-). */#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#endif /* RELIANTUNIX */#include <sys/types.h>#ifdef TIME_WITH_SYS_TIME#include <sys/time.h>#include <time.h>#else#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#else#include <time.h>#endif#endif#ifdef HAVE_SYS_RESOURCE_H#include <sys/resource.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#include <stdio.h>#include <stddef.h>#ifdef HAVE_SYS_PARAM_H#include <sys/param.h>#endif#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#ifdef HAVE_SYS_SOCKET_H#include <sys/socket.h>#endif#ifdef HAVE_UNIXSOCKET#include <sys/un.h>#endif#ifdef HAVE_SYS_SYSCALL_H#include <sys/syscall.h>#elif HAVE_SYSCALL_H#include <syscall.h>#endif#ifdef HAVE_STRING_H#include <string.h>#endif#ifdef HAVE_STRINGS_H#include <strings.h>#endif#ifdef HAVE_MEMORY_H#include <memory.h>#endif#ifdef HAVE_MALLOC_H#include <malloc.h>#endif#ifdef HAVE_FCNTL_H#include <fcntl.h>#else#ifdef HAVE_SYS_FCNTL_H#include <sys/fcntl.h>#endif#endif#include <sys/stat.h>#ifdef HAVE_LIMITS_H#include <limits.h>#endif#ifdef HAVE_SYS_IOCTL_H#include <sys/ioctl.h>#endif#ifdef HAVE_SYS_FILIO_H#include <sys/filio.h>#endif#include <signal.h>#ifdef HAVE_SYS_WAIT_H#include <sys/wait.h>#endif#ifdef HAVE_CTYPE_H#include <ctype.h>#endif#ifdef HAVE_GRP_H#include <grp.h>#endif#ifdef HAVE_SYS_PRIV_H#include <sys/priv.h>#endif#ifdef HAVE_SYS_ID_H#include <sys/id.h>#endif#include <errno.h>#ifdef HAVE_UTIME_H#include <utime.h>#endif#ifdef HAVE_SYS_SELECT_H#include <sys/select.h>#endif#ifdef HAVE_SYS_MODE_H/* apparently AIX needs this for S_ISLNK */#ifndef S_ISLNK#include <sys/mode.h>#endif#endif#ifdef HAVE_GLOB_H#include <glob.h>#endif#include <pwd.h>#ifdef HAVE_STDARG_H#include <stdarg.h>#else#include <varargs.h>#endif#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#ifdef HAVE_SYSLOG_H#include <syslog.h>#else#ifdef HAVE_SYS_SYSLOG_H#include <sys/syslog.h>#endif#endif#include <sys/file.h>#ifdef HAVE_NETINET_TCP_H#include <netinet/tcp.h>#endif/* * The next three defines are needed to access the IPTOS_* options * on some systems. */#ifdef HAVE_NETINET_IN_SYSTM_H#include <netinet/in_systm.h>#endif#ifdef HAVE_NETINET_IN_IP_H#include <netinet/in_ip.h>#endif#ifdef HAVE_NETINET_IP_H#include <netinet/ip.h>#endif#if defined(HAVE_TERMIOS_H)/* POSIX terminal handling. */#include <termios.h>#elif defined(HAVE_TERMIO_H)/* Older SYSV terminal handling - don't use if we can avoid it. */#include <termio.h>#elif defined(HAVE_SYS_TERMIO_H)/* Older SYSV terminal handling - don't use if we can avoid it. */#include <sys/termio.h>#endif#if HAVE_DIRENT_H# include <dirent.h># define NAMLEN(dirent) strlen((dirent)->d_name)#else# define dirent direct# define NAMLEN(dirent) (dirent)->d_namlen# if HAVE_SYS_NDIR_H# include <sys/ndir.h># endif# if HAVE_SYS_DIR_H# include <sys/dir.h># endif# if HAVE_NDIR_H# include <ndir.h># endif#endif#ifdef HAVE_SYS_MMAN_H#include <sys/mman.h>#endif#ifdef HAVE_NET_IF_H#include <net/if.h>#endif#ifdef HAVE_SYS_MOUNT_H#include <sys/mount.h>#endif#ifdef HAVE_SYS_VFS_H#include <sys/vfs.h>#endif#ifdef HAVE_SYS_ACL_H#include <sys/acl.h>#endif#ifdef HAVE_SYS_FS_S5PARAM_H #include <sys/fs/s5param.h>#endif#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)#include <sys/filsys.h> #endif#ifdef HAVE_SYS_STATFS_H# include <sys/statfs.h>#endif#ifdef HAVE_DUSTAT_H #include <sys/dustat.h>#endif#ifdef HAVE_SYS_STATVFS_H #include <sys/statvfs.h>#endif#ifdef HAVE_SHADOW_H/* * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which * was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines * them again without checking if they already exsist. This generates * two "Redefinition of macro" warnings for every single .c file that is * compiled. */#if defined(HPUX) && defined(TCP_NODELAY)#undef TCP_NODELAY#endif#if defined(HPUX) && defined(TCP_MAXSEG)#undef TCP_MAXSEG#endif#include <shadow.h>#endif#ifdef HAVE_GETPWANAM#include <sys/label.h>#include <sys/audit.h>#include <pwdadj.h>#endif#ifdef HAVE_SYS_SECURITY_H#include <sys/security.h>#include <prot.h>#define PASSWORD_LENGTH 16#endif /* HAVE_SYS_SECURITY_H */#ifdef HAVE_STROPTS_H#include <stropts.h>#endif#ifdef HAVE_POLL_H#include <poll.h>#endif#ifdef HAVE_EXECINFO_H#include <execinfo.h>#endif#ifdef HAVE_SYS_CAPABILITY_H#if defined(BROKEN_REDHAT_7_SYSTEM_HEADERS) && !defined(_I386_STATFS_H) && !defined(_PPC_STATFS_H)#define _I386_STATFS_H#define _PPC_STATFS_H#define BROKEN_REDHAT_7_STATFS_WORKAROUND#endif#include <sys/capability.h>#ifdef BROKEN_REDHAT_7_STATFS_WORKAROUND#undef _I386_STATFS_H#undef _PPC_STATFS_H#undef BROKEN_REDHAT_7_STATFS_WORKAROUND#endif#endif#if defined(HAVE_RPC_RPC_H)/* * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h. */#if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)#undef AUTH_ERROR#endif/* * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which * was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines * them again without checking if they already exsist. This generates * two "Redefinition of macro" warnings for every single .c file that is * compiled. */#if defined(HPUX) && defined(TCP_NODELAY)#undef TCP_NODELAY#endif#if defined(HPUX) && defined(TCP_MAXSEG)#undef TCP_MAXSEG#endif#include <rpc/rpc.h>#endif#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)#define HAVE_NETGROUP 1#endif#if defined (HAVE_NETGROUP)#if defined(HAVE_RPCSVC_YP_PROT_H)/* * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which * was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines * them again without checking if they already exsist. This generates * two "Redefinition of macro" warnings for every single .c file that is * compiled. */#if defined(HPUX) && defined(TCP_NODELAY)#undef TCP_NODELAY#endif#if defined(HPUX) && defined(TCP_MAXSEG)#undef TCP_MAXSEG#endif#include <rpcsvc/yp_prot.h>#endif#if defined(HAVE_RPCSVC_YPCLNT_H)#include <rpcsvc/ypclnt.h>#endif#endif /* HAVE_NETGROUP */#if defined(HAVE_SYS_IPC_H)#include <sys/ipc.h>#endif /* HAVE_SYS_IPC_H */#if defined(HAVE_SYS_SHM_H)#include <sys/shm.h>#endif /* HAVE_SYS_SHM_H */#ifdef HAVE_NATIVE_ICONV#ifdef HAVE_ICONV#include <iconv.h>#endif#ifdef HAVE_GICONV#include <giconv.h>#endif#ifdef HAVE_BICONV#include <biconv.h>#endif#endif#if HAVE_KRB5_H#include <krb5.h>#else#undef HAVE_KRB5#endif#if HAVE_LBER_H#include <lber.h>#ifndef LBER_USE_DER#define LBER_USE_DER 0x01#endif#endif#if HAVE_LDAP_H#include <ldap.h>#ifndef LDAP_CONST#define LDAP_CONST const#endif#ifndef LDAP_OPT_SUCCESS#define LDAP_OPT_SUCCESS 0#endif#else#undef HAVE_LDAP#endif#if HAVE_GSSAPI_H#include <gssapi.h>#elif HAVE_GSSAPI_GSSAPI_H#include <gssapi/gssapi.h>#elif HAVE_GSSAPI_GSSAPI_GENERIC_H#include <gssapi/gssapi_generic.h>#endif#if HAVE_COM_ERR_H#include <com_err.h>#endif#if HAVE_SYS_ATTRIBUTES_H#include <sys/attributes.h>#endif/* mutually exclusive (SuSE 8.2) */#if HAVE_ATTR_XATTR_H#include <attr/xattr.h>#elif HAVE_SYS_XATTR_H#include <sys/xattr.h>#endif#ifdef HAVE_SYS_EXTATTR_H#include <sys/extattr.h>#endif#ifdef HAVE_SYS_UIO_H#include <sys/uio.h>#endif#if HAVE_LOCALE_H#include <locale.h>#endif#if HAVE_LANGINFO_H#include <langinfo.h>#endif#if defined(HAVE_AIO_H) && defined(WITH_AIO)#include <aio.h>#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -