diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-08-07 16:58:11 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-08-07 17:01:19 +0200 |
commit | 939c0c2e799734d46e3c3b784545f7c0c489c191 (patch) | |
tree | 9e308bf45b1c5ad015409198d141fc8cae1dbd95 /scriptbase.h | |
parent | e3c86f7ff37de0af10b4165216da14bf0f91dc0b (diff) | |
download | hydrilla-939c0c2e799734d46e3c3b784545f7c0c489c191.tar.gz hydrilla-939c0c2e799734d46e3c3b784545f7c0c489c191.zip |
migrate to Autotools
Diffstat (limited to 'scriptbase.h')
-rw-r--r-- | scriptbase.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/scriptbase.h b/scriptbase.h deleted file mode 100644 index f7694f7..0000000 --- a/scriptbase.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * part of Hydrilla - * Scriptbase struct and functions operating on it. - * - * Copyright (C) 2021 Wojtek Kosior - * Redistribution terms are gathered in the `copyright' file. - */ - -#ifndef SCRIPTBASE_H -#define SCRIPTBASE_H - -#include <stdbool.h> - -#include <cjson/cJSON.h> - -#include "hashtable.h" - -union component { - struct script *script; - struct bag *bag; - void *any; -}; - -struct component_ref { - struct component_ref *next; - union component component; - const char *component_type; -}; - -struct script { - char *name; - char *location; - char *sha256; - bool filled; -}; - -struct bag { - char *name; - struct component_ref *components, *last_component; - bool filled; -}; - -struct page { - char *pattern; - union component payload; - const char *payload_type; -}; - -struct scriptbase { - char *repo_url; - hashtable_t scripts; - hashtable_t bags; - hashtable_t pages; -}; - -int catalogue_component(const char *path, cJSON *index_json, - struct scriptbase *base); - -int scriptbase_init(struct scriptbase *base, const char *repo_url); - -void scriptbase_destroy(struct scriptbase *base); - -const struct script *get_script(const char *name, struct scriptbase *base); -const struct bag *get_bag(const char *name, struct scriptbase *base); -const struct page *get_pattern(const char *pattern, struct scriptbase *base); - -char *get_script_json(const char *name, struct scriptbase *base); -char *get_bag_json(const char *name, struct scriptbase *base); -char *get_pattern_json(const char *name, struct scriptbase *base); -char *get_page_query_json(const char *name, struct scriptbase *base); - -int init_url_lookup_regex(void); -void destroy_url_lookup_regex(void); -int lookup_url(const char *url, struct scriptbase *base, - int (*callback)(struct page*, void*), void *data); - -#endif /* SCRIPTBASE_H */ |