aboutsummaryrefslogtreecommitdiff
path: root/include/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h43
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