aboutsummaryrefslogtreecommitdiff
path: root/misc/chmlib
diff options
context:
space:
mode:
Diffstat (limited to 'misc/chmlib')
-rw-r--r--misc/chmlib/Makefile2
-rw-r--r--misc/chmlib/files/patch-Makefile.in71
-rw-r--r--misc/chmlib/files/patch-chm_lib.h25
3 files changed, 97 insertions, 1 deletions
diff --git a/misc/chmlib/Makefile b/misc/chmlib/Makefile
index 45d573d387b0..c20db4bcba8d 100644
--- a/misc/chmlib/Makefile
+++ b/misc/chmlib/Makefile
@@ -14,7 +14,7 @@ MASTER_SITES= http://66.93.236.84/~jedwin/projects/chmlib/
DISTNAME= ${PORTNAME}-${PORTVERSION:R}${PORTVERSION:E}
EXTRACT_SUFX= .tgz
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= vsevolod@highsecure.ru
COMMENT= A library for dealing with Microsoft ITSS/CHM format files
USE_REINPLACE= yes
diff --git a/misc/chmlib/files/patch-Makefile.in b/misc/chmlib/files/patch-Makefile.in
new file mode 100644
index 000000000000..7519c9c4fa4e
--- /dev/null
+++ b/misc/chmlib/files/patch-Makefile.in
@@ -0,0 +1,71 @@
+--- Makefile.in.orig Fri Feb 25 18:43:09 2005
++++ Makefile.in Fri Feb 25 18:43:21 2005
+@@ -26,7 +26,7 @@
+ %.lo: %.c
+ ${LIBTOOL} --mode=compile ${CC} -c -o $@ $^ ${CFLAGS}
+
+-src/libchm.la: src/chm_lib.lo src/lzx.lo
++src/libchm.la: src/chm_lib.lo src/lzx.lo src/az_chmlib_add.lo
+ ${LIBTOOL} --mode=link ${CC} -o $@ $^ ${LDFLAGS} -rpath ${INSTALLPREFIX}/lib
+
+ install: src/libchm.la
+
+
+patch-az_chmlib_add.c
+--- /dev/null Fri Feb 25 18:33:00 2005
++++ src/az_chmlib_add.c Fri Feb 25 18:29:45 2005
+@@ -0,0 +1,54 @@
++#include <string.h>
++#include "chm_lib.h"
++
++/*
++ * callback function for enumerate API
++ */
++int _get_name(struct chmFile *h,
++ chmUnitInfo *ui,
++ void *context)
++{
++ int i;
++
++
++ chm_dir *dirp = (chm_dir *)context;
++
++ dirp->info=realloc(dirp->info,(dirp->nentries+1)*sizeof (char*));
++
++ dirp->info[dirp->nentries] = malloc(sizeof(ui->path));
++ strcpy(dirp->info[dirp->nentries], ui->path);
++
++ dirp->nentries++;
++ return CHM_ENUMERATOR_CONTINUE;
++}
++
++chm_dir get_names(struct chmFile *h)
++//note: you should free() dir.info and all dir.info[i] in caller
++{
++ chm_dir dir;
++
++ dir.nentries=0;
++ dir.info = NULL;
++
++ if (! chm_enumerate(h,
++ CHM_ENUMERATE_ALL,
++ _get_name,
++ (void *)&dir))
++ printf(" *** ERROR ***\n");
++
++ return dir;
++}
++
++
++int main()
++{
++ int i;
++
++ struct chmFile *h = chm_open("/home/az/new/txt/chm/reg.chm");
++ chm_dir dir=get_names(h);
++ for(i=0;i<dir.nentries;i++)
++ printf("%d: %s\n",i,dir.info[i]);
++
++ return 0;
++}
++
diff --git a/misc/chmlib/files/patch-chm_lib.h b/misc/chmlib/files/patch-chm_lib.h
new file mode 100644
index 000000000000..b32ffd4f3e82
--- /dev/null
+++ b/misc/chmlib/files/patch-chm_lib.h
@@ -0,0 +1,25 @@
+--- src/chm_lib.h.orig Fri Feb 25 21:26:09 2005
++++ src/chm_lib.h Fri Feb 25 21:26:57 2005
+@@ -78,6 +78,12 @@
+ char path[CHM_MAX_PATHLEN+1];
+ };
+
++typedef struct chmUnitInfo chmUnitInfo;
++typedef struct chm_dir {
++ int nentries;
++ char **info;
++} chm_dir;
++
+ /* open an ITS archive */
+ #ifdef PPC_BSTR
+ /* RWE 6/12/2003 */
+@@ -133,6 +139,7 @@
+ CHM_ENUMERATOR e,
+ void *context);
+
++chm_dir get_names(struct chmFile *h);
+ #ifdef __cplusplus
+ }
+ #endif
+
+