Move error codes to different files 77/26577/2
authorZofia Abramowska <z.abramowska@samsung.com>
Tue, 26 Aug 2014 09:33:31 +0000 (11:33 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Thu, 28 Aug 2014 15:19:55 +0000 (17:19 +0200)
Change-Id: Ice6a05d3ef76efed19780e3ce785ff7491519a36

12 files changed:
packaging/cynara.spec
src/admin/api/admin-api.cpp
src/admin/logic/Logic.cpp
src/client/api/client-api.cpp
src/client/cache/CapacityCache.cpp
src/client/cache/NaiveInterpreter.h
src/client/cache/PolicyGetter.cpp
src/include/CMakeLists.txt
src/include/cynara-admin-error.h [new file with mode: 0644]
src/include/cynara-admin.h
src/include/cynara-client-error.h [new file with mode: 0644]
src/include/cynara-client.h

index 5524b9d..a06f5cc 100644 (file)
@@ -197,6 +197,7 @@ fi
 %files -n libcynara-client-devel
 %defattr(-,root,root,-)
 %{_includedir}/cynara/cynara-client.h
+%{_includedir}/cynara/cynara-client-error.h
 %{_libdir}/pkgconfig/cynara-client.pc
 %{_libdir}/libcynara-client.so
 
@@ -209,6 +210,7 @@ fi
 %files -n libcynara-admin-devel
 %defattr(-,root,root,-)
 %{_includedir}/cynara/cynara-admin.h
+%{_includedir}/cynara/cynara-admin-error.h
 %{_libdir}/libcynara-admin.so
 %{_libdir}/pkgconfig/cynara-admin.pc
 
index d6e6a12..417baa3 100644 (file)
@@ -34,6 +34,7 @@
 #include <types/PolicyType.h>
 
 #include <cynara-admin.h>
+#include <cynara-admin-error.h>
 
 #include <api/ApiInterface.h>
 #include <logic/Logic.h>
index 641929d..0934729 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <memory>
 
+#include <cynara-admin-error.h>
 #include <common.h>
 #include <exceptions/ServerConnectionErrorException.h>
 #include <log/log.h>
index b6f139f..0371853 100644 (file)
@@ -27,6 +27,7 @@
 #include <log/log.h>
 
 #include <cynara-client.h>
+#include <cynara-client-error.h>
 #include <api/ApiInterface.h>
 #include <logic/Logic.h>
 
index f5a3df5..a0025b2 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <cinttypes>
 
+#include <cynara-client-error.h>
 #include <log/log.h>
 
 #include <cache/CapacityCache.h>
index 9ae333f..9574f2c 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <attributes/attributes.h>
 #include <cache/CacheInterface.h>
+#include <cynara-client-error.h>
 
 namespace Cynara {
 
index 8bf1a39..f1f2e49 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <cinttypes>
 
+#include <cynara-client-error.h>
 #include <exceptions/ServerConnectionErrorException.h>
 #include <log/log.h>
 #include <request/CheckRequest.h>
index 5d8ed5a..486f657 100644 (file)
 
 INSTALL(FILES
     ${CYNARA_PATH}/include/cynara-client.h
+    ${CYNARA_PATH}/include/cynara-client-error.h
     DESTINATION ${INCLUDE_INSTALL_DIR}/cynara
     )
 
 INSTALL(FILES
     ${CYNARA_PATH}/include/cynara-admin.h
+    ${CYNARA_PATH}/include/cynara-admin-error.h
     DESTINATION ${INCLUDE_INSTALL_DIR}/cynara
     )
diff --git a/src/include/cynara-admin-error.h b/src/include/cynara-admin-error.h
new file mode 100644 (file)
index 0000000..0f5c4d1
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ *  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-error.h
+ * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @author      Zofia Abramowska <z.abramowska@samsung.com>
+ * @version     1.0
+ * @brief       This file contains error codes of administration APIs of Cynara.
+ */
+
+#ifndef CYNARA_ADMIN_ERROR_H
+#define CYNARA_ADMIN_ERROR_H
+
+/**
+ * \name Return Codes
+ * exported by the foundation API.
+ * result codes begin with the start error code and extend into negative direction.
+ * @{
+*/
+
+/*! \brief   indicating the result of the one specific API is successful or access is allowed */
+#define CYNARA_ADMIN_API_SUCCESS 0
+
+/*! \brief   indicating client process is running out of memory */
+#define CYNARA_ADMIN_API_OUT_OF_MEMORY -1
+
+/*! \brief   indicating the API's parameter is malformed */
+#define CYNARA_ADMIN_API_INVALID_PARAM -2
+
+/*! \brief   service not available (cannot connect to cynara service) */
+#define CYNARA_ADMIN_API_SERVICE_NOT_AVAILABLE -3
+
+/*! \brief   unexpected error in client library */
+#define CYNARA_ADMIN_API_UNEXPECTED_CLIENT_ERROR -4
+
+/*! \brief   cynara service does not allow to perform requested operation */
+#define CYNARA_ADMIN_API_OPERATION_NOT_ALLOWED -5
+
+/*! \brief   cynara service hasn't found requested bucket */
+#define CYNARA_ADMIN_API_BUCKET_NOT_FOUND -6
+/** @}*/
+
+#endif // CYNARA_ADMIN_ERROR_H
index d998eb6..2224140 100644 (file)
  * \brief       This file contains administration APIs of cynara available with libcynara-admin.
  */
 
-
 #ifndef CYNARA_ADMIN_H
 #define CYNARA_ADMIN_H
 
-/**
- * \name Return Codes
- * exported by the foundation API.
- * result codes begin with the start error code and extend into negative direction.
- * @{
-*/
-
-/*! \brief   indicating the result of the one specific API is successful or access is allowed */
-#define CYNARA_ADMIN_API_SUCCESS 0
-
-/*! \brief   indicating client process is running out of memory */
-#define CYNARA_ADMIN_API_OUT_OF_MEMORY -1
-
-/*! \brief   indicating the API's parameter is malformed */
-#define CYNARA_ADMIN_API_INVALID_PARAM -2
-
-/*! \brief   service not available (cannot connect to cynara service) */
-#define CYNARA_ADMIN_API_SERVICE_NOT_AVAILABLE -3
-
-/*! \brief   unexpected error in client library */
-#define CYNARA_ADMIN_API_UNEXPECTED_CLIENT_ERROR -4
-
-/*! \brief   cynara service does not allow to perform requested operation */
-#define CYNARA_ADMIN_API_OPERATION_NOT_ALLOWED -5
-
-/*! \brief   cynara service hasn't found requested bucket */
-#define CYNARA_ADMIN_API_BUCKET_NOT_FOUND -6
-/** @}*/
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/include/cynara-client-error.h b/src/include/cynara-client-error.h
new file mode 100644 (file)
index 0000000..b4746b8
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  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-error.h
+ * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @author      Zofia Abramowska <z.abramowska@samsung.com>
+ * @version     1.0
+ * @brief       This file contains error codes returned by client APIs of Cynara.
+ */
+
+#ifndef CYNARA_ERROR_H
+#define CYNARA_ERROR_H
+
+/**
+ * \name Return Codes
+ * exported by the foundation API.
+ * result codes begin with the start error code and extend into negative direction.
+ * @{
+*/
+
+/*! \brief   indicating the result of the one specific API is successful or access is allowed */
+#define CYNARA_API_SUCCESS 0
+
+/*! \brief   indicating that access that was checked is denied */
+#define CYNARA_API_ACCESS_DENIED -1
+
+/*! \brief   indicating system is running out of memory state */
+#define CYNARA_API_OUT_OF_MEMORY -2
+
+/*! \brief   indicating the API's parameter is malformed */
+#define CYNARA_API_INVALID_PARAM -3
+
+/*! \brief   service not available */
+#define CYNARA_API_SERVICE_NOT_AVAILABLE -4
+/** @}*/
+
+#endif // CYNARA_ERROR_H
index f984966..2827ff2 100644 (file)
  * @brief       This file contains client APIs of Cynara available with libcynara-client.
  */
 
-
 #ifndef CYNARA_CLIENT_H
 #define CYNARA_CLIENT_H
 
-/**
- * \name Return Codes
- * exported by the foundation API.
- * result codes begin with the start error code and extend into negative direction.
- * @{
-*/
-
-/*! \brief   indicating the result of the one specific API is successful or access is allowed */
-#define CYNARA_API_SUCCESS 0
-
-/*! \brief   indicating that access that was checked is denied */
-#define CYNARA_API_ACCESS_DENIED -1
-
-/*! \brief   indicating system is running out of memory state */
-#define CYNARA_API_OUT_OF_MEMORY -2
-
-/*! \brief   indicating the API's parameter is malformed */
-#define CYNARA_API_INVALID_PARAM -3
-
-/*! \brief   service not available */
-#define CYNARA_API_SERVICE_NOT_AVAILABLE -4
-/** @}*/
-
 #ifdef __cplusplus
 extern "C" {
 #endif