grim/gplate

Parents c7a1bd6c023e
Children 7130266958a2
Added gplate-config api for handling configs. Right now, all this has is a load_default which is the default config, i'll work on the rest of this later...
--- a/gplate/Makefile.am Sun Feb 10 02:26:34 2008 -0600
+++ b/gplate/Makefile.am Sun Feb 10 02:27:09 2008 -0600
@@ -9,6 +9,7 @@
gplate-code-tag.h \
gplate-collection.h \
gplate-comment-tag.h \
+ gplate-config.h \
gplate-dictionary-variable.h \
gplate-errors.h \
gplate-function.h \
@@ -26,6 +27,7 @@
gplate-code-tag.c \
gplate-collection.c \
gplate-comment-tag.c \
+ gplate-config.c \
gplate-dictionary-variable.c \
gplate-errors.c \
gplate-function.c \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/gplate-config.c Sun Feb 10 02:27:09 2008 -0600
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2007-2008 Gary Kramlich <grim@reaperworld.com>
+ *
+ * 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.
+ *
+ */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <gplate/gplate-config.h>
+
+#include <gplate/gplate-library.h>
+
+#include <gplate/gplate-code-tag.h>
+#include <gplate/gplate-comment-tag.h>
+#include <gplate/gplate-text-tag.h>
+#include <gplate/gplate-variable-tag.h>
+
+#include <gplate/gplate-print-function.h>
+#include <gplate/gplate-noop-function.h>
+
+/******************************************************************************
+ * API
+ *****************************************************************************/
+
+/**
+ * gplate_config_load_default:
+ *
+ * Loads the default configuration. In other words, the normal tags and
+ * functions that GPlate uses.
+ */
+void
+gplate_config_load_default(void) {
+ gplate_library_add_tag(GPLATE_TYPE_CODE_TAG, NULL);
+ gplate_library_add_tag(GPLATE_TYPE_COMMENT_TAG, NULL);
+ gplate_library_add_tag(GPLATE_TYPE_TEXT_TAG, NULL);
+ gplate_library_add_tag(GPLATE_TYPE_VARIABLE_TAG, NULL);
+
+ gplate_library_add_function("noop", GPLATE_TYPE_NOOP_FUNCTION, NULL);
+ gplate_library_add_function("print", GPLATE_TYPE_PRINT_FUNCTION, NULL);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplate/gplate-config.h Sun Feb 10 02:27:09 2008 -0600
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2007-2008 Gary Kramlich <grim@reaperworld.com>
+ *
+ * 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 GPLATE_CONFIG_H
+#define GPLATE_CONFIG_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void gplate_config_load_default(void);
+
+G_END_DECLS
+
+#endif /* GPLATE_CONFIG_H */