From 6b1f75cdd4dfc20b14d1393601533ac199a9b7e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonathan=20Sch=C3=B6bel?= <jonathan@xn--schbel-yxa.info>
Date: Mon, 20 Jun 2022 20:57:38 +0200
Subject: [PATCH] added Fragment

Fragment is the core of SeFHT. (As the name suggests) It represents a
Node inside the DOM and all subsequent Nodes (a Tree).
---
 src/Makefile.am |  1 +
 src/fragment.c  | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/fragment.h  | 37 ++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 src/fragment.c
 create mode 100644 src/fragment.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 0704e76..054cec1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,3 +10,4 @@ sefht_fcgi_SOURCES += macro.h
 sefht_fcgi_SOURCES += sefht.h
 sefht_fcgi_SOURCES += cms.c cms.h
 sefht_fcgi_SOURCES += data.c data.h
+sefht_fcgi_SOURCES += fragment.c fragment.h
diff --git a/src/fragment.c b/src/fragment.c
new file mode 100644
index 0000000..837cf56
--- /dev/null
+++ b/src/fragment.c
@@ -0,0 +1,50 @@
+/*
+ * fragment.c
+ *
+ * Copyright 2022 Jonathan Schöbel <jonathan@Ubermos-2019>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ *
+ */
+
+
+#include <stdlib.h>
+
+#include "macro.h"
+
+#include "fragment.h"
+
+
+struct SH_Fragment *
+SH_Fragment_new ()
+{
+	struct SH_Fragment * fragment;
+	fragment = malloc (sizeof (struct SH_Fragment));
+
+	if (fragment == NULL) {
+		EXIT;
+	}
+
+	return fragment;
+}
+
+void
+SH_Fragment_free (struct SH_Fragment * fragment)
+{
+	free (fragment);
+	return;
+}
diff --git a/src/fragment.h b/src/fragment.h
new file mode 100644
index 0000000..68066f0
--- /dev/null
+++ b/src/fragment.h
@@ -0,0 +1,37 @@
+/*
+ * fragment.h
+ *
+ * Copyright 2022 Jonathan Schöbel <jonathan@Ubermos-2019>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ *
+ */
+
+
+#ifndef _FRAGMENT_H
+#define _FRAGMENT_H
+
+
+struct SH_Fragment
+{
+	//
+};
+
+struct SH_Fragment * SH_Fragment_new ();
+void SH_Fragment_free (struct SH_Fragment * fragment);
+
+#endif /* _FRAGMENT_H */
-- 
GitLab