home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource3
/
165_01
/
config.d
< prev
next >
Wrap
Text File
|
1988-02-19
|
19KB
|
553 lines
###portdefs.h
/* portdefs.h - definitions for portability */
@@ ENVIRONMENT-DEPENDENT - ADJUST TO LOCAL SYSTEM */
@@ Edit your local changes, then replace each "@@" with "/*" */
#ifndef PORTDEFS_H
#define PORTDEFS_H
/* adjust these names to local machine/compiler environment */
typedef unsigned short ushort; @@ or "unsigned" if short-size == int-size */
typedef unsigned char utiny; @@ to get unsigned byte */
typedef int void; @@ delete if compiler supports void */
typedef unsigned index_t; @@ may be chosen ad-lib locally */
typedef char *data_ptr; @@ use ANSI "generic ptr" if available */
/* next 5 names require no local changes, will work anywhere */
typedef char tbits; /* one byte, for bitwise uses */
typedef char tbool; /* one byte: {0:1} */
typedef ushort bits; /* 16 bits (or more), for bitwise uses */
typedef int bool; /* for function returns: {0:1} */
typedef short metachar; /* return from getchar: {EOF,0:UCHAR_MAX} */
/* modulo function giving non-negative result */
#define IMOD(i, j) (((i) % (j)) < 0 ? ((i) % (j)) + (j) : ((i) % (j)))
@@ if i % j is never negative, replace with the following line: */
@@ #define IMOD(i, j) ((i) % (j)) */
/* portably convert unsigned number to signed */
#define UI_TO_I(ui) (int)(ui) @@ more complicated on ones complement */
/* structure offsets and bounds; adjust to local system */
#define STRICT_ALIGN int @@ adjust to local alignment requirement */
#define OFFSET(st, m) \
((char *)&((st *)&struct_addr)->m - (char *)&struct_addr)
#define BOUNDOF(t) \
((char *)(struct {char byte0; t byten; } *)&struct_addr)->byten - \
(char *)&struct_addr)
static STRICT_ALIGN struct_addr = 0;
#define STRUCTASST(a, b) memcpy(&(a), &(b), sizeof(a))
/* defined constants */
#define FAIL 1 @@ failure exit */
#define SUCCEED 0 @@ normal exit */
#define STDIN 0 /* standard input */
#define STDOUT 1 /* standard output */
#define STDERR 2 /* standard error output */
#define SEEK_SET 0 /* seek relative to start of file */
#define SEEK_CUR 1 /* seek relative to current position */
#define SEEK_END 2 /* seek relative to end */
#endif
###stddef.h
/* stddef.h - standard definitions (partial listing) */
@@ ENVIRONMENT-DEPENDENT - ADJUST TO LOCAL SYSTEM */
@@ Edit your local changes, then replace each "@@" with "/*" */
@@ Use your compiler's own <stddef.h>, if available */
#ifndef STDDEF_H
#define STDDEF_H
typedef unsigned size_t; @@ use unsigned long in large-object model */
#ifndef NULL
#define NULL 0 @@ use 0L if int-size < long-size == ptr-size */
#endif
extern int errno;
#endif
###limits.h
/* limits.h - environment limits (partial listing) */
@@ ENVIRONMENT-DEPENDENT - CONFIGURE BEFORE USING */
@@ Edit your local changes, then replace each "@@" with "/*" */
@@ Use your compiler's own <limits.h>, if available */
#ifndef LIMITS_H
#define LIMITS_H
#define CHAR_BIT 8 @@ CONFIGURE */
#endif
###c.pro
# C.PRO - A CONFIGURATION FILE FOR WHITESMITHS C 3.0
# STANDARD ANSI C LIBRARY PROTO FILE
# CNDOS86 NATIVE MSDOS
# PROGRAMMABLE FLAG OPTIONS:
#
# com : create an 8080 model .com file
# debug : load debugger with any C compile
# fpp : use hardware floating point
# lincl : include header files in listing or diagnostic output
# listcs : create c/assembler listing
# lo : create a file (r).lst for listings (default to STDOUT)
# mods : uniform small model (64K data and 64K text maximum)
# modp : uniform medium model (64K data and multiple text sections)
# modd : uniform compact model (64K text and multiple data sections)
# modf : uniform far model (multiple text and data sections)
# proto : enable prototype checking
# savlnk : save linker input file as (r).lnk
# pponly : run pp only
sp:pp -o (o) \
-i "|a:/headers.d/|c:/c/hdrs/" \
c:/c/hdrs/do86{modp?p:{modd?d:{modf?f:s}}}f.h (i)
s:
c:pp -o (o) {lincl?+lincl} {pponly?:-x} \
-i "|a:/headers.d/|c:/c/hdrs/" \
-d_PROTO \
c:/c/hdrs/do86{modp?p:{modd?d:{modf?f:s}}}f.h (i)
1:cp1 -o (o) -cm {debug?+debug} -n31 +std \
-model{modp?p:{modd?d:{modf?f:s}}} (i)
2:p286 -o (o) -f \
{listcs?+list} (i)
s:as86 -o (o) \
{listcs?+list -lo (r).lst} (i)
{listcs?lm -o (r).asl -lt (r).lst}
{listcs?pr (r).asl {lo?>(r).lst}}
{listcs?del (r).asl}
o::echo -o (o) > (r).lnk
type c:\\c\\hdrs\\do86{com?c:{modp?p:{modd?d:{modf?f:s}}}}.lf \
>> (r).lnk
echo (i) {modp?+text:{modd?+data:{modf?+text +data}}} >> (r).lnk
echo \
c:/c/lib/liba{modp?p:{modd?d:{modf?f:s}}}f.86 \
c:/c/lib/libb{modp?p:{modd?d:{modf?f:s}}}f.86 \
c:/c/lib/libm{modp?p:{modd?d:{modf?f:s}}}f.86 \
{modd?+bss:{modf?+bss:}} >> (r).lnk
lnk < (r).lnk
{savlnk?:del (r).lnk}
{com?:xeq:}
com:
xeq:todos -o (o) (i)
exe:
###makefile
@@ ENVIRONMENT-DEPENDENT - HAND-TAILOR EVERY LINE WITH "@@"
@@ THEN EITHER DELETE THE "@@" MESSAGE OR CHANGE TO "#"
#
# Assumes that all files are named function-name.c
# For complexities like atopi(#2.c, copy the last one to
# a simple name like atopi.c
#
# Note: Successful result of a test is recorded by creation of
# a file named <pgm-name>.ok; see cmpok.c for further info.
# Configuration
RM = del @@ what command removes a file
CC = cc @@ the compile command
CFLAGS = @@ what options to pass to the compile command
O = obj @@ the file "extension" for object files
X = exe @@ the file "extension" for executable files
NOLINK = -c @@ the CC option that says "don't link"
LIB = lib @@ the library/archive command
LIBADD = lib -a @@ library/archive command to add a module
L = a @@ the file "extension" for object libraries
RUN = @@ command prefix (if any) for executing a program
.C.O = $(CC) $(CFLAGS) $(NOLINK) $& @@ rule for making p.c into p.o
.C.EXE = $(CC) $(CFLAGS) -o $*.$X $& @@ rule for making p.c into p.exe
.EXE.OK = $(RUN) $*.$X @@ rule for making p.exe into p.ok
COMMON = rdslib.$L
ST_MAIN = st_main.$O st_close.$O st_pop.$O st_push.$O
T_MAIN = t_main.$O q_pop.$O q_close.$O q_insert.$O q_push.$O q_append.$O q_r_insert.$O
SCREEN = screen86.$O
all : atopi.ok st_main.ok t_main.ok t2_main.ok tr_main.ok dq_main.ok dq2_main.ok plot_m.$X run_cars.$X rec_main.$X crhash.$X part_menu.$X part_tmenu.$X part_hmenu.$X
touch uptodate.all
rdslib.$L : itoa.$O fgetsnn.$O getsnn.$O getreply.$O getpstr.$O getplin.$O plot_trk.$O reverse.$O strfit.$O error.$O fixstr.$O
$(LIB) rdslib.$L getreply.$O getpstr.$O getplin.$O getsnn.$O fgetsnn.$O
$(LIBADD) rdslib.$L itoa.$O plot_trk.$O reverse.$O strfit.$O error.$O fixstr.$O
mu_lib.$L : mu_lib.$O mu_ask.$O mu_chv.$O mu_str.$O mu_sval.$O mu_pr.$O mu_do.$O mu_reply.$O
$(LIB) mu_lib.$L mu_lib.$O mu_ask.$O mu_chv.$O mu_str.$O mu_sval.$O mu_pr.$O mu_do.$O mu_reply.$O
dq_lib.$L : dq_lib.$O dq_open.$O dq_close.$O dq_detach.$O dq_r_insert.$O dq_pop.$O dq_insert.$O dq_find.$O dq_first.$O
$(LIB) dq_lib.$L dq_lib.$O dq_open.$O dq_close.$O dq_detach.$O dq_r_insert.$O dq_pop.$O dq_insert.$O dq_find.$O dq_first.$O
tr_lib.$L : tr_delete.$O tr_lnext.$O tr_lfind.$O tr_lpfind.$O tr_insert.$O tr_detach.$O tr_close.$O tr_lfirst.$O
$(LIB) tr_lib.$L tr_delete.$O tr_lnext.$O tr_lfind.$O tr_lpfind.$O tr_insert.$O tr_detach.$O tr_close.$O tr_lfirst.$O
rec_lib.$L : rec_hfind.$O rec_havail.$O rec_open.$O rec_close.$O rec_get.$O rec_put.$O
$(LIB) rec_lib.$L rec_hfind.$O rec_havail.$O rec_open.$O rec_close.$O rec_get.$O rec_put.$O
menu_lib.$L : chg_menu.$O add_menu.$O acd_menu.$O del_menu.$O
$(LIB) menu_lib.$L chg_menu.$O add_menu.$O acd_menu.$O del_menu.$O
tr_main.$X : tr_main.$O tr_lib.$L $(COMMON)
$(CC) $(CFLAGS) -o tr_main.$X tr_main.$O tr_lib.$L $(COMMON)
tr_main.ok : tr_main.$X
$(RUN) tr_main.$X >tr_main.out
cmpok tr_main
part_menu.$X : part_menu.$O mu_lib.$O menu_lib.$L part_db.$O $(SCREEN) $(COMMON)
$(CC) $(CFLAGS) -o part_menu.$X part_menu.$O mu_lib.$O menu_lib.$L part_db.$O $(SCREEN) $(COMMON)
part_tmenu.$X : part_tmenu.$O mu_lib.$O menu_lib.$L part_dbt.$O tr_lib.$L $(SCREEN) $(COMMON)
$(CC) $(CFLAGS) -o part_tmenu.$X part_tmenu.$O mu_lib.$O menu_lib.$L part_dbt.$O tr_lib.$L $(SCREEN) $(CO