dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/csdoc doc_html.c,1.9,1.10


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/csdoc doc_html.c,1.9,1.10
Date: Sun, 29 Jun 2003 17:40:22 -0400

Update of /cvsroot/dotgnu-pnet/pnet/csdoc
In directory subversions:/tmp/cvs-serv12405/csdoc

Modified Files:
        doc_html.c 
Log Message:


Add code to generate href links to the output of cssrc2html.


Index: doc_html.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/csdoc/doc_html.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** doc_html.c  13 Dec 2002 11:24:46 -0000      1.9
--- doc_html.c  29 Jun 2003 21:40:20 -0000      1.10
***************
*** 81,84 ****
--- 81,90 ----
                "-fheader-color=COLOR",
                "Specify the color to use in table headers"},
+       {"-fsource-xref-tags", 'f', 1,
+               "-fsource-xref-tags",
+               "Enable generation of tags for source cross reference"},
+       {"-fsource-xref-dir", 'f', 1,
+               "-fsource-xref-dir=DIR",
+               "Specify relative location of directory containing source html 
file"},
        {0, 0, 0, 0, 0}
  };
***************
*** 99,102 ****
--- 105,112 ----
  static int useFrames;
  
+ static int    sourceXrefTags = 0;
+ static char   *sourceXrefName = NULL;
+ static char   *sourceXrefDir = NULL;
+ 
  /*
   * The next index to use to create unique filenames.
***************
*** 1528,1531 ****
--- 1538,1542 ----
        fputs("<BLOCKQUOTE>\n", stream);
        needComma = 0;
+ 
        child = ILDocTextFirstChild(doc, "seealso");
        while(child != 0)
***************
*** 1877,1880 ****
--- 1888,1906 ----
                PrintSignature(memberStream, member->csSignature);
  
+               if (sourceXrefTags && (member->memberType == 
ILDocMemberType_Method || member->memberType == ILDocMemberType_Constructor))
+               {
+                       fprintf(memberStream, "<a HREF=\"%s/%s#", 
sourceXrefDir, sourceXrefName);
+                       if (type->namespace)
+                       {
+                               fprintf(memberStream, "%s.", 
type->namespace->name);
+                       }
+                       fputs(type->name, memberStream);
+                       if (member->memberType == ILDocMemberType_Method)
+                       {
+                               fprintf(memberStream, ".%s", member->name);
+                       }
+                       fputs("\">Source Code</a>", memberStream);
+               }
+ 
                /* Print the documentation for the member */
                PrintDocs(memberStream, member->doc, type, member);
***************
*** 1904,1907 ****
--- 1930,1973 ----
        const char *title;
        const char *color;
+       int     len;
+ 
+       sourceXrefTags = ILDocFlagSet("source-xref-tags");
+       sourceXrefDir = (char *) ILDocFlagValue("source-xref-dir");
+       if (!sourceXrefDir)
+       {
+               sourceXrefDir = "..";
+       }
+       else
+       {
+               sourceXrefTags = 1;             /* implicit enable if directory 
specified */
+               /* Adjust the first input filename to end in ".html" */
+               len = strlen(inputs[0]);
+               while(len > 0 && inputs[0][len - 1] != '/' &&
+                         inputs[0][len - 1] != '\\' &&
+                         inputs[0][len - 1] != '.')
+               {
+                       --len;
+               }
+               if(len > 0 && inputs[0][len - 1] == '.')
+               {
+                       sourceXrefName = (char *)ILMalloc(len + 5);
+                       if(!sourceXrefName)
+                       {
+                               ILDocOutOfMemory(progname);
+                       }
+                       ILMemCpy(sourceXrefName, inputs[0], len);
+                       strcpy(sourceXrefName + len, "html");
+               }
+               else
+               {
+                       sourceXrefName = (char *)ILMalloc(strlen(inputs[0]) + 
6);
+                       if(!sourceXrefName)
+                       {
+                               ILDocOutOfMemory(progname);
+                       }
+                       strcpy(sourceXrefName, inputs[0]);
+                       strcat(sourceXrefName, ".html");
+               }
+       }
  
        /* Attempt to open the output stream */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]