return (e_filters[i].func) (handle, e);
}
-
+
int
export_file(char filtname[FILTNAME_LEN], char *filename)
buf = line;
continue;
}
-
+
if(*line != ' ') {
fseek(in, pos, SEEK_SET);
free(line);
free(buf);
return NULL;
}
-
+
return buf;
}
int i;
memset(abook_item, 0, sizeof(abook_item));
-
+
if( !ldif_item[LDIF_ITEM_FIELDS -1] )
goto bail_out;
-
+
for(i=0; i < LDIF_ITEM_FIELDS; i++) {
if(ldif_conv_table[i] >= 0 && ldif_item[i] && *ldif_item[i] )
my_free(line);
continue; /* just skip the errors */
}
-
+
ldif_fix_string(value);
ldif_convert(item, type, value);
free(line);
return 1;
}
-
+
ptr += 5;
while( ISSPACE(*ptr) )
item[EMAIL] = email;
else
return;
-
+
while( (start = strchr(start, ',')) && i++ < MAX_EMAILS - 1) {
tmp = strconcat("From: ", ++start, NULL);
getname(tmp, &name, &email);
for(;;) {
memset(item, 0, sizeof(item));
-
+
if( !mutt_read_line(in, &item[NICK],
&item[NAME]) )
mutt_parse_email(item);
if( ( tmp = strchr(s,')')) )
*tmp=0;
-
+
for(i=1; ( tmp = strchr(s, ',') ) != NULL ; i++, s=tmp+1 )
if( i > MAX_EMAILS - 1 ) {
*tmp = 0;
for(i=0, last=0; !last ; i++) {
if( ! (end = strchr(start, '\t')) )
last=1;
-
+
len = last ? strlen(start) : (int) (end-start);
len = min(len, 400-1);
-
+
if(i < (int)(sizeof(pine_conv_table) / sizeof(*pine_conv_table))
&& pine_conv_table[i] >= 0) {
strncpy(tmp, start, len);
}
start = end + 1;
}
-
+
pine_convert_emails(item[EMAIL]);
add_item2database(item);
}
-
+
#define LINESIZE 1024
int i;
fgets(line, LINESIZE, in);
-
+
while(!feof(in)) {
for(i = 2;;i++) {
buf = (char *) realloc(buf, i*LINESIZE);
else
while( *ptr == ' ')
ptr++;
-
+
strcat(buf, ptr);
}
if( *buf == '#' ) {
{
char *copy, *trimmed;
int len;
-
+
copy = trimmed = strdup(s);
strtrim(trimmed);
-
+
len = strlen(trimmed);
if(trimmed[len - 1] == '\"' && *trimmed == '\"') {
if(len < 3) {
* csv addressbook export filters
*/
-#define CSV_LAST (-2)
-#define CSV_UNDEFINED (-3)
-#define CSV_SPECIAL(X) (-4 - (X))
-#define CSV_IS_SPECIAL(X) ((X) <= -4)
-#define CSV_GET_SPECIAL(X) (-4 + (X))
+#define CSV_LAST (-1)
+#define CSV_UNDEFINED (-2)
+#define CSV_SPECIAL(X) (-3 - (X))
+#define CSV_IS_SPECIAL(X) ((X) <= -3)
static int
csv_export_common(FILE *out, struct db_enumerator e,