/*   -*- coding: utf-8 -*-  */
/**********************************************************************
*
*  module   : Hfd
*  fichier  : Hfd.h
*  Auteur   : J. DUCLOY
*  Date     : Décembre 2013
*
***********************************************************************/
#ifndef _HFD_H_
#define _HFD_H_

#include "Buffer.h"
#include "SxmlNode.h"
#include "HfdHcb.h"
#include "HfdIterator.h"

#define Hfd HfdHcb

char *HfdGetPath(char *s1, char f1, char t1);
int HfdNameIsDir(char *name);
int HfdNameIsFile(char *name);

HfdRecord *HfdRecordReadKey(HfdHcb *hfd, char *key);

HfdRecord *HfdRecordCreate(int s, int i);
HfdRecord *HfdRecordPurge(HfdRecord *rec);
void HfdRecordFree(HfdRecord *rec);
HfdRecord *HfdRecordFgets( HfdRecord *rec, FILE *f1);
HfdRecord *HfdRecordReadKey(HfdHcb *hfd, char *key);
HfdRecord *HfdFileGetRecordKey(HfdFile *file, char *key);
HfdRecord *HfdRecordInit(HfdRecord *rec);
HfdRecord *HfdRecordGetSxml(HfdRecord *rec, FILE *f1);
SxmlNode  *HfdRecordToSxml(HfdRecord *rec);
SxmlNode *HfdSxmlReadKey(HfdHcb *hfd, char *key);


HfdFile *HfdFileCreate();
void HfdFileClose(HfdFile *file);
void HfdFileFree(HfdFile *file);
HfdFile *HfdFileOpen(HfdFile *file, char *path);
SxmlNode* HfdFileNextSxml(HfdFile *file);
HfdRecord *HfdFileGetRecordCont(HfdFile *file, char    *cont);
SxmlNode *HfdFileGetSxmlCont(HfdFile *file, char *cont);
SxmlNode *HfdFileGetSxmlRecordCont(HfdFile *file, char    *cont);


HfdHcb *HfdOpenReadKey(char *name);
SxmlNode* HfdFileGetSxmlKey(HfdFile *file, char *k);

int HfdOpenPathCont(HfdHcb *hfd, char *path, char *tag);
HfdFile *HfdFileOpenReadCont(HfdFile *file, char *path);
void HfdFileSetRecordTag( HfdFile *file, char *t1);

#endif /* _HFD_H_ */
