Article View: vmsnet.sources
Article #24Ghostview for VMS 14/14
From: Terry Poot
Date: Thu, 29 Oct 1992 18:50
Date: Thu, 29 Oct 1992 18:50
442 lines
13794 bytes
13794 bytes
Submitted-by: Terry Poot <tp@mccall.com>
Posting-number: Volume 3, Issue 232
Archive-name: ghostview/part14
-+-+-+-+-+-+-+-+ START OF PART 14 -+-+-+-+-+-+-+-+
X`09`09`7D while (--n != 0);
X`09`7D
X`09return (0);
X`7D
$ CALL UNPACK STRCASECMP.C;1 1076978617
$ create 'f'
X$ @lsrc:`5Bx11`5Dlogicals.com !<<< change for your system!
X$ copy/log x11_xmu:xmushr.psects,x11_xaw:xawshr.psects,x11_xaw:user.opt `09`
V09gv.opt
X$ get_run = 0
X$ get_ad2c = 0
X$ if f$search("run-ad2c.").eqs."" then get_run = 1
X$ if f$search("ad2c.").eqs."" then get_ad2c = 1
X$ if get_run then cms fetch run-ad2c.
X$ if get_ad2c then cms fetch ad2c.
X$ posix/run posix$bin:sh. run-ad2c
X$ if get_run then delete run-ad2c.;*
X$ if get_ad2c then delete ad2c.;*
X$ CC /NOLIST/OBJECT=MAIN.OBJ MAIN.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB MAIN.OBJ
X$ CC /NOLIST/OBJECT=MISC.OBJ MISC.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB MISC.OBJ
X$ CC /NOLIST/OBJECT=CALLBACKS.OBJ CALLBACKS.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB CALLBACKS.OBJ
X$ CC /NOLIST/OBJECT=ACTIONS.OBJ ACTIONS.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB ACTIONS.OBJ
X$ CC /NOLIST/OBJECT=DIALOGS.OBJ DIALOGS.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB DIALOGS.OBJ
X$ CC /NOLIST/OBJECT=GHOSTVIEW.OBJ GHOSTVIEW.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB GHOSTVIEW.OBJ
X$ CC /NOLIST/OBJECT=PS.OBJ PS.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB PS.OBJ
X$ CC /NOLIST/OBJECT=STRCASECMP.OBJ STRCASECMP.C
X$ If "''F$Search("GV.OLB")'" .EQS. "" Then LIBRARY/Create GV.OLB
X$ LIBRARY/REPLACE GV.OLB STRCASECMP.OBJ
X$ continue
X$ LINK /TRACE/NOMAP/EXEC=GV.EXE /exe=gv.exe `09`09gv.olb/include=main/librar
Vy,gv.opt/opt
$ CALL UNPACK VMS_BUILD.COM;1 988594
$ create 'f'
X/* DEC/CMS REPLACEMENT HISTORY, Element VMS_TYPES.H */
X/* *4 13-AUG-1992 12:49:50 TP "Added IOSB_GET_T" */
X/* *3 10-AUG-1992 14:20:29 TP "MOVE" */
X/* *2 10-AUG-1992 14:19:45 TP "MOVE" */
X/* *1 10-AUG-1992 14:19:31 TP "VMS data type definitions and macros" */
X/* DEC/CMS REPLACEMENT HISTORY, Element VMS_TYPES.H */
X/* VMS_TYPES.H
X**==========================================================================
V===
X** Copyright (C) 1989 Jym Dyer (jym@wheaties.ai.mit.edu)
X**
X** This program is free software; you can redistribute it and/or modify
X** it under the terms of the GNU General Public License as published by
X** the Free Software Foundation; either version 1, or (at your option)
X** any later version.
X**
X** This program is distributed in the hope that it will be useful,
X** but WITHOUT ANY WARRANTY; without even the implied warranty of
X** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X** GNU General Public License for more details.
X**
X** You should have received a copy of the GNU General Public License
X** along with this program; if not, write to the Free Software
X** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X**--------------------------------------------------------------------------
V---
X** Version:`09V1.0-001
X**--------------------------------------------------------------------------
V---
X** Facility:`09None
X**--------------------------------------------------------------------------
V---
X** Prefix:`09None
X**--------------------------------------------------------------------------
V---
X** Abstract
X** `7E`7E`7E`7E`7E`7E`7E`7E
X** These are typedefs and macro functions for various VMS data types.
X**--------------------------------------------------------------------------
V---
X** Contents
X** `7E`7E`7E`7E`7E`7E`7E`7E
X** EXIT_BLOCK_T
X** IOSB_T
X** IOSB_ACP_T
X** IOSB_CR_T
X** IOSB_DISK_T
X** IOSB_DISK_SENSEMODE_T
X** IOSB_LPA_T
X** IOSB_LP_WRITE_T
X** IOSB_LP_SETMODE_T
X** IOSB_MBX_READ_T
X** IOSB_MBX_WRITE_T
X** IOSB_MBX_SETPROTECTION_T
X** IOSB_MT_T
X** IOSB_TTY_ITEMLIST_READ_T
X** IOSB_TTY_READ_T
X** IOSB_TTY_SETSENSE_T
X** IOSB_TTY_WRITE_T
X** ITEM_2_T
X** ITEM_3_T
X** ITEM_LIST_2_T()
X** ITEM_LIST_3_T()
X**--------------------------------------------------------------------------
V---
X** Environment
X** `7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
X** Should be portable to any compiler running on VMS.
X**--------------------------------------------------------------------------
V---
X** Author:`09Jym Dyer - 15-May-1989
X**--------------------------------------------------------------------------
V---
X** Modifications
X** `7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
X** 1.0-001 - Original version. `7BJym 15-May-1989`7D
X** 1.0-002 - Added IOSB_GET_T `7BTerry Poot <tp@mccall.com> 8/10/1992`7D
X**==========================================================================
V===
X*/
X
X#ifndef __VMS_TYPES_H__
X#define __VMS_TYPES_H__
X`0C
X/* -=- MACRO FUNCTIONS AND TYPEDEFS -=- */
X
X/* --- Exit Handler Block --- */
X
X/* The exit handler block is a variable-length structure. What we provide
X** here is a header for that structure. For the simplest uses (exit
X** handlers that don't take arguments) the typedef alone will suffice:
X**
X**`09extern void exit_function(unsigned int * status_p);
X**`09unsigned int exh_status;
X**`09`09. . .
X**`09 EXIT_BLOCK_T exit_block =
X**`09 `7BNULL,exit_function,0,`7B0,0,0`7D,&exh_status`7D;
X**`09`09. . .
X**`09void
X**`09exit_function(status_p)
X**`09 unsigned int * status_p;
X**`09`7B
X**`09`09. . .
X**
X** For more complicated uses (when you want to pass several arguments to
X** the exit handler) the typedef can be used as a header in a structure:
X**
X**`09extern void exit_function(
X**`09 unsigned int * status_p,int * yin_p,int * yang_p
X**`09);
X**`09unsigned int exh_status;
X**`09int that;
X**`09int this;
X**`09`09. . .
X**`09 struct
X**`09 `7B
X**`09 EXIT_BLOCK_T header;
X**`09 int * this_p;
X**`09 int * that_p;
X**`09 `7D = `7B`7BNULL,exit_function,0,`7B0,0,0`7D,&exh_status`7D,&this,&th
Vat`7D;
X**`09`09. . .
X**`09void
X**`09exit_function(status_p,yin_p,yang_p)
X**`09 unsigned int * status_p;
X**`09 int * yin_p;
X**`09 int * yang_p;
X**`09`7B
X**`09`09. . .
X*/
X
Xtypedef struct
X`7B
X void * flink_p;
X void (*exit_handler_p)();
X unsigned char arg_count;
X unsigned char must_be_zero`5B3`5D;
X unsigned int * status_p;
X`7D EXIT_BLOCK_T;
X`0C
X/* --- All-Purpose IOSB --- */
X
X/* This all-purpose IOSB can be used for any IO function (though it could
X** be a bit of a hassle with terminal set and sense functions). Just be
X** careful with the device dependent data, remembering to use casts where
X** appropriate. Use of the other IOSB typedefs is recommended over use of
X** this one, as their fields have more relevant names.
X*/
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int count;
X unsigned char device_dependent_data`5B4`5D;
X`7D IOSB_T; `20
X
X/* --- Ancillary Control Process (ACP) IOSB --- */
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int not_used_0;
X unsigned long int not_used_1;
X`7D IOSB_ACP_T;
X
X/* --- CR11 Card Reader IOSB --- */
X
X/* Identical to the all-purpose IOSB.
X*/
X
X#define IOSB_CR_T IOSB_T
X`0C
X/* --- Disk Device IOSBs --- */
X
X/* IOSB_DISK_T is for all disk device functions except for sense mode;
X** IOSB_DISK_SENSEMODE_T is for sense mode.
X*/
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count_low_order;
X unsigned short int byte_count_high_order;
X unsigned short int zero;
X`7D IOSB_DISK_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int zero;
X unsigned char sectors;
X unsigned char tracks;
X unsigned short int cylinders;
X`7D IOSB_DISK_SENSEMODE_T;
X`0C
X/* --- Laboratory Peripheral Accelarator (LPA) IOSB --- */
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count;
X unsigned short int ready_out;
X unsigned short int maintenance_status;
X`7D IOSB_LPA_T;
X
X/* --- Line Printer IOSBs --- */
X
X/* IOSB_LP_WRITE_T is for write functions; IOSB_LP_SETMODE_T is for
X** set mode functions. IOSB_LP_SETMODE_T is identical to IOSB_ACP_T.
X*/
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count;
X unsigned long int num_lines_paper_moved;
X`7D IOSB_LP_WRITE_T;
X
X#define IOSB_LP_SETMODE_T IOSB_ACP_T
X
X/* --- Magnetic Tape IOSB --- */
X
X/* Identical to the all-purpose IOSB.
X*/
X
X#define IOSB_MT_T IOSB_T
X
X/* --- Mailbox (MBX) IOSBs --- */
X
X/* IOSB_MBX_READ_T is for the read function; IOSB_MBX_WRITE_T
X** is for the write function; IOSB_MBX_SETPROTECTION_T is for
X** the set protection function.
X*/
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count;
X unsigned long int sender_pid;
X`7D IOSB_MBX_READ_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count;
X unsigned long int receiver_pid;
X`7D IOSB_MBX_WRITE_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int zero;
X unsigned long int protection_mask_value;
X`7D IOSB_MBX_SETPROTECTION_T;
X`0C
X/* --- Terminal (TTY) IOSBs --- */
X
X/* IOSB_TTY_READ_T is for the read function; IOSB_TTY_ITEMLIST_READ_T
X** is for the itemlist read function; IOSB_TTY_WRITE_T is for the
X** write function; IOSB_TTY_SETSENSE_T is for the set mode, set
X** characteristscs, sense mode, and sense characteristics functions.
X*/
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int offset_to_terminator;
X unsigned short int terminator;
X unsigned short int terminator_size;
X`7D IOSB_TTY_READ_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int offset_to_terminator;
X unsigned char terminator_character;
X unsigned char reserved;
X unsigned char terminator_length;
X unsigned char cursor_position_from_eol;
X`7D IOSB_TTY_ITEMLIST_READ_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned short int byte_count;
X unsigned short int zero_0;
X unsigned short int zero_1;
X`7D IOSB_TTY_WRITE_T;
X
Xtypedef struct
X`7B
X unsigned short int status;
X unsigned char transmit_speed;
X unsigned char receive_speed;
X unsigned char cr_fill_count;
X unsigned char lf_fill_count;
X unsigned char parity_flags;
X unsigned char zero;
X`7D IOSB_TTY_SETSENSE_T;
X
X/* Many of the VMS GETxxx system services also use IOSB's, but they are laid
X** out differently. IOSB_GET_T is such a structure. The first longword (not
X** word) is the status code, and the second word is reserved to DEC.
X*/`20
X
Xtypedef struct
X`7B
X unsigned long int status;
X unsigned long int reserved;
X`7D IOSB_GET_T; `20
X`0C
X/* --- Item Lists --- */
X
X/* The item list structures change dynamically according to the number
X** of items in them. For this reason, typedefs (ITEM_2_T and ITEM_3_T)
X** are provided for the items, and macro functions (ITEM_LIST_2_T() and
X** ITEM_LIST_3_T()) are provided for the item lists. Here is an example
X** showing the usage of an item list macro function:
X**
X**`09static const ITEM_LIST_3_T(item_list,2) =
X**`09`7B
X**`09 `7B
X**`09 `7Bsizeof pid,JPI$_PID,&pid,NULL`7D,
X**`09 `7Bsizeof username,JPI$_USERNAME,&username,&username_length`7D
X**`09 `7D,
X**`09 0
X**`09`7D;
X**
X** The number 2 means, of course, that there are two items in the
X** itemlist (i.e., the PID and the username).
X*/
X
Xtypedef struct
X`7B
X unsigned short int component_size;
X unsigned short int item_code;
X void * component_p;
X`7D ITEM_2_T;
X
Xtypedef struct
X`7B
X unsigned short int buffer_size;
X unsigned short int item_code;
X void * buffer_p;
X unsigned short int * buffer_length_p;
X`7D ITEM_3_T;
X
X#define ITEM_LIST_2_T(variable_name,num_items) \
X struct \
X `7B \
X ITEM_2_T item`5Bnum_items`5D; \
X int terminating_zero; \
X `7D variable_name
X
X#define ITEM_LIST_3_T(variable_name,num_items) \
X struct \
X `7B \
X ITEM_3_T item`5Bnum_items`5D; \
X int terminating_zero; \
X `7D variable_name
X
X#endif /* !__VMS_TYPES_H__ */
$ CALL UNPACK VMS_TYPES.H;1 962918799
$ create 'f'
X#include <sys/stat.h>
X#if !defined(S_ISDIR) && defined(S_IFDIR)
X#define`09S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
X#endif
X#if !defined(S_ISREG) && defined(S_IFREG)
X#define`09S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
X#endif
X#if !defined(S_ISSOCK) && defined(S_IFSOCK)
X#define`09S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
X#endif
X
X#ifndef S_IXUSR
X#define S_IXUSR 0100
X#endif
X#ifndef S_IXGRP
X#define S_IXGRP 0010
X#endif
X#ifndef S_IXOTH
X#define S_IXOTH 0001
X#endif
X
X#define S_ISXXX(m) ((m) & (S_IXUSR `7C S_IXGRP `7C S_IXOTH))
X
$ CALL UNPACK XSTAT.H;1 1584671630
$ v=f$verify(v)
$ EXIT
Technical Details
Message-ID:
<8881770@MVB.SAIC.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!arizona.edu!mvb.saic.com!vmsnet-sourcesShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!arizona.edu!mvb.saic.com!vmsnet-sources Newsgroups: vmsnet.sources Subject: Ghostview for VMS 14/14 Message-ID: <8881770@MVB.SAIC.COM> From: Terry Poot <tp@mccall.com> Date: Thu, 29 Oct 1992 18:50:12 GMT Approved: Mark.Berryman@Mvb.Saic.Com Lines: 442