5 kx
5 kx #ifndef __REPO_LIST_H
5 kx #define __REPO_LIST_H
5 kx
5 kx #ifndef __DEBUG__
5 kx #define __DEBUG__ 0
5 kx #endif
5 kx
5 kx #ifndef ST_GLOBAL
5 kx #define ST_GLOBAL 1
5 kx #endif
5 kx #ifndef ST_REPOS
5 kx #define ST_REPOS 2
5 kx #endif
5 kx
5 kx #ifndef DT_NUMERICAL
5 kx #define DT_NUMERICAL 0x01
5 kx #endif
5 kx #ifndef DT_PATH
5 kx #define DT_PATH 0x02
5 kx #endif
5 kx #ifndef DT_STRING
5 kx #define DT_STRING 0x04
5 kx #endif
5 kx
5 kx struct section
5 kx {
5 kx int type;
5 kx unsigned char *name;
5 kx struct dlist *list;
5 kx };
5 kx
5 kx struct variable
5 kx {
5 kx unsigned char *name;
5 kx union
5 kx {
5 kx int val;
5 kx unsigned char *vptr;
5 kx } _v;
5 kx unsigned int type;
5 kx };
5 kx
5 kx struct repo
5 kx {
5 kx unsigned char *path;
5 kx struct dlist *list;
5 kx };
5 kx
5 kx extern struct dlist *config;
5 kx
5 kx
5 kx #ifdef __cplusplus
5 kx extern "C" {
5 kx #endif
5 kx
5 kx typedef void (*rlist_errfunc)( const char *fmt, ... );
5 kx
5 kx extern void rlist_error( const char *fmt, ... ) __attribute__((format (printf,1,2)));
5 kx extern rlist_errfunc rlist_fatal; /* Default Fatal Error Function == rlist_error() */
5 kx
5 kx
5 kx extern struct dlist *read_config( void );
5 kx extern void print_config( struct strbuf *sb, struct dlist *list );
5 kx extern struct variable *lookup( struct repo *repo, struct variable *variable );
5 kx extern struct variable *lookup_global( struct section *section, struct variable *variable );
5 kx extern struct repo *lookup_repo( struct dlist *config, const char *path );
5 kx extern struct section *lookup_section( struct dlist *config, const char *name );
5 kx extern struct section *lookup_global_section( struct dlist *config );
5 kx
5 kx extern int repolist_length( struct dlist *config );
5 kx extern struct repo *repolist_nth( struct dlist *config, int n );
5 kx extern int repo_position( struct dlist *config, struct repo *repo );
5 kx
5 kx extern struct dlist *parent_section_node_repolist_nth( struct dlist *config, int n );
5 kx extern struct dlist *parent_rlist_node_repolist_nth( struct dlist *config, int n );
5 kx
5 kx extern void free_config( void );
5 kx
5 kx
5 kx #ifdef __cplusplus
5 kx }
5 kx #endif
5 kx
5 kx #endif /* __REPO_LIST_H */