Added prototyping stuff

This commit is contained in:
ceriel
1993-11-10 11:14:28 +00:00
parent 48a8bc1bd1
commit 4b6c6de71f
47 changed files with 529 additions and 143 deletions

View File

@@ -2,6 +2,7 @@ BEGIN {
FS = "|";
seenproc = 0;
CC="${CMD}"
if (prototypes == "") prototypes = "prototypes"
}
/^%/ {}
/^$/ {}
@@ -18,7 +19,8 @@ BEGIN {
nam = $1
printf "cat > O_%s.c << '--EOF--'\n",$1
print "#include \"nopt.h\""
printf "O_%s(",$1
printf "void O_%s(",$1
prototype = "_PROTOTYPE(void O_" $1 ", ("
nparms = split($2,parms,":");
for(p=1;p<nparms;p++) {
if(p!=1) {
@@ -28,16 +30,23 @@ BEGIN {
printf a[1]
}
printf ")\n"
if(nparms) {
if(nparms > 1) {
prototype = prototype parms[1]
printf "\t%s",parms[1]
}
else {
prototype = prototype "void"
}
for(p=1;p<nparms;p++) {
split(parms[p+1],a," ")
prototype = prototype " " a[1]
printf " %s;\n",a[1]
if(a[2]) {
prototype = prototype ", " a[2] a[3] a[4]
printf "\t%s%s%s",a[2],a[3],a[4]
}
}
print prototype "));" >> prototypes
if($3) {
printf "{\n\t%s\n",$3
}