Commit graph

26 commits

Author SHA1 Message Date
Kristian Høgsberg
620d9edb25 Rename __wl_container_of macro to just wl_container_of
The _* namespace and identifiers with double underscore are reserved
by the C standard.  That makes __wl_container_of is double plus bad,
so lets just call it wl_container_of.
2012-10-19 23:26:45 -04:00
Kristian Høgsberg
7ec35d8e13 Move un-namespaced container_of into private header 2012-10-19 23:06:53 -04:00
Kristian Høgsberg
bdd272f024 Move ARRAY_LENGTH out of public headers
Exporting unprefixed symbols is a pretty bad idea so don't do that.
Instea of redefining it WL_ARRAY_LENGTH, we just move the define to
our private header.  The scanner generates code that uses ARRAY_LENGTH,
but we can just make it count the number elements and emit an integer
constant instead.
2012-10-19 17:08:38 -04:00
David Herrmann
0d5850e6d6 wayland-util: return -1 if wl_array_copy() fails
We might have to perform memory allocations in wl_array_copy(), so catch
out-of-memory errors in wl_array_add() and return -1 before changing any
state.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15 16:06:15 -04:00
Martin Olsson
dba322c1c0 Fixup source comment in wayland-util.h and fix typo in TODO 2012-07-09 18:11:06 -04:00
Martin Minarik
8e2a786703 Wayland: logging
The core libwayland libraries should not handle logging, only passing
the error messages to subscribed functions.
An application linked to libwayland-server or libwayland-client
will be able to set own functions (one per library) to handle error
messages.

Change in this series: make the wl_log return int, because
of compatibility with printf. It will return the number of bytes logged.
2012-05-31 13:57:15 -04:00
Kristian Høgsberg
f5df38959b Optimize wl_fixed_t to/from double conversion functions 2012-05-14 09:36:38 -04:00
Daniel Stone
c5aba11acc Add support for signed 24.8 decimal numbers
'fixed' is a signed decimal type which offers a sign bit, 23 bits of
integer precision, and 8 bits of decimal precision.  This is exposed as
an opaque struct with conversion helpers to and from double and int on
the C API side.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:40:39 -04:00
Benjamin Franzke
e6a9e1b302 wayland-util.h: Include stddef.h for size_t 2012-04-06 15:54:38 +02:00
Alex Wu
68cf7a1a42 wayland-utils: add wl_list_for_each_reverse_safe macro.
Add the safe version for wl_list_for_each_reverse
2012-04-02 22:12:56 -04:00
Kristian Høgsberg
0ca75a4f32 wayland-util: Fix wl_array signedness warnings 2012-03-30 10:43:36 -04:00
Kristian Høgsberg
ba32db9532 Move DIV_ROUNDUP out of public header, remove unused ALIGN 2012-03-30 10:28:39 -04:00
Kristian Høgsberg
8e2cac7ae4 Add wl_array_for_each 2012-03-04 13:40:49 -05:00
Üstün Ergenoğlu
a676b8f257 util: Comments before wl_list were a bit off, fixed the example usage.
Signed-off-by: Üstün Ergenoğlu <ego@ustun.fi>
2012-02-26 14:00:53 -05:00
Kristian Høgsberg
fa525622e3 wayland-util.h: Avoid un-namespaced _container_of
Yes, there are worse offenders in that file, but this one isn't used in
the code and it makes Xorg angry.
2012-02-09 08:28:51 -05:00
Kristian Høgsberg
c1b9203e5a Drop unused hash table
We now just use a table for looking up object IDs so we should drop the
hash table.
2011-12-27 13:58:56 -05:00
Kristian Høgsberg
bc79f1f820 Rename all instances of typeof 2011-12-22 15:32:37 -05:00
Kristian Høgsberg
5e078bfa5a Use __typeof__ instead of typeof
Thiago Macieira compiles with -std=c++11.
2011-12-22 15:24:20 -05:00
Jørgen Lind
187eace613 Make wl_list_for_each* work for c++ 2011-12-14 09:16:20 -05:00
Kristian Høgsberg
cf04b0a18f Move private definitions and prototypes to new wayland-private.h 2011-11-18 13:46:56 -05:00
Kristian Høgsberg
3a1e6df39a Add display event to acknowledge ID deletion
We need to make sure the client doesn't reuse an object ID until the
server has seen the destroy request.  When a client destroys an ID
the server will now respond with the display.delete_id event, which lets
the client block reuse until it receives the event.
2011-11-17 17:37:52 -05:00
Kristian Høgsberg
51f50b8c64 util: Add wl_list_insert_list() 2011-11-15 13:48:41 -05:00
Kristian Høgsberg
c8147edc3a Store objects in wl_map data structure
The wl_map data structure is just an array with a free-list that lets the
client recycle unused client IDs and keep range of client IDs under control.
2011-08-27 12:06:11 -04:00
Kristian Høgsberg
cc6fd94d6a Always allocate a new wl_resource when binding an object
Previously we would bind some resources into multiple client hash tables.
2011-08-27 12:06:11 -04:00
Kristian Høgsberg
c4774d55e9 Add wl_hash_table_for_each() 2011-08-27 12:06:11 -04:00
Kristian Høgsberg
4c260db68c Rename source subdir from wayland to src 2011-08-12 16:25:14 -04:00
Renamed from wayland/wayland-util.h (Browse further)