Comments added

This commit is contained in:
kaashoek 1988-01-07 15:25:34 +00:00
parent 41d9465e89
commit dcf14f338b

View file

@ -5,10 +5,14 @@ arith cur_pos = 0;
dist( lab) dist( lab)
char *lab; char *lab;
/* Just output a reference which must be filled in on a second pass */
{ {
out( "$%s$ - %ld", lab, cur_pos); out( "$%s$ - %ld", lab, cur_pos);
} }
#define MAX_LABEL 10 #define MAX_LABEL 10
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
@ -24,6 +28,9 @@ int n_labs = 0;
handle_label( lab) handle_label( lab)
char *lab; char *lab;
/* Record position of this label */
{ {
char *Salloc(); char *Salloc();
@ -39,6 +46,9 @@ char *lab;
relocate( f) relocate( f)
FILE *f; FILE *f;
/* Output position-count of the label in file 'f', remove also trailing $ */
{ {
char buf[256]; char buf[256];
int i; int i;
@ -58,6 +68,9 @@ File *oldout;
extern File *outfile; extern File *outfile;
back_patch() back_patch()
/* Echo the text on file '.tmp', but replace every occurence of label-
*reference's by its position-count. Reference of label 'foo' is '$foo$'.
*/
{ {
FILE *save; FILE *save;
char c, c1; char c, c1;
@ -98,5 +111,5 @@ save_output()
if ( ! sys_open( ".tmp", OP_WRITE, &outfile)) if ( ! sys_open( ".tmp", OP_WRITE, &outfile))
fprint( STDERR, "can't open .tmp\n"); fprint( STDERR, "can't open .tmp\n");
cur_pos = 0; cur_pos = 0;
n_labs = 0; /* geheugen-ruimte teruggeven? */ n_labs = 0;
} }