]> arthur.barton.de Git - netatalk.git/blob - include/atalk/util.h
Joe Clarke's fix for linux/quota.h checking, removed NO_DLFCN_H define
[netatalk.git] / include / atalk / util.h
1 /*
2  * $Id: util.h,v 1.2 2001-06-20 14:51:13 rufustfirefly Exp $
3  */
4
5 #ifndef _ATALK_UTIL_H
6 #define _ATALK_UTIL_H 1
7
8 #include <sys/cdefs.h>
9 #include <sys/types.h>
10 #include <unistd.h>
11 #include <netatalk/at.h>
12
13 extern unsigned const char _diacasemap[], _dialowermap[];
14
15 extern char **getifacelist(void);
16 extern void freeifacelist(char **);
17
18 #define diatolower(x)     _dialowermap[(x)]
19 #define diatoupper(x)     _diacasemap[(x)]
20 extern int atalk_aton     __P((char *, struct at_addr *));
21 extern void bprint        __P((char *, int));
22 extern int strdiacasecmp  __P((const unsigned char *, const unsigned char *));
23 extern int strndiacasecmp __P((const unsigned char *, const unsigned char *,
24                                int));
25 extern pid_t server_lock  __P((char * /*program*/, char * /*file*/, 
26                                int /*debug*/));
27 #define server_unlock(x)  (unlink(x))
28
29 #ifndef HAVE_DLFCN_H
30 extern void *mod_open    __P((const char *));
31 extern void *mod_symbol  __P((void *, const char *));
32 extern void mod_close    __P((void *));
33 #define mod_error()      ""
34 #else /* ! HAVE_DLFCN_H */
35 #include <dlfcn.h>
36 #ifndef RTLD_NOW
37 #define RTLD_NOW 1
38 #endif /* ! RTLD_NOW */
39
40 #define mod_open(a)      dlopen(a, RTLD_NOW)
41
42 #ifndef DLSYM_PREPEND_UNDERSCORE
43 #define mod_symbol(a, b) dlsym(a, b)
44 #else /* ! DLSYM_PREPEND_UNDERSCORE */
45 extern void *mod_symbol  __P((void *, const char *));
46 #endif /* ! DLSYM_PREPEND_UNDERSCORE */
47 #define mod_error()      dlerror()
48 #define mod_close(a)     dlclose(a)
49 #endif /* ! HAVE_DLFCN_H */
50
51 #endif