home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / contrib / samba / samba-1.8 / samba-1 / samba-1.8.05 / includes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-27  |  10.2 KB  |  572 lines

  1. #include "local.h"
  2. #include <stdio.h>
  3. #ifdef MIPS
  4. #include <posix/stdlib.h>
  5. #else
  6. #include <stdlib.h>
  7. #endif /* MIPS */
  8. #include <ctype.h>
  9. #include <time.h>
  10. #if (!(defined(sun386) || defined(NEXT2) || defined(NEXT3_0) || defined(APOLLO) || defined(MIPS)))
  11. #include <utime.h>
  12. #endif
  13. #include <sys/types.h>
  14. #include <sys/socket.h>
  15. #include <sys/ioctl.h>
  16. #include <stddef.h>
  17. #ifdef MIPS
  18. #include <posix/utime.h>
  19. #include <bsd/sys/time.h>
  20. #include <bsd/netinet/in.h>
  21. #else
  22. #include <sys/time.h>
  23. #include <netinet/in.h>
  24. #endif /* MIPS */
  25. #include <netdb.h>
  26. #include <signal.h>
  27. #include <errno.h>
  28. #include <sys/file.h>
  29. #include <sys/stat.h>
  30. #include <sys/param.h>
  31. #include <grp.h>
  32. #ifndef APOLLO
  33. #include <sys/mount.h>
  34. #endif
  35. #include <pwd.h>
  36. #ifdef __STDC__
  37. #include <stdarg.h>
  38. #else
  39. #include <varargs.h>
  40. #endif
  41. #if !defined( NEXT3_0 ) && !defined( APOLLO )
  42. #include <unistd.h>
  43. #endif
  44. #include <sys/wait.h>
  45. #ifdef CLIX    /* need rusage structure */
  46. #include <sys/resource.h>
  47. #endif    /* end CLIX */
  48. #ifdef ISC
  49. #include <sys/stream.h>
  50. #endif
  51. #ifdef MIPS
  52. #include <bsd/net/if.h>
  53. #else
  54. #include <net/if.h>
  55. #endif
  56.  
  57. #if USE_MMAP
  58. #include <sys/mman.h>
  59. #endif
  60.  
  61. #if defined(GETPWANAM)
  62. #include <sys/types.h>
  63. #include <sys/label.h>
  64. #include <sys/audit.h>
  65. #include <pwdadj.h>
  66. #endif
  67.  
  68. #if defined(SHADOW_PWD) && !defined(NETBSD)
  69. #include <shadow.h>
  70. #endif
  71.  
  72. #ifdef LINUX
  73. #include <arpa/inet.h>
  74. #include <dirent.h>
  75. #include <string.h>
  76. #include <sys/vfs.h>
  77. #define SIGNAL_CAST (__sighandler_t)
  78. #define HAVE_TIMEZONE
  79. #define HAVE_SYSCONF 1
  80. #define USE_GETCWD
  81. #endif
  82.  
  83. #ifdef SUN
  84. #define HAVE_TIMELOCAL
  85. #include <sys/dirent.h>
  86. #include <sys/acct.h>
  87. #include <sys/vfs.h>
  88. #include <string.h>
  89. #include <errno.h>
  90. #ifndef sun386
  91. #include <utime.h>
  92. #endif
  93. #include <sys/wait.h>
  94. #include <signal.h>
  95. #ifdef sun386
  96. /* Things we need to change for sun386i */
  97. #define NO_STRFTIME
  98. #ifdef PWDAUTH
  99. #undef PWDAUTH
  100. #endif
  101. #define strerror strerror
  102. struct utimbuf {
  103.   time_t actime;
  104.   time_t modtime;
  105. };
  106. typedef unsigned short mode_t;
  107. #endif
  108. #ifndef strerror
  109. extern char *sys_errlist[];
  110. #define strerror(i) sys_errlist[i]
  111. #endif
  112. #endif
  113.  
  114. #ifdef SOLARIS
  115. #include <sys/fcntl.h>
  116. #include <dirent.h>
  117. #include <sys/acct.h>
  118. #include <sys/statfs.h>
  119. #include <sys/statvfs.h>
  120. #include <sys/vfs.h>
  121. #include <sys/filio.h>
  122. #include <string.h>
  123. #define HAVE_TIMEZONE
  124. #define SIGNAL_CAST (void (*)(int))
  125. #define SYSV
  126. #define USE_WAITPID
  127. #define REPLACE_STRLEN
  128. #define USE_STATVFS
  129. #define USE_GETCWD
  130. #endif
  131.  
  132. #ifdef SGI
  133. #include <sys/statfs.h>
  134. #include <string.h>
  135. #include <signal.h>
  136. #define SYSV
  137. #define SIGNAL_CAST (void (*)())
  138. #define STATFS4
  139. #endif
  140.  
  141. #ifdef MIPS
  142. #include <bsd/net/soioctl.h>
  143. #include <string.h>
  144. #include <dirent.h>
  145. #include <fcntl.h>
  146. #include <sys/statfs.h>
  147. #include <sys/wait.h>
  148. #include <sys/termio.h>
  149. #define SIGNAL_CAST (void (*)())
  150. typedef int mode_t;
  151. extern struct group *getgrnam();
  152. extern struct passwd *getpwnam();
  153. #define HAVE_TIMEZONE
  154. #define STATFS4
  155. #ifndef strerror
  156. extern char *sys_errlist[];
  157. #define strerror(i) sys_errlist[i]
  158. #endif /* ! strerror */
  159. #define REPLACE_STRSTR
  160. #endif /* MIPS */
  161.  
  162.  
  163. #ifdef DGUX
  164. #include <string.h>
  165. #include <dirent.h>
  166. #include <sys/statfs.h>
  167. #include <sys/statvfs.h>
  168. #include <fcntl.h>
  169. #include <termios.h>
  170. #define SYSV
  171. #define USE_WAITPID
  172. #define HAVE_TIMEZONE
  173. #define SIGNAL_CAST (void (*)(int))
  174. #define USE_STATVFS
  175. #define USE_GETCWD
  176. #endif
  177.  
  178. #ifdef SVR4
  179. #include <string.h>
  180. #include <sys/dir.h>
  181. #include <dirent.h>
  182. #include <sys/statfs.h>
  183. #include <sys/statvfs.h>
  184. #include <sys/vfs.h>
  185. #include <sys/filio.h>
  186. #include <fcntl.h>
  187. #include <sys/sockio.h>
  188. #include <termios.h>
  189. #define SYSV
  190. #define USE_WAITPID
  191. #define HAVE_TIMEZONE
  192. #define SIGNAL_CAST (void (*)(int))
  193. #define USE_STATVFS
  194. #define USE_GETCWD
  195. #endif
  196.  
  197. #ifdef ULTRIX
  198. #include <strings.h>
  199. #include <nfs/nfs_clnt.h>
  200. #include <nfs/vfs.h>
  201. #ifdef ULTRIX_AUTH
  202. #include <auth.h>
  203. #endif
  204. char *getwd(char *);
  205. #define GID_TYPE int
  206. #define NOSTRDUP
  207. #ifdef __STDC__
  208. #define SIGNAL_CAST (void(*)(int))
  209. #endif
  210. #endif
  211.  
  212. #ifdef OSF1
  213. #include <strings.h>
  214. #include <dirent.h>
  215. char *getwd(char *);
  216. #define STATFS3
  217. #define USE_F_FSIZE
  218. #ifdef OSF1_ENH_SEC
  219. #include <pwd.h>
  220. #include <sys/types.h>
  221. #include <sys/security.h>
  222. #include <prot.h>
  223. #include <unistd.h>
  224. #endif  /* OSF1_ENH_SEC */
  225. #endif
  226.  
  227. #ifdef CLIX
  228. #include <dirent.h>
  229. #define SIGNAL_CAST    (void (*)())
  230. #include <sys/fcntl.h>
  231. #include <sys/statfs.h>
  232. #define HAVE_TIMEZONE
  233. #include <string.h>
  234. #define NO_EID
  235. #define USE_WAITPID
  236. #define STATFS4
  237. #define NO_FSYNC
  238. #define USE_GETCWD
  239. #define USE_SETSID
  240. #define NO_INITGROUPS
  241. #endif    /* CLIX */
  242.  
  243.  
  244. #ifdef BSDI
  245. #include <string.h>
  246. #define USE_F_FSIZE
  247. #endif
  248.  
  249. #ifdef NETBSD
  250. #include <strings.h>
  251. /* you may not need this */
  252. #define NO_GETSPNAM
  253. #define SIGNAL_CAST (void (*)())
  254. #endif 
  255.  
  256.  
  257. #ifdef FreeBSD
  258. #include <strings.h>
  259. #define SIGNAL_CAST (void (*)())
  260. #define GID_TYPE int
  261. #endif 
  262.  
  263.  
  264. #ifdef AIX
  265. #include <strings.h>
  266. #include <sys/dir.h>
  267. #include <sys/select.h>
  268. #include <dirent.h>
  269. #include <sys/statfs.h>
  270. #include <sys/vfs.h>
  271. #include <sys/id.h>
  272. #include <sys/priv.h>
  273. #define HAVE_TIMEZONE
  274. #define SYSV
  275. #define USE_WAITPID
  276. #define SIGNAL_CAST (void (*)())
  277. #endif
  278.  
  279. #ifdef HPUX
  280. #include <string.h>
  281. #include <dirent.h>
  282. #include <fcntl.h>
  283. #include <sys/vfs.h>
  284. #include <sys/types.h>
  285. #include <netinet/tcp.h>
  286. #define SIGNAL_CAST (void (*)(__harg))
  287. #define SELECT_CAST (int *)
  288. #define HAVE_TIMEZONE
  289. #define SYSV
  290. #define USE_WAITPID
  291. #define WAIT3_CAST2 (int *)
  292. #define USE_GETCWD
  293. #define USE_SETSID
  294. #define USE_SETRES
  295. #endif
  296.  
  297. #ifdef SEQUENT
  298. char *strchr();
  299. char *strrchr();
  300. typedef int mode_t;
  301. #define SEEK_SET 0
  302. #endif
  303.  
  304. #ifdef NEXT
  305. #include <strings.h>
  306. #include <sys/dir.h>
  307. #include <dirent.h>
  308. #include <sys/vfs.h>
  309. #define bzero(b,len) memset(b,0,len)
  310. #include <libc.h>
  311. #define NOSTRDUP
  312. #define USE_WAITPID
  313. #define NO_STRFTIME
  314. #define USE_GETCWD
  315. #define WAIT3_CAST1 (union wait *)
  316. #endif
  317.  
  318. #ifdef NEXT2
  319. #include <sys/types.h>
  320. #include <strings.h>
  321. #include <dirent.h>
  322. #include <sys/vfs.h>
  323. #define bzero(b,len) memset(b,0,len)
  324. #define mode_t int
  325. struct utimbuf {
  326.   time_t actime;
  327.   time_t modtime;
  328. };
  329. #include <libc.h>
  330. #define NOSTRDUP
  331. #define USE_DIRECT
  332. #define USE_WAITPID
  333. #endif 
  334.  
  335. #ifdef NEXT3_0
  336. #include <strings.h>
  337. #include <sys/dir.h>
  338. #include <sys/vfs.h>
  339. #define bzero(b,len) memset(b,0,len)
  340. struct utimbuf {
  341.   time_t actime;
  342.   time_t modtime;
  343. };
  344. #include <libc.h>
  345. #define NOSTRDUP
  346. #define USE_DIRECT
  347. #define mode_t int
  348. #endif
  349.  
  350.  
  351. #ifdef APOLLO
  352. #include <string.h>
  353. #include <fcntl.h>
  354. #include <sys/statfs.h>
  355. struct utimbuf {
  356.   time_t actime;
  357.   time_t modtime;
  358. };
  359. #define USE_DIRECT
  360. #define USE_GETCWD
  361. #define SIGNAL_CAST     (void (*)())
  362. #define HAVE_FCNTL_LOCK 0
  363.  
  364. #define HAVE_GETTIMEOFDAY
  365. #define STATFS4
  366. /* Define Posix stat flags if needed */
  367. #ifndef S_IFREG
  368. #define S_IFREG 0100000
  369. #endif
  370. #ifndef S_ISREG
  371. #define S_ISREG(mode)   ((mode & 0xF000) == S_IFDIR)
  372. #endif
  373.  
  374. #endif
  375.  
  376.  
  377. #ifdef SCO
  378. #include <dirent.h>
  379. #include <string.h>
  380. #include <fcntl.h>
  381. #include <sys/statfs.h>
  382. #include <sys/stropts.h>
  383. #ifdef NETGROUP
  384. #include <rpcsvc/ypclnt.h>
  385. #endif
  386. #ifdef SecureWare
  387. #include <sys/security.h>
  388. #include <sys/audit.h>
  389. #include <prot.h>
  390. #define crypt bigcrypt
  391. #endif
  392. #define ftruncate(f,l) syscall(0x0a28,f,l)
  393. #define HAVE_TIMEZONE
  394. #define SIGNAL_CAST (void (*)(int))
  395. #define USE_WAITPID
  396. #define USE_GETCWD
  397. #define USE_SETSID
  398. #define USE_IFREQ
  399. #define STATFS4
  400. #define NO_FSYNC
  401. #define NO_INITGROUPS
  402. #endif
  403.  
  404. #ifdef ISC
  405. #include <net/errno.h>
  406. #include <string.h>
  407. #include <sys/dir.h>
  408. #include <dirent.h>
  409. #include <sys/statfs.h>
  410. #include <fcntl.h>
  411. #include <sys/sioctl.h>
  412. #include <stropts.h>
  413. #define FIONREAD FIORDCHK
  414. #define SYSV
  415. #define USE_WAITPID
  416. #define SIGNAL_CAST (void (*)(int))
  417. #define USE_GETCWD
  418. #define USE_SETSID
  419. #define USE_IFREQ
  420. #define NO_FTRUNCATE
  421. #define STATFS4
  422. #define NO_FSYNC
  423. #define HAVE_TIMEZONE
  424. #endif
  425.  
  426.  
  427. #ifdef KANJI
  428. #ifndef _KANJI_C_
  429. #include "kanji.h"
  430. #endif /* _KANJI_C_ */
  431. #endif /* KANJI */
  432.  
  433. #ifdef NO_GETSPNAM
  434. struct spwd { /* fake shadow password structure */
  435.        char *sp_pwdp;
  436. };
  437. struct spwd *getspnam(char *username); /* fake shadow password routine */
  438. #endif
  439.  
  440. #ifdef USE_DIRECT
  441. #include <sys/dir.h>
  442. #endif
  443.  
  444. /* this unix might use int for gid_t (eg: Ultrix) */
  445. #ifndef GID_TYPE
  446. #define GID_TYPE gid_t
  447. #endif
  448.  
  449. #include "version.h"
  450. #include "smb.h"
  451.  
  452. #ifdef UFC_CRYPT
  453. #define crypt ufc_crypt
  454. #endif
  455.  
  456. #ifdef REPLACE_STRLEN
  457. #define strlen(s) Strlen(s)
  458. #endif
  459.  
  460. #ifdef REPLACE_STRSTR
  461. #define strstr(s,p) Strstr(s,p)
  462. #endif
  463.  
  464. #ifndef NGROUPS_MAX
  465. #define NGROUPS_MAX 128
  466. #endif
  467.  
  468. #ifndef EDQUOT
  469. #define EDQUOT ENOSPC
  470. #endif
  471.  
  472. #ifndef HAVE_SYSCONF
  473. #define HAVE_SYSCONF 0
  474. #endif
  475.  
  476. #ifndef HAVE_GETGRNAM
  477. #define HAVE_GETGRNAM 1
  478. #endif
  479.  
  480. #ifndef SOL_TCP
  481. #define SOL_TCP 6
  482. #endif
  483.  
  484. /* default to using ftruncate workaround as this is safer than assuming
  485. it works and getting lots of bug reports */
  486. #ifndef FTRUNCATE_CAN_EXTEND
  487. #define FTRUNCATE_CAN_EXTEND 0
  488. #endif
  489.  
  490. /* maybe this unix doesn't separate RD and WR locks? */
  491. #ifndef F_RDLCK
  492. #define F_RDLCK F_WRLCK
  493. #endif
  494.  
  495. #ifndef ENOTSOCK
  496. #define ENOTSOCK EINVAL
  497. #endif
  498.  
  499. #ifndef SIGCLD
  500. #define SIGCLD SIGCHLD
  501. #endif 
  502.  
  503. #ifndef HAVE_FCNTL_LOCK
  504. #define HAVE_FCNTL_LOCK 1
  505. #endif
  506.  
  507. #ifndef WAIT3_CAST2
  508. #define WAIT3_CAST2 (struct rusage *)
  509. #endif
  510.  
  511. #ifndef WAIT3_CAST1
  512. #define WAIT3_CAST1 (int *)
  513. #endif
  514.  
  515.  
  516.  
  517. #ifdef NO_EID
  518. #define geteuid() getuid()
  519. #define getegid() getgid()
  520. #define seteuid(x) setuid(x)
  521. #define setegid(x) setgid(x)
  522. #endif
  523.  
  524.  
  525. #if (HAVE_FCNTL_LOCK == 0)
  526. /* since there is no locking available, system includes  */
  527. /* for DomainOS 10.4 do not contain any of the following */
  528. /* #define's. So, to satisfy the compiler, add these     */
  529. /* #define's, although they arn't really necessary.      */
  530. #define F_GETLK 0
  531. #define F_SETLK 0
  532. #define F_WRLCK 0
  533. #define F_UNLCK 0
  534. #endif /* HAVE_FCNTL_LOCK == 0 */
  535.  
  536.  
  537. /* possibly wrap the malloc calls */
  538. #if WRAP_MALLOC
  539.  
  540. /* undo the old malloc def if necessary */
  541. #ifdef malloc
  542. #define xx_old_malloc malloc
  543. #undef malloc
  544. #endif
  545.  
  546. #define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
  547.  
  548. /* undo the old realloc def if necessary */
  549. #ifdef realloc
  550. #define xx_old_realloc realloc
  551. #undef realloc
  552. #endif
  553.  
  554. #define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
  555.  
  556. /* undo the old free def if necessary */
  557. #ifdef free
  558. #define xx_old_free free
  559. #undef free
  560. #endif
  561.  
  562. #define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
  563.  
  564. /* and the malloc prototypes */
  565. void *malloc_wrapped(int,char *,int);
  566. void *realloc_wrapped(void *,int,char *,int);
  567. void free_wrapped(void *,char *,int);
  568.  
  569. #endif
  570.  
  571.  
  572.