ack/util/ceg/ce_back/obj_back/extnd.c

131 lines
3.1 KiB
C
Raw Normal View History

1987-11-20 10:41:03 +00:00
#include <system.h>
#include <out.h>
1989-01-26 13:32:57 +00:00
#include <em.h>
1987-11-20 10:41:03 +00:00
#include "header.h"
1989-01-26 13:32:57 +00:00
#include "back.h"
1987-11-20 10:41:03 +00:00
#include "mach.h"
1988-11-18 17:52:39 +00:00
#include <varargs.h>
/* Mysprint() stores the string directly in the string_arae. This saves
* a copy action. It is assumed that the strings stored in the string-table
* are never longer than MAXSTRLEN bytes.
*/
#define MAXSTRLEN 1024
/*VARARGS*/
static int mysprint(va_alist)
va_dcl
{
char *fmt;
va_list args;
int retval;
va_start(args);
fmt = va_arg(args, char *);
while (string + MAXSTRLEN - string_area > size_string)
mem_string();
retval = _format(string, fmt, args);
string[retval] = '\0';
va_end(args);
return retval;
}
1987-11-20 10:41:03 +00:00
1987-11-25 13:54:01 +00:00
/* The extnd_*()s make a name unique. The resulting string is directly stored
* in the symbol_table (by mysprint()). Later additional fields in the
* symbol_table are filled. For these actions the values of the index in
* the symbol_table and the length of the string are stored.
1987-11-20 10:41:03 +00:00
*/
extern int string_lengte, index_symbol_table;
1988-11-18 17:52:39 +00:00
char *extnd_pro( prcno)
int prcno;
1987-11-20 10:41:03 +00:00
{
1988-11-18 17:52:39 +00:00
string_lengte = mysprint( "%cprc%d", GENLAB, prcno);
1987-11-20 10:41:03 +00:00
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
1988-11-18 17:52:39 +00:00
char *extnd_start( prcno)
int prcno;
1987-11-20 10:41:03 +00:00
{
1988-11-18 17:52:39 +00:00
string_lengte = mysprint( "%cstrt%d", GENLAB, prcno);
1987-11-20 10:41:03 +00:00
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
char *extnd_name( s)
char *s;
{
string_lengte = mysprint( NAME_FMT, s);
index_symbol_table = find_sym( string, STORE_STRING);
return( string_area + symbol_table[ index_symbol_table].on_foff);
}
char *extnd_dnam( s)
char *s;
{
string_lengte = mysprint( DNAM_FMT, s);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
char *extnd_dlb( g)
arith g;
{
string_lengte = mysprint( DLB_FMT, (arith)g);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
1988-11-18 17:52:39 +00:00
char *extnd_ilb( l, prcno)
1987-11-20 10:41:03 +00:00
arith l;
{
1988-11-18 17:52:39 +00:00
string_lengte = mysprint( ILB_FMT, prcno, (arith) l);
1987-11-20 10:41:03 +00:00
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
char *extnd_hol( hol)
int hol;
{
string_lengte = mysprint( HOL_FMT, hol);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
char *extnd_part( d)
int d;
{
1988-10-20 13:06:10 +00:00
string_lengte = mysprint( "%cprt%x", GENLAB, d);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
char *extnd_cont( d)
int d;
{
1988-10-20 13:06:10 +00:00
string_lengte = mysprint( "%ccnt%x", GENLAB, d);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}
1989-03-22 16:44:20 +00:00
char *extnd_main( d)
int d;
{
string_lengte = mysprint( "%cmcnt%x", GENLAB, d);
index_symbol_table = find_sym( string, STORE_STRING);
return( symbol_table[ index_symbol_table].on_foff + string_area);
}