groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ./ChangeLog src/devices/grohtml/post-html...


From: Werner LEMBERG
Subject: [Groff-commit] groff ./ChangeLog src/devices/grohtml/post-html...
Date: Sat, 02 Apr 2005 07:49:12 -0500

CVSROOT:        /cvsroot/groff
Module name:    groff
Branch:         
Changes by:     Werner LEMBERG <address@hidden> 05/04/02 12:49:11

Modified files:
        .              : ChangeLog 
        src/devices/grohtml: post-html.cpp 
        src/include    : Makefile.sub lib.h nonposix.h 
        src/libs/libgroff: Makefile.sub font.cpp maxfilename.cpp 
                           searchpath.cpp 
Added files:
        src/include    : relocate.h 
        src/libs/libgroff: maxpathname.cpp relocate.cpp 

Log message:
        Add binary relocation support for Windows platforms.
        
        * src/include/Makefile.sub (defs.h): Add `INSTALLPATH'.
        
        * src/include/relocate.h, src/libs/libgroff/relocate.cpp: New files.
        
        * src/libs/libgroff/searchpath.cpp: Handle `relocate'.
        (search_path::search_path, search_path::open_file_cautious): Use
        `relocate'.
        
        * src/libs/libgroff/Makefile.sub (OBJS, CCSRCS),
        src/include/Makefile.sub (HDRS): Updated.
        
        * src/devices/grohtml/post-html.cpp: Don't use strdup/free but
        strsave/a_delete.
        
        * src/libs/libgroff/font.cpp: Replace strdup with strsave.
        
        * src/libs/libgroff/maxfilename.cpp: Don't include limits.h since
        lib.h already does it.
        
        * src/libs/libgroff/maxpathname.cpp: New file, defining
        path_name_max.
        
        * src/include/lib.h: Add prototype for path_name_max.
        
        * src/libs/libgroff/Makefile.sub (OBJS, CCSRCS): Updated.
        
        * src/include/nonposix.h (PATH_EXT): New macro.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/ChangeLog.diff?tr1=1.809&tr2=1.810&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/devices/grohtml/post-html.cpp.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/include/relocate.h?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/include/Makefile.sub.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/include/lib.h.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/include/nonposix.h.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/maxpathname.cpp?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/relocate.cpp?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/Makefile.sub.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/font.cpp.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/maxfilename.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/libs/libgroff/searchpath.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: groff/ChangeLog
diff -u groff/ChangeLog:1.809 groff/ChangeLog:1.810
--- groff/ChangeLog:1.809       Mon Mar 28 09:16:04 2005
+++ groff/ChangeLog     Sat Apr  2 12:49:10 2005
@@ -1,3 +1,38 @@
+2005-04-01  Kees Zeelenberg  <address@hidden>
+            Werner LEMBERG  <address@hidden>
+
+       Add binary relocation support for Windows platforms.
+
+       * src/include/Makefile.sub (defs.h): Add `INSTALLPATH'.
+
+       * src/include/relocate.h, src/libs/libgroff/relocate.cpp: New files.
+
+       * src/libs/libgroff/searchpath.cpp: Handle `relocate'.
+       (search_path::search_path, search_path::open_file_cautious): Use
+       `relocate'.
+
+       * src/libs/libgroff/Makefile.sub (OBJS, CCSRCS),
+       src/include/Makefile.sub (HDRS): Updated.
+
+2005-04-01  Werner LEMBERG  <address@hidden>
+
+       * src/devices/grohtml/post-html.cpp: Don't use strdup/free but
+       strsave/a_delete.
+
+       * src/libs/libgroff/font.cpp: Replace strdup with strsave.
+
+       * src/libs/libgroff/maxfilename.cpp: Don't include limits.h since
+       lib.h already does it.
+
+       * src/libs/libgroff/maxpathname.cpp: New file, defining
+       path_name_max.
+
+       * src/include/lib.h: Add prototype for path_name_max.
+
+       * src/libs/libgroff/Makefile.sub (OBJS, CCSRCS): Updated.
+
+       * src/include/nonposix.h (PATH_EXT): New macro.
+
 2005-03-28  Werner LEMBERG  <address@hidden>
 
        Add support for double- and zero-width characters in grotty.
