- add show_cursor config option (idea from Cheryl Homiak)
- autoconf/automake update
- replace abook_malloc, abook_realloc and my_free with new xmalloc routines
+ - update for abook_rl (abook_readline)
+ - code cleanups and minor fixes
0.5.3
- add allcvs filters (Christoph Sobotka)
static void add_email(int);
char *datafile = NULL;
-char *rcfile = NULL;
+static char *rcfile = NULL;
bool alternative_datafile = FALSE;
bool alternative_rcfile = FALSE;
fgetc(stdin);
}
- signal(SIGKILL, quit_abook_sig);
signal(SIGTERM, quit_abook_sig);
if(init_ui())
init_add_email()
{
set_filenames();
- atexit(free_filenames);
check_abook_directory();
init_opts();
load_opts(rcfile);
# Define the identity of the package.
PACKAGE=abook
- VERSION=0.5.4rc1
+ VERSION=0.5.4rc3
cat >>confdefs.h <<_ACEOF
fi;
if test x$debug = xtrue; then
- CPPFLAGS="-DDEBUG $CPPFLAGS"
+ CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
CFLAGS="-g $CFLAGS"
fi
dnl abook configure.in
AC_INIT(abook.c)
-AM_INIT_AUTOMAKE(abook, 0.5.4rc1)
+AM_INIT_AUTOMAKE(abook, 0.5.4rc3)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
esac], [debug=false])
if test x$debug = xtrue; then
- CPPFLAGS="-DDEBUG $CPPFLAGS"
+ CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
CFLAGS="-g $CFLAGS"
fi
extern char *selected;
extern char *datafile;
-extern char *rcfile;
/*
* field definitions
if( (out = abook_fopen(datafile, "w")) == NULL )
return -1;
- if( list_is_empty() ) {
+ if(list_is_empty()) {
fclose(out);
unlink(datafile);
return 1;
ui_print_number_of_items();
- if(items < 1) {
+ if(list_is_empty()) {
refresh();
wrefresh(list);
return;
extern int items, curitem;
extern char *datafile;
-extern int alternative_datafile;
+extern bool alternative_datafile;
/*
* internal variables
#ifdef TIOCGWINSZ
struct winsize winsz;
- ioctl (0, TIOCGWINSZ, &winsz);
+ ioctl(0, TIOCGWINSZ, &winsz);
#ifdef DEBUG
if(winsz.ws_col >= MIN_COLS && winsz.ws_row >= MIN_LINES) {
fprintf(stderr, "Warning: COLS=%d, LINES=%d\n", winsz.ws_col, winsz.ws_row);
free(msg2);
- switch( tolower(getch()) ) {
+ switch(tolower(getch())) {
case 'n':
+ case 'N':
ret = FALSE;
break;
case 'y':
+ case 'Y':
ret = TRUE;
break;
default:
erase();
headerline("help");
- for( i = 0; tbl[i] != NULL; i++) {
+ for(i = 0; tbl[i] != NULL; i++) {
waddstr(helpw, tbl[i]);
if( ( !( (i+1) % (LINES-8) ) ) ||
(tbl[i+1] == NULL) ) {
clear_statusline();
if(next) {
- if( !*findstr )
+ if(!*findstr)
return;
} else {
char *s;
char *command = opt_get_str(STR_PRINT_COMMAND);
int mode;
- if( list_is_empty() )
+ if(list_is_empty())
return;
statusline_addstr("Print All/Selected/Cancel (a/s/C)?");
- switch( tolower(getch()) ) {
+ switch(tolower(getch())) {
case 'a':
mode = ENUM_ALL;
break;
filename = ask_filename("File to open: ");
- if( !filename || ! *filename) {
+ if(!filename || ! *filename) {
free(filename);
refresh_screen();
return;
}
- if( opt_get_bool(BOOL_AUTOSAVE) )
+ if(opt_get_bool(BOOL_AUTOSAVE))
save_database();
else if(statusline_ask_boolean("Save current database", FALSE))
save_database();
load_database(filename);
- if( items == 0 ) {
+ if(items == 0) {
statusline_msg("Sorry, that specified file appears not to be a valid abook addressbook");
load_database(datafile);
} else {
void ui_open_datafile();
-#include "options.h" /* needed for options_get_int */
+#include "options.h" /* needed for options_get_bool */
#define UI_HLINE_CHAR opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
'-' : ACS_HLINE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "xmalloc.h"
static void
xmalloc_default_error_handler(int err)