[comp.os.vms] ARC_H.SHAR

ewilts%Ins.MRC.AdhocNet.CA%Stasis.MRC.AdhocNet.CA%UNCAEDU.@CORNELLC.CCS.CORNELL.EDU.BITNET (Ed Wilts) (06/24/88)

....................... Cut between dotted lines and save .....................
.
$!..............................................................................
$! VAX/VMS archive file created by VMS_SHAR V-5.01 01-Oct-1987
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by EWILTS
$! on Friday 24-JUN-1988 08:03:06.58
$!
$! It contains the following 4 files:
$! ARC.H ARCM.H ARCS.H DIR.H
$!==============================================================================
$ Set Symbol/Scope=(NoLocal,NoGlobal)
$ Version=F$GetSYI("VERSION") ! See what VMS version we have here:
$ If Version.ges."V4.4" then goto Version_OK
$ Write SYS$Output "Sorry, you are running VMS ",Version, -
                ", but this procedure requires V4.4 or higher."
$ Exit 44
$Version_OK: CR[0,8]=13
$ Pass_or_Failed="failed!,passed."
$ Goto Start
$Convert_File:
$ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1: Define/User_Mode SYS$Output NL:
$ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
        VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'File_is
$ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2: Return
$Start:
$ File_is="ARC.H"
$ Check_Sum_is=1969132421
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X/*
X * $Header: arc.h,v 1.2 86/07/15 07:52:34 turner Exp $
X */
X
X/*
X * $Log:`009arc.h,v $
X * Hack-attack 1.3  86/12/20  01:23:45  wilhite@usceast.uucp
X * `009Bludgeoned into submission for VAX 11/780 BSD4.2
X *`009(ugly code, but fewer core dumps)
X *
X * Revision 1.2  86/07/15  07:52:34  turner
X *
X *
X * Revision 1.1  86/06/26  15:01:23  turner
X * initial version
X *
X *
X */
X
X#define`009ST`0090`009/* Atari 520ST or 1040 `009`009 */
X#define BSD`0091`009/* BSD4.2 on a vax`009`009 */
X#define MSDOS`0090`009/* MSDOS on an IBM PC or Wannabe */
X
X#if ST
X#define EXTERN
X#define INT short
X#endif
X
X#if BSD
X#include <ctype.h>`009/* for isupper etc.                  */
X#define EXTERN
X#define INT short
X#define envfind getenv
X#endif
X
X#if MSDOS
X#define EXTERN extern
X#define INT int
X#endif
X
X#ifdef VAXC
X#define abort vabort
X#define unlink(x) delete(x)
X#endif
X
X/*
X * added macro def's in C format 6/26/86 jmt
X */
X#include "arcm.h"
X
X/*  ARC - Archive utility - ARC Header
X
X    Version 2.14, created on 02/03/86 at 22:48:29
X
X(C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED
X
X    By:  Thom Henderson
X
X    Description:
X         This is the header file for the ARC archive utility.  It defines
X         global parameters and the references to the external data.
X
X
X    Language:
X         Computer Innovations Optimizing C86
X */
X
X#include "arcs.h"
X
XEXTERN INT keepbak;             /* true if saving the old archive */
XEXTERN INT warn;                /* true to print warnings */
XEXTERN INT note;                /* true to print comments */
XEXTERN INT bose;                /* true to be verbose */
XEXTERN INT nocomp;              /* true to suppress compression */
XEXTERN INT kludge;              /* kludge flag */
XEXTERN char arctemp[STRLEN];       /* arc temp file prefix */
XEXTERN char *password;          /* encryption password pointer */
XEXTERN INT nerrs;               /* number of errors encountered */
X
XEXTERN char hdrver;                      /* header version */
X
XEXTERN FILE *arc;                        /* the old archive */
XEXTERN FILE *new;                        /* the new archive */
X
XEXTERN char arcname[STRLEN];           /* storage for archive name */
XEXTERN char bakname[STRLEN];           /* storage for backup copy name */
XEXTERN char newname[STRLEN];           /* storage for new archive name */
XEXTERN unsigned INT arcdate;    /* archive date stamp */
XEXTERN unsigned INT arctime;    /* archive time stamp */
XEXTERN int dosquash;
X
X#ifdef VAXC
XEXTERN int vmsstats;`009`009/* Flag for VMS statistics */
X#endif VAXC
$ GoSub Convert_File
$ File_is="ARCM.H"
$ Check_Sum_is=1783726930
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X/*
X * $Header: arcm.h,v 1.2 86/07/15 07:53:40 turner Exp $
X */
X
X/*
X * $Log:`009arcm.h,v $
X * Revision 1.2  86/07/15  07:53:40  turner
X *
X *
X * Revision 1.1  86/06/26  15:01:25  turner
X * initial version
X *
X *
X */
X
X/*
X *
X * ARC archive utility - standard MACRO insert file.
X *
X * parameters:
X *
X */
X
X#define ARCMARK 26 /*                   special archive marker        */
X#define ARCVER 9   /*                   archive header version code   */
X/* For VMS we need to allow for the directory structure */
X#ifdef VAXC
X#define STRLEN 255 /*                   system standard string length */
X#else
X#define STRLEN 100 /*                   system standard string length */
X#endif VAXC
X#define FNLEN 13   /*                   file name length              */
X#define MAXARG 25  /*                   maximum number of arguments   */
X
X#define ARC 1
X#define XARC 0
X
$ GoSub Convert_File
$ File_is="ARCS.H"
$ Check_Sum_is=1932684631
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X/*
X * $Header: arcs.h,v 1.2 86/07/15 07:54:02 turner Exp $
X */
X
X/*
X * $Log:`009arcs.h,v $
X * Revision 1.2  86/07/15  07:54:02  turner
X *
X *
X * Revision 1.1  86/06/26  15:01:27  turner
X * initial version
X *
X *
X */
X
X/*  ARC - Archive utility - Archive file header format
X
X    Version 2.12, created on 12/17/85 at 14:40:26
X
X(C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED
X
X    By:  Thom Henderson
X
X    Description:
X         This file defines the format of an archive file header, excluding
X         the archive marker and the header version number.
X
X         Each entry in an archive begins with a one byte archive marker,
X         which is set to 26.  The marker is followed by a one byte
X         header type code, from zero to 7.
X
X         If the header type code is zero, then it is an end marker, and
X         no more data should be read from the archive.
X
X         If the header type code is in the range 2 to 7, then it is
X         followed by a standard archive header, which is defined below.
X
X         If the header type code is one, then it is followed by an older
X         format archive header.  The older format header does not contain
X         the true length.  A header should be read for a length of
X         sizeof(struct heads)-sizeof(long).  Then set length equal to size
X         and change the header version to 2.
X
X    Programming note:
X         The crc value given in the header is based on the unpacked data.
X
X    Language:
X         Computer Innovations Optimizing C86
X*/
X
Xstruct heads                           /* archive entry header format */
X{   char name[FNLEN];                 /* file name */
X    long size;                         /* size of file, in bytes */
X    unsigned INT date;                 /* creation date */
X    unsigned INT time;                 /* creation time */
X INT crc;                           /* cyclic redundancy check */
X    long length;                       /* true file length */
X}   ;
X
$ GoSub Convert_File
$ File_is="DIR.H"
$ Check_Sum_is=1734141157
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X
X/*
X * template DIR.h
X * This header file is not part of VAXC.  It needed to be created
X * so VAXC could compile ARCDIR.C correctly.
X */
X
Xstruct direct {
X    int d_namlen;
X    char d_name[256];
X};
X
X/*
X * Used by parsedir as the flags argument
X */
X
X#define PARSE_NODE`0090x001
X#define PARSE_DEVICE`0090x002
X#define PARSE_DIRECTORY`0090x004
X#define PARSE_NAME`0090x008
X#define PARSE_TYPE`0090x010
X#define PARSE_VERSION`0090x020
$ GoSub Convert_File
$ Exit