2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 /* Include afs installation dir retrieval routines */
15 #include <afs/dirpath.h>
17 /* These macros are return values from extractAddr. They do not represent
18 * any valid IP address and so can indicate a failure.
20 #define AFS_IPINVALID 0xffffffff /* invalid IP address */
21 #define AFS_IPINVALIDIGNORE 0xfffffffe /* no input given to extractAddr */
28 extern int mrafsStyleLogs;
30 extern int serverLogSyslog;
31 extern int serverLogSyslogFacility;
32 extern char *serverLogSyslogTag;
34 extern void vFSLog(const char *format, va_list args);
35 extern void SetLogThreadNumProgram(int (*func) () );
37 /*@printflike@*/ extern void FSLog(const char *format, ...);
38 #define ViceLog(level, str) if ((level) <= LogLevel) (FSLog str)
39 #define vViceLog(level, str) if ((level) <= LogLevel) (vFSLog str)
41 extern int OpenLog(const char *filename);
42 extern int ReOpenLog(const char *fileName);
43 extern void SetupLogSignals(void);
46 afs_vsnprintf( /*@out@ */ char *p, size_t avail, const char *fmt,
48 /*@requires maxSet(p) >= (avail-1)@ */
51 extern /*@printflike@ */ int
52 afs_snprintf( /*@out@ */ char *p, size_t avail,
54 /*@requires maxSet(p) >= (avail-1)@ */
58 /* special version of ctime that clobbers a *different static variable, so
59 * that ViceLog can call ctime and not cause buffer confusion.
61 extern char *vctime(const time_t * atime);
63 /* Need a thead safe ctime for pthread builds. Use std ctime for LWP */
64 #if defined(AFS_PTHREAD_ENV) && !defined(AFS_NT40_ENV)
66 #define afs_ctime(C, B, L) ctime_r(C, B, L)
68 /* Cast is for platforms which do not prototype ctime_r */
69 #define afs_ctime(C, B, L) (char*)ctime_r(C, B)
70 #endif /* AFS_SUN5_ENV */
71 #else /* AFS_PTHREAD_ENV && !AFS_NT40_ENV */
72 #define afs_ctime(C, B, S) \
73 ((void)strncpy(B, ctime(C), (S-1)), (B)[S-1] = '\0', (B))
74 #endif /* AFS_PTHREAD_ENV && !AFS_NT40_ENV */
77 /* abort the current process. */
79 #define afs_abort() afs_NTAbort()
81 #define afs_abort() abort()
90 /* Initialize the windows sockets before calling networking routines. */
91 extern int afs_winsockInit(void);
94 int tz_minuteswest; /* of Greenwich */
95 int tz_dsttime; /* type of dst correction to apply */
97 #define gettimeofday afs_gettimeofday
98 int afs_gettimeofday(struct timeval *tv, struct timezone *tz);
100 /* Unbuffer output when Un*x would do line buffering. */
101 #define setlinebuf(S) setvbuf(S, NULL, _IONBF, 0)
103 /* regular expression parser for NT */
104 extern char *re_comp(char *sp);
105 extern int rc_exec(char *p);
107 /* Abort on error, possibly trapping to debugger or dumping a trace. */
108 void afs_NTAbort(void);
111 typedef char b32_string_t[8];
112 /* b64_string_t is 8 bytes, in stds.h */
113 typedef char lb64_string_t[12];
116 #include "afs/ktime.h"
118 #include "afsutil_prototypes.h"
120 #endif /* _AFSUTIL_H_ */