mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 17:04:19 +00:00
Upload
Digital Research
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
e:vax GETARHD.C r
|
||||
e:vax GETCHD.C r
|
||||
e:vax LIBGET.C r
|
||||
e:vax LIBPUT.C r
|
||||
e:vax LIBREAD.C r
|
||||
e:vax LIBWRITE.C r
|
||||
e:vax PUTARHD.C r
|
||||
e:vax PUTCHD.C r
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Directory DRB0:[STEVE.CPM68K.V102A.ALCLIB.V7]
|
||||
|
||||
DOWN.SUB;2
|
||||
DOWN.SUB;1
|
||||
GETARHD.C;2
|
||||
GETCHD.C;2
|
||||
LIBGET.C;2
|
||||
LIBPUT.C;2
|
||||
LIBREAD.C;2
|
||||
LIBWRITE.C;2
|
||||
PUTARHD.C;2
|
||||
PUTCHD.C;2
|
||||
|
||||
Total of 10 files.
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) getarhd.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef MC68000
|
||||
# include <c68/ar68.h>
|
||||
#else
|
||||
# include <ar68.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* getarhd - fills the archive header structure from the buffer int
|
||||
* the manner which will be understood on the current machine.
|
||||
*/
|
||||
int
|
||||
getarhd(fp,arptr) /* returns -1 for failure, 0 for success */
|
||||
FILE *fp;
|
||||
struct libhdr *arptr;
|
||||
{
|
||||
register int i;
|
||||
register char *p, *lp;
|
||||
|
||||
for (i = 0, lp = arptr->lfname; i < LIBNSIZE; i++)
|
||||
if ((*lp++ = getc(fp)) == EOF)
|
||||
return(-1);
|
||||
if ((lgetl(&arptr->lmodti,fp)) == -1)
|
||||
return(-1);
|
||||
if ((arptr->luserid = getc(fp)) == EOF)
|
||||
return(-1);
|
||||
if ((arptr->lgid = getc(fp)) == EOF)
|
||||
return(-1);
|
||||
if ((lgetw(&arptr->lfimode,fp)) == -1)
|
||||
return(-1);
|
||||
if ((lgetl(&arptr->lfsize,fp)) == -1)
|
||||
return(-1);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) getchd.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef MC68000
|
||||
# include <c68/cout.h>
|
||||
#else
|
||||
# include <cout.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* getchd - fills the c.out header structure from the buffer in
|
||||
* the manner which will be understood on the current machine.
|
||||
*/
|
||||
int
|
||||
getchd(fp,arptr) /* returns 0 for success, -1 for failure */
|
||||
FILE *fp;
|
||||
struct hdr2 *arptr;
|
||||
{
|
||||
if (lgetw(&arptr->ch_magic,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_tsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_dsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_bsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_ssize,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_stksize,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_entry,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetw(&arptr->ch_rlbflg,fp) == -1)
|
||||
return(-1);
|
||||
if (arptr->ch_magic == EX_ABMAGIC) {
|
||||
if (lgetl(&arptr->ch_dstart,fp) == -1)
|
||||
return(-1);
|
||||
if (lgetl(&arptr->ch_bstart,fp) == -1)
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) libget.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
#include "order.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef PDP11
|
||||
# define dogetc(byte,i,fp) byte = (unsigned char)getc(fp)
|
||||
#else
|
||||
# define dogetc(byte,i,fp) byte = getc(fp)
|
||||
#endif
|
||||
|
||||
lgetl(lp,f) /* returns -1 for failure, 0 for success */
|
||||
long *lp; /* 32 bits */
|
||||
FILE *f;
|
||||
{
|
||||
register int i;
|
||||
|
||||
dogetc(lp->b1,i,f);
|
||||
dogetc(lp->b2,i,f);
|
||||
dogetc(lp->b3,i,f);
|
||||
dogetc(lp->b4,i,f);
|
||||
return((ferror(f)) ? ERROR :SUCCESS);
|
||||
}
|
||||
|
||||
lgetw(lp,f) /* returns -1 for failure, 0 for success */
|
||||
short *lp; /* 16 bits */
|
||||
FILE *f;
|
||||
{
|
||||
register int i;
|
||||
|
||||
dogetc(lp->wb1,i,f);
|
||||
dogetc(lp->wb2,i,f);
|
||||
*lp &= 0xffff;
|
||||
return((ferror(f)) ? ERROR :SUCCESS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) libput.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
|
||||
#include "order.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define doputc(byte,fp) putc(byte,fp)
|
||||
|
||||
lputl(lp,f) /* returns 0 for success, -1 for failure */
|
||||
long *lp; /* 32 bits */
|
||||
FILE *f;
|
||||
{
|
||||
doputc(lp->b1,f);
|
||||
doputc(lp->b2,f);
|
||||
doputc(lp->b3,f);
|
||||
doputc(lp->b4,f);
|
||||
return((ferror(f)) ? ERROR : SUCCESS);
|
||||
}
|
||||
|
||||
lputw(lp,f) /* returns 0 for success, -1 for failure */
|
||||
short *lp; /* 16 bits */
|
||||
FILE *f;
|
||||
{
|
||||
doputc(lp->wb1,f);
|
||||
doputc(lp->wb2,f);
|
||||
return((ferror(f)) ? ERROR : SUCCESS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, Ca. 92121
|
||||
|
||||
@(#) libread.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
#include "order.h"
|
||||
|
||||
lreadl(fd,str)
|
||||
int fd;
|
||||
long *str;
|
||||
{
|
||||
register char *p;
|
||||
char junk[4];
|
||||
|
||||
if (read(fd,junk,4) != 4)
|
||||
return(ERROR);
|
||||
p = junk;
|
||||
str->b1 = *p++;
|
||||
str->b2 = *p++;
|
||||
str->b3 = *p++;
|
||||
str->b4 = *p;
|
||||
return(SUCCESS);
|
||||
}
|
||||
|
||||
lreadw(fd,str)
|
||||
int fd;
|
||||
short *str;
|
||||
{
|
||||
register char *p;
|
||||
char junk[2];
|
||||
|
||||
if (read(fd,junk,2) != 2)
|
||||
return(ERROR);
|
||||
p = junk;
|
||||
str->wb1 = *p++;
|
||||
str->wb2 = *p;
|
||||
return(SUCCESS);
|
||||
}
|
||||
|
||||
lreadc(fd,str)
|
||||
int fd;
|
||||
char *str;
|
||||
{
|
||||
char junk[1];
|
||||
|
||||
if (read(fd,&junk,1) != 1)
|
||||
return(ERROR);
|
||||
*str = junk[0];
|
||||
return(SUCCESS);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, Ca. 92121
|
||||
|
||||
@(#) libwrite.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
#include "order.h"
|
||||
|
||||
lwritel(fd,str)
|
||||
int fd;
|
||||
long *str;
|
||||
{
|
||||
register char *p;
|
||||
char junk[4];
|
||||
|
||||
p = junk;
|
||||
*p++ = str->b1;
|
||||
*p++ = str->b2;
|
||||
*p++ = str->b3;
|
||||
*p = str->b4;
|
||||
if (write(fd,junk,4) == 4)
|
||||
return(SUCCESS);
|
||||
else
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
lwritew(fd,str)
|
||||
int fd;
|
||||
short *str;
|
||||
{
|
||||
register char *p;
|
||||
char junk[2];
|
||||
|
||||
p = junk;
|
||||
*p++ = str->wb1;
|
||||
*p = str->wb2;
|
||||
if (write(fd,junk,2) == 2)
|
||||
return(SUCCESS);
|
||||
else
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
lwritec(fd,str)
|
||||
int fd;
|
||||
char *str;
|
||||
{
|
||||
if (write(fd,str,1) != 1)
|
||||
return(ERROR);
|
||||
return(SUCCESS);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) putarhd.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef MC68000
|
||||
# include <c68/ar68.h>
|
||||
#else
|
||||
# include <ar68.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* putarhd - fills the buffer from the archive header structure in
|
||||
* the byte orientation of the target machine (68000).
|
||||
*/
|
||||
int
|
||||
putarhd(fp,arptr) /* returns 0 for success, -1 for error */
|
||||
FILE *fp;
|
||||
struct libhdr *arptr;
|
||||
{
|
||||
register int i;
|
||||
register char *p, *lp;
|
||||
|
||||
for (i=0, lp = arptr->lfname; i<LIBNSIZE; i++, lp++)
|
||||
if ((putc(*lp,fp)) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->lmodti,fp) == -1)
|
||||
return(-1);
|
||||
if ((putc(arptr->luserid,fp)) == -1)
|
||||
return(-1);
|
||||
if ((putc(arptr->lgid,fp)) == -1)
|
||||
return(-1);
|
||||
if (lputw(&arptr->lfimode,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->lfsize,fp) == -1)
|
||||
return(-1);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 1983
|
||||
Alcyon Corporation
|
||||
8716 Production Ave.
|
||||
San Diego, CA 92121
|
||||
|
||||
@(#) putchd.c - Sep 12, 1983 REGULUS 4.1
|
||||
*/
|
||||
|
||||
/*
|
||||
I/O independent mapping routine. Machine specific. Independent
|
||||
of structure padding. Buffer must contain at least as many
|
||||
characters as is required for structure.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef MC68000
|
||||
# include <c68/cout.h>
|
||||
#else
|
||||
# include <cout.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* putchd - fills the buffer from the c.out header structure in
|
||||
* the byte orientation of the target machine (68000).
|
||||
*/
|
||||
int
|
||||
putchd(fp,arptr) /* returns 0 for success, -1 for failure */
|
||||
FILE *fp;
|
||||
struct hdr2 *arptr;
|
||||
{
|
||||
if (lputw(&arptr->ch_magic,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_tsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_dsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_bsize,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_ssize,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_stksize,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_entry,fp) == -1)
|
||||
return(-1);
|
||||
if (lputw(&arptr->ch_rlbflg,fp) == -1)
|
||||
return(-1);
|
||||
if (arptr->ch_magic == EX_ABMAGIC) {
|
||||
if (lputl(&arptr->ch_dstart,fp) == -1)
|
||||
return(-1);
|
||||
if (lputl(&arptr->ch_bstart,fp) == -1)
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user