summaryrefslogtreecommitdiff
path: root/template.h
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2024-02-20 21:17:01 +0100
committerVincent Douillet <vincent@vdouillet.fr>2024-02-20 22:13:53 +0100
commit0effd40bad7ae753102e7040159afd76be4e8732 (patch)
tree20c80821ba637a395d8874414e00f4d120a837ea /template.h
parent42f538cc66546997a166dbe67e489c9afabbb908 (diff)
browse: http page
Diffstat (limited to 'template.h')
-rw-r--r--template.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/template.h b/template.h
new file mode 100644
index 0000000..560465f
--- /dev/null
+++ b/template.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2023, Vincent Douillet <vincent@vdouillet.fr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TEMPLATE_H
+#define TEMPLATE_H
+
+/*
+ * A set of templates for a page.
+ */
+struct page_template {
+ char *header; /* global header */
+ char *footer; /* global footer */
+ char *page_header; /* page specific header */
+ char *page_footer; /* page specific footer */
+ char *page_item; /* page specific item template */
+};
+
+/*
+ * Build a new set of templates for a specific page.
+ */
+struct page_template *page_template_new(char *);
+
+/*
+ * Free a set of templates. Should be able to free a partially allocated set of
+ * templates as per page_template_new.
+ */
+void page_template_free(struct page_template *);
+
+#endif /* TEMPLATE_H */