]> git.deb.at Git - pkg/abook.git/blob - abook.h
new configuration system
[pkg/abook.git] / abook.h
1 #ifndef _ABOOK_H
2 #define _ABOOK_H
3
4 #include <stdio.h>
5
6 void            *abook_malloc(size_t size);
7 void            *abook_realloc(void *ptr, size_t size);
8 FILE            *abook_fopen (const char *path, const char *mode);
9 void            quit_abook();
10 void            launch_wwwbrowser(int item);
11 void            launch_mutt(int item);
12 void            print_stderr(int item);
13 #ifdef _AIX
14 int             strcasecmp (const char *, const char *);
15 int             strncasecmp (const char *, const char *, size_t);
16 #endif
17
18 #define MAIN_HELPLINE        "q:quit  ?:help  a:add  r:remove"
19
20 #define Y_STATUSLINE    (LINES - 2)
21
22 #define MIN_LINES       20      
23 #define MIN_COLS        70      
24
25 #define DEFAULT_UMASK   066
26 #define DIR_IN_HOME     ".abook"
27 #define DATAFILE        "addressbook"
28
29 #define RCFILE          "abookrc"
30
31 /*
32  * some "abookwide" useful macros
33  */
34
35 #define hide_cursor()   curs_set(0)
36 #define show_cursor()   curs_set(1)
37
38 #define safe_atoi(X)    (X == NULL) ? 0 : atoi(X)
39 #define my_free(X)      do {free(X); X=NULL;} while(0)
40 #define safe_str(X)     X == NULL ? "" : X
41 #define safe_strdup(X)  (X == NULL) ? NULL : strdup(X)
42
43 #ifndef min
44 #       define min(x,y) (((x)<(y)) ? (x):(y))
45 #endif
46
47 #ifndef max
48 #       define max(x,y) (((x)>(y)) ? (x):(y))
49 #endif
50
51 #define ISSPACE(c)      isspace((unsigned char)c)
52
53 #ifndef DEBUG
54 #       define NDEBUG   1
55 #else
56 #       undef NDEBUG
57 #endif
58
59 #endif