summary refs log tree commit diff
path: root/archive.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--archive.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/archive.h b/archive.h
index d804021..8d96878 100644
--- a/archive.h
+++ b/archive.h
@@ -14,6 +14,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
 
@@ -56,6 +57,20 @@ static inline void envelopeFree(struct Envelope envelope) {
 	free(envelope.bcc.addrs);
 }
 
+#define TEMPLATE(...) #__VA_ARGS__
+
+struct Variable {
+	const char *name;
+	const char *value;
+};
+
+typedef int EscapeFn(FILE *file, const char *str);
+
+int templateRender(
+	FILE *file, const char *template,
+	const struct Variable *vars, EscapeFn *escape
+);
+
 #define MBOX_HEADERS \
 	"Date Subject From Sender Reply-To To Cc Bcc " \
 	"Message-Id In-Reply-To References " \
@@ -64,3 +79,5 @@ static inline void envelopeFree(struct Envelope envelope) {
 int mboxFrom(FILE *file);
 int mboxHeader(FILE *file, char *header);
 int mboxBody(FILE *file, char *body);
+
+int htmlEnvelope(FILE *file, const struct Envelope *envelope);