1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819
|
/* $Id: cim.h,v 1.15 1996/03/27 16:42:29 cim Exp $ */
/* Copyright (C) 1994 Sverre Hvammen Johansen, Stein Krogdahl and Terje Mjs
* Department of Informatics, University of Oslo.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/******************************************************************************
Definition of runtime-constants */
#define __FALSE 0
#define __TRUE 1
#define __NULL 0L
#define __EOF (-1)
/* Executing must have the value 0 since it is not set */
#define __EXECUTING 0
#define __DETACHED 1
#define __TERMINATED 2
#define __RESUMED 3
#define __CONSTANT 1
#define __ACTS 1
#define __TEXT 3
#define __ARRAY 5
#define __THUNK 7
#define __FROM_START 0
#define __CURRENT_POS 1
#define __AT_END 2
#define __ADDRESS_NOTHUNK 0
#define __ADDRESS_THUNK 1
#define __VALUE_NOTHUNK 2
#define __VALUE_THUNK 3
#define __NOTEST 0
#define __WRITETEST 1
#define __READTEST 2
#define __READWRITETEST 3
#define __NOCONV 0
#define __INTREAL 1
#define __REALINT 2
#define __REALINTREAL 3
#define __RTPUTTEXTLENGTH 150
#define __RTPUTTEXTFORMATLENGTH 10
#define __RTPUTMAXN 100
/* Definition of kind */
#define __KNOKD 'N'
#define __KSIMPLE 'S'
#define __KARRAY 'A'
#define __KPROC 'P'
#define __KCLASS 'C'
#define __KBLOKK 'B'
#define __KPRBLK 'R'
#define __KFOR 'F'
#define __KINSP 'I'
#define __KCON 'O'
#define __KERROR 'E'
/* Definition of type */
#define __TNOTY 'N'
#define __TINTG 'I'
#define __TSHORT 'I' /* S */
#define __TREAL 'R'
#define __TLONG 'R' /* D */
#define __TBOOL 'B'
#define __TCHAR 'C'
#define __TLABEL 'L'
#define __TTEXT 'T'
#define __TREF 'P'
#define __TERROR 'E'
#define __NOSHARED 0
#define __SHARED 1
#define __NOAPPEND 0
#define __APPEND 1
#define __NOCREATE 0
#define __CREATE 1
#define __ANYCREATE 2
#define __READWRITE 0
#define __WRITEONLY 1
#define __READONLY 2
#define __NOREWIND 0
#define __REWIND 1
#define __NOPURGE 0
#define __PURGE 1
#define __READ 0
#define __WRITE 1
#define __SEEK 2
#define __BYTESIZE 8
/******************************************************************************
Structures, unions and type definitions */
typedef struct
{
short ent;
void (*ment) ();
}
__progadr;
typedef union
{
long i;
int c;
double f;
short s;
long l;
__progadr adr;
double d;
}
__valuetype;
/* A prototype-object */
typedef struct __ptys __ptyp,
*__pty;
struct __ptys
{
char kind,
plev;
short blev,
size;
__progadr adr;
short fornest,
connest;
short naref,
navirt;
short *ref;
__pty *virt;
__pty *pref;
__progadr *virtlab;
};
/* Head of a data-object */
typedef struct __dhs *__dhp;
typedef struct __dhs
{
__pty pp;
__dhp gl,
dl;
char pm,
dt;
__progadr ex;
__dhp sl;
}
__dh;
/* Var parameter of type boolean, char, or text */
typedef struct
{
__dhp bp; /* Pointer to block to akt.par. */
int ofs; /* Relativ adress of akt.par */
}
__varpar;
/* Aritmetic var parameter */
typedef struct
{
__dhp bp; /* Pointer to block to akt.par. */
int ofs; /* Relativ adress of akt.par */
char conv; /* What kind of converting (integer, real) */
}
__aritvarpar;
/* Ref var parameter */
typedef struct
{
__dhp bp; /* Pointer to block to akt.par. */
int ofs; /* Relativ adress of akt.par */
__pty q; /* Pointer to prototype to strongest
* qualification on the access path */
char conv; /* When in test must be done */
}
__refvarpar;
/* Formal prosedure parameter */
typedef struct
{
__pty pp;
__dhp psl;
}
__forprocpar;
typedef struct
{
__pty pp;
__dhp psl;
char conv;
}
__aritprocpar;
typedef struct
{
__pty pp;
__dhp psl;
char conv;
__pty q;
}
__refprocpar;
typedef union
{
__valuetype v;
__dhp r;
}
__val_or_ref;
/* Head of a stack-object */
typedef struct
{
__pty pp;
__dhp gl,
dl;
char pm,
dt,
at; /* pm="ant ref", at="ant text", and dt="ant
* value" */
short size;
}
__sh, *__shp;
/* A stack-object */
typedef struct
{
__sh h;
__val_or_ref s[1];
}
__stk, *__stkp;
/* Head of a tekst-object */
typedef struct
{
__pty pp;
__dhp gl;
char konstant;
short size;
}
__th, *__thp;
/* Tekst-object */
typedef struct
{
__th h;
char string[1];
}
__tobj, *__textref;
/* Tekst-variable */
typedef struct
{
__textref obj;
unsigned short length,
pos,
start;
}
__txt, *__txtvp;
/* Notext */
typedef struct
{
__txt tvar;
}
__notext;
/* Head of an array-object */
typedef struct
{
__pty pp;
__dhp gl;
int size;
short dim;
char type;
}
__ah, *__ahp;
/* Upper and lower limit for each dimension */
typedef struct
{
int low,
size;
}
__arrlimit;
/* Head of an array-object */
typedef struct
{
__ah h;
__arrlimit limits[1];
}
*__arrp;
/* Name transmission */
typedef union
{
int ofs; /* Offset adress for a variable, bp is base
* adress */
int i; /* Valuie for a constant aktual name par */
double f;
char c;
short s;
long l;
double d;
__dhp r;
}
__ofsorvalue;
typedef struct
{
__dh h;
char conv; /* What kind of conversions have to be
* performed */
__pty q; /* Strongest qualification on the access
* path. */
char ftype; /* Formal type of an aritmetick name. */
char writeaccess; /* TRUE or FALSE. For thunks that is
* computing adresses. */
/* Should the thunk return the adress or an value. */
}
__thunk, *__thunkp;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp bp;
__ofsorvalue v;
char namekind;
}
__simplenamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp bp;
__ofsorvalue v;
char namekind;
}
__charboolnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp bp;
__ofsorvalue v;
char namekind;
char conv;
}
__aritnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp bp;
__ofsorvalue v;
char namekind;
__pty q;
char conv;
}
__refnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp bp;
__ofsorvalue v;
char namekind;
__txtvp tp;
}
__textnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__pty pp; /* Pointer to the procedures prototype */
__dhp psl; /* Procedures static environment */
char namekind;
}
__procname;
typedef struct
{
__dhp sl;
__progadr adr;
__pty pp; /* Pointer to the procedures prototype */
__dhp psl; /* Procedures static environment */
char namekind;
}
__simpleprocnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__pty pp; /* Pointer to the procedures prototype */
__dhp psl; /* Procedures static environment */
char namekind;
char conv;
}
__aritprocnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__pty pp; /* Pointer to the procedures prototype */
__dhp psl; /* Procedures static environment */
char namekind;
char conv;
__pty q;
}
__refprocnamepar;
typedef struct
{
__dhp sl;
__progadr adr;
__dhp ob;
int swv;
char namekind;
}
__labelnamepar;
/* Label var and standard transmitted parameter or
* a name, var or standard transmitted switch parameter */
typedef struct /* No thunk for switch parameter by name */
{
__progadr adr;
__dhp ob;
}
__labelswitchpar;
typedef struct
{
__dhp sl;
__progadr adr;
__arrp ap;
char namekind;
}
__arraynamepar;
typedef struct
{
char *fil;
long line,
fromline;
}
__map;
/******************************************************************************
External variables */
/* Inline error messages */
extern char *__errnone,
*__errlim,
*__errarr,
*__errswitch,
*__errqual,
*__errvirt,
*__errbound;
/* Program counter */
extern __progadr __goto,
__return;
extern long __vreturn;
extern void __main_modul ();
/* switch */
extern int __swv;
/* Local-block, parameter-block, and static environm,ent to rcp(p)() */
extern __dhp __lb,
__pb;
extern __dhp __sl; /* Can't be a parameter since GBC must update
* it */
/* Garbage collections statistics */
extern int __gc;
extern double __gbctime;
/* Stack or return value for evaluation of expressions */
/* 900526 (1) */
extern __valuetype __v[],
__ev;
extern __dhp __r[],
__er;
extern __txt __t[],
__et,__t1,__t2;
extern long __as; /* Antall p} h.h.v ref og text stakken */
/* Pointer to current array-object */
extern __arrp __ap;
/* (indeks - lower bound) for the actual dimensions to an array object */
extern int __h[];
extern char *__progname;
extern __pty __pp; /* Prototyp pointer */
extern __dhp __bp; /* In test */
extern __refvarpar *__vrp; /* In test for var par */
extern __aritvarpar *__vvp; /* Convertion between real and integer */
extern __refnamepar *__nrp; /* In test for name par */
extern __aritnamepar *__nvp; /* Convertion between real and integer for
* name */
extern long __rputlen;
extern char __conv;
extern char __currentlowten,
__currentdecimalmark;
extern __notext __tk0; /* tk0 == notext */
extern char __ctab[3][4];
extern long __poolsize,
__maxsize;
extern char __dynsize,
__chpoolsize;
extern char *__ctext;
extern char *__nullstr;
extern char *__progname;
extern long __argc;
extern long __argv;
extern long __rargc ();
extern long __rargv ();
extern __map *__curent_map;
extern long __cline;
extern long __lines_per_page;
extern __dhp __sto,
__max,
__min,
__fri;
extern __dh __niu,
__nil;
extern __dhp __p;
/******************************************************************************
External declaration of run-time routines that do not return int */
/* RTCK.C */
extern __dhp __rca ();
extern __dhp __ralloc ();
extern char __rin ();
extern char __rrin ();
extern char __ris ();
extern char __rgetav ();
extern char __rgetcbv ();
extern char __rgetrv ();
extern char __rgettv ();
extern char __rgetproc ();
extern char __rgetlab ();
extern char __rgeta ();
extern char __rgetsa ();
/* RTBASICIO.C */
extern __dhp __rsysin ();
extern __dhp __rsysout ();
extern __dhp __rsyserr ();
/* ENVIRONMENT.C */
/* Basic operations */
extern double __rabsr ();
extern long __rabsi ();
extern long __rsigndi ();
extern long __rsigndr ();
extern long __rmod ();
extern long __rrem ();
extern long __rentier ();
extern long __rintrea ();
extern double __raddepsilon ();
extern double __rsubepsilon ();
extern long __rlowerbound ();
extern long __rupperbound ();
extern long __ridiv0();
extern double __rrdiv0();
/* Power functions */
extern long __rpowii ();
extern double __rpowri ();
extern double __rpow ();
/* Text utilities */
extern char __rchar ();
extern char __risochar ();
extern long __rrank ();
extern long __risorank ();
extern char __rdigit ();
extern char __rletter ();
extern char __rlowten ();
extern char __rdecimalmark ();
extern __txtvp __rupcase ();
extern __txtvp __rlowcase ();
/* Mathematical functions */
extern double __rsqrt ();
extern double __rsin ();
extern double __rcos ();
extern double __rtan ();
extern double __rarcsin ();
extern double __rarccos ();
extern double __rarctan ();
extern double __rarctan2 ();
extern double __rsinh ();
extern double __rcosh ();
extern double __rtanh ();
extern double __rln ();
extern double __rlog10 ();
extern double __rexp ();
extern double __rcotan ();
/* Extremum functions */
extern void __rmint ();
extern char __rminc ();
extern long __rmini ();
extern double __rminr ();
extern void __rmaxt ();
extern char __rmaxc ();
extern long __rmaxi ();
extern double __rmaxr ();
/* Environmental enquiries */
extern __txtvp __rsimulaid();
/* Random drawing */
extern char __rdraw ();
extern long __rrandint ();
extern double __runiform ();
extern double __rnormal ();
extern double __rnegexp ();
extern long __rpoisson ();
extern double __rerlang ();
extern long __rdiscrete ();
extern double __rlinear ();
extern long __rhistd ();
/* Calendar and timing utilities */
extern __txtvp __rdatetime ();
extern double __rcputime ();
extern double __rclocktime ();
/* RTTEXT.C */
extern char __rtconstant ();
extern long __rtstart ();
extern long __rtlength ();
extern char __rtmore ();
extern char __rtgetchar ();
extern double __rtgetreal ();
extern long __rtgetfrac ();
extern long __rtgetint ();
extern long __rtpos ();
extern __txtvp __rtmain ();
extern __txtvp __rtputchar ();
extern __txtvp __rtputint ();
extern __txtvp __rtputfix ();
extern __txtvp __rtputreal ();
extern __txtvp __rtputfrac ();
extern __txtvp __rtsetpos ();
extern __txtvp __rtsub ();
extern __txtvp __rtstrip ();
extern __txtvp __rcopy ();
extern __txtvp __rblanks ();
extern __txtvp __rconc ();
extern __txtvp __rtextvalassign ();
extern __txtvp __rtextassign ();
extern char __reqrtext ();
extern char __reqrtext ();
extern char __reqtext ();
extern char __rlttext ();
extern char __rletext ();
/* FILESYSTEM.C */
extern long __rfsize ();
/* Class file */
extern __txtvp __rfilename ();
extern char __risopen ();
extern char __rsetaccess ();
/* File class imagefile */
extern long __rpos ();
extern char __rmore ();
extern long __rlength ();
extern __dhp __rsetpos ();
/* Imagefile class infile */
extern char __riendfile ();
extern char __riopen ();
extern char __riclose ();
extern char __riinrecord ();
extern char __riinchar ();
extern char __rilastitem ();
extern long __riinint ();
extern double __riinreal ();
extern long __riinfrac ();
extern __txtvp __riintext ();
extern __dhp __riinimage ();
/* Imagefile class outfile */
extern char __roopen ();
extern char __roclose ();
extern __dhp __rooutimage ();
extern __dhp __rooutrecord ();
extern __dhp __robreakoutimage ();
extern __dhp __rooutchar ();
extern __dhp __roouttext ();
extern __dhp __rooutint ();
extern __dhp __rooutfix ();
extern __dhp __rooutreal ();
extern __dhp __rooutfrac ();
/* Outfile class printfile */
extern long __rpline ();
extern long __rppage ();
extern char __rpopen ();
extern char __rpclose ();
extern long __rplinesperpage ();
extern __dhp __rpspacing ();
extern __dhp __rpeject ();
extern __dhp __rpoutimage ();
extern __dhp __rpoutrecord ();
/* Imagefile class directfile */
extern long __rdlocation ();
extern char __rdendfile ();
extern char __rdlocked ();
extern char __rdcheckpoint ();
extern char __rdunlock ();
extern long __rdlock ();
extern char __rdopen ();
extern char __rdclose ();
extern long __rdlastloc ();
extern long __rdmaxloc ();
extern char __rddeleteimage ();
extern __dhp __rdlocate ();
extern __dhp __rdoutimage ();
extern __dhp __rdinimage ();
/* File class bytefile */
extern long __rbytesize ();
/* Bytefile class inbytefile */
extern __txtvp __ribintext ();
extern long __ribinbyte ();
extern char __ribendfile ();
extern char __ribopen ();
extern char __ribclose ();
/* Bytefile class outbytefile */
extern char __robopen ();
extern char __robclose ();
extern __dhp __roboutbyte ();
extern __dhp __robouttext ();
/* Bytefile class directbytefile */
extern __txtvp __rdbintext ();
extern long __rdblocation ();
extern long __rdbmaxloc ();
extern char __rdblocked ();
extern long __rdblock ();
extern char __rdbunlock ();
extern char __rdbopen ();
extern char __rdbclose ();
extern long __rdblastloc ();
extern __dhp __rdblocate ();
extern __dhp __rdboutbyte ();
extern __dhp __rdbouttext ();
/* Environment to C */
extern char *__rcopytexttoc ();
extern char *__raddroffirstchar ();
extern char *__raddroffirstelem ();
extern char **__rcopytextarrtoc ();
extern char *__rcopyarrtoc ();
extern char *xmalloc();
|