Move some definitions outside of cynara-admin.h 12/27512/6
authorAleksander Zdyb <a.zdyb@partner.samsung.com>
Wed, 17 Sep 2014 06:20:44 +0000 (08:20 +0200)
committerAleksander Zdyb <a.zdyb@partner.samsung.com>
Thu, 18 Sep 2014 07:20:00 +0000 (09:20 +0200)
The consts and structs will be used by both cynara-admin
and upcomming cynara-offline-admin APIs.

Change-Id: I05e320e54ff9c6a16521318560de059c6928cbea

packaging/cynara.spec
src/include/CMakeLists.txt
src/include/cynara-admin-types.h [new file with mode: 0644]
src/include/cynara-admin.h

index 3421fd9..015737a 100644 (file)
@@ -372,6 +372,7 @@ fi
 %files -n libcynara-admin-devel
 %{_includedir}/cynara/cynara-admin.h
 %{_includedir}/cynara/cynara-admin-error.h
+%{_includedir}/cynara/cynara-admin-types.h
 %{_libdir}/libcynara-admin.so
 %{_libdir}/pkgconfig/cynara-admin.pc
 
index 261c34d..e4c74a4 100644 (file)
@@ -19,6 +19,7 @@
 INSTALL(FILES
     ${CYNARA_PATH}/include/cynara-admin.h
     ${CYNARA_PATH}/include/cynara-admin-error.h
+    ${CYNARA_PATH}/include/cynara-admin-types.h
     ${CYNARA_PATH}/include/cynara-client.h
     ${CYNARA_PATH}/include/cynara-client-error.h
     ${CYNARA_PATH}/include/cynara-creds-commons.h
diff --git a/src/include/cynara-admin-types.h b/src/include/cynara-admin-types.h
new file mode 100644 (file)
index 0000000..61b3545
--- /dev/null
@@ -0,0 +1,93 @@
+/**
+ *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+/**
+ * \file        cynara-admin-types.h
+ * \author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * \author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * \version     1.0
+ * \brief       This file contains structs and consts for cynara admin.
+ */
+
+#ifndef CYNARA_ADMIN_TYPES_H
+#define CYNARA_ADMIN_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \name cynara_admin_policy
+ * defines single policy
+ * bucket - is the name of bucket, in which policy is placed
+ * client, user, privilege - defines policy key
+ * result - defines result of policy
+ * result_extra - not always used, may contain some additional result data
+ *                like e.g. name of bucket in case result == CYNARA_ADMIN_BUCKET
+ */
+struct cynara_admin_policy {
+    char *bucket;
+
+    char *client;
+    char *user;
+    char *privilege;
+
+    int result;
+    char *result_extra;
+};
+
+/**
+ * \name Wildcard
+ * definition of WILDCARD, that can replace client, user or privilege name.
+ * WILDCARD matches any string during check procedure from libcynara-client.
+ */
+#define CYNARA_ADMIN_WILDCARD "*"
+
+/**
+ * \name Name of Default Bucket
+ * definition of name for default bucket - the one that check starts in.
+ * default bucket cannot be removed, although its default policy
+ * (which originally is set to DENY) can be changed.
+ */
+#define CYNARA_ADMIN_DEFAULT_BUCKET ""
+
+/**
+ * \name Operation Codes
+ * operation codes that define action type to be taken in below defined functions
+ * they are used mostly to define policy result
+ * @{
+ */
+
+/*! \brief   a policy or bucket should be removed */
+#define CYNARA_ADMIN_DELETE -1
+
+/*! \brief   set policy result or bucket's default policy to DENY */
+#define CYNARA_ADMIN_DENY 0
+
+/*! \brief   set bucket's default policy to NONE */
+#define CYNARA_ADMIN_NONE 1
+
+/*! \brief   set policy result or bucket's default policy to ALLOW */
+#define CYNARA_ADMIN_ALLOW 2
+
+/*! \brief   set policy to point into another bucket */
+#define CYNARA_ADMIN_BUCKET 3
+/** @}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CYNARA_ADMIN_TYPES_H */
index 8260676..d93a232 100644 (file)
@@ -24,6 +24,7 @@
 #define CYNARA_ADMIN_H
 
 #include <cynara-admin-error.h>
+#include <cynara-admin-types.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -37,64 +38,6 @@ extern "C" {
 struct cynara_admin;
 
 /**
- * \name Wildcard
- * definition of WILDCARD, that can replace client, user or privilege name.
- * WILDCARD matches any string during check procedure from libcynara-client.
- */
-#define CYNARA_ADMIN_WILDCARD "*"
-
-/**
- * \name Name of Default Bucket
- * definition of name for default bucket - the one that check starts in.
- * default bucket cannot be removed, although its default policy
- * (which originaly is set to DENY) can be changed.
- */
-#define CYNARA_ADMIN_DEFAULT_BUCKET ""
-
-/**
- * \name Operation Codes
- * operation codes that define action type to be taken in below defined functions
- * they are used mosty to define policy result
- * @{
- */
-
-/*! \brief   a policy or bucket should be removed */
-#define CYNARA_ADMIN_DELETE -1
-
-/*! \brief   set policy result or bucket's default policy to DENY */
-#define CYNARA_ADMIN_DENY 0
-
-/*! \brief   set bucket's default policy to NONE */
-#define CYNARA_ADMIN_NONE 1
-
-/*! \brief   set policy result or bucket's default policy to ALLOW */
-#define CYNARA_ADMIN_ALLOW 2
-
-/*! \brief   set policy to point into another bucket */
-#define CYNARA_ADMIN_BUCKET 3
-/** @}*/
-
-/**
- * \name cynara_admin_policy
- * defines single policy
- * bucket - is the name of bucket, in which policy is placed
- * client, user, privilege - defines policy key
- * result - defines result of policy
- * result_extra - not always used, may contain some additional result data
- *                like e.g. name of bucket in case result == CYNARA_ADMIN_BUCKET
- */
-struct cynara_admin_policy {
-    char *bucket;
-
-    char *client;
-    char *user;
-    char *privilege;
-
-    int result;
-    char *result_extra;
-};
-
-/**
  * \par Description:
  * Initialize cynara-admin library.
  * Creates structure used in following API calls.