Merge pull request #108 from davidgiven/dtrg-warnings
Warning-fix and protoise the basic library.
This commit is contained in:
commit
47bdd9cc49
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Strings are allocated in a fixed string descriptor table
|
||||
** This mechanism is used to avoid string copying as much as possible
|
||||
*/
|
||||
|
||||
typedef struct{
|
||||
char *strval;
|
||||
int strcount;
|
||||
int strlength;
|
||||
} String;
|
||||
|
||||
extern String *_newstr(char* str);
|
||||
|
||||
#define MAXSTRING 1024
|
|
@ -1,9 +1,4 @@
|
|||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include "lib.h"
|
||||
|
||||
long _abl(long i)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "bc_string.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
int _asc(String* str)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "lib.h"
|
||||
|
||||
void asrt(int b)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _atn(double x) { return atan(x); }
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* BASIC file io definitions */
|
||||
|
||||
extern FILE *_chanrd;
|
|
@ -12,6 +12,7 @@ for _, plat in ipairs(vars.plats) do
|
|||
"h+emheaders",
|
||||
"lang/cem/libcc.ansi/headers+pkg",
|
||||
"plat/"..plat.."/include+pkg",
|
||||
"./*.h",
|
||||
},
|
||||
vars = { plat = plat }
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "bc_string.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
String* _chr(int i)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
int _cint(double f)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "lib.h"
|
||||
|
||||
int _errsym;
|
||||
int _erlsym;
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define __NO_DEFS
|
||||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _exp(double x)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
|
||||
; $Id$
|
||||
|
||||
#define FARG 0
|
||||
#define ERES EM_DSIZE
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
|
||||
; $Id$
|
||||
|
||||
#define ARG1 0
|
||||
#define ARG2 EM_DSIZE
|
||||
#define IRES 2*EM_DSIZE
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "bc_string.h"
|
||||
#include <stdio.h>
|
||||
#include "bc_io.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
Filedesc _fdtable[16];
|
||||
/* BASIC file descriptor table */
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <stdlib.h>
|
||||
#include "lib.h"
|
||||
|
||||
void _hlt(int nr)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "bc_io.h"
|
||||
#include "lib.h"
|
||||
|
||||
/* dtrg --- this originally used sgtty.h to do clever tty manipulation.
|
||||
* Strictly this should be converted to use termios, but for simplicity
|
||||
|
|
|
@ -1,9 +1,107 @@
|
|||
#ifndef LIB_H
|
||||
#define LIB_H
|
||||
|
||||
typedef struct{
|
||||
char *strval;
|
||||
int strcount;
|
||||
int strlength;
|
||||
} String;
|
||||
|
||||
#define MAXSTRING 1024
|
||||
|
||||
extern String *_chr(int i);
|
||||
extern String *_concat(String *s1, String *s2);
|
||||
extern String *_hex(int i);
|
||||
extern String *_left(int size, String *s);
|
||||
extern String *_mid(int i1, int i2, String *s);
|
||||
extern String *_mkd(double d);
|
||||
extern String *_mki(long i);
|
||||
extern String *_newstr(char *str);
|
||||
extern String *_nstr(double f);
|
||||
extern String *_oct(int i);
|
||||
extern String *_right(int length, String *str);
|
||||
extern String *_space(int d);
|
||||
extern String *_strascii(void);
|
||||
extern String *_string(double f, double d);
|
||||
extern char *salloc(unsigned length);
|
||||
extern double _abr(double f);
|
||||
extern double _atn(double x);
|
||||
extern double _cos(double x);
|
||||
extern double _cvd(String *s);
|
||||
extern double _exp(double x);
|
||||
extern double _fcint(double f);
|
||||
extern double _log(double x);
|
||||
extern double _power(double x, double y);
|
||||
extern double _rnd(double d);
|
||||
extern double _sin(double x);
|
||||
extern double _sqt(double x);
|
||||
extern double _tan(double x);
|
||||
extern double _trunc(double f);
|
||||
extern int _asc(String *str);
|
||||
extern int _cint(double f);
|
||||
extern int _fix(double f);
|
||||
extern int _forsgn(double v);
|
||||
extern int _ioeof(int channel);
|
||||
extern int _length(String *str);
|
||||
extern int _retstmt(void);
|
||||
extern int _sgn(double v);
|
||||
extern int _stop(void);
|
||||
extern int _strcomp(String *s1, String *s2);
|
||||
extern int peek(int addr);
|
||||
extern long _abl(long i);
|
||||
extern long _cvi(String *s);
|
||||
extern void _asschn(void);
|
||||
extern void _clochn(int nr);
|
||||
extern void _closeall(void);
|
||||
extern void _decstr(String *str);
|
||||
extern void _delstr(String *src);
|
||||
extern void _fltswap(double *i1, double *i2);
|
||||
extern void _gosub(int x);
|
||||
extern void _goto_err(void);
|
||||
extern void _hlt(int nr);
|
||||
extern void _in(char *buf);
|
||||
extern void _incstr(String *src);
|
||||
extern void _ini_trp(void);
|
||||
extern void _intswap(int *i1, int *i2);
|
||||
extern void _midstmt(String *s2, int i1, int i2, String *s);
|
||||
extern void _nl(void);
|
||||
extern void _opnchn(int reclen, String *fname, String *mode);
|
||||
extern void _out(char *str);
|
||||
extern void _outnl(void);
|
||||
extern void _poke(int i, int j);
|
||||
extern void _prfnum(double f);
|
||||
extern void _prinum(int i);
|
||||
extern void _prstr(String *str);
|
||||
extern void _qstmark(void);
|
||||
extern void _randomi(void);
|
||||
extern void _rdline(String **s);
|
||||
extern void _readflt(double *addr);
|
||||
extern void _readint(int *addr);
|
||||
extern void _readln(void);
|
||||
extern void _readstr(String **s);
|
||||
extern void _restore(int line);
|
||||
extern void _setchan(int index);
|
||||
extern void _setline(void);
|
||||
extern void _setrand(int i);
|
||||
extern void _settrap(int nr);
|
||||
extern void _spc(int x);
|
||||
extern void _str(double f, char *buffer);
|
||||
extern void _strcpy(String *dst, String *src);
|
||||
extern void _strswap(String **s1, String **s2);
|
||||
extern void _tab(int x);
|
||||
extern void _trace(int i);
|
||||
extern void _trap(void);
|
||||
extern void _trpfatal(int i);
|
||||
extern void _trpset(int nr);
|
||||
extern void _wrcomma(void);
|
||||
extern void _wrflt(double f);
|
||||
extern void _wrint(int i);
|
||||
extern void _wrnl(void);
|
||||
extern void _wrstr(String *s);
|
||||
extern void _zone(void);
|
||||
extern void asrt(int b);
|
||||
extern void error(int index);
|
||||
extern char* salloc(unsigned length);
|
||||
extern void sfree(char* c);
|
||||
extern void readskip(void);
|
||||
extern void sfree(char *c);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define __NO_DEFS
|
||||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _log(double x)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "bc_string.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
String* _mki(long i)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "bc_string.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
String* _oct(int i)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
int peek(int addr)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _power(double x, double y) { return pow(x, y); }
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "bc_string.h"
|
||||
#include <string.h>
|
||||
#include "bc_io.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
/* Here all routine to generate terminal oriented output is located */
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "lib.h"
|
||||
|
||||
#if !defined(EM_WSIZE)
|
||||
#define EM_WSIZE _EM_WSIZE
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "bc_string.h"
|
||||
#include "bc_io.h"
|
||||
#include <ctype.h>
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
void _readln(void)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
#define MAXNESTING 1000
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <stdlib.h>
|
||||
#include "lib.h"
|
||||
|
||||
char* salloc(unsigned length)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
; $Id$
|
||||
; Save the line where the error occurred
|
||||
exp $_setline
|
||||
pro $_setline,0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
int _sgn(double v)
|
||||
{
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define __NO_DEFS
|
||||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _sin(double x) { return sin(x); }
|
||||
double _cos(double x) { return cos(x); }
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*
|
||||
* Author: Ceriel J.H. Jacobs
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define __NO_DEFS
|
||||
#include <math.h>
|
||||
#include "lib.h"
|
||||
|
||||
double _sqt(double x) { return sqrt(x); }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "lib.h"
|
||||
|
||||
_stop()
|
||||
{
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "bc_string.h"
|
||||
#include "lib.h"
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define ok(X) \
|
||||
if (X == 0) \
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "bc_string.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
void _intswap(int* i1, int* i2)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* $Id$ */
|
||||
#include <stdio.h>
|
||||
#include "lib.h"
|
||||
|
||||
void _trace(int i)
|
||||
{
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#include "lib.h"
|
||||
|
||||
#ifndef NSIG
|
||||
#define NSIG _NSIG
|
||||
#endif
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Trap handling */
|
||||
int _trpline; /* BASIC return label */
|
||||
jmp_buf trpbuf;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "bc_string.h"
|
||||
#include "bc_io.h"
|
||||
|
||||
/* $Id$ */
|
||||
#include "lib.h"
|
||||
|
||||
/* assume that the channel has been set */
|
||||
|
||||
|
|
Loading…
Reference in a new issue