summaryrefslogtreecommitdiffstats
path: root/xlators/playground/template/src/template.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/playground/template/src/template.h')
-rw-r--r--xlators/playground/template/src/template.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/xlators/playground/template/src/template.h b/xlators/playground/template/src/template.h
index d6aced50107..c53dc1c7010 100644
--- a/xlators/playground/template/src/template.h
+++ b/xlators/playground/template/src/template.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013 Red Hat, Inc. <http://www.redhat.com>
+ Copyright (c) 2013-2018 Red Hat, Inc. <http://www.redhat.com>
This file is part of GlusterFS.
This file is licensed to you under your choice of the GNU Lesser
@@ -10,15 +10,34 @@
#ifndef __TEMPLATE_H__
#define __TEMPLATE_H__
-#ifndef _CONFIG_H
-#define _CONFIG_H
-#include "config.h"
-#endif
+#include <glusterfs/glusterfs.h>
+#include <glusterfs/logging.h>
+#include <glusterfs/dict.h>
+#include <glusterfs/xlator.h>
+#include <glusterfs/defaults.h>
-#include "glusterfs.h"
-#include "logging.h"
-#include "dict.h"
-#include "xlator.h"
-#include "defaults.h"
+struct template_private {
+ /* Add all the relevant fields you need here */
+ int32_t dummy;
+};
+
+typedef struct template_private template_private_t;
+
+/* Below section goes to template-mem-types.h */
+#include <glusterfs/mem-types.h>
+
+enum gf_template_mem_types_ {
+ gf_template_mt_private_t = gf_common_mt_end + 1,
+ gf_template_mt_end,
+};
+
+/* This normally goes to another file 'template-messages.h",
+ required for 'gf_msg()'.
+ NOTE: make sure you have added your component (in this case,
+ TEMPLATE) in `libglusterfs/src/glfs-message-id.h`.
+ */
+#include <glusterfs/glfs-message-id.h>
+
+GLFS_MSGID(TEMPLATE, TEMPLATE_MSG_NO_MEMORY, TEMPLATE_MSG_NO_GRAPH);
#endif /* __TEMPLATE_H__ */