mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 17:04:19 +00:00
58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
/*
|
|
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);
|
|
}
|
|
|