This file contains changes for running xloadimage under VMS.  Please
note that this file has not been updated to work with versions of
xloadimage newer than 1.05.  The differences should be fairly trivial.

jim frost
09.20.90

-- cut here --
From B1F5814@rigel.tamu.edu Thu May 31 15:14:35 1990
Date:    Thu, 31 May 1990 14:11:53 CDT
From: B1F5814@RIGEL.TAMU.EDU (Brian Frost -- Academic Computing Services)
Message-Id: <900531141153.2020197e@RIGEL.TAMU.EDU>
Subject: xloadimage diffs and additions for VMS
To: jimf
X-Vmsmail-To: SMTP%"jimf@saber.com"

Jim,

At the bottom of this messages is the diff file for the current release (1.05)
of xloadimage.  In addition to these changes, two new files are also needed for
VMS use only. MAKE_VMS.COM compiles and links xloadimage. rindex.c is my
version of rindex for VMS.  They are both listed below:

Brian

-README.VMS---------------------------------------------------------------------
To compile XLOADIMAGE under VMS just use the MAKE_VMS.COM command procedure
provided.

To use XLOADIMAGE you need to define a foreign command.  Here is an example of
how to do it.

   XLOADIMAGE :== $SYS$USERDISKB:[B1F5814.DECWINDOWS.XLOADIMAGE]XLOADIMAGE

Brian Frost
--------------------------------------------------------------------------------
-MAKE_VMS.COM-------------------------------------------------------------------
$ define sys sys$library
$ define X11 decw$include
$ cc -
BRIGHT, CLIP, COMPRESS, DITHER, FACES, FILL, GIF, HALFTONE, -
IMAGETYPES, MERGE, MISC, NEW, OPTIONS, PATH, PBM, REDUCE, -
RINDEX, ROOT, SEND, SUNRASTER, VALUE, WINDOW, XBITMAP, XLOADIMAGE, -
XPIXMAP, ZIO, ZOOM 
$ link/nouserlibrary/exe=xloadimage -
BRIGHT, CLIP, COMPRESS, DITHER, FACES, FILL, GIF, HALFTONE, -
IMAGETYPES, MERGE, MISC, NEW, OPTIONS, PATH, PBM, REDUCE, -
RINDEX, ROOT, SEND, SUNRASTER, VALUE, WINDOW, XBITMAP, XLOADIMAGE, -
XPIXMAP, ZIO, ZOOM, sys$input/opt
sys$library:decw$xlibshr.exe/share
sys$library:vaxcrtl.exe/share
--------------------------------------------------------------------------------
-rindex.c-----------------------------------------------------------------------
#include string
char *rindex (our_string, a_char)
   char our_string[], a_char;
   {
      int char_index, string_length;
      string_length = strlen(our_string);
      for (char_index = string_length; char_index >= 0 && 
           our_string[char_index] != a_char; --char_index);
      if (char_index >= 0)
         return &our_string[char_index];
      else
         return 0;
   }
--------------------------------------------------------------------------------
-diff file----------------------------------------------------------------------
diff -c v1.05/path.c vms/path.c
*** v1.05/path.c	Thu May 31 13:03:33 1990
--- vms/path.c	Thu May 31 11:53:27 1990
***************
*** 12,18 ****
--- 12,22 ----
  #include "xloadimage.h"
  #include <X11/Xos.h>
  #include <sys/stat.h>
+ #ifndef VMS			/* Bef 5/31/89 */
  #include <pwd.h>
+ #else
+ #define R_OK 4
+ #endif			/* Bef 5/31/89 */
  #include <errno.h>
  
  extern int errno;
***************
*** 100,105 ****
--- 104,110 ----
    }
  }
  
+ #ifndef VMS			/* Bef 5/31/90 */
  void loadPathsAndExts()
  { static int     havepaths= 0;
    struct passwd *pw;
***************
*** 122,128 ****
    readPathsAndExts(SYSPATHFILE);
  #endif
  }
! 
  /* find an image with paths and extensions from defaults files.  returns
   * -1 if access denied or not found, 0 if ok.
   */
--- 127,133 ----
    readPathsAndExts(SYSPATHFILE);
  #endif
  }
! #endif
  /* find an image with paths and extensions from defaults files.  returns
   * -1 if access denied or not found, 0 if ok.
   */
diff -c v1.05/xloadimage.c vms/xloadimage.c
*** v1.05/xloadimage.c	Thu May 31 13:03:37 1990
--- vms/xloadimage.c	Thu May 31 11:53:43 1990
***************
*** 10,17 ****
  
  #include "copyright.h"
  #include "xloadimage.h"
  #include "patchlevel"
! 
  /* options array and definitions.  note that the enum values must be in the
   * same order as the options strings.
   */
--- 10,20 ----
  
  #include "copyright.h"
  #include "xloadimage.h"
+ #ifndef VMS			/* Bef 5/31/90 */
  #include "patchlevel"
! #else				/* Bef 5/31/90 */
! #include "patchlevel."	/* Bef 5/31/90 */
! #endif			/* Bef 5/31/90 */
  /* options array and definitions.  note that the enum values must be in the
   * same order as the options strings.
   */
***************
*** 105,111 ****
--- 108,116 ----
     * our name was when invoked.
     */
  
+ #ifndef VMS			/* Bef 5/31/90 */
    loadPathsAndExts();
+ #endif			/* Bef 5/31/90 */
    onroot= 0;
    verbose= 1;
    if (!strcmp(tail(argv[0]), "xview")) {
diff -c v1.05/zio.c vms/zio.c
*** v1.05/zio.c	Thu May 31 13:03:39 1990
--- vms/zio.c	Thu May 31 11:53:49 1990
***************
*** 17,22 ****
--- 17,23 ----
    char   buf[BUFSIZ];
  
    zf= (ZFILE *)lmalloc((unsigned int)sizeof(ZFILE));
+ #ifndef VMS			/* Bef 5/31/90 */
    if ((strlen(name) > 2) && !strcmp(".Z", name + (strlen(name) - 2))) {
      zf->type= ZPIPE;
      sprintf(buf, "uncompress -c %s", name);
***************
*** 26,31 ****
--- 27,33 ----
      }
      return(zf);
    }
+ #endif			/* Bef 5/31/90 */
    zf->type= ZSTANDARD;
    if (! (zf->stream= fopen(name, "r"))) {
      lfree((byte *)zf);
***************
*** 66,74 ****
--- 68,78 ----
    case ZSTANDARD:
      fclose(zf->stream);
      break;
+ #ifndef VMS			/* Bef 5/31/90 */
    case ZPIPE:
      pclose(zf->stream);
      break;
+ #endif			/* Bef 5/31/90 */
    default:
      printf("zclose: bad ZFILE structure\n");
      exit(1);
--------------------------------------------------------------------------------