Index: groff/src/devices/grohtml/post-html.cpp
diff -u groff/src/devices/grohtml/post-html.cpp:1.21 
groff/src/devices/grohtml/post-html.cpp:1.22
--- groff/src/devices/grohtml/post-html.cpp:1.21        Tue Mar 15 22:07:46 2005
+++ groff/src/devices/grohtml/post-html.cpp     Sat Apr  2 12:49:11 2005
@@ -1740,9 +1740,9 @@
     }
     t->id = i;
     t->val = v;
-    free((void *)c);
-    free((void *)f);
-    free((void *)l);
+    a_delete c;
+    a_delete f;
+    a_delete l;
   }
 }
 
@@ -1797,7 +1797,7 @@
 const char *replace_negate_str (const char *before, char *after)
 {
   if (before != NULL)
-    free((void *)before);
+    a_delete before;
 
   if (strlen(after) > 0) {
     int d = atoi(after);
@@ -1818,7 +1818,7 @@
 const char *replace_str (const char *before, const char *after)
 {
   if (before != NULL)
-    free((void *)before);
+    a_delete before;
   return after;
 }
 
@@ -1833,29 +1833,29 @@
   // fprintf(stderr, "%s:%s:setting %s to %s\n", f, l, c, v);
   if (strcmp(c, "sp") == 0) {
     check_sp_flag = 1;
-    val_sp = replace_str(val_sp, strdup(v));
-    file_sp = replace_str(file_sp, strdup(f));
-    line_sp = replace_str(line_sp, strdup(l));
+    val_sp = replace_str(val_sp, strsave(v));
+    file_sp = replace_str(file_sp, strsave(f));
+    line_sp = replace_str(line_sp, strsave(l));
   } else if (strcmp(c, "br") == 0) {
     check_br_flag = 1;
-    val_br = replace_str(val_br, strdup(v));
-    file_br = replace_str(file_br, strdup(f));
-    line_br = replace_str(line_br, strdup(l));
+    val_br = replace_str(val_br, strsave(v));
+    file_br = replace_str(file_br, strsave(f));
+    line_br = replace_str(line_br, strsave(l));
   } else if (strcmp(c, "fi") == 0) {
     check_fi_flag = 1;
-    val_fi = replace_str(val_fi, strdup(v));
-    file_fi = replace_str(file_fi, strdup(f));
-    line_fi = replace_str(line_fi, strdup(l));
+    val_fi = replace_str(val_fi, strsave(v));
+    file_fi = replace_str(file_fi, strsave(f));
+    line_fi = replace_str(line_fi, strsave(l));
   } else if (strcmp(c, "nf") == 0) {
     check_fi_flag = 1;
-    val_fi = replace_negate_str(val_fi, strdup(v));
-    file_fi = replace_str(file_fi, strdup(f));
-    line_fi = replace_str(line_fi, strdup(l));
+    val_fi = replace_negate_str(val_fi, strsave(v));
+    file_fi = replace_str(file_fi, strsave(f));
+    line_fi = replace_str(line_fi, strsave(l));
   } else if (strcmp(c, "ce") == 0) {
     check_ce_flag = 1;
-    val_ce = replace_str(val_ce, strdup(v));
-    file_ce = replace_str(file_ce, strdup(f));
-    line_ce = replace_str(line_ce, strdup(l));
+    val_ce = replace_str(val_ce, strsave(v));
+    file_ce = replace_str(file_ce, strsave(f));
+    line_ce = replace_str(line_ce, strsave(l));
   }
 }
 
@@ -4751,7 +4751,7 @@
     char buf[30];
 
     sprintf(buf, "%d", v);
-    return strdup(buf);
+    return strsave(buf);
   }
   else {
     /*
Index: groff/src/include/Makefile.sub
diff -u groff/src/include/Makefile.sub:1.12 groff/src/include/Makefile.sub:1.13
--- groff/src/include/Makefile.sub:1.12 Tue Jun  1 10:46:52 2004
+++ groff/src/include/Makefile.sub      Sat Apr  2 12:49:11 2005
@@ -21,6 +21,7 @@
   printer.h \
   ptable.h \
   refid.h \
+  relocate.h \
   search.h \
   searchpath.h \
   stringclass.h \
@@ -35,6 +36,7 @@
        @$(SHELL) $(top_srcdir)/gendef.sh defs.h \
        "PROG_PREFIX=\"$(g)\"" \
        "DEVICE=\"$(DEVICE)\"" \
+       "INSTALLPATH=\"$(prefix)\"" \
        "BINPATH=\"$(bindir)\"" \
        "FONTPATH=\"$(fontpath)\"" \
        "MACROPATH=\"$(tmacpath)\"" \
Index: groff/src/include/lib.h
diff -u groff/src/include/lib.h:1.36 groff/src/include/lib.h:1.37
--- groff/src/include/lib.h:1.36        Fri Mar 18 07:04:47 2005
+++ groff/src/include/lib.h     Sat Apr  2 12:49:11 2005
@@ -101,6 +101,7 @@
 #endif /* NEED_DECLARATION_PCLOSE */
 
 size_t file_name_max(const char *fname);
+size_t path_name_max();
 
 int interpret_lf_args(const char *p);
 
Index: groff/src/include/nonposix.h
diff -u groff/src/include/nonposix.h:1.18 groff/src/include/nonposix.h:1.19
--- groff/src/include/nonposix.h:1.18   Sun Feb 29 00:07:07 2004
+++ groff/src/include/nonposix.h        Sat Apr  2 12:49:11 2005
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
      Written by Eli Zaretskii (address@hidden)
 
 This file is part of groff.
@@ -101,6 +102,9 @@
 /* The executable extension.  */
 # define EXE_EXT       ".exe"
 
+/* Possible executable extensions.  */
+# define PATH_EXT      ".com;.exe;.bat;.cmd"
+
 /* The system null device.  */
 # define NULL_DEV      "NUL"
 
@@ -209,6 +213,9 @@
 #ifndef EXE_EXT
 # define EXE_EXT       ""
 #endif
+#ifndef PATH_EXT
+# define PATH_EXT      ""
+#endif
 #ifndef NULL_DEV
 # define NULL_DEV      "/dev/null"
 #endif
Index: groff/src/libs/libgroff/Makefile.sub
diff -u groff/src/libs/libgroff/Makefile.sub:1.22 
groff/src/libs/libgroff/Makefile.sub:1.23
--- groff/src/libs/libgroff/Makefile.sub:1.22   Fri Mar 18 07:00:51 2005
+++ groff/src/libs/libgroff/Makefile.sub        Sat Apr  2 12:49:11 2005
@@ -26,6 +26,7 @@
   macropath.$(OBJEXT) \
   matherr.$(OBJEXT) \
   maxfilename.$(OBJEXT) \
+  maxpathname.$(OBJEXT) \
   mksdir.$(OBJEXT) \
   nametoindex.$(OBJEXT) \
   new.$(OBJEXT) \
@@ -34,6 +35,7 @@
   progname.$(OBJEXT) \
   ptable.$(OBJEXT) \
   quotearg.$(OBJEXT) \
+  relocate.$(OBJEXT) \
   searchpath.$(OBJEXT) \
   spawnvp.$(OBJEXT) \
   string.$(OBJEXT) \
@@ -68,6 +70,7 @@
   $(srcdir)/lineno.cpp \
   $(srcdir)/macropath.cpp \
   $(srcdir)/maxfilename.cpp \
+  $(srcdir)/maxpathname.cpp \
   $(srcdir)/mksdir.cpp \
   $(srcdir)/mkstemp.cpp \
   $(srcdir)/nametoindex.cpp \
@@ -75,6 +78,7 @@
   $(srcdir)/paper.cpp \
   $(srcdir)/prime.cpp \
   $(srcdir)/ptable.cpp \
+  $(srcdir)/relocate.cpp \
   $(srcdir)/searchpath.cpp \
   $(srcdir)/string.cpp \
   $(srcdir)/strsave.cpp \
Index: groff/src/libs/libgroff/font.cpp
diff -u groff/src/libs/libgroff/font.cpp:1.5 
groff/src/libs/libgroff/font.cpp:1.6
--- groff/src/libs/libgroff/font.cpp:1.5        Fri Oct  8 07:08:08 2004
+++ groff/src/libs/libgroff/font.cpp    Sat Apr  2 12:49:11 2005
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
@@ -999,7 +999,7 @@
        t.error("image_generator command requires an argument");
        return 0;
       }
