[PATCH 5/7] doc: added \memberof and \cond commands

Bill Spitzak spitzak at gmail.com
Thu Dec 18 20:15:09 PST 2014


\memberof added to undocumented functions that belong to classes, such
as all the wl_list_* functions. This makes doxygen produce them as a
single block.

\cond added to hide the non-public map implementation.
---
 src/wayland-client.c |    7 ++++---
 src/wayland-server.c |   39 ++++++++++++++++++++++++++++++++++++++-
 src/wayland-shm.c    |    7 +++++++
 src/wayland-util.c   |   12 ++++++++++++
 4 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index 9e8bdfe..1ace1da 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -1336,6 +1336,7 @@ err:
 	return -1;
 }
 
+/** \memberof wl_display */
 WL_EXPORT int
 wl_display_prepare_read_queue(struct wl_display *display,
 			      struct wl_event_queue *queue)
@@ -1689,8 +1690,7 @@ wl_display_get_error(struct wl_display *display)
 	return ret;
 }
 
-/**
- * Retrieves the information about a protocol error:
+/** Retrieves the information about a protocol error:
  *
  * \param display    The Wayland display
  * \param interface  if not NULL, stores the interface where the error occurred
@@ -1709,7 +1709,8 @@ wl_display_get_error(struct wl_display *display)
  *
  * ...
  *
- *  \endcode
+ * \endcode
+ * \memberof wl_display
  */
 WL_EXPORT uint32_t
 wl_display_get_protocol_error(struct wl_display *display,
diff --git a/src/wayland-server.c b/src/wayland-server.c
index c845dd6..e03ce4f 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -120,6 +120,7 @@ struct wl_resource {
 
 static int debug_server = 0;
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_event_array(struct wl_resource *resource, uint32_t opcode,
 			     union wl_argument *args)
@@ -144,6 +145,7 @@ wl_resource_post_event_array(struct wl_resource *resource, uint32_t opcode,
 	wl_closure_destroy(closure);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...)
 {
@@ -160,6 +162,7 @@ wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...)
 }
 
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_queue_event_array(struct wl_resource *resource, uint32_t opcode,
 			      union wl_argument *args)
@@ -184,6 +187,7 @@ wl_resource_queue_event_array(struct wl_resource *resource, uint32_t opcode,
 	wl_closure_destroy(closure);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...)
 {
@@ -199,6 +203,7 @@ wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...)
 	wl_resource_queue_event_array(resource, opcode, args);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_error(struct wl_resource *resource,
 		       uint32_t code, const char *msg, ...)
@@ -504,6 +509,7 @@ wl_client_get_object(struct wl_client *client, uint32_t id)
 	return wl_map_lookup(&client->objects, id);
 }
 
+/** \memberof wl_client */
 WL_EXPORT void
 wl_client_post_no_memory(struct wl_client *client)
 {
@@ -511,6 +517,7 @@ wl_client_post_no_memory(struct wl_client *client)
 			       WL_DISPLAY_ERROR_NO_MEMORY, "no memory");
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_no_memory(struct wl_resource *resource)
 {
@@ -535,6 +542,7 @@ destroy_resource(void *element, void *data)
 		free(resource);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_destroy(struct wl_resource *resource)
 {
@@ -555,18 +563,21 @@ wl_resource_destroy(struct wl_resource *resource)
 	}
 }
 
