X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=database.h;h=3bfeb4e385a342fed6cd77ad0a0c7793646c5ecd;hb=4d2aca39cdd96958b3f0bbc6973f15aac5133cdc;hp=43b733817a06827d8ba848c91b25d4fc4c26d4cc;hpb=c4d2f4ab3d5166b75f8fc1bf9e2be776014d391d;p=pkg%2Fabook.git diff --git a/database.h b/database.h index 43b7338..3bfeb4e 100644 --- a/database.h +++ b/database.h @@ -23,13 +23,23 @@ enum { NICK, URL, NOTES, + CUSTOM1, + CUSTOM2, + CUSTOM3, + CUSTOM4, + CUSTOM5, ITEM_FIELDS /* this is the last */ }; #define LAST_FIELD (ITEM_FIELDS - 1) +#define CUSTOM_MIN CUSTOM1 +#define CUSTOM_MAX CUSTOM5 + typedef char * list_item[ITEM_FIELDS]; +#define MAX_FIELDNAME_LEN 21 + struct abook_field { char *name; char *key; @@ -46,6 +56,7 @@ struct db_enumerator { int mode; /* warning: read only */ }; +int find_field(const char *field); int parse_database(FILE *in); int write_database(FILE *out, struct db_enumerator e); int load_database(char *filename); @@ -63,6 +74,7 @@ int is_valid_item(int item); int real_db_enumerate_items(struct db_enumerator e); struct db_enumerator init_db_enumerator(int mode); +int change_custom_field_name(const char *name, int n); #define LAST_ITEM (items - 1)