init_abook();
- get_commands();
+ get_commands();
quit_abook(QUIT_SAVE);
{
puts (PACKAGE " v " VERSION "\n");
puts (" -h --help show usage");
- puts (" -C --config <file> use an alternative configuration file");
+ puts (" -C --config <file> use an alternative configuration file");
puts (" --datafile <file> use an alternative addressbook file");
puts (" --mutt-query <string> make a query for mutt");
puts (" --add-email "
FILE *
abook_fopen (const char *path, const char *mode)
-{
+{
struct stat s;
bool stat_ok;
stat_ok = (stat(path, &s) != -1);
-
+
if(strchr(mode, 'r'))
return (stat_ok && S_ISREG(s.st_mode)) ?
fopen(path, mode) : NULL;
return 0;
}
}
-
+
if(!quiet) {
FILE *in = fopen("/dev/tty", "r");
char c;
#define Y_STATUSLINE (LINES - 2)
-#define MIN_LINES 20
-#define MIN_COLS 70
+#define MIN_LINES 20
+#define MIN_COLS 70
#define DEFAULT_UMASK 066
#define DIR_IN_HOME ".abook"
{"Name", "name", TAB_CONTACT},/* NAME */
{"E-mails", "email", TAB_CONTACT},/* EMAIL */
{"Address", "address", TAB_ADDRESS},/* ADDRESS */
- {"Address2", "address2", TAB_ADDRESS},/* ADDRESS2 */
+ {"Address2", "address2", TAB_ADDRESS},/* ADDRESS2 */
{"City", "city", TAB_ADDRESS},/* CITY */
{"State/Province","state", TAB_ADDRESS},/* STATE */
{"ZIP/Postal Code","zip", TAB_ADDRESS},/* ZIP */
list_item item;
memset(&item, 0, sizeof(item));
-
+
for(;;) {
line = getaline(in);
if( feof(in) ) {
return 0;
}
-
+
int
load_database(char *filename)
if ( (in = abook_fopen(filename, "r")) == NULL )
return -1;
-
+
parse_database(in);
return (items == 0) ? 2 : 0;
return 1;
}
-
+
write_database(out, e);
-
+
fclose(out);
-
+
return 0;
}
close_database()
{
int i;
-
+
for(i=0; i < items; i++)
free_item(i);
{
int i;
char *tmp;
-
+
if(item[EMAIL] == NULL)
item[EMAIL] = strdup("");
if( ! selected_items() )
selected[ curitem ] = 1;
-
+
for( j = LAST_ITEM; j >= 0; j-- ) {
if( selected[j] ) {
free_item(j); /* added for .4 data_s_ */
itemcpy(database[ i ], database[ i + 1 ]);
selected[ i ] = selected[ i + 1 ];
}
- items--;
+ items--;
}
}
itemcpy(a, i1);
itemcpy(b, i2);
-
+
return safe_strcoll( a[sort_field], b[sort_field] );
}
}
sort_field = field;
-
+
qsort((void *)database, items, sizeof(list_item), namecmp);
refresh_screen();
{
int item = max(0, e.item + 1);
int i;
-
+
switch(e.mode) {
#ifdef DEBUG
case ENUM_ALL:
*/
if(strcasecmp(abook_fields[i].name, abook_fields[i].key))
xfree(abook_fields[i].name);
-
+
s = xmalloc_inc(MAX_FIELDNAME_LEN, 1);
snprintf(s, MAX_FIELDNAME_LEN, "%s", name);
abook_fields[i].name = s;
strcpy(database[item][EMAIL], p+1);
strcat(database[item][EMAIL], ",");
- strcat(database[item][EMAIL], tmp);
+ strcat(database[item][EMAIL], tmp);
}
static void
};
#define MAX_TAB TAB_CUSTOM
-
+
#define TABS (MAX_TAB+1)
#endif
print_filters()
{
int i;
-
+
puts("input:");
for(i=0; *i_filters[i].filtname ; i++)
printf("\t%s\t%s\n", i_filters[i].filtname,
i_filters[i].desc);
putchar('\n');
-
+
puts("output:");
for(i=0; *e_filters[i].filtname ; i++)
printf("\t%s\t%s\n", e_filters[i].filtname,
/*
* import
*/
-
+
static int i_read_file(char *filename, int (*func) (FILE *in));
static void
import_screen()
{
int i;
-
+
clear();
refresh_statusline();
headerline("import database");
mvaddstr(3, 1, "please select a filter");
-
+
for(i=0; *i_filters[i].filtname ; i++)
mvprintw(5 + i, 6, "%c -\t%s\t%s\n", 'a' + i,
int tmp = items;
import_screen();
-
+
filter = getch() - 'a';
if(filter == 'x' - 'a' ||
filter >= number_of_input_filters() || filter < 0) {
refresh_screen();
return 1;
}
-
+
mvaddstr(5+filter, 2, "->");
-
+
filename = ask_filename("Filename: ");
if( !filename ) {
refresh_screen();
return 2;
}
-
+
if( i_read_file(filename, i_filters[filter].func ) )
statusline_msg("Error occured while opening the file");
else if( tmp == items )
statusline_msg("Hmm.., file seems not to be a valid file");
-
+
refresh_screen();
free(filename);
fclose(in);
- return ret;
+ return ret;
}
int
ret = (*i_filters[i].func) (stdin);
} else
ret = i_read_file(filename, i_filters[i].func);
-
+
if( tmp == items )
ret = 1;
-
+
return ret;
}
export_screen()
{
int i;
-
+
clear();
headerline("export database");
mvaddstr(3, 1, "please select a filter");
-
+
for(i=0; *e_filters[i].filtname ; i++)
mvprintw(5 + i, 6, "%c -\t%s\t%s\n", 'a' + i,
char *filename;
export_screen();
-
+
filter = getch() - 'a';
if(filter == 'x' - 'a' ||
filter >= number_of_output_filters() || filter < 0) {
refresh_screen();
return 1;
}
-
+
mvaddstr(5+filter, 2, "->");
if( selected_items() ) {
}
clear_statusline();
}
-
+
filename = ask_filename("Filename: ");
if( !filename ) {
refresh_screen();
return 2;
}
-
+
if( e_write_file(filename, e_filters[filter].func, enum_mode ) )
statusline_msg("Error occured while exporting");
-
+
refresh_screen();
free(filename);
return 1;
ret = (*func) (out, enumerator);
-
+
fclose(out);
-
+
return ret;
}
int i;
int ret = 0;
struct db_enumerator e = init_db_enumerator(mode);
-
+
for(i=0;; i++) {
if( ! strncasecmp(e_filters[i].filtname, filtname,
FILTNAME_LEN) )
typedef char* ldif_item[LDIF_ITEM_FIELDS];
static ldif_item ldif_field_names = {
- "cn",
+ "cn",
"mail",
"streetaddress",
"streetaddress2",
NAME, /* "cn" */
EMAIL, /* "mail" */
ADDRESS, /* "streetaddress" */
- ADDRESS2, /* "streetaddress2" */
+ ADDRESS2, /* "streetaddress2" */
CITY, /* "locality" */
STATE, /* "st" */
ZIP, /* "postalcode" */
};
-static char *
+static char *
ldif_read_line(FILE *in)
{
char *buf = NULL;
pos = ftell(in);
line = getaline(in);
-
+
if( feof(in) || !line )
break;
-
+
if(i == 1) {
buf = line;
continue;
while(ISSPACE(*ptr))
ptr++;
- *rest = strdup(ptr);
+ *rest = strdup(ptr);
free(line);
return 0;
fprintf(out, "\n</table>\n");
fprintf(out, "\n</body>\n</html>\n");
}
-
+
/*
* end of html export filter
*/
for(i=1; ( tmp = strchr(s, ',') ) != NULL ; i++, s=tmp+1 )
if( i > MAX_EMAILS - 1 ) {
*tmp = 0;
- break;
+ break;
}
}
int pine_conv_table[]= {NICK, NAME, EMAIL, -1, NOTES};
memset(&item, 0, sizeof(item));
-
+
for(i=0, last=0; !last ; i++) {
if( ! (end = strchr(start, '\t')) )
last=1;
char *ptr;
int i;
- fgets(line, LINESIZE, in);
+ fgets(line, LINESIZE, in);
while(!feof(in)) {
for(i = 2;;i++) {
/* FIXME
* these files should be parsed according to a certain
- * lay out, or the default if layout is not given, at
+ * lay out, or the default if layout is not given, at
* the moment only default is done...
- */
+ */
#define CSV_COMMENT_CHAR '#'
for(i=1; ( tmp = strchr(s, ',') ) != NULL ; i++, s = tmp + 1 )
if( i > MAX_EMAILS - 1 ) {
*tmp = 0;
- break;
+ break;
}
}
};
csv_export_common(out, e, csv_export_fields, NULL);
-
+
return 0;
}
fprintf(out, "\"CUSTOM5\"\n");
csv_export_common(out, e, allcsv_export_fields, NULL);
-
+
return 0;
}
#define PALM_CSV_END CSV_SPECIAL(1)
#define PALM_CSV_CAT CSV_SPECIAL(2)
-static void
+static void
palm_split_and_write_name(FILE *out, char *name)
{
char *p;
}
}
-static void
+static void
palm_csv_handle_specials(FILE *out, int item, int field)
{
switch(field) {
FAX, /* FAX */
MOBILEPHONE, /* OTHER */
EMAIL, /* EMAIL */
- ADDRESS, /* ADDRESS */
+ ADDRESS, /* ADDRESS */
CITY, /* CITY */
STATE, /* STATE */
ZIP, /* ZIP */
for( j = strlen(database[e.item][NAME]) - 1; j >= 0; j-- ) {
if(database[e.item][NAME][j] == ' ')
break;
- }
+ }
fprintf(out, "N:%s;%.*s\n",
safe_str(name),
j,
safe_str(database[e.item][NAME])
- );
+ );
free(name);
if ( database[e.item][ADDRESS] )
fprintf(out, "ADR:;;%s;%s;%s;%s;%s;%s\n",
safe_str(database[e.item][ADDRESS]),
- safe_str(database[e.item][ADDRESS2]),
+ safe_str(database[e.item][ADDRESS2]),
safe_str(database[e.item][CITY]),
safe_str(database[e.item][STATE]),
safe_str(database[e.item][ZIP]),
safe_str(database[e.item][COUNTRY])
);
-
+
if (database[e.item][PHONE])
fprintf(out, "TEL;HOME:%s\n", database[e.item][PHONE]);
if (database[e.item][WORKPHONE])
if ( database[e.item][EMAIL] ) {
split_emailstr(e.item, emails);
for(j=0; j < MAX_EMAILS ; j++) {
- if ( *emails[j] )
+ if ( *emails[j] )
fprintf(out, "EMAIL;INTERNET:%s\n",
emails[j]);
}
}
-
- if ( database[e.item][NOTES] )
+
+ if ( database[e.item][NOTES] )
fprintf(out, "NOTE:%s\n", database[e.item][NOTES]);
if (database[e.item][URL])
fprintf(out, "URL:%s\n", database[e.item][URL]);
fprintf(out, "END:VCARD\n\n");
-
+
}
return 0;
mutt_alias_genalias(int i)
{
char *tmp, *pos;
-
+
if(database[i][NICK])
return strdup(database[i][NICK]);
strlower(tmp);
- return tmp;
+ return tmp;
}
static int
if (database[i][CITY])
fprintf(out, "\n%s", database[i][CITY]);
-
+
if (database[i][STATE] || database[i][ZIP]) {
fputc('\n', out);
-
+
if(database[i][STATE]) {
fprintf(out, "%s", database[i][STATE]);
if(database[i][ZIP])
if(database[i][CITY])
fprintf(out, "%s", database[i][CITY]);
}
-
+
if (database[i][STATE])
fprintf(out, "\n%s", database[i][STATE]);
** From: [blank From: line]
** From: uu.net!kent [uucp addresses - no comment]
** From: uu.net!kent (kent) [uucp addresses - with comment]
-** From: "(Joe Bloggs)" <joe@anorg.com>
+** From: "(Joe Bloggs)" <joe@anorg.com>
** From: "Roy T. Fielding" <fielding@kiwi.ics.uci.edu>
** From: kent@localhost
** From: kent@uu.net (Kent Landfield)
** From: (George Burgyan) <gburgyan@cybercon.com>
-** From: <gburgyan@cybercon.com> (George Burgyan)
+** From: <gburgyan@cybercon.com> (George Burgyan)
** From: Kent B. Landfield <kent@landfield.com>
** From: IN%"fekete+reply@c2.net" 26-JAN-1997 13:28:55.36
** From: IN%"vicric@panix.com" "Vicki Richman" 13-AUG-1996 10:54:33.38
** First, is there an '@' sign we can use as an anchor ?
*/
if ((c = hm_strchr(line, '@')) == NULL) {
- /*
+ /*
** No '@' sign here so ...
*/
if (strchr(line, '(')) { /* From: bob (The Big Guy) */
email[i++] = *c;
email[i] = '\0';
} else {
- /*
+ /*
* - check to see if the From: line is blank, (taken care of)
* - check if From: uu.net!kent formatted line
* - check if "From: kent" formatted line
else if (use_domainaddr) {
/*
- * check if site domainizes addresses
+ * check if site domainizes addresses
* but don't modify uucp addresses
*/
if ((c = strchr(email, '!')) == NULL) {
comment_fnd = 1;
} else {
/*
- * Is there an email address available
+ * Is there an email address available
* that we can use for the name ?
*/
if (!strcmp(email, NOEMAIL)) /* No */
name[i] = '\0';
/*
- * Is the name string blank ? If so then
+ * Is the name string blank ? If so then
* force it to get filled with something.
*/
if (blankstring(name))
strcpymax(name, email, NAMESTRLEN);
}
- /*
- * need to strip spaces off the end of
- * the email and name strings
+ /*
+ * need to strip spaces off the end of
+ * the email and name strings
*/
c = email + (strlen(email) - 1);
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-\f
+
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
-\f
+
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
-\f
+
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
return optstring;
}
-\f
+
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
}
#endif /* Not ELIDE_CODE. */
-\f
+
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-\f
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
}
#endif /* Not ELIDE_CODE. */
-\f
+
#ifdef TEST
#include <stdio.h>
refresh_list()
{
int i, line;
-
+
werase(list);
ui_print_number_of_items();
-
+
if(items < 1) {
refresh();
wrefresh(list);
return;
}
-
+
if(curitem < 0)
curitem = 0;
if(selected[i])
mvwaddch(list, line, 0, '*' );
-
+
mvwaddnstr(list, line, NAMEPOS, database[i][NAME],
bytes2width(database[i][NAME], NAMELEN));
if(opt_get_bool(BOOL_SHOW_ALL_EMAILS))
if(highlight)
wstandend(list);
}
-
+
void
list_headerline()
{
if(curitem < 1)
return;
-
+
curitem = curitem == first_list_item ?
((curitem -= LIST_LINES) < 0 ? 0 : curitem) : first_list_item;
-
+
refresh_list();
}
{
if(items > 0)
curitem = 0;
-
+
refresh_list();
}
MY_VA_LOCAL_DECL;
size_t size = 100;
char *buffer = xmalloc (size);
-
+
assert(format != NULL);
for(;;) {
size = n + 1;
else
size *= 2;
-
+
buffer = xrealloc(buffer, size);
}
}
MY_VA_SHIFT(s, char*);
}
MY_VA_END;
-
+
concat = (char *)
xmalloc(l);
if(concat == NULL)
return NULL;
*dir = 0;
-
+
while( getcwd(dir, size) == NULL && errno == ERANGE )
if( (dir = xrealloc(dir, size *=2)) == NULL)
return NULL;
* original. Also, there is now a builtin-test, just compile with:
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
* and run snprintf for results.
- *
+ *
* Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
- * The PGP code was using unsigned hexadecimal formats.
+ * The PGP code was using unsigned hexadecimal formats.
* Unfortunately, unsigned formats simply didn't work.
*
* Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
/*int snprintf (char *str, size_t count, const char *fmt, ...);*/
/*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/
-static void dopr (char *buffer, size_t maxlen, const char *format,
+static void dopr (char *buffer, size_t maxlen, const char *format,
va_list args);
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
char *value, int flags, int min, int max);
int flags;
int cflags;
size_t currlen;
-
+
state = DP_S_DEFAULT;
currlen = flags = cflags = min = 0;
max = -1;
while (state != DP_S_DONE)
{
- if ((ch == '\0') || (currlen >= maxlen))
+ if ((ch == '\0') || (currlen >= maxlen))
state = DP_S_DONE;
- switch(state)
+ switch(state)
{
case DP_S_DEFAULT:
- if (ch == '%')
+ if (ch == '%')
state = DP_S_FLAGS;
- else
+ else
dopr_outch (buffer, &currlen, maxlen, ch);
ch = *format++;
break;
case DP_S_FLAGS:
- switch (ch)
+ switch (ch)
{
case '-':
flags |= DP_F_MINUS;
}
break;
case DP_S_MIN:
- if (isdigit((unsigned char)ch))
+ if (isdigit((unsigned char)ch))
{
min = 10*min + char_to_int (ch);
ch = *format++;
- }
- else if (ch == '*')
+ }
+ else if (ch == '*')
{
min = va_arg (args, int);
ch = *format++;
state = DP_S_DOT;
- }
- else
+ }
+ else
state = DP_S_DOT;
break;
case DP_S_DOT:
- if (ch == '.')
+ if (ch == '.')
{
state = DP_S_MAX;
ch = *format++;
- }
- else
+ }
+ else
state = DP_S_MOD;
break;
case DP_S_MAX:
- if (isdigit((unsigned char)ch))
+ if (isdigit((unsigned char)ch))
{
if (max < 0)
max = 0;
max = 10*max + char_to_int (ch);
ch = *format++;
- }
- else if (ch == '*')
+ }
+ else if (ch == '*')
{
max = va_arg (args, int);
ch = *format++;
state = DP_S_MOD;
- }
- else
+ }
+ else
state = DP_S_MOD;
break;
case DP_S_MOD:
/* Currently, we don't support Long Long, bummer */
- switch (ch)
+ switch (ch)
{
case 'h':
cflags = DP_C_SHORT;
state = DP_S_CONV;
break;
case DP_S_CONV:
- switch (ch)
+ switch (ch)
{
case 'd':
case 'i':
- if (cflags == DP_C_SHORT)
+ if (cflags == DP_C_SHORT)
value = va_arg (args, short int);
else if (cflags == DP_C_LONG)
value = va_arg (args, long int);
break;
case 's':
strvalue = va_arg (args, char *);
- if (max < 0)
+ if (max < 0)
max = maxlen; /* ie, no max */
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
break;
fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
break;
case 'n':
- if (cflags == DP_C_SHORT)
+ if (cflags == DP_C_SHORT)
{
short int *num;
num = va_arg (args, short int *);
*num = currlen;
- }
- else if (cflags == DP_C_LONG)
+ }
+ else if (cflags == DP_C_LONG)
{
long int *num;
num = va_arg (args, long int *);
*num = currlen;
- }
- else
+ }
+ else
{
int *num;
num = va_arg (args, int *);
break; /* some picky compilers need this */
}
}
- if (currlen < maxlen - 1)
+ if (currlen < maxlen - 1)
buffer[currlen] = '\0';
- else
+ else
buffer[maxlen - 1] = '\0';
}
{
int padlen, strln; /* amount to pad */
int cnt = 0;
-
+
if (value == 0)
{
value = "<NULL>";
for (strln = 0; value[strln]; ++strln); /* strlen */
padlen = min - strln;
- if (padlen < 0)
+ if (padlen < 0)
padlen = 0;
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
padlen = -padlen; /* Left Justify */
- while ((padlen > 0) && (cnt < max))
+ while ((padlen > 0) && (cnt < max))
{
dopr_outch (buffer, currlen, maxlen, ' ');
--padlen;
++cnt;
}
- while (*value && (cnt < max))
+ while (*value && (cnt < max))
{
dopr_outch (buffer, currlen, maxlen, *value++);
++cnt;
}
- while ((padlen < 0) && (cnt < max))
+ while ((padlen < 0) && (cnt < max))
{
dopr_outch (buffer, currlen, maxlen, ' ');
++padlen;
int spadlen = 0; /* amount to space pad */
int zpadlen = 0; /* amount to zero pad */
int caps = 0;
-
+
if (max < 0)
max = 0;
if (flags & DP_F_SPACE)
signvalue = ' ';
}
-
+
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
do {
zpadlen = MAX(zpadlen, spadlen);
spadlen = 0;
}
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
spadlen = -spadlen; /* Left Justifty */
#ifdef DEBUG_SNPRINTF
#endif
/* Spaces */
- while (spadlen > 0)
+ while (spadlen > 0)
{
dopr_outch (buffer, currlen, maxlen, ' ');
--spadlen;
}
/* Sign */
- if (signvalue)
+ if (signvalue)
dopr_outch (buffer, currlen, maxlen, signvalue);
/* Zeros */
- if (zpadlen > 0)
+ if (zpadlen > 0)
{
while (zpadlen > 0)
{
}
/* Digits */
- while (place > 0)
+ while (place > 0)
dopr_outch (buffer, currlen, maxlen, convert[--place]);
-
+
/* Left Justified spaces */
while (spadlen < 0) {
dopr_outch (buffer, currlen, maxlen, ' ');
result *= 10;
exp--;
}
-
+
return result;
}
int iplace = 0;
int fplace = 0;
int padlen = 0; /* amount to pad */
- int zpadlen = 0;
+ int zpadlen = 0;
int caps = 0;
long intpart;
long fracpart;
-
- /*
+
+ /*
* AIX manpage says the default is 0, but Solaris says the default
* is 6, and sprintf on AIX defaults to 6
*/
intpart = ufvalue;
- /*
- * Sorry, we only support 9 digits past the decimal because of our
+ /*
+ * Sorry, we only support 9 digits past the decimal because of our
* conversion method
*/
if (max > 9)
fconvert[fplace] = 0;
/* -1 for decimal point, another -1 if we are printing a sign */
- padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
+ padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
zpadlen = max - fplace;
if (zpadlen < 0)
zpadlen = 0;
- if (padlen < 0)
+ if (padlen < 0)
padlen = 0;
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
padlen = -padlen; /* Left Justifty */
- if ((flags & DP_F_ZERO) && (padlen > 0))
+ if ((flags & DP_F_ZERO) && (padlen > 0))
{
- if (signvalue)
+ if (signvalue)
{
dopr_outch (buffer, currlen, maxlen, signvalue);
--padlen;
dopr_outch (buffer, currlen, maxlen, ' ');
--padlen;
}
- if (signvalue)
+ if (signvalue)
dopr_outch (buffer, currlen, maxlen, signvalue);
- while (iplace > 0)
+ while (iplace > 0)
dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
/*
*/
dopr_outch (buffer, currlen, maxlen, '.');
- while (fplace > 0)
+ while (fplace > 0)
dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
while (zpadlen > 0)
--zpadlen;
}
- while (padlen < 0)
+ while (padlen < 0)
{
dopr_outch (buffer, currlen, maxlen, ' ');
++padlen;
char *fmt;
#endif
VA_LOCAL_DECL;
-
+
VA_START (fmt);
VA_SHIFT (str, char *);
VA_SHIFT (count, size_t );
"%3.2f",
NULL
};
- double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
+ double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
0.9996, 1.996, 4.136, 0};
char *int_fmt[] = {
"%-1.5d",
sprintf (buf2, fp_fmt[x], fp_nums[y]);
if (strcmp (buf1, buf2))
{
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
fp_fmt[x], buf1, buf2);
fail++;
}
sprintf (buf2, int_fmt[x], int_nums[y]);
if (strcmp (buf1, buf2))
{
- printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
int_fmt[x], buf1, buf2);
fail++;
}
{ "mutt_command", OT_STR, STR_MUTT_COMMAND, UL "mutt" },
{ "mutt_return_all_emails", OT_BOOL, BOOL_MUTT_RETURN_ALL_EMAILS,
TRUE },
-
+
{ "print_command", OT_STR, STR_PRINT_COMMAND, UL "lpr" },
{ "www_command", OT_STR, STR_WWW_COMMAND, UL "lynx" },
-
+
{ "address_style", OT_STR, STR_ADDRESS_STYLE, UL "eu" },
{ "use_ascii_only", OT_BOOL, BOOL_USE_ASCII_ONLY, FALSE },
find_token_start(buffer *b)
{
assert(b);
-
+
for(; ISSPACE(*b -> ptr); b -> ptr ++);
}
opt_set_set_option(char *var, char *p, struct option *opt)
{
int len;
-
+
strtrim(p);
len = strlen(p);
default:
assert(0);
}
-
+
return NULL;
}
*p++ = 0;
else
return "invalid value assignment";
-
+
strtrim(b -> ptr);
for(i = 0;abook_vars[i].option; i++)
if(!strcmp(abook_vars[i].option, b -> ptr))
return opt_set_set_option(b -> ptr, p, &abook_vars[i]);
-
+
return "unknown option";
}
char *err = NULL;
char *token;
buffer b;
-
+
assert(line && fn);
b.ptr = line;
return FALSE;
break;
}
-
+
fprintf(stderr, "%s: parse error at line %d: ", fn, n);
if(err)
fprintf(stderr, "%s\n", err);
char *line = NULL;
int n;
int err = 0;
-
+
if((in = fopen(filename, "r")) == NULL)
return -1;
-
+
for(n = 1;!feof(in); n++) {
line = getaline(in);
fprintf(stderr, "Warning: COLS=%d, LINES=%d\n", winsz.ws_col, winsz.ws_row);
}
#endif
-
+
if(winsz.ws_col >= MIN_COLS && winsz.ws_row >= MIN_LINES) {
#ifdef HAVE_RESIZETERM
resizeterm(winsz.ws_row, winsz.ws_col);
if( can_resize )
resize_abook();
else
- should_resize = TRUE;
+ should_resize = TRUE;
}
#endif /* SIGWINCH */
statusline_msg(char *msg)
{
int c;
-
+
clear_statusline();
statusline_addstr(msg);
c = getch();
if(statusline_ask_boolean("Remove selected item(s)", TRUE))
remove_selected_items();
- clear_statusline();
+ clear_statusline();
refresh_list();
}
return;
fexport("text", handle, mode);
-
+
pclose(handle);
}