]> git.deb.at Git - pkg/abook.git/blob - abook.h
Initial revision
[pkg/abook.git] / abook.h
1 #ifndef _ABOOK_H
2 #define _ABOOK_H
3
4 void            refresh_screen();
5 void            statusline_msg(char *msg);
6 char            *ask_filename(char *prompt, int flags);
7 void            clear_statusline();
8 void            statusline_addstr(char *str);
9 char            *statusline_getnstr(char *str, int n, int use_filesel);
10 void            headerline(char *str);
11 void            refresh_statusline();
12 void            display_editor_help();
13 void            *abook_malloc(size_t size);
14 void            *abook_realloc(void *ptr, size_t size);
15 FILE            *abook_fopen (const char *path, const char *mode);
16 void            quit_abook();
17 #ifdef _AIX
18 int             strcasecmp (const char *, const char *);
19 int             strncasecmp (const char *, const char *, size_t);
20 #endif
21
22 #define MAIN_HELPLINE        "q:quit  ?:help  a:add  r:remove"
23
24 #define Y_STATUSLINE    (LINES - 2)
25
26 #define MIN_LINES       20      
27 #define MIN_COLS        70      
28
29 #define DEFAULT_UMASK   066
30 #define DATAFILE        ".abook.addressbook"
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 my_free(X)      do {free(X); X=NULL;} while(0)
41 #define safe_str(X)     X == NULL ? "" : X
42 #define safe_strdup(X)  (X == NULL) ? NULL : strdup(X)
43
44 #ifndef min
45 #       define min(x,y) (((x)<(y)) ? (x):(y))
46 #endif
47
48 #ifndef max
49 #       define max(x,y) (((x)>(y)) ? (x):(y))
50 #endif
51
52 #define ISSPACE(c)      isspace((unsigned char)c)
53
54 #ifndef DEBUG
55 #       define NDEBUG   1
56 #else
57 #       undef NDEBUG
58 #endif
59
60 #endif