10 function log_msg(severity, msg)
12 printf "%s (%d): %s: %s %s\n", FILENAME, FNR, severity, doc_name, msg
15 function log_error(msg)
20 function log_warning(msg)
22 log_msg("WARNING", msg)
30 /^(\/\*\*$| \*[ \t]| \*$| \*\*\/$)/ {
36 log_error("bad line: '" $0 "'")
41 # new doc name. Did we find the previous one?
42 # (macros are not expected to be found in the same place as
43 # their documentation)
44 if (!name_found && doc_name !~ /CAIRO_/)
45 log_warning("not found")
47 if (doc_name ~ /^SECTION:.*$/) {
48 doc_type = SECTION_DOC
50 } else if (tolower(doc_name) ~ /^cairo_[a-z0-9_]*:$/) {
53 real_name = substr(doc_name, 1, length(doc_name) - 1)
54 } else if (tolower(doc_name) ~ /^_[a-z0-9_]*:$/) {
55 doc_type = PRIVATE_DOC
57 real_name = substr(doc_name, 1, length(doc_name) - 1)
59 log_error("invalid doc id (should be 'cairo_...:')")
66 regex = "(^|[ \\t\\*])" real_name "([ ;()]|$)"
71 /^ \* Since: ([0-9]*.[0-9]*|TBD)$/ {
72 if (doc_has_since != 0) {
73 log_error("Duplicate 'Since' field")
75 doc_has_since = doc_line
79 if (doc_type == PUBLIC_DOC) {
81 # private types can start with cairo_
82 if (doc_name ~ /^cairo_.*_t:$/)
83 log_warning("missing 'Since' field (is it a private type?)")
85 log_error("missing 'Since' field")
86 } else if (doc_has_since != doc_line - 1)
87 log_warning("misplaced 'Since' field (should be right before the end of the comment)")
90 log_warning("'Since' field in non-public element")
101 log_error("documentation comment not closed with **/")
107 log_warning("not found")