diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-07 02:02:45 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-07 02:02:45 +0300 |
commit | e3a41da5a0a3d70ac53591f2b66144f2be2b3871 (patch) | |
tree | 789cc69b05f2447c11f04dbb6ae972ffa0acd1c9 /include/config.h | |
download | revela-e3a41da5a0a3d70ac53591f2b66144f2be2b3871.tar.gz revela-e3a41da5a0a3d70ac53591f2b66144f2be2b3871.zip |
Initial commit.
Almost functional but still missing features and lacking testing.
Diffstat (limited to 'include/config.h')
-rw-r--r-- | include/config.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h new file mode 100644 index 0000000..398160b --- /dev/null +++ b/include/config.h @@ -0,0 +1,43 @@ +#ifndef REVELA_CONFIG_H +#define REVELA_CONFIG_H +#include <stdbool.h> +#include <stdint.h> +#include <sys/types.h> + +#define SITE_CONF "site.ini" +#define ALBUM_CONF "album.ini" + +struct image_config { + bool strip; + uint8_t quality; + size_t max_width; + size_t max_height; + bool smart_resize; +}; + +struct site_config { + char *title; + char *base_url; + uint32_t max_previews; + struct image_config images; + struct image_config thumbnails; +}; + +struct album_config { + char *title; + char *desc; +}; + +bool site_config_read_ini(const char *wdir, struct site_config *); + +bool album_config_read_ini(const char *adir, struct album_config *); + +struct site_config *site_config_init(void); + +struct album_config *album_config_init(void); + +void site_config_destroy(struct site_config *config); + +void album_config_destroy(struct album_config *config); + +#endif |