summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd3ad55)
raw | patch | inline | side by side (parent: cd3ad55)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 19 Feb 2014 22:12:24 +0000 (23:12 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 19 Feb 2014 22:12:24 +0000 (23:12 +0100) |
src/Makefile.am | patch | blob | history | |
src/core/store-private.h | [new file with mode: 0644] | patch | blob |
src/core/store.c | patch | blob | history | |
src/frontend/connection-private.h | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index 873694874bc06645af68624bb93bbdb23204d875..77ce39fba705e3dc96c57cc4b3568e2b9aad825e 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
core/object.c include/core/object.h \
core/plugin.c include/core/plugin.h \
core/store.c include/core/store.h \
+ core/store-private.h \
core/data.c include/core/data.h \
frontend/connection.c include/frontend/connection.h \
frontend/connection-private.h \
diff --git a/src/core/store-private.h b/src/core/store-private.h
--- /dev/null
+++ b/src/core/store-private.h
@@ -0,0 +1,92 @@
+/*
+ * SysDB - src/core/store-private.h
+ * Copyright (C) 2012-2013 Sebastian 'tokkee' Harl <sh@tokkee.org>
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+/*
+ * private data structures used by the store module
+ */
+
+#ifndef SDB_CORE_STORE_PRIVATE_H
+#define SDB_CORE_STORE_PRIVATE_H 1
+
+#include "core/store.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct sdb_store_base {
+ sdb_object_t super;
+
+ /* object type */
+ int type;
+
+ /* common meta information */
+ sdb_time_t last_update;
+ sdb_store_base_t *parent;
+};
+#define STORE_BASE(obj) ((sdb_store_base_t *)(obj))
+#define STORE_CONST_BASE(obj) ((const sdb_store_base_t *)(obj))
+
+typedef struct {
+ sdb_store_base_t super;
+
+ sdb_data_t value;
+} sdb_attribute_t;
+#define SDB_ATTR(obj) ((sdb_attribute_t *)(obj))
+#define SDB_CONST_ATTR(obj) ((const sdb_attribute_t *)(obj))
+
+typedef struct {
+ sdb_store_base_t super;
+
+ sdb_llist_t *children;
+ sdb_llist_t *attributes;
+} sdb_store_obj_t;
+#define SDB_STORE_OBJ(obj) ((sdb_store_obj_t *)(obj))
+#define SDB_CONST_STORE_OBJ(obj) ((const sdb_store_obj_t *)(obj))
+
+enum {
+ SDB_HOST = 1,
+ SDB_SERVICE,
+ SDB_ATTRIBUTE,
+};
+#define TYPE_TO_NAME(t) \
+ (((t) == SDB_HOST) ? "host" \
+ : ((t) == SDB_SERVICE) ? "service" \
+ : ((t) == SDB_ATTRIBUTE) ? "attribute" : "unknown")
+
+/* shortcuts for accessing the sdb_store_obj_t attributes
+ * of inheriting objects */
+#define _last_update super.last_update
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* ! SDB_CORE_STORE_H */
+
+/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
+
diff --git a/src/core/store.c b/src/core/store.c
index 753b9815b0bd4b23be3bee71cfcfacb651060f28..d3448c20b08a678785d5decca96d2078f353cb8b 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
*/
#include "sysdb.h"
-#include "core/store.h"
+#include "core/store-private.h"
#include "core/plugin.h"
#include "utils/error.h"
#include "utils/llist.h"
static sdb_type_t sdb_store_obj_type;
static sdb_type_t sdb_attribute_type;
-struct sdb_store_base {
- sdb_object_t super;
-
- /* object type */
- int type;
-
- /* common meta information */
- sdb_time_t last_update;
- sdb_store_base_t *parent;
-};
-#define STORE_BASE(obj) ((sdb_store_base_t *)(obj))
-#define STORE_CONST_BASE(obj) ((const sdb_store_base_t *)(obj))
-
-typedef struct {
- sdb_store_base_t super;
-
- sdb_data_t value;
-} sdb_attribute_t;
-#define SDB_ATTR(obj) ((sdb_attribute_t *)(obj))
-#define SDB_CONST_ATTR(obj) ((const sdb_attribute_t *)(obj))
-
-typedef struct {
- sdb_store_base_t super;
-
- sdb_llist_t *children;
- sdb_llist_t *attributes;
-} sdb_store_obj_t;
-#define SDB_STORE_OBJ(obj) ((sdb_store_obj_t *)(obj))
-#define SDB_CONST_STORE_OBJ(obj) ((const sdb_store_obj_t *)(obj))
-
-enum {
- SDB_HOST = 1,
- SDB_SERVICE,
- SDB_ATTRIBUTE,
-};
-#define TYPE_TO_NAME(t) \
- (((t) == SDB_HOST) ? "host" \
- : ((t) == SDB_SERVICE) ? "service" \
- : ((t) == SDB_ATTRIBUTE) ? "attribute" : "unknown")
-
-/* shortcuts for accessing the sdb_store_obj_t attributes
- * of inheriting objects */
-#define _last_update super.last_update
-
static int
store_base_init(sdb_object_t *obj, va_list ap)
{
index 6cf7395b7c122b0c5c329c622be47745f71f5bb3..39fc85240e7c637817f2495a1e9bea07f62737df 100644 (file)
/*
- * SysDB - src/include/frontend/connection-private.h
+ * SysDB - src/frontend/connection-private.h
* Copyright (C) 2013 Sebastian 'tokkee' Harl <sh@tokkee.org>
* All rights reserved.
*