Fix some glib docs warnings

Remove some symbols from glib-sections.txt that gtk-doc has no idea
about.

Add proper callback typedefs for GTester (gtk-doc dislikes inline
function types).

Fix some other minor issues.
This commit is contained in:
Ryan Lortie 2010-07-12 16:37:56 -04:00
parent dc8cf867c8
commit 7791fce38a
9 changed files with 121 additions and 43 deletions

View File

@ -1168,6 +1168,7 @@ g_mapped_file_get_contents
g_open g_open
g_rename g_rename
g_mkdir g_mkdir
GStatBuf
g_stat g_stat
g_lstat g_lstat
g_unlink g_unlink
@ -1399,7 +1400,6 @@ g_date_sunday_week_of_year
g_date_days_in_month g_date_days_in_month
g_date_monday_weeks_in_year g_date_monday_weeks_in_year
g_date_sunday_weeks_in_year g_date_sunday_weeks_in_year
tm
</SECTION> </SECTION>
<SECTION> <SECTION>
@ -2654,7 +2654,9 @@ g_test_perf
g_test_verbose g_test_verbose
g_test_quiet g_test_quiet
g_test_run g_test_run
GTestFunc
g_test_add_func g_test_add_func
GTestDataFunc
g_test_add_data_func g_test_add_data_func
g_test_add g_test_add
@ -2701,6 +2703,7 @@ g_assert_error
GTestCase GTestCase
GTestSuite GTestSuite
GTestFixtureFunc
g_test_create_case g_test_create_case
g_test_create_suite g_test_create_suite
g_test_get_root g_test_get_root
@ -2718,7 +2721,6 @@ g_assertion_message_error
g_test_add_vtable g_test_add_vtable
GTestConfig GTestConfig
g_test_config_vars
GTestLogType GTestLogType
GTestLogMsg GTestLogMsg
GTestLogBuffer GTestLogBuffer
@ -2757,6 +2759,9 @@ G_VARIANT_TYPE_TUPLE
G_VARIANT_TYPE_UNIT G_VARIANT_TYPE_UNIT
G_VARIANT_TYPE_DICT_ENTRY G_VARIANT_TYPE_DICT_ENTRY
G_VARIANT_TYPE_DICTIONARY G_VARIANT_TYPE_DICTIONARY
G_VARIANT_TYPE_STRING_ARRAY
G_VARIANT_TYPE_BYTESTRING
G_VARIANT_TYPE_BYTESTRING_ARRAY
<SUBSECTION> <SUBSECTION>
G_VARIANT_TYPE G_VARIANT_TYPE

View File

@ -382,6 +382,12 @@ not be accessed directly.
@Returns: @Returns:
<!-- ##### TYPEDEF GStatBuf ##### -->
<para>
</para>
<!-- ##### FUNCTION g_stat ##### --> <!-- ##### FUNCTION g_stat ##### -->
<para> <para>

View File

@ -150,13 +150,29 @@ Returns %TRUE if tests are run in quiet mode.
@Returns: @Returns:
<!-- ##### USER_FUNCTION GTestFunc ##### -->
<para>
</para>
@void:
<!-- ##### FUNCTION g_test_add_func ##### --> <!-- ##### FUNCTION g_test_add_func ##### -->
<para> <para>
</para> </para>
@testpath: @testpath:
@void: @test_func:
<!-- ##### USER_FUNCTION GTestDataFunc ##### -->
<para>
</para>
@user_data:
<!-- ##### FUNCTION g_test_add_data_func ##### --> <!-- ##### FUNCTION g_test_add_data_func ##### -->
@ -166,7 +182,7 @@ Returns %TRUE if tests are run in quiet mode.
@testpath: @testpath:
@test_data: @test_data:
@gconstpointer: @test_func:
<!-- ##### MACRO g_test_add ##### --> <!-- ##### MACRO g_test_add ##### -->
@ -597,6 +613,15 @@ An opaque structure representing a test suite.
</para> </para>
<!-- ##### USER_FUNCTION GTestFixtureFunc ##### -->
<para>
</para>
@fixture:
@user_data:
<!-- ##### FUNCTION g_test_create_case ##### --> <!-- ##### FUNCTION g_test_create_case ##### -->
<para> <para>
@ -605,9 +630,9 @@ An opaque structure representing a test suite.
@test_name: @test_name:
@data_size: @data_size:
@test_data: @test_data:
@void: @data_setup:
@void: @data_test:
@void: @data_teardown:
@Returns: @Returns:

View File

