Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / tt / lib / util / tt_port.h
1 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
2 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
3 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
4 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
5 /*%%  $XConsortium: tt_port.h /main/3 1995/10/23 10:43:42 rswiston $                                                     */
6 /* @(#)tt_port.h        1.12 93/09/07
7  *
8  * tt_port.h
9  *
10  * Routines for centralizing portability problems.
11  *
12  * Copyright (c) 1992 by Sun Microsystems, Inc.
13  */
14
15 #if !defined(_TT_PORT_H)
16 #define _TT_PORT_H
17
18 #include <sys/wait.h>
19 #include "tt_options.h"
20
21 // WCOREDUMP is a semi-useful BSDism which we use to print (core dumped)
22 // after subprocess termination messages.  If it's not available,
23 // like on AIX, just suppress the message.
24 #if !defined(WCOREDUMP)
25 #define WCOREDUMP(x) (0)
26 #endif
27
28
29 #if defined(OPT_BSD_WAIT)
30         typedef union wait      _Tt_wait_status;
31 #else
32         typedef int             _Tt_wait_status;
33 #endif
34
35 #include <stdio.h>
36 #include <signal.h>
37 #include <stdarg.h>
38 #include <syslog.h>
39 #include "util/tt_string.h"
40 #if defined(OPT_DEFINE_SIG_PF)
41         typedef void (*SIG_PF)(int);
42 #endif
43
44 #if defined(OPT_BUG_USL) ||  defined(OPT_BUG_UXP)
45 #if !defined(MNTTYPE_NFS)
46 #define MNTTYPE_NFS "nfs"
47 #endif
48 #endif
49
50 _Tt_string      _tt_gethostname(void);
51 int     _tt_getdtablesize(void);
52 int     _tt_zoomdtablesize(void);
53 int     _tt_restoredtablesize(void);
54 long    _tt_gethostid(void);
55 int     _tt_sigset(int sig, SIG_PF handler);
56 char   *_tt_putenv(const char *variable, const char *value);
57 char   *_tt_get_first_set_env_var(int i_num_names, ...);
58 int     _tt_put_all_env_var (int i_num_names, const char* pc_val, ...);
59 void    _tt_openlog(const char *prefix, int logopt, int facility);
60
61 //
62 // Log to sink, or use syslog() if sink is 0
63 //
64 void    _tt_syslog(FILE *sink, int priority, const char *format, ...);
65 void    _tt_vsyslog(FILE *sink, int priority, const char *format, va_list args);
66
67 #endif