#endif
-static void DEFUN(init_string_with_size,(buffer, size),
- string_type *buffer AND
- unsigned int size )
+static void
+init_string_with_size (buffer, size)
+ string_type *buffer;
+ unsigned int size;
{
buffer->write_idx = 0;
buffer->size = size;
buffer->ptr = malloc(size);
}
-static void DEFUN(init_string,(buffer),
- string_type *buffer)
+static void
+init_string (buffer)
+ string_type *buffer;
{
init_string_with_size(buffer, DEF_SIZE);
}
-static int DEFUN(find, (str, what),
- string_type *str AND
- char *what)
+static int
+find (str, what)
+ string_type *str;
+ char *what;
{
unsigned int i;
char *p;
}
-static void DEFUN(write_buffer,(buffer, f),
- string_type *buffer AND
- FILE *f)
+static void
+write_buffer (buffer, f)
+ string_type *buffer;
+ FILE *f;
{
fwrite(buffer->ptr, buffer->write_idx, 1, f);
}
-static void DEFUN(delete_string,(buffer),
- string_type *buffer)
+static void
+delete_string (buffer)
+ string_type *buffer;
{
free(buffer->ptr);
}
-static char *DEFUN(addr, (buffer, idx),
- string_type *buffer AND
- unsigned int idx)
+static char *
+addr (buffer, idx)
+ string_type *buffer;
+ unsigned int idx;
{
return buffer->ptr + idx;
}
-static char DEFUN(at,(buffer, pos),
- string_type *buffer AND
- unsigned int pos)
+static char
+at (buffer, pos)
+ string_type *buffer;
+ unsigned int pos;
{
if (pos >= buffer->write_idx)
return 0;
return buffer->ptr[pos];
}
-static void DEFUN(catchar,(buffer, ch),
- string_type *buffer AND
- int ch)
+static void
+catchar (buffer, ch)
+ string_type *buffer;
+ int ch;
{
if (buffer->write_idx == buffer->size)
{
}
-static void DEFUN(overwrite_string,(dst, src),
- string_type *dst AND
- string_type *src)
+static void
+overwrite_string (dst, src)
+ string_type *dst;
+ string_type *src;
{
free(dst->ptr);
dst->size = src->size;
dst->ptr = src->ptr;
}
-static void DEFUN(catbuf,(buffer, buf, len),
- string_type *buffer AND
- char *buf AND
- unsigned int len)
+static void
+catbuf (buffer, buf, len)
+ string_type *buffer;
+ char *buf;
+ unsigned int len;
{
if (buffer->write_idx + len >= buffer->size)
{
buffer->write_idx += len;
}
-static void DEFUN(cattext,(buffer, string),
- string_type *buffer AND
- char *string)
+static void
+cattext (buffer, string)
+ string_type *buffer;
+ char *string;
{
catbuf (buffer, string, (unsigned int) strlen (string));
}
-static void DEFUN(catstr,(dst, src),
- string_type *dst AND
- string_type *src)
+static void
+catstr (dst, src)
+ string_type *dst;
+ string_type *src;
{
catbuf (dst, src->ptr, src->write_idx);
}
static unsigned int
-DEFUN(skip_white_and_stars,(src, idx),
- string_type *src AND
- unsigned int idx)
+skip_white_and_stars (src, idx)
+ string_type *src;
+ unsigned int idx;
{
char c;
while ((c = at(src,idx)),
static void chew_exit (void);
#endif
-static void DEFUN(exec,(word),
- dict_type *word)
+static void
+exec (word)
+ dict_type *word;
{
pc = word->code;
while (*pc)
Blank lines are turned into one blank line. */
static void
-DEFUN(remove_noncomments,(src,dst),
- string_type *src AND
- string_type *dst)
+remove_noncomments (src,dst)
+ string_type *src;
+ string_type *dst;
{
unsigned int idx = 0;
*/
static void
-DEFUN_VOID(paramstuff)
+paramstuff (void)
{
unsigned int openp;
unsigned int fname;
/* Mod tos so that only lines with leading dots remain */
static void
-DEFUN_VOID(outputdots)
+outputdots (void)
{
unsigned int idx = 0;
string_type out;
}
/* A command is all upper case,and alone on a line */
static int
-DEFUN( iscommand,(ptr, idx),
- string_type *ptr AND
- unsigned int idx)
+iscommand (ptr, idx)
+ string_type *ptr;
+ unsigned int idx;
{
unsigned int len = 0;
while (at(ptr,idx)) {
static int
-DEFUN(copy_past_newline,(ptr, idx, dst),
- string_type *ptr AND
- unsigned int idx AND
- string_type *dst)
+copy_past_newline (ptr, idx, dst)
+ string_type *ptr;
+ unsigned int idx;
+ string_type *dst;
{
int column = 0;
}
char *
-DEFUN(nextword,(string, word),
- char *string AND
- char **word)
+nextword (string, word)
+ char *string;
+ char **word;
{
char *word_start;
int idx;
}
dict_type *root;
dict_type *
-DEFUN(lookup_word,(word),
- char *word)
+lookup_word (word)
+ char *word;
{
dict_type *ptr = root;
while (ptr) {
}
-static void DEFUN_VOID(perform)
+static void
+perform (void)
{
tos = stack;
}
dict_type *
-DEFUN(newentry,(word),
- char *word)
+newentry (word)
+ char *word;
{
dict_type *new = (dict_type *)malloc(sizeof(dict_type));
new->word = word;
unsigned int
-DEFUN(add_to_definition,(entry, word),
- dict_type *entry AND
- stinst_type word)
+add_to_definition (entry, word)
+ dict_type *entry;
+ stinst_type word;
{
if (entry->code_end == entry->code_length)
{
void
-DEFUN(add_intrinsic,(name, func),
- char *name AND
- void (*func)())
+add_intrinsic (name, func)
+ char *name;
+ void (*func)();
{
dict_type *new = newentry(name);
add_to_definition(new, func);
}
void
-DEFUN(add_var,(name),
- char *name)
+add_var (name)
+ char *name;
{
dict_type *new = newentry(name);
add_to_definition(new, push_number);
void
-DEFUN(compile, (string),
- char *string)
+compile (string)
+ char *string;
{
/* add words to the dictionary */
char *word;
}
-static void DEFUN_VOID(bang)
+static void
+bang (void)
{
*(long *)((isp[0])) = isp[-1];
isp-=2;
}
-static void DEFUN(read_in, (str, file),
- string_type *str AND
- FILE *file)
+static void
+read_in (str, file)
+ string_type *str;
+ FILE *file;
{
char buff[10000];
unsigned int r;
}
-static void DEFUN_VOID(usage)
+static void
+usage (void)
{
fprintf(stderr,"usage: -[d|i|g] <file >file\n");
exit(33);
exit (0);
}
-int DEFUN(main,(ac,av),
-int ac AND
-char *av[])
+int
+main (ac,av)
+ int ac;
+ char *av[];
{
unsigned int i;
string_type buffer;