]> arthur.barton.de Git - netatalk.git/blob - include/atalk/util.h
4384ad896cce24af622a88d01e701995f9ab0f7a
[netatalk.git] / include / atalk / util.h
1 /*
2  * $Id: util.h,v 1.5.2.1 2001-12-31 20:05:20 srittau 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 #ifdef HAVE_UNISTD_H
11 #include <unistd.h>
12 #endif /* HAVE_UNISTD_H */
13 #include <netatalk/at.h>
14
15 extern const int _diacasemap[], _dialowermap[];
16
17 extern char **getifacelist(void);
18 extern void freeifacelist(char **);
19
20 #define diatolower(x)     _dialowermap[(unsigned char) (x)]
21 #define diatoupper(x)     _diacasemap[(unsigned char) (x)]
22 extern int atalk_aton     __P((char *, struct at_addr *));
23 extern void bprint        __P((char *, int));
24 extern int strdiacasecmp  __P((const char *, const char *));
25 extern int strndiacasecmp __P((const char *, const char *, size_t));
26 extern pid_t server_lock  __P((char * /*program*/, char * /*file*/, 
27                                int /*debug*/));
28 #define server_unlock(x)  (unlink(x))
29
30 #ifndef HAVE_DLFCN_H
31 extern void *mod_open    __P((const char *));
32 extern void *mod_symbol  __P((void *, const char *));
33 extern void mod_close    __P((void *));
34 #define mod_error()      ""
35 #else /* ! HAVE_DLFCN_H */
36 #include <dlfcn.h>
37
38 #ifndef RTLD_NOW
39 #define RTLD_NOW 1
40 #endif /* ! RTLD_NOW */
41
42 #define mod_open(a)      dlopen(a, RTLD_NOW)
43
44 #ifndef DLSYM_PREPEND_UNDERSCORE
45 #define mod_symbol(a, b) dlsym(a, b)
46 #else /* ! DLSYM_PREPEND_UNDERSCORE */
47 extern void *mod_symbol  __P((void *, const char *));
48 #endif /* ! DLSYM_PREPEND_UNDERSCORE */
49 #define mod_error()      dlerror()
50 #define mod_close(a)     dlclose(a)
51 #endif /* ! HAVE_DLFCN_H */
52
53 #endif