Debian Codegraph @

libidu/iduglobal.h

raw symbols SCIP
1 #ifndef _iduglobal_h
2 #define _iduglobal_h
3
4 /* iduglobal.h -- global definitions for libidu
5 Copyright (C) 1995-2020 Free Software Foundation, Inc.
6 Written by Claudio Fontana <[email protected]>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef offsetof
23 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
24 #endif
25
26 #ifndef cardinalityof
27 #define cardinalityof(ARRAY) (sizeof (ARRAY) / sizeof ((ARRAY)[0]))
28 #endif
29
30 #ifndef strequ
31 #define strequ(s1, s2) (strcmp ((s1), (s2)) == 0)
32 #define strnequ(s1, s2, n) (strncmp ((s1), (s2), (n)) == 0)
33 #endif
34
35 #ifndef obstack_chunk_alloc
36 #define obstack_chunk_alloc xmalloc
37 #endif
38 #ifndef obstack_chunk_free
39 #define obstack_chunk_free free
40 #endif
41
42 #define CLONE(o, t, n) ((t *) memcpy (xmalloc (sizeof(t) * (n)), (o), sizeof (t) * (n)))
43
44 #define DEBUG(args) /* printf args */
45
46 #if HAVE_LINK
47 #define MAYBE_FNM_CASEFOLD 0
48 #else
49 #define MAYBE_FNM_CASEFOLD FNM_CASEFOLD
50 #endif
51
52 #if HAVE_LINK
53 #define IS_ABSOLUTE(_dir_) ((_dir_)[0] == '/')
54 #define SLASH_STRING "/"
55 #define SLASH_CHAR '/'
56 #define DOT_DOT_SLASH "../"
57 #else
58 /* NEEDSWORK: prefer forward-slashes as a user-configurable option. */
59 #define IS_ABSOLUTE(_dir_) ((_dir_)[1] == ':')
60 #define SLASH_STRING "\\/"
61 #define SLASH_CHAR '\\'
62 #define DOT_DOT_SLASH "..\\"
63 #endif
64
65 #define STREQ(a, b) (strcmp (a, b) == 0)
66
67 static inline char *
68 bad_cast (char const *s)
69 {
70 return (char *) s;
71 }
72
73 #endif /* _iduglobal_h */