Permalink
Browse files

Update docs

  • Loading branch information...
1 parent 571b55d commit 9dfc8725f96472aa2f4be3207beccb4ee2edd477 @tagoh committed Oct 16, 2012
Showing with 471 additions and 117 deletions.
  1. +7 −1 docs/liblangtag-docs.sgml
  2. +52 −1 liblangtag/lt-error.c
  3. +186 −27 liblangtag/lt-list.c
  4. +10 −5 liblangtag/lt-list.h
  5. +41 −0 liblangtag/lt-macros.h
  6. +0 −51 liblangtag/lt-messages.c
  7. +165 −28 liblangtag/lt-string.c
  8. +10 −4 liblangtag/lt-string.h
@@ -47,7 +47,13 @@
<xi:include href="xml/lt-ext-module.xml"/>
<xi:include href="xml/lt-ext-module-data.xml"/>
</section>
- <xi:include href="xml/lt-error.xml"/>
+ <section id="Utilities">
+ <title>Utilities APIs</title>
+ <xi:include href="xml/lt-macros.xml"/>
+ <xi:include href="xml/lt-error.xml"/>
+ <xi:include href="xml/lt-list.xml"/>
+ <xi:include href="xml/lt-string.xml"/>
+ </section>
</chapter>
<chapter id="object-tree">
View
@@ -49,6 +49,15 @@ lt_error_new(void)
}
/*< public >*/
+
+/**
+ * lt_error_ref:
+ * @error: a #lt_error_t
+ *
+ * Inscreases the reference count of @error.
+ *
+ * Returns: (transfer none): the same @error object.
+ */
lt_error_t *
lt_error_ref(lt_error_t *error)
{
@@ -57,13 +66,31 @@ lt_error_ref(lt_error_t *error)
return lt_mem_ref(&error->parent);
}
+/**
+ * lt_error_unref:
+ * @error: a #lt_error_t
+ *
+ * Decreases the reference count of @error. when its reference count
+ * drops to 0, the object is finalized (i.e. its memory is freed).
+ */
void
lt_error_unref(lt_error_t *error)
{
if (error)
lt_mem_unref(&error->parent);
}
+/**
+ * lt_error_set:
+ * @error: a return location for a #lt_error_t
+ * @type: a #lt_error_type_t
+ * @message: the string format to output the error messages
+ * @...: the parameters to insert into the format string
+ *
+ * Sets the error into @error according to the given parameters.
+ *
+ * Returns: an instance of #lt_error_t
+ */
lt_error_t *
lt_error_set(lt_error_t **error,
lt_error_type_t type,
@@ -112,15 +139,32 @@ lt_error_set(lt_error_t **error,
return *error;
}
+/**
+ * lt_error_clear:
+ * @error: a #lt_error_t
+ *
+ * Clean up all of the errors in @error.
+ */
void
lt_error_clear(lt_error_t *error)
{
if (error) {
- lt_mem_remove_ref(&error->parent, error->data);
+ lt_mem_delete_ref(&error->parent, error->data);
error->data = NULL;
}
}
+/**
+ * lt_error_is_set:
+ * @error: a #lt_error_t
+ * @type: a #lt_error_type_t
+ *
+ * Checks if @error contains @type of errors. if #LT_ERR_ANY is set to @type,
+ * all the types of the errors are targeted. otherwise the result is filtered
+ * out by @type.
+ *
+ * Returns: %TRUE if any, otherwise %FALSE
+ */
lt_bool_t
lt_error_is_set(lt_error_t *error,
lt_error_type_t type)
@@ -143,6 +187,13 @@ lt_error_is_set(lt_error_t *error,
return FALSE;
}
+/**
+ * lt_error_print:
+ * @error: a #lt_error_t
+ * @type: a #lt_error_type_t
+ *
+ * Output the error messages in @error according to @type.
+ */
void
lt_error_print(lt_error_t *error,
lt_error_type_t type)
Oops, something went wrong.

0 comments on commit 9dfc872

Please sign in to comment.