Re: kernel-doc !E and !I

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Apr 07 2000 - 05:30:08 EST


On Thu, 6 Apr 2000, Jeff Garzik wrote:

> However... init_etherdev in net_init.c has to be pulled in via !I for
> some reason.

Yeah, it all looks bogus to me. I think a more useful escape would be one
that you can list named functions to document. Like this one (see
below). Comments?

Tim.
*/

Index: linux/scripts/docproc.c
diff -u linux/scripts/docproc.c:1.1.1.2 linux/scripts/docproc.c:1.2
--- linux/scripts/docproc.c:1.1.1.2 Wed Mar 29 09:56:00 2000
+++ linux/scripts/docproc.c Fri Apr 7 11:28:35 2000
@@ -13,6 +13,8 @@
 {
         char buf[1024];
         char *vec[8192];
+ char *fvec[200];
+ char **svec;
         char type[64];
         int i;
         int vp=2;
@@ -46,32 +48,55 @@
          
         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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:18 EST