1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
- #include "bem.h"
- #ifndef NORSCID
- static char rcs_id[] = "$Header$" ;
- #endif
- #define abs(X) (X>=0?X:-X)
- /* Miscelaneous routines can be found here */
- int errorcnt;
- warning(str)
- char *str;
- {
- if (wflag) return;
- Xerror("WARNING", str);
- }
- error(str)
- char *str;
- {
- Xerror("ERROR", str);
- errorcnt++;
- }
- Xerror(type, str)
- char *str;
- char *type;
- {
- extern int listing;
- extern int basicline;
- if( !listing) fprint(STDERR, "LINE %d:",basicline);
- fprint(STDERR, "%s:%s\n",type, str);
- }
- fatal(str)
- char *str;
- {
- Xerror("FATAL",str);
- C_close();
- sys_stop(S_EXIT);
- }
- notyetimpl()
- {
- warning("not yet implemented");
- }
- illegalcmd()
- {
- warning("illegal command");
- }
- char *itoa(i)
- int i;
- {
- static char buf[30];
- (void) sprint(buf,"%d",i);
- return(buf);
- }
- char *salloc(length)
- unsigned length;
- {
- char *s,*c;
- extern char *malloc() ;
- s=c=malloc(length);
- if ( !s ) fatal("Out of memory") ;
- while(length--)*c++ =0;
- return(s);
- }
|