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