[docs] Add gtkdoc comments to hb-map

This commit is contained in:
Nathan Willis 2019-04-21 20:30:54 +01:00 committed by Khaled Hosny
parent 71af2c6d9b
commit 922c32eb2d
2 changed files with 60 additions and 33 deletions

View File

@ -42,7 +42,9 @@
/** /**
* hb_map_create: (Xconstructor) * hb_map_create: (Xconstructor)
* *
* Return value: (transfer full): * Creates a new, initially empty map.
*
* Return value: (transfer full): The new #hb_map_t
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -62,7 +64,9 @@ hb_map_create ()
/** /**
* hb_map_get_empty: * hb_map_get_empty:
* *
* Return value: (transfer full): * Fetches the singleton empty #hb_map_t.
*
* Return value: (transfer full): The empty #hb_map_t
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -74,9 +78,11 @@ hb_map_get_empty ()
/** /**
* hb_map_reference: (skip) * hb_map_reference: (skip)
* @map: a map. * @map: A map
* *
* Return value: (transfer full): * Increases the reference count on a map.
*
* Return value: (transfer full): The map
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -88,7 +94,11 @@ hb_map_reference (hb_map_t *map)
/** /**
* hb_map_destroy: (skip) * hb_map_destroy: (skip)
* @map: a map. * @map: A map
*
* Decreases the reference count on a map. When
* the reference count reaches zero, the map is
* destroyed, freeing all memory.
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -104,13 +114,15 @@ hb_map_destroy (hb_map_t *map)
/** /**
* hb_map_set_user_data: (skip) * hb_map_set_user_data: (skip)
* @map: a map. * @map: A map
* @key: * @key: The user-data key to set
* @data: * @data: A pointer to the user data to set
* @destroy: * @destroy: A callback to call when @data is not needed anymore
* @replace: * @replace: Whether to replace an existing data with the same key
* *
* Return value: * Attaches a user-data key/data pair to the specified map.
*
* Return value: %true if success, false otherwise
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -126,10 +138,13 @@ hb_map_set_user_data (hb_map_t *map,
/** /**
* hb_map_get_user_data: (skip) * hb_map_get_user_data: (skip)
* @map: a map. * @map: A map
* @key: * @key: The user-data key to query
* *
* Return value: (transfer none): * Fetches the user data associated with the specified key,
* attached to the specified map.
*
* Return value: (transfer none): A pointer to the user data
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -143,11 +158,11 @@ hb_map_get_user_data (hb_map_t *map,
/** /**
* hb_map_allocation_successful: * hb_map_allocation_successful:
* @map: a map. * @map: A map
* *
* Tests whether memory allocation for a set was successful.
* *
* * Return value: %true if allocation succeeded, false otherwise
* Return value:
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -160,11 +175,11 @@ hb_map_allocation_successful (const hb_map_t *map)
/** /**
* hb_map_set: * hb_map_set:
* @map: a map. * @map: A map
* @key: * @key: The key to store in the map
* @value: * @value: The value to store for @key
*
* *
* Stores @key:@value in the map.
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -178,10 +193,10 @@ hb_map_set (hb_map_t *map,
/** /**
* hb_map_get: * hb_map_get:
* @map: a map. * @map: A map
* @key: * @key: The key to query
*
* *
* Fetches the value stored for @key in @map.
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -194,10 +209,10 @@ hb_map_get (const hb_map_t *map,
/** /**
* hb_map_del: * hb_map_del:
* @map: a map. * @map: A map
* @key: * @key: The key to delete
*
* *
* Removes @key and its stored value from @map.
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -210,10 +225,12 @@ hb_map_del (hb_map_t *map,
/** /**
* hb_map_has: * hb_map_has:
* @map: a map. * @map: A map
* @key: * @key: The key to query
* *
* Tests whether @key is an element of @map.
* *
* Return value: %true if @key is found in @map, false otherwise
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -227,9 +244,9 @@ hb_map_has (const hb_map_t *map,
/** /**
* hb_map_clear: * hb_map_clear:
* @map: a map. * @map: A map
*
* *
* Clears out the contents of @map.
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -241,9 +258,11 @@ hb_map_clear (hb_map_t *map)
/** /**
* hb_map_is_empty: * hb_map_is_empty:
* @map: a map. * @map: A map
* *
* Tests whether @map is empty (contains no elements).
* *
* Return value: %true if @map is empty
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/
@ -255,9 +274,11 @@ hb_map_is_empty (const hb_map_t *map)
/** /**
* hb_map_get_population: * hb_map_get_population:
* @map: a map. * @map: A map
* *
* Returns the number of key-value pairs in the map.
* *
* Return value: The population of @map
* *
* Since: 1.7.7 * Since: 1.7.7
**/ **/

View File

@ -41,6 +41,12 @@ HB_BEGIN_DECLS
*/ */
#define HB_MAP_VALUE_INVALID ((hb_codepoint_t) -1) #define HB_MAP_VALUE_INVALID ((hb_codepoint_t) -1)
/**
* hb_map_t:
*
* Data type for holding integer-to-integer hash maps.
*
**/
typedef struct hb_map_t hb_map_t; typedef struct hb_map_t hb_map_t;