File: abook.h

package info (click to toggle)
abook 0.5.3-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,084 kB
  • ctags: 759
  • sloc: ansic: 6,613; sh: 3,272; cpp: 956; python: 256; perl: 91; makefile: 89
file content (62 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef _ABOOK_H
#define _ABOOK_H

#include <stdio.h>

void		*abook_malloc(size_t size);
void		*abook_realloc(void *ptr, size_t size);
FILE		*abook_fopen (const char *path, const char *mode);
void		quit_abook(int save_db);
void		launch_wwwbrowser(int item);
void		launch_mutt(int item);
void		print_stderr(int item);
#ifdef _AIX
int		strcasecmp (const char *, const char *);
int		strncasecmp (const char *, const char *, size_t);
#endif

#define MAIN_HELPLINE        "q:quit  ?:help  a:add  r:remove"

#define Y_STATUSLINE   	(LINES - 2)

#define MIN_LINES	20	
#define MIN_COLS	70	

#define DEFAULT_UMASK	066
#define DIR_IN_HOME	".abook"
#define DATAFILE	"addressbook"

#define RCFILE		"abookrc"

#define QUIT_SAVE	1
#define QUIT_DONTSAVE	0

/*
 * some "abookwide" useful macros
 */

#define hide_cursor()	curs_set(0)
#define show_cursor()	curs_set(1)

#define safe_atoi(X)    ((X == NULL) ? 0 : atoi(X))
#define my_free(X)	do {free(X); X=NULL;} while(0)
#define safe_str(X)	((X == NULL) ? "" : X)
#define safe_strdup(X)	((X == NULL) ? NULL : strdup(X))

#ifndef min
#       define min(x,y) (((x)<(y)) ? (x):(y))
#endif

#ifndef max
#       define max(x,y) (((x)>(y)) ? (x):(y))
#endif

#define ISSPACE(c)	isspace((unsigned char)c)

#ifndef DEBUG
#	define NDEBUG	1
#else
#	undef NDEBUG
#endif

#endif