|
Make C prototypes
[Back]
Creates a list of prototypes from the definitions
in the current file.
if ($selection_start == -1) {
start = 0
end = $text_length
} else {
start = $selection_start
end = $selection_end
}
string = get_range(start, end)
nDefs = 0
searchPos = 0
prototypes = ""
staticPrototypes = ""
for (;;) {
headerStart = search_string(string, \
"^[a-zA-Z]([^;#\"'{}=><!/]|\n)*\\)[ \t]*\n?[ \t]*{", \
searchPos, "regex")
if (headerStart == -1)
break
headerEnd = search_string(string, ")", $search_end,"backward") + 1
prototype = substring(string, headerStart, headerEnd) ";\n"
if (substring(string, headerStart, headerStart+6) == "static")
staticPrototypes = staticPrototypes prototype
else
prototypes = prototypes prototype
searchPos = headerEnd
nDefs++
}
if (nDefs == 0) {
dialog("No function declarations found")
return
}
replace_range(0, 0, prototypes staticPrototypes)
select(0, length(prototypes) + length(staticPrototypes))
set_cursor_pos(0)
[Back]
Released on Wed, 21 Nov 2001
by
C. Denat
|
|