#ifndef __BLOB_H
#define __BLOB_H
typedef struct blob {
char *name;
unsigned char *data;
unsigned long len;
unsigned long size;
int isClosed;
#ifdef CL_DEBUG
object_type magic;
#endif
} blob;
blob *blobCreate(void);
void blobDestroy(blob *b);
void blobArrayDestroy(blob *b[], int n);
void blobSetFilename(blob *b, const char *dir, const char *filename);
const char *blobGetFilename(const blob *b);
void blobAddData(blob *b, const unsigned char *data, size_t len);
unsigned char *blobGetData(const blob *b);
unsigned long blobGetDataSize(const blob *b);
void blobClose(blob *b);
int blobcmp(const blob *b1, const blob *b2);
void blobGrow(blob *b, size_t len);
typedef struct fileblob {
FILE *fp;
blob b;
} fileblob;
fileblob *fileblobCreate(void);
void fileblobDestroy(fileblob *fb);
void fileblobSetFilename(fileblob *fb, const char *dir, const char *filename);
const char *fileblobGetFilename(const fileblob *fb);
void fileblobAddData(fileblob *fb, const unsigned char *data, size_t len);
void sanitiseName(char *name);
#endif