bug-groff
[Top][All Lists]
Advanced

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

Re: mkstemp


From: Gaius Mulley
Subject: Re: mkstemp
Date: Tue, 03 Jul 2001 12:06:30 +0100

Ahh, I misread the code, and didn't need the fd, after all. But thanks
for the `fileno' prompt anyway.

Here is an improved patch which makes pre-html use xtmpfile not mkstemp,
and also a minor change to www.tmac

Gaius


--- groff-cvs/src/preproc/html/pre-html.cc      Thu Jun 21 08:56:00 2001
+++ groff-html/src/preproc/html/pre-html.cc     Tue Jul  3 11:56:31 2001
@@ -1324,19 +1324,23 @@
   troffFileName  = "/tmp/prehtml-troff";
   htmlFileName   = "/tmp/prehtml-html";
 #else
-  int fd;
+  FILE *f;
 
-  if ((fd = mkstemp(psFileName = xtmptemplate("-ps-"))) == -1) {
-    sys_fatal("mkstemp");
+  psFileName = "-ps-";
+  f = xtmpfile(&psFileName, psFileName, FALSE);
+  if (f == NULL) {
+    sys_fatal("xtmpfile");
     return -1;
   }
-  close(fd);
-  if ((fd = mkstemp(regionFileName = xtmptemplate("-regions-"))) == -1) {
-    sys_fatal("mkstemp");
-    unlink(psFileName);
+  fclose(f);
+
+  regionFileName = "-regions-";
+  f = xtmpfile(&regionFileName, regionFileName, FALSE);
+  if (f == NULL) {
+    sys_fatal("xtmpfile");
     return -1;
   }
-  close(fd);
+  fclose(f);
 #endif
   return 0;
 }
--- groff-cvs/tmac/www.tmac     Mon Jun 18 23:37:34 2001
+++ groff-html/tmac/www.tmac    Fri Jun 29 12:04:04 2001
@@ -103,20 +103,25 @@
 .\"
 .\" IMAGE - reference an image
 .\"         $1 is the image file
-.\"         $2 is the x width (default if absent 400 pixels)
-.\"         $3 is the y width (default if absent is the x value)
+.\"         $2 is the alignment r, l or c  (center by default)
+.\"         $3 is the x width (default if absent 400 pixels)
+.\"         $4 is the y width (default if absent is the x value)
 .\"
 .de IMAGE
 .  ie \\n[www-html] \{\
+.    ie '\\$2'r' .HTML-TAG ".right-image"
+.    el \{\
+.      ie '\\$2'l' .HTML-TAG ".left-image"
+.      el .HTML-TAG ".centered-image"
+.    \}
 .    nr HTMLWIDTH 400
-.    if !'\\$2'' \{\
-.      nr HTMLWIDTH \\$2
+.    if !'\\$3'' \{\
+.      nr HTMLWIDTH \\$3
 .    \}
 .    nr HTMLHEIGHT \\n[HTMLWIDTH]
-.    if !'\\$3'' \{\
-.      nr HTMLHEIGHT \\$3
+.    if !'\\$4'' \{\
+.      nr HTMLHEIGHT \\$4
 .    \}
-.    HTML-TAG ".centered-image"
 .    HTML <img src="\\$1" width=\\n[HTMLWIDTH] height=\\n[HTMLHEIGHT]>
 .  \}
 .  el \{\



reply via email to

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