Antiword for VMS
Antiword is a MS Word document file reader.
Author: Adri van Os. Homepage:
  www.winfield.demon.nl 
With a minimum of changes, I have made a version working 
on VMS ( Alpha, Compaq C V6.+ , Vax should work as well).
Current version is 0.33:
Build instructions for VMS
Get the distribution from the programmers/Linux  version at
 linux/antiword-0.33.tar.gz , 
Decompress using gzip, then untar and set directory to [.antiword-0_33] .
 Replace Makefile.VMS by my new version
 Makefile.VMS
 (The one in the distribution now has a LINK command-line too long for VMS!).
 Execute "make -f makefile.vms" (if You have GNU make).
 Or,
 if You have MMS , simply type "MMS" using the 
 DESCRIP.MMS  descriptor file provided here.
 Without make or MMS, compile everything, except main_r, 
 then link main_u (the common Unix- and VMS main program)
 and all other object files.
 (all commands are in  vms_make.com).
Optional changes for VMS
 
Global file directory and the /usr path
 You may want to change the location of the global file directory 
 ( macro GLOBAL_ANTIWORD_DIR in header-file antiword.h ) holding the files
 from the [.resources] subdirectory:
 change /usr/share/antiword to a different location (in Unix syntax), unless You
 define a VMS logical device "/usr" ( USR:[SHARE.ANTIWORD] ).
On my system the logical usr looks like this:
   "USR" [super] = "SYS$SYSDEVICE:[UTIL.]" [concealed] (LNM$SYSTEM_TABLE)
I will not change the source for this , since there is no convention in VMS 
for those user-shared files (or ?).
VMS 7.3-1 introduces a SYS$POSIX_ROOT logical: simply create the usr/ 
directory tree under SYS$POSIX_ROOT.
A general -not VMS specific- solution of course would be to translate a
environment-variable for the directory at run-time.
A proposal for such a routine can be found in 
 get_global_file.c
DEBUG option and the /tmp path
To compile the sources with the DEBUG option, have a look into the *2eps.c 
files: they write image files to a directory /tmp/pics/... 
Either define a concealed logical TMP (e.g. to point to sys$scratch), or change 
the 3 source files to point to sys$scratch: instead of /tmp/pics/.
All newer VMS versions (since V7.?) contain a DECC RTL, with a specific 
handling of "/tmp": it translates to sys$scratch, if no "tmp" logical is
defined. So usually it is enough to create a directory [.pics] in your user
root.
My way of defining a compatible /tmp path in my login is:
$! use sys$scratch+[.tmp] or sys$scratch
$  y = f$parse("SYS$SCRATCH",,,,"NO_CONCEAL") - "SYS$SCRATCH" - ".;"
$  x = f$length(y) - 1
$  if f$search("SYS$SCRATCH:TMP.DIR").nes.""
$  then
$     y = F$EXTRACT(0,x,y) + ".TMP.]"
$  else
$     y = F$EXTRACT(0,x,y) + ".]"
$  endif
$  DEFINE/JOB/TRANS=(CONCEALED) TMP 'y'
i.e. I move all temporary files in a subdirectory [.tmp] of sys$scratch.
I did not observe any real problems in using the standard DECC unix-vms
filename conventions. 
Maybe including the OpenVMS porting library in building 
antiword could add even more flexibility like mixing VMS and Unix-style
filenames, but I didn't try it: future Crtl updates (in view of DII-COE) will
make the file-naming problems vanish, I hope.
Installation:
   define a foreign command pointing to antiword.exe
 or
   copy antiword.exe into dcl$path:
 Setup/font files:
 System-wide: copy the [.resources] file into the directory defined by 
  /usr/share/antiword
 Private: create directory [.ANTIWORD] in sys$login:
          copy the [.resources] files into the newly created directory.
 Usage 
Produce a postscript file from a word-document:
   pipe antiword -p a4 file.doc >file.ps
A DCL commandfile in our DCL$PATH directory does the postscript conversion 
and X11 display with Ghostscript in one go:
 wordviewer.com 
Use it in a commandline like this: wordviewer testdoc
Comment applying to all GNU/Unix style programs compiled with DECC:
The interpretation of command-line switches and path-names can be influenced
by several DECC$* logical names, most important ones are:
$ define DECC$ARGV_PARSE_STYLE "ENABLE"
$ SET PROCESS/PARSE_STYLE=EXTENDED 
 These 2 settings  preserve case of foreign command-lines
 ( otherwise `antiword -L` has to be typed as `antiword -"L"` )
$ define DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION "ENABLE"  
 path foo/bar translates to [.foo]bar; if disabled, it translates to foo:[bar]
 (but some programs will not work , java in particular !)
How to define a global antiword directory /usr/share/antiword :
Let's assume the global directory in VMS is SYS$SYSDEVICE:[UTIL.SHARE.ANTIWORD]
 $ dir sys$sysdevice:[util.share.antiword]
 Directory SYS$SYSDEVICE:[UTIL.SHARE.ANTIWORD]
 8859-1.TXT;1        ...
 $ define/trans=concealed usr sys$sysdevice:[util.]
 $ ls /usr/share/antiword/
 8859-1.txt   ...
This way "/usr/share/antiword/" in the C program is equvalent to
SYS$SYSDEVICE:[UTIL.SHARE.ANTIWORD]
Please send VMS-specific questions to me: 
huber@mppmu.mpg.de 
Joseph Huber , 
http://wwwvms.mppmu.mpg.de/~huber/ 
2003-02-11   huber@mppmu.mpg.de