summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-16 01:12:51 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-16 01:12:51 +0900
commit9de09e2838c439444d7fd438a4eff56e05633d01 (patch)
treef7fcd70726454412b1e0633a2ae88e4ae0471a03
parent9945e57e45c70b16b7e2ddd6c0a62f2d03397f02 (diff)
downloadbundle-9de09e2838c439444d7fd438a4eff56e05633d01.tar.gz
bundle-9de09e2838c439444d7fd438a4eff56e05633d01.tar.bz2
bundle-9de09e2838c439444d7fd438a4eff56e05633d01.zip
merge with master
-rw-r--r--CMakeLists.txt4
-rwxr-xr-xinclude/bundle.h16
-rw-r--r--packaging/bundle.changes3
-rw-r--r--packaging/bundle.spec20
-rwxr-xr-xsrc/bundle.c57
5 files changed, 51 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a298eb..95b8e07 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,7 +38,7 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bundle.pc.in ${CMAKE_BINARY_DIR}/bundle.pc @O
### Install
install(TARGETS bundle
- DESTINATION lib
+ DESTINATION lib${LIB_SUFFIX}
)
install(FILES
${CMAKE_SOURCE_DIR}/include/bundle.h
@@ -46,7 +46,7 @@ install(FILES
DESTINATION include/
)
install(FILES ${CMAKE_BINARY_DIR}/bundle.pc
- DESTINATION lib/pkgconfig/
+ DESTINATION lib${LIB_SUFFIX}/pkgconfig/
)
diff --git a/include/bundle.h b/include/bundle.h
index d12cd06..15b22fc 100755
--- a/include/bundle.h
+++ b/include/bundle.h
@@ -448,6 +448,20 @@ API int bundle_keyval_type_is_array(bundle_keyval_t *kv);
/**
+ * @brief Determine if kv is measurable type or not.
+ * @pre kv must be a valid bundle_keyval_t object.
+ * @post None
+ * @see bundle_foreach
+ * @param[in] kv A bundle_keyval_t object
+ * @return Operation result
+ * @retval 1 kv is an measurable.
+ * @retval 0 kv is not an measurable.
+ * @remark
+ */
+API int bundle_keyval_type_is_measurable(bundle_keyval_t *kv);
+
+
+/**
* @brief Get value and size of the value from kv of basic type.
* @pre kv must be a valid bundle_keyval_t object.
* @post val, size are set.
@@ -637,7 +651,6 @@ API int bundle_free_exported_argv(int argc, char ***argv);
*/
API bundle * bundle_import_from_argv(int argc, char **argv);
-#if 0
/**
* @brief Add a string type key-value pair into bundle.
* @pre b must be a valid bundle object.
@@ -897,7 +910,6 @@ API int bundle_get_byte(bundle *b, const char *key, void **byte, size_t *size);
@endcode
*/
API int bundle_get_byte_array(bundle *b, const char *key, void ***byte_array, unsigned int *len, unsigned int **array_element_size);
-#endif
#ifdef __cplusplus
diff --git a/packaging/bundle.changes b/packaging/bundle.changes
new file mode 100644
index 0000000..7f9e669
--- /dev/null
+++ b/packaging/bundle.changes
@@ -0,0 +1,3 @@
+* Fri Jan 18 2013 Anas Nashif <anas.nashif@intel.com> accepted/trunk/20130116.003550@4ecb922
+- Support installation in /usr/lib64
+
diff --git a/packaging/bundle.spec b/packaging/bundle.spec
index d4a91fe..95ab43c 100644
--- a/packaging/bundle.spec
+++ b/packaging/bundle.spec
@@ -1,23 +1,16 @@
-
Name: bundle
Summary: String key-val dictionary ADT
-Version: 0.1.27
+Version: 0.1.30
Release: 1
Group: System/Libraries
License: Apache License, Version 2.0
Source0: bundle-%{version}.tar.gz
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dlog)
-
-
%description
Simple string key-val dictionary ADT
-
-
%package devel
Summary: String key-val dictionary ADT (devel)
Group: Development/Libraries
@@ -32,26 +25,17 @@ Simple string key-val dictionary ADT (devel)
%build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-
+%cmake .
make %{?jobs:-j%jobs}
%install
-rm -rf %{buildroot}
%make_install
-
-
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-
-
-
%files
%manifest bundle.manifest
%defattr(-,root,root,-)
diff --git a/src/bundle.c b/src/bundle.c
index ce45976..5775954 100755
--- a/src/bundle.c
+++ b/src/bundle.c
@@ -326,6 +326,12 @@ bundle_keyval_type_is_array(bundle_keyval_t *kv)
}
int
+bundle_keyval_type_is_measurable(bundle_keyval_t *kv)
+{
+ return keyval_type_is_measurable(kv->type);
+}
+
+int
bundle_keyval_get_basic_val(bundle_keyval_t *kv, void **val, size_t *size)
{
return keyval_get_data(kv, NULL, val, size);
@@ -693,38 +699,38 @@ bundle_get_array_val_size(bundle *b, const char *key, const void *val_ptr)
{
return 0;
}
-/*static int
- bundle_set_array_val(bundle *b, const char *key, const int type, const unsigned int idx, const void *val, const size_t size)
- {
+static int
+bundle_set_array_val(bundle *b, const char *key, const int type, const unsigned int idx, const void *val, const size_t size)
+{
//void **array = NULL;
-keyval_t *kv = _bundle_find_kv(b, key);
-if(NULL == kv) return -1;
+ keyval_t *kv = _bundle_find_kv(b, key);
+ if(NULL == kv) return -1;
-if(type != kv->type) {
-errno = EINVAL;
-return -1;
-}
+ if(type != kv->type) {
+ errno = EINVAL;
+ return -1;
+ }
-if(! keyval_type_is_array(kv->type)) { // TODO: Is this needed?
-errno = EINVAL;
-return -1;
-}
+ if(! keyval_type_is_array(kv->type)) { // TODO: Is this needed?
+ errno = EINVAL;
+ return -1;
+ }
-keyval_array_t *kva = (keyval_array_t *)kv;
+ keyval_array_t *kva = (keyval_array_t *)kv;
-if(! keyval_array_is_idx_valid(kva, idx)) {
-errno = EINVAL;
-return -1;
-}
+ if(! keyval_array_is_idx_valid(kva, idx)) {
+ errno = EINVAL;
+ return -1;
+ }
-if(!kva->array_val) { // NULL value test (TODO: is this needed?)
-errno = ENOMEM;
-return -1;
-}
+ if(!kva->array_val) { // NULL value test (TODO: is this needed?)
+ errno = ENOMEM;
+ return -1;
+ }
-return keyval_array_set_element(kva, idx, val, size);
-}*/
+ return keyval_array_set_element(kva, idx, val, size);
+}
int
@@ -771,7 +777,6 @@ bundle_compare(bundle *b1, bundle *b2)
-#if 0
int
bundle_set_str_array_element(bundle *b, const char *key, const unsigned int idx, const char *val)
{
@@ -815,5 +820,3 @@ bundle_set_byte_array_element(bundle *b, const char *key, const unsigned int idx
return bundle_set_array_val(b, key, BUNDLE_TYPE_BYTE_ARRAY, idx, val, size);
}
-#endif
-