summaryrefslogtreecommitdiff
path: root/tests/scanner/annotation.h
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2020-07-01 23:34:34 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2020-07-12 02:52:12 +0200
commitd7504419093aef9fae802ad599cff1bf9022e24d (patch)
treeba9b0aa6815f98ae44106388134d9e822b2327a1 /tests/scanner/annotation.h
parentbc8d3bc249e8eeff444e5fafac0d8821244fdb26 (diff)
downloadgobject-introspection-d7504419093aef9fae802ad599cff1bf9022e24d.tar.gz
giscanner: parse block comments for members and fields
There was previously no mechanism for tagging enum members and struct fields with Since tags (or other, eg deprecation tags). While the customary place to add Since tags for these symbols is inline in the parent symbol's documentation eg: /** * Foo: * * @FOO_BAR: some bar. Since X.Y */ And variations on that theme, implementing parsing for that scheme would result in a pretty ambiguous grammar, especially if we also want support for multiple tags. Instead, the solution implemented here is to allow providing documentation for individual members and fields through their own separate block, as is done for virtual functions already. Inline comments are still used, with a lower precedence. Fixes #348
Diffstat (limited to 'tests/scanner/annotation.h')
-rw-r--r--tests/scanner/annotation.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index 92c0b6bd..5c23d77c 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -8,7 +8,13 @@
typedef enum /*< flags,prefix=ANN >*/
{
ANN_FLAG_FOO = 1,
- ANN_FLAG_BAR = 2
+ ANN_FLAG_BAR = 2,
+ /**
+ * ANN_FLAG_FOOBAR:
+ *
+ * Since: 1.4
+ */
+ ANN_FLAG_FOOBAR = 3,
} RegressAnnotationBitfield;
/**
@@ -256,9 +262,16 @@ struct RegressAnnotationFields
int field1;
guchar *arr;
gulong len;
+ /**
+ * RegressAnnotationFields.field4:
+ *
+ * A new field, breaking ABI is fun!
+ *
+ * Since: 1.4
+ */
+ guint field4;
};
-
_GI_TEST_EXTERN
void regress_annotation_ptr_array (GPtrArray *array);