@ -425,6 +425,14 @@ g_chdir (const gchar *path)
#endif #endif
} }
/**
* GStatBuf:
*
* A type corresponding to the appropriate struct type for the stat
* system call, depending on the platform and/or compiler being used.
*
* See g_stat() for more information.
**/
/** /**
* g_stat: * g_stat:
* @filename: a pathname in the GLib file name encoding (UTF-8 on Windows) * @filename: a pathname in the GLib file name encoding (UTF-8 on Windows)

View File

@ -1664,10 +1664,10 @@ g_strlcpy (gchar *dest,
* strcat() or strncat(), but for real security g_strconcat() is harder * strcat() or strncat(), but for real security g_strconcat() is harder
* to mess up.</para></note> * to mess up.</para></note>
* *
* Returns size of attempted result, which is * Returns: size of attempted result, which is MIN (dest_size, strlen
* MIN (dest_size, strlen (original dest)) + strlen (src), * (original dest)) + strlen (src), so if retval >= dest_size,
* so if retval >= dest_size, truncation occurred. * truncation occurred.
*/ **/
gsize gsize
g_strlcat (gchar *dest, g_strlcat (gchar *dest,
const gchar *src, const gchar *src,
@ -3216,7 +3216,7 @@ g_dgettext (const gchar *domain,
} }
/** /**
* g_dgettext: * g_dcgettext:
* @domain: (allow-none): the translation domain to use, or %NULL to use * @domain: (allow-none): the translation domain to use, or %NULL to use
* the domain set with textdomain() * the domain set with textdomain()
* @msgid: message to translate * @msgid: message to translate

View File

@ -909,9 +909,9 @@ GTestCase*
g_test_create_case (const char *test_name, g_test_create_case (const char *test_name,
gsize data_size, gsize data_size,
gconstpointer test_data, gconstpointer test_data,
void (*data_setup) (void), GTestFixtureFunc data_setup,
void (*data_test) (void), GTestFixtureFunc data_test,
void (*data_teardown) (void)) GTestFixtureFunc data_teardown)
{ {
GTestCase *tc; GTestCase *tc;
g_return_val_if_fail (test_name != NULL, NULL); g_return_val_if_fail (test_name != NULL, NULL);
@ -928,13 +928,29 @@ g_test_create_case (const char *test_name,
return tc; return tc;
} }
/**
* GTestFixtureFunc:
* @fixture: the test fixture
* @user_data: the data provided when registering the test
*
* The type used for functions that operate on test fixtures. This is
* used for the fixture setup and teardown functions as well as for the
* testcases themselves.
*
* @user_data is a pointer to the data that was given when registering
* the test case.
*
* @fixture will be a pointer to the area of memory allocated by the
* test framework, of the size requested. If the requested size was
* zero then @fixture will be equal to @user_data.
**/
void void
g_test_add_vtable (const char *testpath, g_test_add_vtable (const char *testpath,
gsize data_size, gsize data_size,
gconstpointer test_data, gconstpointer test_data,
void (*data_setup) (void), GTestFixtureFunc data_setup,
void (*fixture_test_func) (void), GTestFixtureFunc fixture_test_func,
void (*data_teardown) (void)) GTestFixtureFunc data_teardown)
{ {
gchar **segments; gchar **segments;
guint ui; guint ui;
@ -969,6 +985,11 @@ g_test_add_vtable (const char *testpath,
g_strfreev (segments); g_strfreev (segments);
} }
/**
* GTestFunc:
*
* The type used for test case functions.
**/
/** /**
* g_test_add_func: * g_test_add_func:
* @testpath: Slash-separated test case path name for the test. * @testpath: Slash-separated test case path name for the test.
@ -983,14 +1004,21 @@ g_test_add_vtable (const char *testpath,
*/ */
void void
g_test_add_func (const char *testpath, g_test_add_func (const char *testpath,
void (*test_func) (void)) GTestFunc test_func)
{ {
g_return_if_fail (testpath != NULL); g_return_if_fail (testpath != NULL);
g_return_if_fail (testpath[0] == '/'); g_return_if_fail (testpath[0] == '/');
g_return_if_fail (test_func != NULL); g_return_if_fail (test_func != NULL);
g_test_add_vtable (testpath, 0, NULL, NULL, test_func, NULL); g_test_add_vtable (testpath, 0, NULL, NULL, (GTestFixtureFunc) test_func, NULL);
} }
/**
* GTestDataFunc:
* @user_data: the data provided when registering the test
*
* The type used for test case functions that take an extra pointer
* argument.
**/
/** /**
* g_test_add_data_func: * g_test_add_data_func:
* @testpath: Slash-separated test case path name for the test. * @testpath: Slash-separated test case path name for the test.
@ -1008,12 +1036,12 @@ g_test_add_func (const char *testpath,
void void
g_test_add_data_func (const char *testpath, g_test_add_data_func (const char *testpath,
gconstpointer test_data, gconstpointer test_data,
void (*test_func) (gconstpointer)) GTestDataFunc test_func)
{ {
g_return_if_fail (testpath != NULL); g_return_if_fail (testpath != NULL);
g_return_if_fail (testpath[0] == '/'); g_return_if_fail (testpath[0] == '/');
g_return_if_fail (test_func != NULL); g_return_if_fail (test_func != NULL);
g_test_add_vtable (testpath, 0, test_data, NULL, (void(*)(void)) test_func, NULL); g_test_add_vtable (testpath, 0, test_data, NULL, (GTestFixtureFunc) test_func, NULL);
} }
/** /**

View File

@ -34,6 +34,10 @@ G_BEGIN_DECLS
typedef struct GTestCase GTestCase; typedef struct GTestCase GTestCase;
typedef struct GTestSuite GTestSuite; typedef struct GTestSuite GTestSuite;
typedef void (*GTestFunc) (void);
typedef void (*GTestDataFunc) (gconstpointer user_data);
typedef void (*GTestFixtureFunc) (gpointer fixture,
gconstpointer user_data);
/* assertion API */ /* assertion API */
#define g_assert_cmpstr(s1, cmp, s2) do { const char *__s1 = (s1), *__s2 = (s2); \ #define g_assert_cmpstr(s1, cmp, s2) do { const char *__s1 = (s1), *__s2 = (s2); \
@ -98,10 +102,12 @@ void g_test_init (int *argc,
int g_test_run (void); int g_test_run (void);
/* hook up a test functions under test path */ /* hook up a test functions under test path */
void g_test_add_func (const char *testpath, void g_test_add_func (const char *testpath,
void (*test_func) (void)); GTestFunc test_func);
void g_test_add_data_func (const char *testpath, void g_test_add_data_func (const char *testpath,
gconstpointer test_data, gconstpointer test_data,
void (*test_func) (gconstpointer)); GTestDataFunc test_func);
/* hook up a test with fixture under test path */ /* hook up a test with fixture under test path */
#define g_test_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \ #define g_test_add(testpath, Fixture, tdata, fsetup, ftest, fteardown) \
G_STMT_START { \ G_STMT_START { \
@ -161,9 +167,9 @@ double g_test_rand_double_range (double range_start,
GTestCase* g_test_create_case (const char *test_name, GTestCase* g_test_create_case (const char *test_name,
gsize data_size, gsize data_size,
gconstpointer test_data, gconstpointer test_data,
void (*data_setup) (void), GTestFixtureFunc data_setup,
void (*data_test) (void), GTestFixtureFunc data_test,
void (*data_teardown) (void)); GTestFixtureFunc data_teardown);
GTestSuite* g_test_create_suite (const char *suite_name); GTestSuite* g_test_create_suite (const char *suite_name);
GTestSuite* g_test_get_root (void); GTestSuite* g_test_get_root (void);
void g_test_suite_add (GTestSuite *suite, void g_test_suite_add (GTestSuite *suite,
@ -217,9 +223,9 @@ void g_assertion_message_error (const char *domain,
void g_test_add_vtable (const char *testpath, void g_test_add_vtable (const char *testpath,
gsize data_size, gsize data_size,
gconstpointer test_data, gconstpointer test_data,
void (*data_setup) (void), GTestFixtureFunc data_setup,
void (*data_test) (void), GTestFixtureFunc data_test,
void (*data_teardown) (void)); GTestFixtureFunc data_teardown);
typedef struct { typedef struct {
gboolean test_initialized; gboolean test_initialized;
gboolean test_quick; /* disable thorough tests */ gboolean test_quick; /* disable thorough tests */

View File

@ -95,7 +95,7 @@
(Result) |= ((Chars)[(Count)] & 0x3f); \ (Result) |= ((Chars)[(Count)] & 0x3f); \
} }
/** /*
* Check whether a Unicode (5.2) char is in a valid range. * Check whether a Unicode (5.2) char is in a valid range.
* *
* The first check comes from the Unicode guarantee to never encode * The first check comes from the Unicode guarantee to never encode

View File

@ -1392,7 +1392,7 @@ g_variant_dup_bytestring (GVariant *value,
/** /**
* g_variant_new_bytestring_array: * g_variant_new_bytestring_array:
* @strv (array length=length): an array of strings * @strv: (array length=length): an array of strings
* @length: the length of @strv, or -1 * @length: the length of @strv, or -1
* @returns: a new floating #GVariant instance * @returns: a new floating #GVariant instance
* *