File: headers.h

package info (click to toggle)
fkiss 0.33a.patch-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 804 kB
  • ctags: 1,074
  • sloc: ansic: 9,141; sh: 2,924; makefile: 98; sed: 14
file content (142 lines) | stat: -rw-r--r-- 3,268 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* $Header: /home/yav/catty/fkiss/RCS/headers.h,v 1.12 2000/10/17 05:00:44 yav Exp $
 * fkiss header files and macros for portability
 * written by yav <yav@bigfoot.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
#  include <strings.h>
# endif
#endif

#ifndef HAVE_INDEX
# define index strchr
#endif
#ifndef HAVE_RINDEX
# define rindex strrchr
#endif
#ifndef HAVE_BCOPY
# define bcopy(src,dst,len) memcpy((dst),(src),(len))
#endif
#ifndef HAVE_BCMP
# define bcmp(dst,src,len) memcmp((dst),(src),(len))
#endif
#ifndef HAVE_BZERO
# define bzero(dst,len) memset((dst),0,(len))
#endif

#ifndef MAXPATH
# ifdef MAXPATHLEN
#  define MAXPATH MAXPATHLEN
# else
#  define MAXPATH 1024
# endif
#endif

/* for (void *) not supported C-compiler */
#ifdef __STDC__
typedef void *VOIDPTR;
#else
typedef char *VOIDPTR;
#endif

/* get signed short value (little-endian byte order) */
#define GET_SHORT(p) (*((unsigned char *)p)|(*(((char *)p)+1) << 8))

/* variable arguments */

#ifndef USE_STDARG
#ifndef USE_VARARGS
# if HAVE_STDARG_H
#  define USE_STDARG 1
# else
#  if HAVE_VARARGS_H
#   define USE_VARARGS 1
#  endif
# endif
#endif
#endif

#if USE_STDARG
# if HAVE_STDARG_H
#  include <stdarg.h>
# endif
#endif
#if USE_VARARGS
# if HAVE_VARARGS_H
#  include <varargs.h>
# endif
#endif

/* directory access routine */
#ifndef USE_BSD_DIRLIB
# ifndef HAVE_DIRENT_H
#  ifndef HAVE_SYS_NDIR_H
#   ifndef HAVE_SYS_DIR_H
#    ifndef HAVE_NDIR_H
#     define USE_BSD_DIRLIB 0
#    endif
#   endif
#  endif
# endif
# ifndef USE_BSD_DIRLIB
#  define USE_BSD_DIRLIB 1
# endif
#endif

/*
 * If your system have ctype.h header
 * and library functions conformins to ISO 9899 ("ISO C"),
 * uncomment following.
 */
/* #define HAVE_CTYPE_H 1 */

#ifdef HAVE_CTYPE_H
# define is_digit(c) isdigit(c) 
# define is_lower(c) islower(c)
# define is_upper(c) isupper(c)
# define is_alpha(c) isalpha(c)
# define is_alnum(c) isalnum(c)
# define to_lower(c) tolower(c)
#else /* HAVE_CTYPE_H */
/* (for ASCII character set only) */
# define is_digit(c) ('0'<=(c)&&(c)<='9')
# define is_lower(c) ('a'<=(c)&&(c)<='z')
# define is_upper(c) ('A'<=(c)&&(c)<='Z')
# define is_alpha(c) (is_lower(c)||is_upper(c))
# define is_alnum(c) (is_alpha(c)||is_digit(c))
# define to_lower(c) (is_upper(c) ? ((c) + 0x20) : (c))
#endif /* HAVE_CTYPE_H */


#ifndef USE_UNAME
# ifdef HAVE_UNAME
#  ifdef HAVE_SYS_UTSNAME_H
#   define USE_UNAME 1
#  else
#   define USE_UNAME 0
#  endif
# else
#   define USE_UNAME 0
# endif
#endif /* USE_UNAME */


/* End of file */