Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / tt / lib / util / tt_port.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
24 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
25 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
26 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
27 /*%%  $XConsortium: tt_port.h /main/3 1995/10/23 10:43:42 rswiston $                                                     */
28 /* @(#)tt_port.h        1.12 93/09/07
29  *
30  * tt_port.h
31  *
32  * Routines for centralizing portability problems.
33  *
34  * Copyright (c) 1992 by Sun Microsystems, Inc.
35  */
36
37 #if !defined(_TT_PORT_H)
38 #define _TT_PORT_H
39
40 #include <sys/wait.h>
41 #include "tt_options.h"
42
43 // WCOREDUMP is a semi-useful BSDism which we use to print (core dumped)
44 // after subprocess termination messages.  If it's not available,
45 // like on AIX, just suppress the message.
46 #if !defined(WCOREDUMP)
47 #define WCOREDUMP(x) (0)
48 #endif
49
50
51 #if defined(OPT_BSD_WAIT)
52         typedef union wait      _Tt_wait_status;
53 #else
54         typedef int             _Tt_wait_status;
55 #endif
56
57 #include <stdio.h>
58 #include <signal.h>
59 #include <stdarg.h>
60 #include <syslog.h>
61 #include "util/tt_string.h"
62 #if defined(OPT_DEFINE_SIG_PF)
63         typedef void (*SIG_PF)(int);
64 #endif
65
66 #if defined(OPT_BUG_USL) ||  defined(OPT_BUG_UXP)
67 #if !defined(MNTTYPE_NFS)
68 #define MNTTYPE_NFS "nfs"
69 #endif
70 #endif
71
72 _Tt_string      _tt_gethostname(void);
73 int     _tt_getdtablesize(void);
74 int     _tt_zoomdtablesize(void);
75 int     _tt_restoredtablesize(void);
76 long    _tt_gethostid(void);
77 int     _tt_sigset(int sig, SIG_PF handler);
78 char   *_tt_putenv(const char *variable, const char *value);
79 char   *_tt_get_first_set_env_var(int i_num_names, ...);
80 int     _tt_put_all_env_var (int i_num_names, const char* pc_val, ...);
81 void    _tt_openlog(const char *prefix, int logopt, int facility);
82
83 //
84 // Log to sink, or use syslog() if sink is 0
85 //
86 void    _tt_syslog(FILE *sink, int priority, const char *format, ...);
87 void    _tt_vsyslog(FILE *sink, int priority, const char *format, va_list args);
88
89 #endif