#ifndef FBCPList__H
#define FBCPList__H

#ifndef FBVersion
#define FBVersion 7
#elif FBVersion != 7
#error "The headers for FBCAccess version have been mixed"
#endif

typedef struct FBCPList FBCPList;

#ifdef __cplusplus
extern "C" {
#endif
   

FBCPList* fbcplDictionary (void);
FBCPList* fbcplArray      (void);

FBCPList* fbcplParse( const char* plist);

FBCPList* fbcplAddToDictionary( FBCPList* plist, const char* name, const FBCPList* value);
FBCPList* fbcplSetValueForKey ( FBCPList* plist, const char* name, const FBCPList* value);
FBCPList* fbcplEmptyArray     ( void);
FBCPList* fbcplAddToArray     ( FBCPList* plist, const FBCPList* value);
FBCPList* fbcplMakeString     ( const char* str);

int fbcplIsDictionary(const FBCPList* pl);
int fbcplIsArray     (const FBCPList* pl);
int fbcplIsString    (const FBCPList* pl);

unsigned fbcplCount(const FBCPList* pl);

const char*     fbcplKeyAtIndex  (const FBCPList* pl, unsigned indx);
const FBCPList* fbcplValueForKey (const FBCPList* pl, const char* key);
const FBCPList* fbcplValueAtIndex(const FBCPList* pl, unsigned indx);
const char*     fbcplString      (const FBCPList* pl);

FBCPList* fbcplCopy(const FBCPList* pl);
FBCPList* fbcplSortArrayOfStrings(FBCPList* plist);
FBCPList* fbcplSortArrayOfDictionariesWithKey(FBCPList* plist, char *key);

void fbcplRelease(FBCPList* pl);

char* fbcplUnparse ( const FBCPList* pl);
void  fbcplFreeUnparsed(char* unparsed);                           

void  fbcplDump   (const FBCPList* pl);

#ifdef __cplusplus
   }
#endif

#endif /* FBCPList__H */
