25 # define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) )
41 int daemon(
int nochdir,
int noclose);
46 int setenv(
const char *name,
const char *value,
int why);
49 # ifndef HAVE_STRERROR
54 # ifndef HAVE_STRCHRNUL
59 # ifndef HAVE_ALPHASORT
62 alphasort(
const void *dirent1,
const void *dirent2);
66 size_t strnlen(
const char *s,
size_t maxlen);
72 char *
strndup(
const char *str,
size_t len);
78 # if !GLIB_CHECK_VERSION(2,14,0)
89 g_hash_prepend_value(gpointer key, gpointer value, gpointer user_data)
91 GList **values = (GList **) user_data;
93 *values = g_list_prepend(*values, value);
98 g_hash_table_get_values(GHashTable * hash_table)
100 GList *values = NULL;
102 g_hash_table_foreach(hash_table, g_hash_prepend_value, &values);
107 # if !GLIB_CHECK_VERSION(2,16,0)
109 static inline gboolean
110 g_hash_table_nth_data(gpointer key, gpointer value, gpointer user_data)
114 if (iter->
lpc++ == iter->
nth) {
123 g_hash_table_iter_init(
GHashTableIter * iter, GHashTable * hash_table)
125 iter->
hash = hash_table;
132 static inline gboolean
133 g_hash_table_iter_next(
GHashTableIter * iter, gpointer * key, gpointer * value)
135 gboolean found = FALSE;
140 if (iter->
nth < g_hash_table_size(iter->
hash)) {
141 found = ! !g_hash_table_find(iter->
hash, g_hash_table_nth_data, iter);
147 *value = iter->
value;
154 g_hash_table_remove(iter->
hash, iter->
key);
159 g_strcmp0(
const char *str1,
const char *str2)
162 return -(str1 != str2);
165 return strcmp(str1, str2);
169 # if !GLIB_CHECK_VERSION(2,28,0)
173 g_list_free_full(GList * list, GDestroyNotify free_func)
175 g_list_foreach(list, (GFunc) free_func, NULL);
181 # ifndef HAVE_DBUSBASICVALUE
183 # include <dbus/dbus.h>
206 unsigned char bytes[8];
212 # ifdef DBUS_HAVE_INT64
216 DBus8ByteStruct eight;
229 # define ENOTUNIQ 190
241 # define EREMOTEIO 193
268 # ifndef EKEYREJECTED
269 # define EKEYREJECTED 200
276 # define __FUNCTION__ __func__
279 # ifdef __MY_UNKNOWN_C
280 # define __FUNCTION__ "__FUNCTION__"
int alphasort(const void *dirent1, const void *dirent2)
char * strerror(int errnum)
char * strndup(const char *str, size_t len)
int daemon(int nochdir, int noclose)
int setenv(const char *name, const char *value, int why)
size_t strnlen(const char *s, size_t maxlen)
struct fake_ghi GHashTableIter
char * strchrnul(const char *s, int c_in)