summaryrefslogtreecommitdiff
path: root/csvncgi/repolist.h
diff options
context:
space:
mode:
authorkx <kx@radix.pro>2023-03-24 03:55:33 +0300
committerkx <kx@radix.pro>2023-03-24 03:55:33 +0300
commitbfc1508d26c89c9a36d2d9a827fe2c4ed128884d (patch)
tree8d41298a7072a3e289e4912f77ece75cbea1bd54 /csvncgi/repolist.h
parentc836ae3775cf72f17e0b7e3792d156fdb389bee3 (diff)
downloadcsvn-ui-bfc1508d26c89c9a36d2d9a827fe2c4ed128884d.tar.xz
Version 0.1.4
Diffstat (limited to 'csvncgi/repolist.h')
-rw-r--r--csvncgi/repolist.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/csvncgi/repolist.h b/csvncgi/repolist.h
new file mode 100644
index 0000000..a4c76ad
--- /dev/null
+++ b/csvncgi/repolist.h
@@ -0,0 +1,85 @@
+
+#ifndef __REPO_LIST_H
+#define __REPO_LIST_H
+
+#ifndef __DEBUG__
+#define __DEBUG__ 0
+#endif
+
+#ifndef ST_GLOBAL
+#define ST_GLOBAL 1
+#endif
+#ifndef ST_REPOS
+#define ST_REPOS 2
+#endif
+
+#ifndef DT_NUMERICAL
+#define DT_NUMERICAL 0x01
+#endif
+#ifndef DT_PATH
+#define DT_PATH 0x02
+#endif
+#ifndef DT_STRING
+#define DT_STRING 0x04
+#endif
+
+struct section
+{
+ int type;
+ unsigned char *name;
+ struct dlist *list;
+};
+
+struct variable
+{
+ unsigned char *name;
+ union
+ {
+ int val;
+ unsigned char *vptr;
+ } _v;
+ unsigned int type;
+};
+
+struct repo
+{
+ unsigned char *path;
+ struct dlist *list;
+};
+
+extern struct dlist *config;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*rlist_errfunc)( const char *fmt, ... );
+
+extern void rlist_error( const char *fmt, ... ) __attribute__((format (printf,1,2)));
+extern rlist_errfunc rlist_fatal; /* Default Fatal Error Function == rlist_error() */
+
+
+extern struct dlist *read_config( void );
+extern void print_config( struct strbuf *sb, struct dlist *list );
+extern struct variable *lookup( struct repo *repo, struct variable *variable );
+extern struct variable *lookup_global( struct section *section, struct variable *variable );
+extern struct repo *lookup_repo( struct dlist *config, const char *path );
+extern struct section *lookup_section( struct dlist *config, const char *name );
+extern struct section *lookup_global_section( struct dlist *config );
+
+extern int repolist_length( struct dlist *config );
+extern struct repo *repolist_nth( struct dlist *config, int n );
+extern int repo_position( struct dlist *config, struct repo *repo );
+
+extern struct dlist *parent_section_node_repolist_nth( struct dlist *config, int n );
+extern struct dlist *parent_rlist_node_repolist_nth( struct dlist *config, int n );
+
+extern void free_config( void );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __REPO_LIST_H */