1 /* $Id$
2  *  GNU C for BeOS compiler-specific declarations
3  *
4  * HUSKYLIB: common defines, types and functions for HUSKY
5  *
6  * This is part of The HUSKY Fidonet Software project:
7  * see http://husky.sourceforge.net for details
8  *
9  *
10  * HUSKYLIB is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * HUSKYLIB is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; see file COPYING. If not, write to the
22  * Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  * See also http://www.gnu.org, license may be found here.
25  */
26 
27 /* BeOS 5.x (Unix clone, GNU C) */
28 
29 #ifndef HUSKY_BEOS5_H
30 #define HUSKY_BEOS5_H
31 
32 #ifndef __GNUC__
33   #error This file may be used only with GNU C !
34 #endif
35 
36 #ifndef __BEOS__
37   #error This file may be used only with GNU C on BeOS
38 #endif
39 
40 
41 #  define _XPENTRY
42 #  define _intr
43 #  define _intcast
44 #  define _veccast
45 #  define _fast
46 #  define _loadds
47 #  ifndef _stdc
48 #    define _stdc     /*__stdcall*/ /* produce compiler warnings */
49 #  endif
50 #  ifndef cdecl
51 #    define cdecl     __cdecl
52 #  endif
53 
54 #  define pascal
55 #  define near
56 #  undef  far
57 #  define far
58 
59 #  define farread read
60 #  define farwrite write
61 
62 #  define mymkdir(a) mkdir((a), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
63 
64 #  define tell(a) lseek((a),0,SEEK_CUR)
65 
66 #  include <fcntl.h>
67 
68 #  ifndef SH_DENYNONE
69 #    define SH_DENYNONE 0
70 #  endif
71 #  ifndef SH_DENYNO
72 #    define SH_DENYNO 0
73 #  endif
74 #  ifndef SH_DENYALL
75 #    define SH_DENYALL 1
76 #  endif
77 
78 #  define mysleep(x) sleep(x)
79 /*#  define sleep(x) snooze(x*1000000l)   use sleep() from unistd.h */
80 #  define HAS_sleep     1
81 #  define HAS_mktime	1  /* in <time.h> */
82 #  define HAS_strftime	1  /* in <time.h> */
83 #  define HAS_snprintf  1
84 #  define HAS_vsnprintf 1
85 #  define HAS_popen_close 1 /* popen(); pclose() */
86 #  define HAS_strcasecmp  1
87 #  define HAS_strncasecmp 1
88 #  define HAS_strlwr      1
89 #  define HAS_strupr      1
90 
91 #  define stricmp(s1,s2) strcasecmp(s1,s2)
92 #  define strnicmp(s1,s2,z) strncasecmp(s1,s2,z)
93 
94 #  define HAS_DIRENT_H         1  /* <dirent.h> */
95 #  define HAS_UNISTD_H         1  /*? <unistd.h> conflicts with be/kernel/OS.h ?*/
96 #  define HAS_PWD_H            1  /* <pwd.h> */
97 #  define HAS_GRP_H            1  /* may be used "#include <grp.h>" */
98 #  define HAS_SIGNAL_H         1  /* <signal.h> */
99 #  define USE_STAT_MACROS      1
100 #  define HAS_SYS_PARAM_H      1
101 #  define HAS_SYS_SYSEXITS_H   1  /*  <sys/sysexits.h> */
102 #  define HAS_SYS_WAIT_H       1  /* <sys/wait.h> */
103 #  define HAS_SYS_STATVFS_H    1
104 
105 typedef unsigned bit;
106 
107 typedef unsigned char byte;
108 typedef signed char sbyte;
109 
110 typedef unsigned short word;
111 typedef signed short sword;
112 
113 typedef unsigned long dword;
114 typedef signed long sdword;
115 
116 typedef signed short sshort;
117 typedef unsigned short ushort;
118 
119 typedef signed long slong;
120 typedef unsigned long ulong;
121 
122 
123 typedef   signed char        hCHAR;              /*  1 byte */
124 typedef   signed char       hSCHAR;              /*  1 byte */
125 typedef unsigned char       hUCHAR;              /*  1 byte */
126 
127 typedef   signed char        hINT8;              /*  1 byte */
128 typedef   signed char       hSINT8;              /*  1 byte */
129 typedef unsigned char       hUINT8;              /*  1 byte */
130 
131 typedef   signed short      hINT16;              /*  2 bytes */
132 typedef   signed short     hSINT16;              /*  2 bytes */
133 typedef unsigned short     hUINT16;              /*  2 bytes */
134 
135 typedef   signed int        hINT32;              /*  4 bytes */
136 typedef   signed int       hSINT32;              /*  4 bytes */
137 typedef unsigned int       hUINT32;              /*  4 bytes */
138 
139 typedef   signed long long  hINT64;              /*  8 bytes */
140 typedef   signed long long hSINT64;              /*  8 bytes */
141 typedef unsigned long long hUINT64;              /*  8 bytes */
142 #define HAS_INT64
143 
144 #endif
145