Skip to content

Commit

Permalink
support for short comments was added to ext_skel proto files
Browse files Browse the repository at this point in the history
theese will be used in proto comments in the source
and as <refpurpose> information in the XML docs
  • Loading branch information
Hartmut Holzgraefe committed Oct 31, 2000
1 parent f589a3b commit c420d65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.EXT_SKEL
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ FORMAT OF FUNCTION DEFINITIONS FILE
']'s as there where '['s. Currently, it does not harm if you forget to do it
or there is a wrong amount of ']'s, but this may change in the future.

An additional short description may be added after the parameters.
If present it will be filled into the 'proto' header comments in the stubs
code and the <refpurpose> tag in the XML documentation.

An example:

my_function(int arg1, int arg2 [, int arg3 [, int arg4]])
my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st

Arguments arg3 and arg4 are optional.

Expand Down
9 changes: 7 additions & 2 deletions ext/skeleton/create_stubs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ BEGIN {
}
}

if (x = gobble("\\)")) {
sub(/^[ \t]+/, "", line)
fcomments[num_funcs] = line
}

funcs[num_funcs] = func_name
types[num_funcs] = func_type
maxargs[num_funcs] = args_max
Expand All @@ -171,7 +176,7 @@ END {
xmlstr = " <refentry id=\"function." refid "\">\n" \
" <refnamediv>\n" \
" <refname>" funcs[i] "</refname>\n" \
" <refpurpose></refpurpose>\n" \
" <refpurpose>" fcomments[i] "</refpurpose>\n" \
" </refnamediv>\n" \
" <refsect1>\n" \
" <title>Description</title>\n" \
Expand Down Expand Up @@ -261,7 +266,7 @@ END {
}
}

proto = proto closeopts ")\n */\nPHP_FUNCTION(" funcs[i] ")\n{"
proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i] ")\n{"
if (maxargs[i]) {
zvals = zvals ";"
fetchargs = fetchargs ") == FAILURE)" closefetch "{\n\t\tWRONG_PARAM_COUNT;\n\t}\n"
Expand Down

0 comments on commit c420d65

Please sign in to comment.