]> git.deb.at Git - pkg/abook.git/blob - abook.h
Merged first 0.4.13pre patch
[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_lynx();
11 void            launch_mutt();
12 #ifdef _AIX
13 int             strcasecmp (const char *, const char *);
14 int             strncasecmp (const char *, const char *, size_t);
15 #endif
16
17 #define MAIN_HELPLINE        "q:quit  ?:help  a:add  r:remove"
18
19 #define Y_STATUSLINE    (LINES - 2)
20
21 #define MIN_LINES       20      
22 #define MIN_COLS        70      
23
24 #define DEFAULT_UMASK   066
25 #define DATAFILE        ".abook.addressbook"
26
27 /*
28  * some "abookwide" useful macros
29  */
30
31 #define hide_cursor()   curs_set(0)
32 #define show_cursor()   curs_set(1)
33
34 #define safe_atoi(X)    (X == NULL) ? 0 : atoi(X)
35 #define my_free(X)      do {free(X); X=NULL;} while(0)
36 #define safe_str(X)     X == NULL ? "" : X
37 #define safe_strdup(X)  (X == NULL) ? NULL : strdup(X)
38
39 #ifndef min
40 #       define min(x,y) (((x)<(y)) ? (x):(y))
41 #endif
42
43 #ifndef max
44 #       define max(x,y) (((x)>(y)) ? (x):(y))
45 #endif
46
47 #define ISSPACE(c)      isspace((unsigned char)c)
48
49 #ifndef DEBUG
50 #       define NDEBUG   1
51 #else
52 #       undef NDEBUG
53 #endif
54
55 #endif