]> git.deb.at Git - pkg/abook.git/blob - abook.h
- replace abook_malloc, abook_realloc and my_free with new xmalloc routines
[pkg/abook.git] / abook.h
1 #ifndef _ABOOK_H
2 #define _ABOOK_H
3
4 #include <stdio.h>
5
6 FILE            *abook_fopen (const char *path, const char *mode);
7 void            quit_abook(int save_db);
8 void            launch_wwwbrowser(int item);
9 void            launch_mutt(int item);
10 void            print_stderr(int item);
11 #ifdef _AIX
12 int             strcasecmp (const char *, const char *);
13 int             strncasecmp (const char *, const char *, size_t);
14 #endif
15
16 #define MAIN_HELPLINE        "q:quit  ?:help  a:add  r:remove"
17
18 #define Y_STATUSLINE    (LINES - 2)
19
20 #define MIN_LINES       20      
21 #define MIN_COLS        70      
22
23 #define DEFAULT_UMASK   066
24 #define DIR_IN_HOME     ".abook"
25 #define DATAFILE        "addressbook"
26
27 #define RCFILE          "abookrc"
28
29 #define QUIT_SAVE       1
30 #define QUIT_DONTSAVE   0
31
32 /*
33  * some "abookwide" useful macros
34  */
35
36 #define hide_cursor()   curs_set(0)
37 #define show_cursor()   curs_set(1)
38
39 #define safe_atoi(X)    ((X == NULL) ? 0 : atoi(X))
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