📄 includes.h
字号:
/* skip valgrind headers on 64bit AMD boxes */#ifndef HAVE_64BIT_LINUX/* Special macros that are no-ops except when run under Valgrind on * x86. They've moved a little bit from valgrind 1.0.4 to 1.9.4 */#if HAVE_VALGRIND_MEMCHECK_H /* memcheck.h includes valgrind.h */#include <valgrind/memcheck.h>#elif HAVE_VALGRIND_H#include <valgrind.h>#endif#endif/* If we have --enable-developer and the valgrind header is present, * then we're OK to use it. Set a macro so this logic can be done only * once. */#if defined(DEVELOPER) && !defined(HAVE_64BIT_LINUX)#if (HAVE_VALGRIND_H || HAVE_VALGRIND_VALGRIND_H)#define VALGRIND#endif#endif/* we support ADS if we want it and have krb5 and ldap libs */#if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP)#define HAVE_ADS#endif/* * Define VOLATILE if needed. */#if defined(HAVE_VOLATILE)#define VOLATILE volatile#else#define VOLATILE#endif/* * Define additional missing types */#if defined(HAVE_SIG_ATOMIC_T_TYPE) && defined(AIX)typedef sig_atomic_t SIG_ATOMIC_T;#elif defined(HAVE_SIG_ATOMIC_T_TYPE) && !defined(AIX)typedef sig_atomic_t VOLATILE SIG_ATOMIC_T;#elsetypedef int VOLATILE SIG_ATOMIC_T;#endif#ifndef HAVE_SOCKLEN_T_TYPE#define HAVE_SOCKLEN_T_TYPEtypedef int socklen_t;#endif#ifndef uchar#define uchar unsigned char#endif#ifdef HAVE_UNSIGNED_CHAR#define schar signed char#else#define schar char#endif/* Samba needs type definitions for int16, int32, uint16 and uint32. Normally these are signed and unsigned 16 and 32 bit integers, but they actually only need to be at least 16 and 32 bits respectively. Thus if your word size is 8 bytes just defining them as signed and unsigned int will work.*/#ifndef uint8#define uint8 unsigned char#endif#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)#if (SIZEOF_SHORT == 4)#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;#else /* SIZEOF_SHORT != 4 */#define int16 short#endif /* SIZEOF_SHORT != 4 */#endif/* * Note we duplicate the size tests in the unsigned * case as int16 may be a typedef from rpc/rpc.h */#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)#if (SIZEOF_SHORT == 4)#define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;#else /* SIZEOF_SHORT != 4 */#define uint16 unsigned short#endif /* SIZEOF_SHORT != 4 */#endif#if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)#if (SIZEOF_INT == 4)#define int32 int#elif (SIZEOF_LONG == 4)#define int32 long#elif (SIZEOF_SHORT == 4)#define int32 short#else/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */#define int32 int#endif#endif/* * Note we duplicate the size tests in the unsigned * case as int32 may be a typedef from rpc/rpc.h */#if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)#if (SIZEOF_INT == 4)#define uint32 unsigned int#elif (SIZEOF_LONG == 4)#define uint32 unsigned long#elif (SIZEOF_SHORT == 4)#define uint32 unsigned short#else/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */#define uint32 unsigned#endif#endif/* * Types for devices, inodes and offsets. */#ifndef SMB_DEV_T# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)# define SMB_DEV_T dev64_t# else# define SMB_DEV_T dev_t# endif#endif#ifndef LARGE_SMB_DEV_T# if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))# define LARGE_SMB_DEV_T 1# endif#endif#ifdef LARGE_SMB_DEV_T#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32)))#else #define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0))#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs))))#endif/* * Setup the correctly sized inode type. */#ifndef SMB_INO_T# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)# define SMB_INO_T ino64_t# else# define SMB_INO_T ino_t# endif#endif#ifndef LARGE_SMB_INO_T# if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))# define LARGE_SMB_INO_T 1# endif#endif#ifdef LARGE_SMB_INO_T#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32)))#else #define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))#endif#ifndef SMB_OFF_T# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)# define SMB_OFF_T off64_t# else# define SMB_OFF_T off_t# endif#endif#if defined(HAVE_LONGLONG)#define SMB_BIG_UINT unsigned long long#define SMB_BIG_INT long long#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))#else#define SMB_BIG_UINT unsigned long#define SMB_BIG_INT long#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))#endif#define SMB_BIG_UINT_BITS (sizeof(SMB_BIG_UINT)*8)/* this should really be a 64 bit type if possible */#define br_off SMB_BIG_UINT#define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)/* * Set the define that tells us if we can do 64 bit * NT SMB calls. */#ifndef LARGE_SMB_OFF_T# if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))# define LARGE_SMB_OFF_T 1# endif#endif#ifdef LARGE_SMB_OFF_T#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32))#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF) )))#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \ (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )#else #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0))#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF )))#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \ (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) )#endif/* * Type for stat structure. */#ifndef SMB_STRUCT_STAT# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STAT64) && defined(HAVE_OFF64_T)# define SMB_STRUCT_STAT struct stat64# else# define SMB_STRUCT_STAT struct stat# endif#endif/* * Type for dirent structure. */#ifndef SMB_STRUCT_DIRENT# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIRENT64)# define SMB_STRUCT_DIRENT struct dirent64# else# define SMB_STRUCT_DIRENT struct dirent# endif#endif/* * Type for DIR structure. */#ifndef SMB_STRUCT_DIR# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)# define SMB_STRUCT_DIR DIR64# else# define SMB_STRUCT_DIR DIR# endif#endif/* * Defines for 64 bit fcntl locks. */#ifndef SMB_STRUCT_FLOCK# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)# define SMB_STRUCT_FLOCK struct flock64# else# define SMB_STRUCT_FLOCK struct flock# endif#endif#ifndef SMB_F_SETLKW# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)# define SMB_F_SETLKW F_SETLKW64# else# define SMB_F_SETLKW F_SETLKW# endif#endif#ifndef SMB_F_SETLK# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)# define SMB_F_SETLK F_SETLK64# else# define SMB_F_SETLK F_SETLK# endif#endif#ifndef SMB_F_GETLK# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)# define SMB_F_GETLK F_GETLK64# else# define SMB_F_GETLK F_GETLK# endif#endif/* * Type for aiocb structure. */#ifndef SMB_STRUCT_AIOCB# if defined(WITH_AIO)# if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_AIOCB64)# define SMB_STRUCT_AIOCB struct aiocb64# else# define SMB_STRUCT_AIOCB struct aiocb# endif# else# define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */# endif#endif#ifndef HAVE_STRUCT_TIMESPECstruct timespec { time_t tv_sec; /* Seconds. */ long tv_nsec; /* Nanoseconds. */};#endif#ifndef MIN#define MIN(a,b) ((a)<(b)?(a):(b))#endif#ifndef MAX#define MAX(a,b) ((a)>(b)?(a):(b))#endif#ifndef HAVE_STRERRORextern char *sys_errlist[];#define strerror(i) sys_errlist[i]#endif#ifndef HAVE_ERRNO_DECLextern int errno;#endif#ifdef HAVE_BROKEN_GETGROUPS#define GID_T int#else#define GID_T gid_t#endif#ifndef NGROUPS_MAX#define NGROUPS_MAX 32 /* Guess... */#endif#ifdef SOCKET_WRAPPER#define SOCKET_WRAPPER_REPLACE#include "include/socket_wrapper.h"#endif/* Our own pstrings and fstrings */#include "pstring.h"/* Lists, trees, caching, database... */#include "xfile.h"#include "intl.h"#include "ubi_sLinkList.h"#include "ubi_dLinkList.h"#include "dlinklist.h"#include "tdb/tdb.h"#include "tdb/spinlock.h"#include "tdb/tdbutil.h"#include "talloc.h"/* And a little extension. Abort on type mismatch */#define talloc_get_type_abort(ptr, type) \ (type *)talloc_check_name_abort(ptr, #type)#include "nt_status.h"#include "ads.h"#include "interfaces.h"#include "trans2.h"#include "nterr.h"#include "ntioctl.h"#include "messages.h"#include "charset.h"#include "dynconfig.h"#include "util_getent.h"#ifndef UBI_BINTREE_H#include "ubi_Cache.h"#endif /* UBI_BINTREE_H */#include "debugparse.h"#include "version.h"#include "privileges.h"#include "smb.h"#include "nameserv.h"#include "secrets.h"#include "byteorder.h"#include "privileges.h"#include "rpc_misc.h"#include "rpc_dce.h"#include "mapping.h"#include "passdb.h"#include "rpc_secdes.h"#include "authdata.h"#include "msdfs.h"#include "smbprofile.h"#include "rap.h"#include "md5.h"#include "hmacmd5.h"#include "ntlmssp.h"#include "auth.h"#include "ntdomain.h"#include "rpc_svcctl.h"#include "rpc_ntsvcs.h"#include "rpc_lsa.h"#include "rpc_netlogon.h"#include "reg_objects.h"#include "rpc_reg.h"#include "rpc_samr.h"#include "rpc_srvsvc.h"#include "rpc_wkssvc.h"#include "rpc_spoolss.h"#include "rpc_eventlog.h"#include "rpc_dfs.h"#include "rpc_ds.h"#include "rpc_echo.h"#include "rpc_shutdown.h"#include "rpc_perfcount.h"#include "rpc_perfcount_defs.h"#include "nt_printing.h"#include "idmap.h"#include "client.h"#ifdef WITH_SMBWRAPPER#include "smbw.h"#endif#include "session.h"#include "asn_1.h"#include "popt.h"#include "mangle.h"#include "module.h"#include "nsswitch/winbind_client.h"#include "spnego.h"#include "rpc_client.h"/* * Type for wide character dirent structure. * Only d_name is defined by POSIX. */typedef struct smb_wdirent { wpstring d_name;} SMB_STRUCT_WDIRENT;/* * Type for wide character passwd structure. */typedef struct smb_wpasswd { wfstring pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; wpstring pw_gecos; wpstring pw_dir; wpstring pw_shell;} SMB_STRUCT_WPASSWD;/* used in net.c */struct functable { const char *funcname; int (*fn)(int argc, const char **argv);};/* Defines for wisXXX functions. */#define UNI_UPPER 0x1#define UNI_LOWER 0x2#define UNI_DIGIT 0x4#define UNI_XDIGIT 0x8#define UNI_SPACE 0x10#include "nsswitch/winbind_nss.h"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -