11 # define DIMOF(a) ((int) (sizeof(a)/sizeof(a[0])) ) 27 int daemon(
int nochdir,
int noclose);
32 int setenv(
const char *name,
const char *value,
int why);
35 # ifndef HAVE_STRERROR 40 # ifndef HAVE_STRCHRNUL 45 # ifndef HAVE_ALPHASORT 48 alphasort(
const void *dirent1,
const void *dirent2);
52 size_t strnlen(
const char *s,
size_t maxlen);
58 char *
strndup(
const char *str,
size_t len);
64 # if defined(ON_BSD) || defined(ON_SOLARIS) 65 # define SUPPORT_PROCFS 0 67 # define SUPPORT_PROCFS 1 71 # if !GLIB_CHECK_VERSION(2,14,0) 82 g_hash_prepend_value(gpointer
key, gpointer
value, gpointer user_data)
84 GList **values = (GList **) user_data;
86 *values = g_list_prepend(*values, value);
91 g_hash_table_get_values(GHashTable * hash_table)
95 g_hash_table_foreach(hash_table, g_hash_prepend_value, &values);
100 # if !GLIB_CHECK_VERSION(2,16,0) 102 static inline gboolean
103 g_hash_table_nth_data(gpointer
key, gpointer
value, gpointer user_data)
107 if (iter->
lpc++ == iter->
nth) {
116 g_hash_table_iter_init(
GHashTableIter * iter, GHashTable * hash_table)
118 iter->
hash = hash_table;
125 static inline gboolean
128 gboolean found = FALSE;
133 if (iter->
nth < g_hash_table_size(iter->
hash)) {
134 found = ! !g_hash_table_find(iter->
hash, g_hash_table_nth_data, iter);
140 *value = iter->
value;
147 g_hash_table_remove(iter->
hash, iter->
key);
152 g_strcmp0(
const char *str1,
const char *str2)
155 return -(str1 != str2);
158 return strcmp(str1, str2);
162 # if !GLIB_CHECK_VERSION(2,28,0) 166 g_list_free_full(GList * list, GDestroyNotify free_func)
168 g_list_foreach(list, (GFunc) free_func, NULL);
174 # ifndef HAVE_DBUSBASICVALUE 176 # include <dbus/dbus.h> 199 unsigned char bytes[8];
205 # ifdef DBUS_HAVE_INT64 209 DBus8ByteStruct eight;
222 # define ENOTUNIQ 190 234 # define EREMOTEIO 193 261 # ifndef EKEYREJECTED 262 # define EKEYREJECTED 200 269 # define __FUNCTION__ __func__ 272 # ifdef __MY_UNKNOWN_C 273 # 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)