This source file includes following definitions.
- g_list_free_full
1
2
3
4
5
6
7
8
9 #ifndef PORTABILITY_H
10 # define PORTABILITY_H
11
12 # define EOS '\0'
13 # define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) )
14
15
16
17 # undef _GNU_SOURCE
18 # define _GNU_SOURCE
19
20
21 # ifdef HAVE_CONFIG_H
22 # ifndef PCMK__CONFIG_H
23 # define PCMK__CONFIG_H
24 # include <config.h>
25 # endif
26 # endif
27
28
29
30 # ifndef HAVE_DAEMON
31
32 int daemon(int nochdir, int noclose);
33 # endif
34
35 # ifndef HAVE_SETENV
36
37 int setenv(const char *name, const char *value, int why);
38 # endif
39
40 # ifndef HAVE_STRERROR
41
42 char *strerror(int errnum);
43 # endif
44
45 # ifndef HAVE_STRCHRNUL
46
47 char *strchrnul(const char *s, int c_in);
48 # endif
49
50 # ifndef HAVE_ALPHASORT
51 # include <dirent.h>
52 int
53 alphasort(const void *dirent1, const void *dirent2);
54 # endif
55
56 # ifndef HAVE_STRNLEN
57 size_t strnlen(const char *s, size_t maxlen);
58 # else
59 # define USE_GNU
60 # endif
61
62 # ifndef HAVE_STRNDUP
63 char *strndup(const char *str, size_t len);
64 # else
65 # define USE_GNU
66 # endif
67
68
69 # if defined(ON_BSD) || defined(ON_SOLARIS)
70 # define SUPPORT_PROCFS 0
71 # else
72 # define SUPPORT_PROCFS 1
73 # endif
74
75 # include <glib.h>
76
77 # if !GLIB_CHECK_VERSION(2,28,0)
78 # include <string.h>
79
80 static inline void
81 g_list_free_full(GList * list, GDestroyNotify free_func)
82 {
83 g_list_foreach(list, (GFunc) free_func, NULL);
84 g_list_free(list);
85 }
86 # endif
87
88 # if SUPPORT_DBUS
89 # ifndef HAVE_DBUSBASICVALUE
90 # include <stdint.h>
91 # include <dbus/dbus.h>
92
93
94
95
96 typedef struct
97 {
98 uint32_t first32;
99 uint32_t second32;
100 } DBus8ByteStruct;
101
102
103
104
105
106
107
108
109
110
111
112 typedef union
113 {
114 unsigned char bytes[8];
115 int16_t i16;
116 uint16_t u16;
117 int32_t i32;
118 uint32_t u32;
119 uint32_t bool_val;
120 # ifdef DBUS_HAVE_INT64
121 int64_t i64;
122 uint64_t u64;
123 # endif
124 DBus8ByteStruct eight;
125 double dbl;
126 unsigned char byt;
127 char *str;
128 int fd;
129 } DBusBasicValue;
130 # endif
131 # endif
132
133
134 # include <errno.h>
135
136 # ifndef ENOTUNIQ
137 # define ENOTUNIQ 190
138 # endif
139
140 # ifndef ECOMM
141 # define ECOMM 191
142 # endif
143
144 # ifndef ELIBACC
145 # define ELIBACC 192
146 # endif
147
148 # ifndef EREMOTEIO
149 # define EREMOTEIO 193
150 # endif
151
152 # ifndef EUNATCH
153 # define EUNATCH 194
154 # endif
155
156 # ifndef ENOKEY
157 # define ENOKEY 195
158 # endif
159
160 # ifndef ENODATA
161 # define ENODATA 196
162 # endif
163
164 # ifndef ETIME
165 # define ETIME 197
166 # endif
167
168 # ifndef ENOSR
169 # define ENOSR 198
170 # endif
171
172 # ifndef ENOSTR
173 # define ENOSTR 199
174 # endif
175
176 # ifndef EKEYREJECTED
177 # define EKEYREJECTED 200
178 # endif
179
180 #endif