Add pkginfo manager for adaptor class between C and C++
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 22 Feb 2021 10:08:00 +0000 (19:08 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 22 Feb 2021 10:08:00 +0000 (19:08 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/CMakeLists.txt
src/manager/pkginfo_manager.cc [new file with mode: 0644]
src/manager/pkginfo_manager.h [new file with mode: 0644]
src/pkgmgrinfo_pkginfo.c

index 0b06e0b..f0ed793 100644 (file)
@@ -2,6 +2,7 @@
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/client CLIENT_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/common COMMON_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/manager MANAGER_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/common/database DATABASE_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/common/socket SOCKET_SRCS)
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/common/parcel PARCEL_SRCS)
@@ -13,6 +14,7 @@ ADD_LIBRARY(pkgmgr-info SHARED
   ${DATABASE_SRCS}
   ${SOCKET_SRCS}
   ${PARCEL_SRCS}
+  ${MANAGER_SRCS}
 )
 
 ## Compile flags
diff --git a/src/manager/pkginfo_manager.cc b/src/manager/pkginfo_manager.cc
new file mode 100644 (file)
index 0000000..730a68e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#include "manager/pkginfo_manager.h"
+
+#include <sys/types.h>
+
+#include "glib.h"
+
+#include "pkgmgrinfo_private.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "PKGMGR_INFO"
+
+#ifdef EXPORT_API
+#undef EXPORT_API
+#endif
+#define EXPORT_API __attribute__((visibility("default")))
+
+extern "C" EXPORT_API int _pkginfo_get_packages(uid_t uid,
+    pkgmgrinfo_filter_x *filter, int flag, GHashTable *packages) {
+  return 0;
+}
\ No newline at end of file
diff --git a/src/manager/pkginfo_manager.h b/src/manager/pkginfo_manager.h
new file mode 100644 (file)
index 0000000..ef31f8a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#ifndef __MANAGER_PKGINFO_MANAGER__
+#define __MANAGER_PKGINFO_MANAGER__
+
+#include <sys/types.h>
+
+#include <glib.h>
+
+#include "pkgmgrinfo_private.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _pkginfo_get_packages(uid_t uid,
+               pkgmgrinfo_filter_x *filter, int flag, GHashTable *packages);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif  /* __MANAGER_PKGINFO_MANAGER__ */
\ No newline at end of file
index 439a59e..77d3b4c 100644 (file)
@@ -39,6 +39,7 @@
 #include "pkgmgrinfo_private.h"
 #include "pkgmgrinfo_debug.h"
 #include "pkgmgr-info.h"
+#include "manager/pkginfo_manager.h"
 
 static bool _get_bool_value(const char *str)
 {