]> git.deb.at Git - pkg/abook.git/blob - abook.h
Imported Upstream version 0.4.16
[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 DATAFILE        ".abook.addressbook"
27
28 /*
29  * some "abookwide" useful macros
30  */
31
32 #define hide_cursor()   curs_set(0)
33 #define show_cursor()   curs_set(1)
34
35 #define safe_atoi(X)    (X == NULL) ? 0 : atoi(X)
36 #define my_free(X)      do {free(X); X=NULL;} while(0)
37 #define safe_str(X)     X == NULL ? "" : X
38 #define safe_strdup(X)  (X == NULL) ? NULL : strdup(X)
39
40 #ifndef min
41 #       define min(x,y) (((x)<(y)) ? (x):(y))
42 #endif
43
44 #ifndef max
45 #       define max(x,y) (((x)>(y)) ? (x):(y))
46 #endif
47
48 #define ISSPACE(c)      isspace((unsigned char)c)
49
50 #ifndef DEBUG
51 #       define NDEBUG   1
52 #else
53 #       undef NDEBUG
54 #endif
55
56 #endif