From: Taekyun Kim Date: Tue, 9 Jun 2015 07:07:29 +0000 (+0900) Subject: pepper: Merged pepper-utils package into pepper. X-Git-Tag: accepted/tizen/mobile/20151221.050925~34^2~343 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a19640015f3daeb555d9723df89453e14cd83083;p=platform%2Fcore%2Fuifw%2Fpepper.git pepper: Merged pepper-utils package into pepper. Change-Id: I00c82ea2e0e8745ee83a74647cfa7a35e732ec07 --- diff --git a/pepper/src/Makefile.am b/pepper/src/Makefile.am index 94bb546..ab9da87 100644 --- a/pepper/src/Makefile.am +++ b/pepper/src/Makefile.am @@ -1,5 +1,5 @@ lib_LTLIBRARIES = libpepper.la -include_HEADERS = pepper.h +include_HEADERS = pepper.h pepper-utils.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = pepper.pc @@ -19,5 +19,5 @@ libpepper_la_SOURCES = pepper.h \ buffer.c \ data-device.c \ view.c \ - pepper-util.h \ - pepper-util.c + utils-file.c \ + utils-map.c diff --git a/pepper/src/pepper-internal.h b/pepper/src/pepper-internal.h index d3ce704..57f38f9 100644 --- a/pepper/src/pepper-internal.h +++ b/pepper/src/pepper-internal.h @@ -5,7 +5,6 @@ #include "pepper.h" #include #include -#include "pepper-util.h" typedef struct pepper_region pepper_region_t; typedef struct pepper_surface_state pepper_surface_state_t; diff --git a/pepper/src/pepper-util.h b/pepper/src/pepper-utils.h similarity index 83% rename from pepper/src/pepper-util.h rename to pepper/src/pepper-utils.h index 3c2eee1..61de497 100644 --- a/pepper/src/pepper-util.h +++ b/pepper/src/pepper-utils.h @@ -1,10 +1,30 @@ -#ifndef PEPPER_UTIL_H -#define PEPPER_UTIL_H +#ifndef PEPPER_UTILS_H +#define PEPPER_UTILS_H -#include "common.h" #include #include +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__GNUC__) && __GNUC__ >= 4 +# define PEPPER_API __attribute__ ((visibility("default"))) +#else +# define PEPPER_API +#endif + +#define pepper_container_of(ptr, type, member) ({ \ + const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +typedef void (*pepper_free_func_t)(void *); + +typedef unsigned int pepper_bool_t; + +#define PEPPER_FALSE 0 +#define PEPPER_TRUE 1 + typedef struct pepper_list pepper_list_t; #define PEPPER_LIST_FOR_EACH(head, pos) \ @@ -139,22 +159,29 @@ typedef int (*pepper_key_length_func_t)(const void *key); typedef int (*pepper_key_compare_func_t)(const void *key0, int key0_length, const void *key1, int key1_length); -pepper_map_t * +PEPPER_API pepper_map_t * pepper_map_create(int bucket_bits, pepper_hash_func_t hash_func, pepper_key_length_func_t key_length_func, pepper_key_compare_func_t key_compare_func); -void +PEPPER_API void pepper_map_clear(pepper_map_t *map); -void +PEPPER_API void pepper_map_destroy(pepper_map_t *map); -void * +PEPPER_API void * pepper_map_get(pepper_map_t *map, const void *key); -void +PEPPER_API void pepper_map_set(pepper_map_t *map, const void *key, void *data, pepper_free_func_t free_func); -#endif /* PEPPER_UTIL_H */ +PEPPER_API int +pepper_create_anonymous_file(off_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* PEPPER_UTILS_H */ diff --git a/pepper/src/pepper.h b/pepper/src/pepper.h index f8935d7..50f46ff 100644 --- a/pepper/src/pepper.h +++ b/pepper/src/pepper.h @@ -1,6 +1,8 @@ #ifndef PEPPER_H #define PEPPER_H +#include + #define WL_HIDE_DEPRECATED #include @@ -10,23 +12,6 @@ extern "C" { #endif -#if defined(__GNUC__) && __GNUC__ >= 4 -# define PEPPER_API __attribute__ ((visibility("default"))) -#else -# define PEPPER_API -#endif - -#define pepper_container_of(ptr, type, member) ({ \ - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) - -#define PEPPER_FALSE 0 -#define PEPPER_TRUE 1 - -typedef void (*pepper_free_func_t)(void *); - -typedef unsigned int pepper_bool_t; - typedef struct pepper_compositor pepper_compositor_t; typedef struct pepper_output_geometry pepper_output_geometry_t; diff --git a/utils/src/shm.c b/pepper/src/utils-file.c similarity index 100% rename from utils/src/shm.c rename to pepper/src/utils-file.c diff --git a/pepper/src/pepper-util.c b/pepper/src/utils-map.c similarity index 94% rename from pepper/src/pepper-util.c rename to pepper/src/utils-map.c index f5f1b2f..f43917c 100644 --- a/pepper/src/pepper-util.c +++ b/pepper/src/utils-map.c @@ -1,4 +1,5 @@ -#include "pepper-util.h" +#include "pepper-utils.h" +#include "common.h" struct pepper_map_entry { @@ -62,7 +63,7 @@ pepper_map_create(int bucket_bits, map->buckets = pepper_calloc(map->bucket_size, sizeof(pepper_map_entry_t *)); if (!map->buckets) { - free(map); + pepper_free(map); return NULL; } @@ -85,7 +86,7 @@ pepper_map_clear(pepper_map_t *map) if (curr->free_func) curr->free_func(curr->data); - free(curr); + pepper_free(curr); curr = next; } } @@ -97,8 +98,8 @@ void pepper_map_destroy(pepper_map_t *map) { pepper_map_clear(map); - free(map->buckets); - free(map); + pepper_free(map->buckets); + pepper_free(map); } void * @@ -165,7 +166,7 @@ pepper_map_set(pepper_map_t *map, const void *key, void *data, pepper_free_func_ else *bucket = curr->next; - free(curr); + pepper_free(curr); } return; @@ -182,7 +183,7 @@ pepper_map_set(pepper_map_t *map, const void *key, void *data, pepper_free_func_ } /* Allocate a new entry. */ - curr = malloc(sizeof(pepper_map_entry_t)); + curr = pepper_malloc(sizeof(pepper_map_entry_t)); PEPPER_ASSERT(curr != NULL); curr->key = key; diff --git a/samples/configure.ac b/samples/configure.ac index 6f95d04..6ebe7ee 100644 --- a/samples/configure.ac +++ b/samples/configure.ac @@ -36,10 +36,10 @@ PKG_CHECK_MODULES(X11_BACKEND, [wayland-server pepper pepper-render pepper-x11 pepper-desktop-shell]) # simple-touch -PKG_CHECK_MODULES(SIMPLE_TOUCH, [wayland-client pepper-utils]) +PKG_CHECK_MODULES(SIMPLE_TOUCH, [wayland-client pepper]) # simple-shm -PKG_CHECK_MODULES(SIMPLE_SHM, [wayland-client pepper-utils]) +PKG_CHECK_MODULES(SIMPLE_SHM, [wayland-client pepper]) AC_CONFIG_FILES([ Makefile diff --git a/utils/Makefile.am b/utils/Makefile.am deleted file mode 100644 index af437a6..0000000 --- a/utils/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/utils/autogen.sh b/utils/autogen.sh deleted file mode 100755 index 916169a..0000000 --- a/utils/autogen.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. -( - cd "$srcdir" && - autoreconf --force -v --install -) || exit -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/utils/configure.ac b/utils/configure.ac deleted file mode 100644 index dd2b9ca..0000000 --- a/utils/configure.ac +++ /dev/null @@ -1,35 +0,0 @@ -m4_define([pepper_utils_major], 0) -m4_define([pepper_utils_minor], 0) -m4_define([pepper_utils_micro], 0) - -m4_define([pepper_utils_version], [pepper_utils_major.pepper_utils_minor.pepper_utils_micro]) - -AC_PREREQ([2.64]) -AC_INIT([pepper_utils], [pepper_utils_version], [tkq.kim@samsung.com]) - -AC_SUBST([PEPPER_UTILS_VERSION_MAJOR], [pepper_utils_major_version]) -AC_SUBST([PEPPER_UTILS_VERSION_MINOR], [pepper_utils_minor_version]) -AC_SUBST([PEPPER_UTILS_VERSION_MICRO], [pepper_utils_micro_version]) -AC_SUBST([PEPPER_UTILS_VERSION], [pepper_utils_version]) - -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz]) -AM_SILENT_RULES([yes]) - -AC_PROG_CC - -LT_PREREQ([2.2]) -LT_INIT([disable-static]) - -PEPPER_UTILS_MODULES="pepper" - -PKG_CHECK_MODULES(PEPPER_UTILS, [$PEPPER_UTILS_MODULES]) -AC_SUBST([PEPPER_UTILS_REQUIRES], [$PEPPER_UTILS_MODULES]) - -AC_CONFIG_FILES([ -Makefile -src/Makefile -src/pepper-utils.pc -]) - -AC_OUTPUT diff --git a/utils/src/Makefile.am b/utils/src/Makefile.am deleted file mode 100644 index b58b1f7..0000000 --- a/utils/src/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -lib_LTLIBRARIES = libpepper-utils.la -include_HEADERS = pepper-utils.h - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = pepper-utils.pc - -libpepper_utils_la_CFLAGS = $(PEPPER_UTILS_CFLAGS) -libpepper_utils_la_LIBADD = $(PEPPER_UTILS_LIBS) - -libpepper_utils_la_SOURCES = pepper-utils.h \ - shm.c diff --git a/utils/src/pepper-utils.h b/utils/src/pepper-utils.h deleted file mode 100644 index 9cc1a2d..0000000 --- a/utils/src/pepper-utils.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright © 2012 Collabora, Ltd. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* This source code was taken from weston's os-compatability.h. */ - -#ifndef PEPPER_UTILS_H -#define PEPPER_UTILS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -PEPPER_API int -pepper_create_anonymous_file(off_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* PEPPER_UTILS_H */ diff --git a/utils/src/pepper-utils.pc.in b/utils/src/pepper-utils.pc.in deleted file mode 100644 index bd437d3..0000000 --- a/utils/src/pepper-utils.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -libexecdir=@libexecdir@ -pkglibexecdir=${libexecdir}/@PACKAGE@ - -Name: Pepper Utility Library -Description: Pepper utility library header and library files -Version: @PEPPER_UTILS_VERSION@ - -Requires.private: @PEPPER_UTILS_REQUIRES@ -Cflags: -I${includedir} -Libs: -L${libdir} -lpepper-utils diff --git a/wayland/configure.ac b/wayland/configure.ac index 468d507..94d4d47 100644 --- a/wayland/configure.ac +++ b/wayland/configure.ac @@ -21,7 +21,7 @@ AC_PROG_CC LT_PREREQ([2.2]) LT_INIT([disable-static]) -PEPPER_WAYLAND_MODULES="pepper pepper-render wayland-server wayland-client pixman-1 pepper-utils" +PEPPER_WAYLAND_MODULES="pepper pepper-render wayland-server wayland-client pixman-1" PKG_CHECK_MODULES(PEPPER_WAYLAND, [$PEPPER_WAYLAND_MODULES]) AC_SUBST([PEPPER_WAYLAND_REQUIRES], [$PEPPER_WAYLAND_MODULES]) diff --git a/wayland/src/wayland-shm-buffer.c b/wayland/src/wayland-shm-buffer.c index b32bcdf..9d9770a 100644 --- a/wayland/src/wayland-shm-buffer.c +++ b/wayland/src/wayland-shm-buffer.c @@ -5,7 +5,6 @@ #include #include #include -#include static void buffer_release(void *data, struct wl_buffer *buf)