#ifndef VCARD_H
#define VCARD_H
#include "defines.h"


typedef struct VCF_IMPORT{
	char *group,*name,*param,*value, nextline[BFSZ];
	int gotline,incard,version_ok,base64;
	int carddav;
	FILE *f;
}VcfImport;

enum {VCF_END,VCF_BEGINCARD,VCF_ENDCARD,VCF_RECORD,VCF_DATA};

int vcf_new(VcfImport **vc);
int vcf_free(VcfImport **vc);
int vcf_line(VcfImport *vc, void *f, char *raw, int *len, int bfsz);
int vcf_rawline(VcfImport *vc, FILE *f, char *raw);
char *vcard_locate_type(char *param, char *name, char *out);
char *vcard_decode(char *in,char *out);
char *vcard_encode(char *in,char *out);
char *vcard_url_decode(char *in,char *out);
char *vcard_url_encode(char *in,char *out);
char *vcard_decode_text(char *in,char *out);
char *vcard_encode_text(char *in,char *out);

char *vcard_eol_decode(char *bf, char *s);


#endif