+/** \memberof wl_resource */
 WL_EXPORT uint32_t
 wl_resource_get_id(struct wl_resource *resource)
 {
 	return resource->object.id;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_list *
 wl_resource_get_link(struct wl_resource *resource)
 {
 	return &resource->link;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_resource *
 wl_resource_from_link(struct wl_list *link)
 {
@@ -575,6 +586,7 @@ wl_resource_from_link(struct wl_list *link)
 	return wl_container_of(link, resource, link);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_resource *
 wl_resource_find_for_client(struct wl_list *list, struct wl_client *client)
 {
@@ -591,30 +603,35 @@ wl_resource_find_for_client(struct wl_list *list, struct wl_client *client)
         return NULL;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_client *
 wl_resource_get_client(struct wl_resource *resource)
 {
 	return resource->client;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_set_user_data(struct wl_resource *resource, void *data)
 {
 	resource->data = data;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void *
 wl_resource_get_user_data(struct wl_resource *resource)
 {
 	return resource->data;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT int
 wl_resource_get_version(struct wl_resource *resource)
 {
 	return resource->version;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_set_destructor(struct wl_resource *resource,
 			   wl_resource_destroy_func_t destroy)
@@ -622,6 +639,7 @@ wl_resource_set_destructor(struct wl_resource *resource,
 	resource->destroy = destroy;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT int
 wl_resource_instance_of(struct wl_resource *resource,
 			const struct wl_interface *interface,
@@ -631,6 +649,7 @@ wl_resource_instance_of(struct wl_resource *resource,
 		resource->object.implementation == implementation;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_add_destroy_listener(struct wl_resource *resource,
 				 struct wl_listener * listener)
@@ -638,6 +657,7 @@ wl_resource_add_destroy_listener(struct wl_resource *resource,
 	wl_signal_add(&resource->destroy_signal, listener);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_listener *
 wl_resource_get_destroy_listener(struct wl_resource *resource,
 				 wl_notify_func_t notify)
@@ -645,6 +665,7 @@ wl_resource_get_destroy_listener(struct wl_resource *resource,
 	return wl_signal_get(&resource->destroy_signal, notify);
 }
 
+/** \memberof wl_client */
 WL_EXPORT void
 wl_client_add_destroy_listener(struct wl_client *client,
 			       struct wl_listener *listener)
@@ -652,6 +673,7 @@ wl_client_add_destroy_listener(struct wl_client *client,
 	wl_signal_add(&client->destroy_signal, listener);
 }
 
+/** \memberof wl_client */
 WL_EXPORT struct wl_listener *
 wl_client_get_destroy_listener(struct wl_client *client,
 			       wl_notify_func_t notify)
@@ -659,6 +681,7 @@ wl_client_get_destroy_listener(struct wl_client *client,
 	return wl_signal_get(&client->destroy_signal, notify);
 }
 
+/** \memberof wl_client */
 WL_EXPORT void
 wl_client_destroy(struct wl_client *client)
 {
@@ -896,6 +919,7 @@ wl_display_destroy(struct wl_display *display)
 	free(display);
 }
 
+/** \memberof wl_global */
 WL_EXPORT struct wl_global *
 wl_global_create(struct wl_display *display,
 		 const struct wl_interface *interface, int version,
@@ -932,6 +956,7 @@ wl_global_create(struct wl_display *display,
 	return global;
 }
 
+/** \memberof wl_global */
 WL_EXPORT void
 wl_global_destroy(struct wl_global *global)
 {
@@ -977,18 +1002,21 @@ wl_display_next_serial(struct wl_display *display)
 	return display->serial;
 }
 
+/** \memberof wl_display */
 WL_EXPORT struct wl_event_loop *
 wl_display_get_event_loop(struct wl_display *display)
 {
 	return display->loop;
 }
 
+/** \memberof wl_display */
 WL_EXPORT void
 wl_display_terminate(struct wl_display *display)
 {
 	display->run = 0;
 }
 
+/** \memberof wl_display */
 WL_EXPORT void
 wl_display_run(struct wl_display *display)
 {
@@ -1000,6 +1028,7 @@ wl_display_run(struct wl_display *display)
 	}
 }
 
+/** \memberof wl_display */
 WL_EXPORT void
 wl_display_flush_clients(struct wl_display *display)
 {
@@ -1123,6 +1152,7 @@ wl_socket_init_for_display_name(struct wl_socket *s, const char *name)
 	return 0;
 }
 
+/** \memberof wl_display */
 static int
 _wl_display_add_socket(struct wl_display *display, struct wl_socket *s)
 {
@@ -1155,6 +1185,7 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s)
 	return 0;
 }
 
+/** \memberof wl_display */
 WL_EXPORT const char *
 wl_display_add_socket_auto(struct wl_display *display)
 {
@@ -1250,6 +1281,7 @@ wl_display_add_socket(struct wl_display *display, const char *name)
 	return 0;
 }
 
+/** \memberof wl_display */
 WL_EXPORT void
 wl_display_add_destroy_listener(struct wl_display *display,
 				struct wl_listener *listener)
@@ -1257,6 +1289,7 @@ wl_display_add_destroy_listener(struct wl_display *display,
 	wl_signal_add(&display->destroy_signal, listener);
 }
 
+/** \memberof wl_display */
 WL_EXPORT struct wl_listener *
 wl_display_get_destroy_listener(struct wl_display *display,
 				wl_notify_func_t notify)
@@ -1264,6 +1297,7 @@ wl_display_get_destroy_listener(struct wl_display *display,
 	return wl_signal_get(&display->destroy_signal, notify);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_set_implementation(struct wl_resource *resource,
 			       const void *implementation,
@@ -1275,6 +1309,7 @@ wl_resource_set_implementation(struct wl_resource *resource,
 	resource->dispatcher = NULL;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_set_dispatcher(struct wl_resource *resource,
 			   wl_dispatcher_func_t dispatcher,
@@ -1287,6 +1322,7 @@ wl_resource_set_dispatcher(struct wl_resource *resource,
 	resource->destroy = destroy;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_resource *
 wl_resource_create(struct wl_client *client,
 		   const struct wl_interface *interface,
@@ -1331,7 +1367,7 @@ wl_log_set_handler_server(wl_log_func_t handler)
 	wl_log_handler = handler;
 }
 
-/* Deprecated functions below. */
+/** \cond */ /* Deprecated functions below. */
 
 uint32_t
 wl_client_add_resource(struct wl_client *client,
@@ -1427,6 +1463,7 @@ wl_display_remove_global(struct wl_display *display, struct wl_global *global)
 {
 	wl_global_destroy(global);
 }
+/** \endcond */
 
 /** Add support for a wl_shm pixel format
  *
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index b6b31d6..a20c3be 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -302,6 +302,7 @@ bind_shm(struct wl_client *client,
 		wl_shm_send_format(resource, *p);
 }
 
+/** \memberof wl_display */
 WL_EXPORT int
 wl_display_init_shm(struct wl_display *display)
 {
@@ -311,6 +312,7 @@ wl_display_init_shm(struct wl_display *display)
 	return 0;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT struct wl_shm_buffer *
 wl_shm_buffer_create(struct wl_client *client,
 		     uint32_t id, int32_t width, int32_t height,
@@ -346,6 +348,7 @@ wl_shm_buffer_create(struct wl_client *client,
 	return buffer;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT struct wl_shm_buffer *
 wl_shm_buffer_get(struct wl_resource *resource)
 {
@@ -359,6 +362,7 @@ wl_shm_buffer_get(struct wl_resource *resource)
 		return NULL;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT int32_t
 wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer)
 {
@@ -391,18 +395,21 @@ wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)
 		return buffer + 1;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT uint32_t
 wl_shm_buffer_get_format(struct wl_shm_buffer *buffer)
 {
 	return buffer->format;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT int32_t
 wl_shm_buffer_get_width(struct wl_shm_buffer *buffer)
 {
 	return buffer->width;
 }
 
+/** \memberof wl_shm_buffer */
 WL_EXPORT int32_t
 wl_shm_buffer_get_height(struct wl_shm_buffer *buffer)
 {
diff --git a/src/wayland-util.c b/src/wayland-util.c
index b099882..24edaa5 100644
--- a/src/wayland-util.c
+++ b/src/wayland-util.c
@@ -32,6 +32,7 @@
 
 struct wl_object global_zombie_object;
 
+/** \memberof wl_list */
 WL_EXPORT void
 wl_list_init(struct wl_list *list)
 {
@@ -39,6 +40,7 @@ wl_list_init(struct wl_list *list)
 	list->next = list;
 }
 
+/** \memberof wl_list */
 WL_EXPORT void
 wl_list_insert(struct wl_list *list, struct wl_list *elm)
 {
@@ -48,6 +50,7 @@ wl_list_insert(struct wl_list *list, struct wl_list *elm)
 	elm->next->prev = elm;
 }
 
+/** \memberof wl_list */
 WL_EXPORT void
 wl_list_remove(struct wl_list *elm)
 {
@@ -57,6 +60,7 @@ wl_list_remove(struct wl_list *elm)
 	elm->prev = NULL;
 }
 
+/** \memberof wl_list */
 WL_EXPORT int
 wl_list_length(const struct wl_list *list)
 {
@@ -73,12 +77,14 @@ wl_list_length(const struct wl_list *list)
 	return count;
 }
 
+/** \memberof wl_list */
 WL_EXPORT int
 wl_list_empty(const struct wl_list *list)
 {
 	return list->next == list;
 }
 
+/** \memberof wl_list */
 WL_EXPORT void
 wl_list_insert_list(struct wl_list *list, struct wl_list *other)
 {
@@ -91,18 +97,21 @@ wl_list_insert_list(struct wl_list *list, struct wl_list *other)
 	list->next = other->next;
 }
 
+/** \memberof wl_array */
 WL_EXPORT void
 wl_array_init(struct wl_array *array)
 {
 	memset(array, 0, sizeof *array);
 }
 
+/** \memberof wl_array */
 WL_EXPORT void
 wl_array_release(struct wl_array *array)
 {
 	free(array->data);
 }
 
+/** \memberof wl_array */
 WL_EXPORT void *
 wl_array_add(struct wl_array *array, size_t size)
 {
@@ -135,6 +144,7 @@ wl_array_add(struct wl_array *array, size_t size)
 	return p;
 }
 
+/** \memberof wl_array */
 WL_EXPORT int
 wl_array_copy(struct wl_array *array, struct wl_array *source)
 {
@@ -149,6 +159,7 @@ wl_array_copy(struct wl_array *array, struct wl_array *source)
 	return 0;
 }
 
+/** \cond */
 union map_entry {
 	uintptr_t next;
 	void *data;
@@ -360,6 +371,7 @@ wl_map_for_each(struct wl_map *map, wl_iterator_func_t func, void *data)
 	for_each_helper(&map->client_entries, func, data);
 	for_each_helper(&map->server_entries, func, data);
 }
+/** \endcond */
 
 static void
 wl_log_stderr_handler(const char *fmt, va_list arg)
-- 
1.7.9.5



More information about the wayland-devel mailing list