-      image_generator = strdup(p);
+      image_generator = strsave(p);
     }
     else if (strcmp("charset", p) == 0)
       break;
Index: groff/src/libs/libgroff/maxfilename.cpp
diff -u groff/src/libs/libgroff/maxfilename.cpp:1.1 
groff/src/libs/libgroff/maxfilename.cpp:1.2
--- groff/src/libs/libgroff/maxfilename.cpp:1.1 Tue Apr 15 15:13:38 2003
+++ groff/src/libs/libgroff/maxfilename.cpp     Sat Apr  2 12:49:11 2005
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-/* Copyright (C) 1992, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2001, 2003, 2005 Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
 This file is part of groff.
@@ -37,10 +37,6 @@
 
 #else /* not _POSIX_VERSION */
 
-#ifdef HAVE_CC_LIMITS_H
-#include <limits.h>
-#endif /* HAVE_CC_LIMITS_H */
-
 #ifdef HAVE_DIRENT_H
 #include <dirent.h>
 #else /* not HAVE_DIRENT_H */
Index: groff/src/libs/libgroff/searchpath.cpp
diff -u groff/src/libs/libgroff/searchpath.cpp:1.3 
groff/src/libs/libgroff/searchpath.cpp:1.4
--- groff/src/libs/libgroff/searchpath.cpp:1.3  Sat Dec  6 13:09:41 2003
+++ groff/src/libs/libgroff/searchpath.cpp      Sat Apr  2 12:49:11 2005
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003, 2005
    Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
