Archived
1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2011-06-08 18:46:58 +02:00
commit b2df740514
19 changed files with 1640 additions and 0 deletions

43
cconf.h Normal file
View file

@ -0,0 +1,43 @@
#ifndef CCONF_H
#define CCONF_H
/*
* data structure for 'Dlight compiled config' file format.
*/
/* \232 D C C */
#define CCONF_SIGNATURE 0xe8444343
struct cconf_header {
unsigned int signature;
unsigned int version;
unsigned char crc[20];
};
struct target {
char *src; /* source. (url) */
char *dest; /* destination, path on filesystem */
char **filter;
unsigned int nr;
};
struct cconf {
struct target *target;
unsigned int nr;
struct {
void *buf;
unsigned long size;
} map;
};
void cconf_free(struct cconf *c);
struct target* cconf_new_target(struct cconf *c);
void cconf_add_filter(struct target *t, char *filter);
int cconf_write(int fd, struct cconf *c);
struct cconf* cconf_read(const char *filename);
#endif /* CCONF_H */