summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorminskim <minskim@pkgsrc.org>2007-01-29 16:40:58 +0000
committerminskim <minskim@pkgsrc.org>2007-01-29 16:40:58 +0000
commit39358132418b6292c544e5d9a7f8d2e121d5135a (patch)
tree3292ce95dd62ff711d5d8e4ff3ca933189c9bb3b /textproc
parent38a9ea5eba38fb9701d93433451a9d7d6402f4e0 (diff)
downloadpkgsrc-39358132418b6292c544e5d9a7f8d2e121d5135a.tar.gz
Import c2html from pkgsrc-wip. Packaged by Lubomir Kundrak.
c2html is a simple program which converts a C source code tree into HTML which can be easily navigated using a web browser. Features: * Colorized output * Hyperlinks between files are created for functions and, in some cases, macro definitions. * A file called .index can contain one-line comments about each file in a directory; it will be included in the HTML-ized directory listing. * HTML "header" and "footer" files can be included. href-links pointing to local files (relative to the current directory) are automatically updated. * A "web bug" can be included on each page.
Diffstat (limited to 'textproc')
-rw-r--r--textproc/c2html/DESCR13
-rw-r--r--textproc/c2html/Makefile17
-rw-r--r--textproc/c2html/PLIST4
-rw-r--r--textproc/c2html/TODO0
-rw-r--r--textproc/c2html/distinfo8
-rw-r--r--textproc/c2html/patches/patch-aa27
-rw-r--r--textproc/c2html/patches/patch-ab30
-rw-r--r--textproc/c2html/patches/patch-ac39
8 files changed, 138 insertions, 0 deletions
diff --git a/textproc/c2html/DESCR b/textproc/c2html/DESCR
new file mode 100644
index 00000000000..87fb4d7c718
--- /dev/null
+++ b/textproc/c2html/DESCR
@@ -0,0 +1,13 @@
+c2html is a simple program which converts a C source code tree into
+HTML which can be easily navigated using a web browser.
+
+Features:
+ * Colorized output
+ * Hyperlinks between files are created for functions and, in some cases,
+ macro definitions.
+ * A file called .index can contain one-line comments about each file in a
+ directory; it will be included in the HTML-ized directory listing.
+ * HTML "header" and "footer" files can be included. href-links pointing
+ to local files (relative to the current directory) are automatically
+ updated.
+ * A "web bug" can be included on each page.
diff --git a/textproc/c2html/Makefile b/textproc/c2html/Makefile
new file mode 100644
index 00000000000..aaff49931d0
--- /dev/null
+++ b/textproc/c2html/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+
+DISTNAME= c2html-20070126
+CATEGORIES= textproc devel
+MASTER_SITES= http://gavare.se/c2html/src/
+
+MAINTAINER= lkundrak@skosi.org
+HOMEPAGE= http://gavare.se/c2html/
+COMMENT= Converts a C source tree to hyperlinked and colored HTML
+
+INSTALLATION_DIRS= bin ${PREFIX}/share/doc/${PKGBASE}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/c2html ${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/${PKGBASE}
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/textproc/c2html/PLIST b/textproc/c2html/PLIST
new file mode 100644
index 00000000000..597e387e111
--- /dev/null
+++ b/textproc/c2html/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+bin/c2html
+share/doc/c2html/README
+@dirrm share/doc/c2html
diff --git a/textproc/c2html/TODO b/textproc/c2html/TODO
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/textproc/c2html/TODO
diff --git a/textproc/c2html/distinfo b/textproc/c2html/distinfo
new file mode 100644
index 00000000000..74115b394bc
--- /dev/null
+++ b/textproc/c2html/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+
+SHA1 (c2html-20070126.tar.gz) = 91e0935a6f4e4f9b2f56e29f80fdd6611178db93
+RMD160 (c2html-20070126.tar.gz) = 7667558f7fad3856bbfd257f1563b99b84681ca8
+Size (c2html-20070126.tar.gz) = 17422 bytes
+SHA1 (patch-aa) = be9ed0c668fcf1915dcdd5b3f58a057a2563e203
+SHA1 (patch-ab) = 48bf7abefadcb8dfe6c6c0427183113700b73340
+SHA1 (patch-ac) = 7fc9b98073dd8b7a84b0c09a1a367ded8c0bb73e
diff --git a/textproc/c2html/patches/patch-aa b/textproc/c2html/patches/patch-aa
new file mode 100644
index 00000000000..acd1295432a
--- /dev/null
+++ b/textproc/c2html/patches/patch-aa
@@ -0,0 +1,27 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+
+Some platforms (GNU) lack strl* functions.
+Anyways, here the return value is not checked, so toe only
+difference is the trailing \0-padding, which has just very
+minor performance implications.
+
+--- build_ht.c.orig 2007-01-26 18:23:32.000000000 +0100
++++ build_ht.c
+@@ -101,7 +101,7 @@ char **build_ht(char **strings, int nr_o
+ prevline[0] = '\0';
+
+ while (cur_string_no < nr_of_strings) {
+- strlcpy(line, strings[cur_string_no], sizeof line);
++ strncpy(line, strings[cur_string_no], sizeof line);
+
+ if (isdigit(line[0]) && strcmp(line, prevline) != 0) {
+ /* Get the hashcode from the line: */
+@@ -148,7 +148,7 @@ char **build_ht(char **strings, int nr_o
+ cp += strlen(line+i);
+ }
+
+- strlcpy(prevline, line, sizeof(prevline));
++ strncpy(prevline, line, sizeof(prevline));
+ cur_string_no ++;
+ }
+
diff --git a/textproc/c2html/patches/patch-ab b/textproc/c2html/patches/patch-ab
new file mode 100644
index 00000000000..e96e1399e56
--- /dev/null
+++ b/textproc/c2html/patches/patch-ab
@@ -0,0 +1,30 @@
+$NetBSD: patch-ab,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+
+Some platforms (GNU) lack strl* functions.
+Anyways, here the return value is not checked, so toe only
+difference is the trailing \0-padding, which has just very
+minor performance implications.
+
+--- relative.c.orig 2007-01-26 18:24:51.000000000 +0100
++++ relative.c
+@@ -147,7 +147,7 @@ printf ("matchlen=%i\n", matchlen);
+ /* Find last slash (withing the first matchlen bytes) of
+ the matched part: */
+
+- strlcpy (result, src, reslen_max);
++ strncpy (result, src, reslen_max);
+ result[matchlen] = 0;
+
+ /* printf ("result='%s'\n", result); */
+@@ -182,9 +182,9 @@ printf ("Nm=%i, Ns=%i\n", Nm, Ns);
+
+ result[0] = 0;
+ for (i=0; i<Ndown; i++)
+- strlcat (result, "../", reslen_max);
++ strncat (result, "../", reslen_max);
+
+- strlcat (result, dst+baselen, reslen_max);
++ strncat (result, dst+baselen, reslen_max);
+
+ /*
+ printf ("result='%s'\n", result);
diff --git a/textproc/c2html/patches/patch-ac b/textproc/c2html/patches/patch-ac
new file mode 100644
index 00000000000..8951c562cb0
--- /dev/null
+++ b/textproc/c2html/patches/patch-ac
@@ -0,0 +1,39 @@
+$NetBSD: patch-ac,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $
+
+4.4BSD's radixsort() is unportable, replace it with slower qsort() for now.
+
+--- main.c.orig 2007-01-26 18:24:41.000000000 +0100
++++ main.c
+@@ -249,6 +249,15 @@ void add_string(char *string)
+ strcpy(strings[nr_of_strings-1], string);
+ }
+
++/*
++ * this is for system lacking radixsort() facility for sorting strings effectively
++ * hopefully gcc optimizes this out otherwise
++ */
++int
++pstrcmp (const void *s1, const void *s2)
++{
++ return strcmp (*(u_char **)s1, *(u_char **)s2);
++}
+
+ /*
+ * main():
+@@ -296,10 +305,16 @@ int main(int argc, char *argv[])
+ add_string(s);
+ }
+
++#ifdef BSD
+ printf ("radixsort...\n");
+ i = radixsort((const u_char **)strings, nr_of_strings, NULL, 0);
+ if (i)
+ printf("radixsort result = %i\n", i);
++#else
++ printf ("quicksort...\n");
++ qsort((void *)strings, nr_of_strings, sizeof (u_char *), pstrcmp);
++ printf ("quicksort finished.\n");
++#endif
+
+ /* for (i=0; i<nr_of_strings; i++)
+ printf("strings[%i]: %s", i, strings[i]); */