@@ -28,6 +28,12 @@
 #include "searchpath.h"
 #include "nonposix.h"
 
+#ifdef _WIN32
+# include "relocate.h"
+#else
+# define relocate(path) strsave(path)
+#endif
+
 search_path::search_path(const char *envvar, const char *standard,
                         int add_home, int add_current)
 {
@@ -108,11 +114,16 @@
     if (!end)
       end = strchr(p, '\0');
     int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
-    char *path = new char[(end - p) + need_slash + namelen + 1];
-    memcpy(path, p, end - p);
+    char *origpath = new char[(end - p) + need_slash + namelen + 1];
+    memcpy(origpath, p, end - p);
     if (need_slash)
-      path[end - p] = '/';
-    strcpy(path + (end - p) + need_slash, name);
+      origpath[end - p] = '/';
+    strcpy(origpath + (end - p) + need_slash, name);
+#if 0
+    fprintf(stderr, "origpath `%s'\n", origpath);
+#endif
+    char *path = relocate(origpath);
+    a_delete origpath;
 #if 0
     fprintf(stderr, "trying `%s'\n", path);
 #endif
@@ -160,11 +171,16 @@
     if (!end)
       end = strchr(p, '\0');
     int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
-    char *path = new char[(end - p) + need_slash + namelen + 1];
-    memcpy(path, p, end - p);
+    char *origpath = new char[(end - p) + need_slash + namelen + 1];
+    memcpy(origpath, p, end - p);
     if (need_slash)
-      path[end - p] = '/';
-    strcpy(path + (end - p) + need_slash, name);
+      origpath[end - p] = '/';
+    strcpy(origpath + (end - p) + need_slash, name);
+#if 0
+    fprintf(stderr, "origpath `%s'\n", origpath);
+#endif
+    char *path = relocate(origpath);
+    a_delete origpath;
 #if 0
     fprintf(stderr, "trying `%s'\n", path);
 #endif




reply via email to

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