all external names start with C_

This commit is contained in:
ceriel 1987-06-30 16:09:36 +00:00
parent 19ffd2c1f2
commit dce90d9491
2 changed files with 43 additions and 43 deletions

View file

@ -15,7 +15,7 @@
/* /*
C_putbyte(), C_open() and C_close() are the basic routines for C_putbyte(), C_open() and C_close() are the basic routines for
respectively write on, open and close the output file. respectively write on, open and close the output file.
The put_*() functions serve as formatting functions of the The C_pt_*() functions serve as formatting functions of the
various EM language constructs. various EM language constructs.
See "Description of a Machine Architecture for use with See "Description of a Machine Architecture for use with
Block Structured Languages" par. 11.2 for the meaning of these Block Structured Languages" par. 11.2 for the meaning of these
@ -84,7 +84,7 @@ C_magic()
#define fit16i(x) ((x) >= (long)0xFFFF8000 && (x) <= (long)0x00007FFF) #define fit16i(x) ((x) >= (long)0xFFFF8000 && (x) <= (long)0x00007FFF)
#define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */ #define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */
put_ilb(l) C_pt_ilb(l)
register label l; register label l;
{ {
if (fit8u(l)) { if (fit8u(l)) {
@ -97,7 +97,7 @@ put_ilb(l)
} }
} }
put_dlb(l) C_pt_dlb(l)
register label l; register label l;
{ {
if (fit8u(l)) { if (fit8u(l)) {
@ -110,7 +110,7 @@ put_dlb(l)
} }
} }
put_cst(l) C_pt_cst(l)
register arith l; register arith l;
{ {
if (l >= (arith) -sp_zcst0 && l < (arith) (sp_ncst0 - sp_zcst0)) { if (l >= (arith) -sp_zcst0 && l < (arith) (sp_ncst0 - sp_zcst0)) {
@ -130,76 +130,76 @@ put_cst(l)
} }
} }
put_doff(l, v) C_pt_doff(l, v)
label l; label l;
arith v; arith v;
{ {
if (v == 0) { if (v == 0) {
put_dlb(l); C_pt_dlb(l);
} }
else { else {
put8(sp_doff); put8(sp_doff);
put_dlb(l); C_pt_dlb(l);
put_cst(v); C_pt_cst(v);
} }
} }
put_noff(s, v) C_pt_noff(s, v)
char *s; char *s;
arith v; arith v;
{ {
if (v == 0) { if (v == 0) {
put_dnam(s); C_pt_dnam(s);
} }
else { else {
put8(sp_doff); put8(sp_doff);
put_dnam(s); C_pt_dnam(s);
put_cst(v); C_pt_cst(v);
} }
} }
put_dnam(s) C_pt_dnam(s)
char *s; char *s;
{ {
put8(sp_dnam); put8(sp_dnam);
put_str(s); C_pt_str(s);
} }
put_pnam(s) C_pt_pnam(s)
char *s; char *s;
{ {
put8(sp_pnam); put8(sp_pnam);
put_str(s); C_pt_str(s);
} }
put_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */ C_pt_wcon(sp, v, sz) /* sp_icon, sp_ucon or sp_fcon with int repr */
int sp; int sp;
char *v; char *v;
arith sz; arith sz;
{ {
/* how 'bout signextension int --> long ??? */ /* how 'bout signextension int --> long ??? */
put8(sp); put8(sp);
put_cst(sz); C_pt_cst(sz);
put_str(v); C_pt_str(v);
} }
put_str(s) C_pt_str(s)
register char *s; register char *s;
{ {
register int len; register int len;
put_cst((arith) (len = strlen(s))); C_pt_cst((arith) (len = strlen(s)));
while (--len >= 0) { while (--len >= 0) {
put8(*s++); put8(*s++);
} }
} }
put_scon(b, n) C_pt_scon(b, n)
register char *b; register char *b;
register arith n; register arith n;
{ {
put8(sp_scon); put8(sp_scon);
put_cst(n); C_pt_cst(n);
while (--n >= 0) { while (--n >= 0) {
put8(*b++); put8(*b++);
} }

View file

@ -16,27 +16,27 @@
#include <em_reg.h> #include <em_reg.h>
/* macros used in the definitions of the interface functions C_* */ /* macros used in the definitions of the interface functions C_* */
#define OP(x) put_op(x) #define OP(x) C_pt_op(x)
#define CST(x) put_cst(x) #define CST(x) C_pt_cst(x)
#define DCST(x) put_cst(x) #define DCST(x) C_pt_cst(x)
#define SCON(x,y) put_scon((x), (y)) #define SCON(x,y) C_pt_scon((x), (y))
#define PS(x) put_ps(x) #define PS(x) C_pt_ps(x)
#define DLB(x) put_dlb(x) #define DLB(x) C_pt_dlb(x)
#define DFDLB(x) put_dlb(x) #define DFDLB(x) C_pt_dlb(x)
#define ILB(x) put_ilb(x) #define ILB(x) C_pt_ilb(x)
#define DFILB(x) put_ilb(x) #define DFILB(x) C_pt_ilb(x)
#define NOFF(x,y) put_noff((x), (y)) #define NOFF(x,y) C_pt_noff((x), (y))
#define DOFF(x,y) put_doff((x), (y)) #define DOFF(x,y) C_pt_doff((x), (y))
#define PNAM(x) put_pnam(x) #define PNAM(x) C_pt_pnam(x)
#define DNAM(x) put_dnam(x) #define DNAM(x) C_pt_dnam(x)
#define DFDNAM(x) put_dnam(x) #define DFDNAM(x) C_pt_dnam(x)
#define CEND() put_cend() #define CEND() C_pt_cend()
#define CCEND() put_cend() #define CCEND() C_pt_cend()
#define WCON(x,y,z) put_wcon((x), (y), (z)) #define WCON(x,y,z) C_pt_wcon((x), (y), (z))
#define COMMA() #define COMMA()
#define NL() #define NL()
#define CILB(x) CST((arith) x) #define CILB(x) CST((arith) x)
#define put_cend() C_putbyte(sp_cend) #define C_pt_cend() C_putbyte(sp_cend)
#define put_op(x) C_putbyte(x) #define C_pt_op(x) C_putbyte(x)
#define put_ps(x) C_putbyte(x) #define C_pt_ps(x) C_putbyte(x)