From: Jim Evins Date: Mon, 15 Oct 2007 03:12:42 +0000 (+0000) Subject: 2007-10-14 Jim Evins X-Git-Tag: glabels-2_3_0~318 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=830b1c677df8aef20f24fa11c5dfc3591bf068ee;p=glabels 2007-10-14 Jim Evins * docs/libglabels/libglabels-decl-list.txt: * docs/libglabels/libglabels-sections.txt: * docs/libglabels/libglabels-undocumented.txt: * docs/libglabels/tmpl/category.sgml: * libglabels/category.c: * libglabels/category.h: Added lgl_category_get_id_list() and lgl_category_free_id_list() to have parity with paper functions. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@680 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 536b7ab6..463a4912 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,14 @@ +2007-10-14 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/category.sgml: + * libglabels/category.c: + * libglabels/category.h: + Added lgl_category_get_id_list() and lgl_category_free_id_list() to have + parity with paper functions. + 2007-10-12 Jim Evins * docs/libglabels/libglabels-decl-list.txt: diff --git a/glabels2/docs/libglabels/libglabels-decl-list.txt b/glabels2/docs/libglabels/libglabels-decl-list.txt index fbd07003..1cbc8701 100644 --- a/glabels2/docs/libglabels/libglabels-decl-list.txt +++ b/glabels2/docs/libglabels/libglabels-decl-list.txt @@ -116,6 +116,8 @@ lglCategory lgl_category_new lgl_category_dup lgl_category_free +lgl_category_get_id_list +lgl_category_free_id_list lgl_category_get_name_list lgl_category_free_name_list lgl_category_from_name diff --git a/glabels2/docs/libglabels/libglabels-sections.txt b/glabels2/docs/libglabels/libglabels-sections.txt index f3c04c4d..d29ec3d6 100644 --- a/glabels2/docs/libglabels/libglabels-sections.txt +++ b/glabels2/docs/libglabels/libglabels-sections.txt @@ -44,6 +44,8 @@ lgl_category_free lgl_category_from_name lgl_category_from_id +lgl_category_get_id_list +lgl_category_free_id_list lgl_category_get_name_list lgl_category_free_name_list diff --git a/glabels2/docs/libglabels/libglabels-undocumented.txt b/glabels2/docs/libglabels/libglabels-undocumented.txt index 2e20b3a5..2b02c59e 100644 --- a/glabels2/docs/libglabels/libglabels-undocumented.txt +++ b/glabels2/docs/libglabels/libglabels-undocumented.txt @@ -1,5 +1,5 @@ 99% symbol docs coverage. -128 symbols documented. +130 symbols documented. 0 symbols incomplete. 1 not documented. diff --git a/glabels2/docs/libglabels/tmpl/category.sgml b/glabels2/docs/libglabels/tmpl/category.sgml index 0797f854..1a603f37 100644 --- a/glabels2/docs/libglabels/tmpl/category.sgml +++ b/glabels2/docs/libglabels/tmpl/category.sgml @@ -71,6 +71,22 @@ This structure defines a category. @Returns: + + + + + +@Returns: + + + + + + + +@ids: + + diff --git a/glabels2/libglabels/category.c b/glabels2/libglabels/category.c index 03576e88..11cc40bb 100644 --- a/glabels2/libglabels/category.c +++ b/glabels2/libglabels/category.c @@ -153,6 +153,55 @@ void lgl_category_free (lglCategory *category) } +/** + * lgl_category_get_id_list: + * + * Get a list of all category ids known to libglabels. + * + * Returns: a list of category ids. + * + */ +GList * +lgl_category_get_id_list (void) +{ + GList *ids = NULL; + GList *p; + lglCategory *category; + + if (!categories) { + lgl_category_init (); + } + + for ( p=categories; p != NULL; p=p->next ) { + category = (lglCategory *)p->data; + ids = g_list_append (ids, g_strdup (category->id)); + } + + return ids; +} + +/** + * lgl_category_free_id_list: + * @ids: List of id strings to be freed. + * + * Free up all storage associated with an id list obtained with + * lgl_category_get_id_list(). + * + */ +void +lgl_category_free_id_list (GList *ids) +{ + GList *p; + + for (p = ids; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + + g_list_free (ids); +} + + /** * lgl_category_get_name_list: * diff --git a/glabels2/libglabels/category.h b/glabels2/libglabels/category.h index 84817da0..cab4585d 100644 --- a/glabels2/libglabels/category.h +++ b/glabels2/libglabels/category.h @@ -54,6 +54,13 @@ lglCategory *lgl_category_dup (const lglCategory *orig); void lgl_category_free (lglCategory *category); +/* + * ID lists + */ +GList *lgl_category_get_id_list (void); +void lgl_category_free_id_list (GList *ids); + + /* * Known category name lists */