lib_LTLIBRARIES = libpepper.la
-include_HEADERS = pepper.h
+include_HEADERS = pepper.h pepper-utils.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pepper.pc
buffer.c \
data-device.c \
view.c \
- pepper-util.h \
- pepper-util.c
+ utils-file.c \
+ utils-map.c
#include "pepper.h"
#include <wayland-util.h>
#include <pixman.h>
-#include "pepper-util.h"
typedef struct pepper_region pepper_region_t;
typedef struct pepper_surface_state pepper_surface_state_t;
-#ifndef PEPPER_UTIL_H
-#define PEPPER_UTIL_H
+#ifndef PEPPER_UTILS_H
+#define PEPPER_UTILS_H
-#include "common.h"
#include <stdlib.h>
#include <string.h>
+#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) \
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 */
#ifndef PEPPER_H
#define PEPPER_H
+#include <pepper-utils.h>
+
#define WL_HIDE_DEPRECATED
#include <wayland-server.h>
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;
-#include "pepper-util.h"
+#include "pepper-utils.h"
+#include "common.h"
struct pepper_map_entry
{
map->buckets = pepper_calloc(map->bucket_size, sizeof(pepper_map_entry_t *));
if (!map->buckets)
{
- free(map);
+ pepper_free(map);
return NULL;
}
if (curr->free_func)
curr->free_func(curr->data);
- free(curr);
+ pepper_free(curr);
curr = next;
}
}
pepper_map_destroy(pepper_map_t *map)
{
pepper_map_clear(map);
- free(map->buckets);
- free(map);
+ pepper_free(map->buckets);
+ pepper_free(map);
}
void *
else
*bucket = curr->next;
- free(curr);
+ pepper_free(curr);
}
return;
}
/* 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;
[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
+++ /dev/null
-SUBDIRS = src
+++ /dev/null
-#! /bin/sh
-
-test -n "$srcdir" || srcdir=`dirname "$0"`
-test -n "$srcdir" || srcdir=.
-(
- cd "$srcdir" &&
- autoreconf --force -v --install
-) || exit
-test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-/*
- * 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 <pepper.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-PEPPER_API int
-pepper_create_anonymous_file(off_t size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* PEPPER_UTILS_H */
+++ /dev/null
-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
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])
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <pepper-utils.h>
static void
buffer_release(void *data, struct wl_buffer *buf)