summaryrefslogtreecommitdiffstats
path: root/scripts/docproc.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
commitb9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 (patch)
tree42d07b0c7246ae2536a702e7c5de9e2732341116 /scripts/docproc.c
parent7406b0a326f2d70ade2671c37d1beef62249db97 (diff)
Merge with 2.3.99-pre6.
Diffstat (limited to 'scripts/docproc.c')
-rw-r--r--scripts/docproc.c73
1 files changed, 49 insertions, 24 deletions
diff --git a/scripts/docproc.c b/scripts/docproc.c
index 0f7eaa218..465a604a3 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -13,6 +13,8 @@ int main(int argc, char *argv[])
{
char buf[1024];
char *vec[8192];
+ char *fvec[200];
+ char **svec;
char type[64];
int i;
int vp=2;
@@ -46,32 +48,55 @@ int main(int argc, char *argv[])
while(fgets(buf, 1024, stdin))
{
- if(*buf!='!')
+ if(*buf!='!') {
printf("%s", buf);
- else
- {
- fflush(stdout);
- if(buf[1]=='E')
- strcpy(type, "-function");
- else if(buf[1]=='I')
- strcpy(type, "-nofunction");
- else
- {
- fprintf(stderr, "Unknown ! escape.\n");
- exit(1);
- }
- switch(pid=fork())
- {
- case -1:
- perror("fork");
- exit(1);
- case 0:
- execvp("scripts/kernel-doc", vec);
- perror("exec scripts/kernel-doc");
- exit(1);
- default:
- waitpid(pid, NULL,0);
+ continue;
+ }
+
+ fflush(stdout);
+ svec = vec;
+ if(buf[1]=='E')
+ strcpy(type, "-function");
+ else if(buf[1]=='I')
+ strcpy(type, "-nofunction");
+ else if(buf[1]=='F') {
+ int snarf = 0;
+ fvec[0] = "kernel-doc";
+ fvec[1] = "-docbook";
+ strcpy (type, "-function");
+ vp = 2;
+ for (i = 2; buf[i]; i++) {
+ if (buf[i] == ' ' || buf[i] == '\n') {
+ buf[i] = '\0';
+ snarf = 1;
+ continue;
+ }
+
+ if (snarf) {
+ snarf = 0;
+ fvec[vp++] = type;
+ fvec[vp++] = &buf[i];
+ }
}
+ fvec[vp++] = &buf[2];
+ fvec[vp] = NULL;
+ svec = fvec;
+ } else
+ {
+ fprintf(stderr, "Unknown ! escape.\n");
+ exit(1);
+ }
+ switch(pid=fork())
+ {
+ case -1:
+ perror("fork");
+ exit(1);
+ case 0:
+ execvp("scripts/kernel-doc", svec);
+ perror("exec scripts/kernel-doc");
+ exit(1);
+ default:
+ waitpid(pid, NULL,0);
}
}
exit(0);