configure.in plug-ins/script-fu/siod/Makefile.am

2003-11-26  Michael Natterer  <mitch@gimp.org>

	* configure.in
	* plug-ins/script-fu/siod/Makefile.am
	* plug-ins/script-fu/siod/.cvsignore
	* plug-ins/script-fu/siod/regex.c
	* plug-ins/script-fu/siod/slib.c
	* plug-ins/script-fu/siod/sliba.c
	* plug-ins/script-fu/siod/trace.c
	* plug-ins/script-fu/siod/siod.h
	* plug-ins/script-fu/siod/siodp.h: added new directory for siod.

	* plug-ins/script-fu/Makefile.am
	* plug-ins/script-fu/interp_regex.c
	* plug-ins/script-fu/interp_slib.c
	* plug-ins/script-fu/interp_sliba.c
	* plug-ins/script-fu/interp_trace.c
	* plug-ins/script-fu/siod.h
	* plug-ins/script-fu/siodp.h: removed siod from here.

	* plug-ins/script-fu/script-fu-scripts.[ch]
	* plug-ins/script-fu/script-fu.c
	* plug-ins/script-fu/siod-wrapper.c
	* tools/pdbgen/enumcode.pl: changed #includes accordingly.

	* plug-ins/script-fu/script-fu-constants.c: regenerated.

	* plug-ins/script-fu/script-fu-scripts.c (script_fu_error_msg):
	use siod-wrapper.c siod_get_error_msg() instead of accessing
	siod's global siod_err_msg variable directly.
This commit is contained in:
Michael Natterer 2003-11-26 17:14:58 +00:00 committed by Michael Natterer
parent e76a587d7e
commit 282d65bef2
19 changed files with 72 additions and 7696 deletions

View File

@ -1,3 +1,34 @@
2003-11-26 Michael Natterer <mitch@gimp.org>
* configure.in
* plug-ins/script-fu/siod/Makefile.am
* plug-ins/script-fu/siod/.cvsignore
* plug-ins/script-fu/siod/regex.c
* plug-ins/script-fu/siod/slib.c
* plug-ins/script-fu/siod/sliba.c
* plug-ins/script-fu/siod/trace.c
* plug-ins/script-fu/siod/siod.h
* plug-ins/script-fu/siod/siodp.h: added new directory for siod.
* plug-ins/script-fu/Makefile.am
* plug-ins/script-fu/interp_regex.c
* plug-ins/script-fu/interp_slib.c
* plug-ins/script-fu/interp_sliba.c
* plug-ins/script-fu/interp_trace.c
* plug-ins/script-fu/siod.h
* plug-ins/script-fu/siodp.h: removed siod from here.
* plug-ins/script-fu/script-fu-scripts.[ch]
* plug-ins/script-fu/script-fu.c
* plug-ins/script-fu/siod-wrapper.c
* tools/pdbgen/enumcode.pl: changed #includes accordingly.
* plug-ins/script-fu/script-fu-constants.c: regenerated.
* plug-ins/script-fu/script-fu-scripts.c (script_fu_error_msg):
use siod-wrapper.c siod_get_error_msg() instead of accessing
siod's global siod_err_msg variable directly.
2003-11-26 Sven Neumann <sven@gimp.org>
* libgimpthumb/Makefile.am

View File

@ -1400,6 +1400,7 @@ plug-ins/libgck/Makefile
plug-ins/libgck/gck/Makefile
plug-ins/dbbrowser/Makefile
plug-ins/script-fu/Makefile
plug-ins/script-fu/siod/Makefile
plug-ins/script-fu/scripts/Makefile
plug-ins/script-fu/scripts/images/Makefile
plug-ins/xjt/Makefile

View File

@ -6,17 +6,13 @@ endif
AM_LDFLAGS = $(mwindows)
SUBDIRS = scripts
SUBDIRS = siod scripts
libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = script-fu
script_fu_SOURCES = \
interp_regex.c \
interp_slib.c \
interp_sliba.c \
interp_trace.c \
script-fu.c \
script-fu-console.c \
script-fu-console.h \
@ -30,8 +26,6 @@ script_fu_SOURCES = \
script-fu-server.c \
script-fu-server.h \
script-fu-enums.h \
siod.h \
siodp.h \
siod-wrapper.c \
siod-wrapper.h
@ -53,6 +47,7 @@ LDADD = \
$(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
siod/libsiod.a \
$(GTK_LIBS) \
$(SOCKET_LIBS) \
$(INTLLIBS) \

View File

@ -1,190 +0,0 @@
#include "config.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef HAVE_GLIBC_REGEX
#include "regexrepl/regex.h"
#else
#include <regex.h>
#endif
#include "siod.h"
/* OSF/1 doc says that POSIX and XPG4 include regcomp in libc.
So we might as well set ourselves up to take advantage of it.
This functionality is also available in hpux, and is also provided
by the FSF's librx package, so if you can use that if your
operating system vendor doesn't supply it.
*/
static void
init_regex_version (void)
{
setvar (cintern ("*regex-version*"),
cintern ("$Id$"),
NIL);
}
long tc_regex = 0;
struct tc_regex
{
int compflag;
size_t nmatch;
regex_t *r;
regmatch_t *m;
};
struct tc_regex *
get_tc_regex (LISP ptr)
{
if NTYPEP
(ptr, tc_regex) my_err ("not a regular expression", ptr);
return ((struct tc_regex *) ptr->storage_as.string.data);
}
LISP
regcomp_l (LISP pattern, LISP flags)
{
long iflag, iflags;
char *str, errbuff[1024];
int error;
LISP result;
struct tc_regex *h;
iflags = NNULLP (flags) ? get_c_long (flags) : 0;
str = get_c_string (pattern);
iflag = no_interrupt (1);
result = cons (NIL, NIL);
h = (struct tc_regex *) must_malloc (sizeof (struct tc_regex));
h->compflag = 0;
h->nmatch = 0;
h->r = NULL;
h->m = NULL;
result->type = tc_regex;
result->storage_as.string.data = (char *) h;
h->r = (regex_t *) must_malloc (sizeof (regex_t));
if ((error = regcomp (h->r, str, iflags)))
{
regerror (error, h->r, errbuff, sizeof (errbuff));
return (my_err (errbuff, pattern));
}
h->compflag = 1;
if (iflags & REG_NOSUB)
{
no_interrupt (iflag);
return (result);
}
h->nmatch = h->r->re_nsub + 1;
h->m = (regmatch_t *) must_malloc (sizeof (regmatch_t) * h->nmatch);
no_interrupt (iflag);
return (result);
}
LISP
regerror_l (LISP code, LISP ptr)
{
char errbuff[1024];
regerror (get_c_long (code), get_tc_regex (ptr)->r, errbuff, sizeof (errbuff));
return (strcons (strlen (errbuff), errbuff));
}
LISP
regexec_l (LISP ptr, LISP str, LISP eflags)
{
size_t j;
int error;
LISP result;
struct tc_regex *h;
h = get_tc_regex (ptr);
if ((error = regexec (h->r,
get_c_string (str),
h->nmatch,
h->m,
NNULLP (eflags) ? get_c_long (eflags) : 0)))
return (flocons (error));
for (j = 0, result = NIL; j < h->nmatch; ++j)
result = cons (cons (flocons (h->m[j].rm_so),
flocons (h->m[j].rm_eo)),
result);
return (nreverse (result));
}
void
regex_gc_free (LISP ptr)
{
struct tc_regex *h;
if ((h = (struct tc_regex *) ptr->storage_as.string.data))
{
if ((h->compflag) && h->r)
regfree (h->r);
if (h->r)
{
free (h->r);
h->r = NULL;
}
if (h->m)
{
free (h->m);
h->m = NULL;
}
free (h);
ptr->storage_as.string.data = NULL;
}
}
void
regex_prin1 (LISP ptr, struct gen_printio *f)
{
char buffer[256];
regex_t *p;
p = get_tc_regex (ptr)->r;
sprintf (buffer, "#<REGEX %p nsub=%d",
p, (int) p->re_nsub);
gput_st (f, buffer);
gput_st (f, ">");
}
void
init_regex (void)
{
long j;
tc_regex = allocate_user_tc ();
set_gc_hooks (tc_regex,
NULL,
NULL,
NULL,
regex_gc_free,
&j);
set_print_hooks (tc_regex, regex_prin1);
init_subr_2 ("regcomp", regcomp_l);
init_subr_2 ("regerror", regerror_l);
init_subr_3 ("regexec", regexec_l);
setvar (cintern ("REG_EXTENDED"), flocons (REG_EXTENDED), NIL);
setvar (cintern ("REG_ICASE"), flocons (REG_ICASE), NIL);
setvar (cintern ("REG_NOSUB"), flocons (REG_NOSUB), NIL);
setvar (cintern ("REG_NEWLINE"), flocons (REG_NEWLINE), NIL);
setvar (cintern ("REG_NOTBOL"), flocons (REG_NOTBOL), NIL);
setvar (cintern ("REG_NOTEOL"), flocons (REG_NOTEOL), NIL);
setvar (cintern ("REG_NOMATCH"), flocons (REG_NOMATCH), NIL);
setvar (cintern ("REG_BADPAT"), flocons (REG_BADPAT), NIL);
setvar (cintern ("REG_ECOLLATE"), flocons (REG_ECOLLATE), NIL);
setvar (cintern ("REG_ECTYPE"), flocons (REG_ECTYPE), NIL);
setvar (cintern ("REG_EESCAPE"), flocons (REG_EESCAPE), NIL);
setvar (cintern ("REG_ESUBREG"), flocons (REG_ESUBREG), NIL);
setvar (cintern ("REG_EBRACK"), flocons (REG_EBRACK), NIL);
setvar (cintern ("REG_EPAREN"), flocons (REG_EPAREN), NIL);
setvar (cintern ("REG_EBRACE"), flocons (REG_EBRACE), NIL);
setvar (cintern ("REG_BADBR"), flocons (REG_BADBR), NIL);
setvar (cintern ("REG_ERANGE"), flocons (REG_ERANGE), NIL);
setvar (cintern ("REG_ESPACE"), flocons (REG_ESPACE), NIL);
setvar (cintern ("REG_BADRPT"), flocons (REG_BADRPT), NIL);
#ifdef REG_ECHAR
setvar (cintern ("REG_ECHAR"), flocons (REG_ECHAR), NIL);
#endif
init_regex_version ();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,192 +0,0 @@
/* COPYRIGHT (c) 1992-1994 BY
* MITECH CORPORATION, ACTON, MASSACHUSETTS.
* See the source file SLIB.C for more information.
(trace procedure1 procedure2 ...)
(untrace procedure1 procedure2 ...)
Currently only user-defined procedures can be traced.
Fancy printing features such as indentation based on
recursion level will also have to wait for a future version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include "siod.h"
#include "siodp.h"
static void
init_trace_version (void)
{
setvar (cintern ("*trace-version*"),
cintern ("$Id$"),
NIL);
}
static long tc_closure_traced = 0;
static LISP sym_traced = NIL;
static LISP sym_quote = NIL;
static LISP sym_begin = NIL;
LISP ltrace_fcn_name (LISP body);
LISP ltrace_1 (LISP fcn_name, LISP env);
LISP ltrace (LISP fcn_names, LISP env);
LISP luntrace_1 (LISP fcn);
LISP luntrace (LISP fcns);
static void ct_gc_scan (LISP ptr);
static LISP ct_gc_mark (LISP ptr);
void ct_prin1 (LISP ptr, struct gen_printio *f);
LISP ct_eval (LISP ct, LISP * px, LISP * penv);
LISP
ltrace_fcn_name (LISP body)
{
LISP tmp;
if NCONSP
(body) return (NIL);
if NEQ
(CAR (body), sym_begin) return (NIL);
tmp = CDR (body);
if NCONSP
(tmp) return (NIL);
tmp = CAR (tmp);
if NCONSP
(tmp) return (NIL);
if NEQ
(CAR (tmp), sym_quote) return (NIL);
tmp = CDR (tmp);
if NCONSP
(tmp) return (NIL);
return (CAR (tmp));
}
LISP
ltrace_1 (LISP fcn_name, LISP env)
{
LISP fcn, code;
fcn = leval (fcn_name, env);
if (TYPE (fcn) == tc_closure)
{
code = fcn->storage_as.closure.code;
if NULLP
(ltrace_fcn_name (cdr (code)))
setcdr (code, cons (sym_begin,
cons (cons (sym_quote, cons (fcn_name, NIL)),
cons (cdr (code), NIL))));
fcn->type = tc_closure_traced;
}
else if (TYPE (fcn) == tc_closure_traced)
;
else
my_err ("not a closure, cannot trace", fcn);
return (NIL);
}
LISP
ltrace (LISP fcn_names, LISP env)
{
LISP l;
for (l = fcn_names; NNULLP (l); l = cdr (l))
ltrace_1 (car (l), env);
return (NIL);
}
LISP
luntrace_1 (LISP fcn)
{
if (TYPE (fcn) == tc_closure)
;
else if (TYPE (fcn) == tc_closure_traced)
fcn->type = tc_closure;
else
my_err ("not a closure, cannot untrace", fcn);
return (NIL);
}
LISP
luntrace (LISP fcns)
{
LISP l;
for (l = fcns; NNULLP (l); l = cdr (l))
luntrace_1 (car (l));
return (NIL);
}
static void
ct_gc_scan (LISP ptr)
{
CAR (ptr) = gc_relocate (CAR (ptr));
CDR (ptr) = gc_relocate (CDR (ptr));
}
static LISP
ct_gc_mark (LISP ptr)
{
gc_mark (ptr->storage_as.closure.code);
return (ptr->storage_as.closure.env);
}
void
ct_prin1 (LISP ptr, struct gen_printio *f)
{
gput_st (f, "#<CLOSURE(TRACED) ");
lprin1g (car (ptr->storage_as.closure.code), f);
gput_st (f, " ");
lprin1g (cdr (ptr->storage_as.closure.code), f);
gput_st (f, ">");
}
LISP
ct_eval (LISP ct, LISP * px, LISP * penv)
{
LISP fcn_name, args, env, result, l;
fcn_name = ltrace_fcn_name (cdr (ct->storage_as.closure.code));
args = leval_args (CDR (*px), *penv);
fput_st (stdout, "->");
lprin1f (fcn_name, stdout);
for (l = args; NNULLP (l); l = cdr (l))
{
fput_st (stdout, " ");
lprin1f (car (l), stdout);
}
fput_st (stdout, "\n");
env = extend_env (args,
car (ct->storage_as.closure.code),
ct->storage_as.closure.env);
result = leval (cdr (ct->storage_as.closure.code), env);
fput_st (stdout, "<-");
lprin1f (fcn_name, stdout);
fput_st (stdout, " ");
lprin1f (result, stdout);
fput_st (stdout, "\n");
*px = result;
return (NIL);
}
void
init_trace (void)
{
long j;
tc_closure_traced = allocate_user_tc ();
set_gc_hooks (tc_closure_traced,
NULL,
ct_gc_mark,
ct_gc_scan,
NULL,
&j);
gc_protect_sym (&sym_traced, "*traced*");
setvar (sym_traced, NIL, NIL);
gc_protect_sym (&sym_begin, "begin");
gc_protect_sym (&sym_quote, "quote");
set_print_hooks (tc_closure_traced, ct_prin1);
set_eval_hooks (tc_closure_traced, ct_eval);
init_fsubr ("trace", ltrace);
init_lsubr ("untrace", luntrace);
init_trace_version ();
}

View File

@ -24,12 +24,13 @@
#include "libgimp/gimp.h"
#include "siod/siod.h"
#include "script-fu-constants.h"
#include "script-fu-enums.h"
#include "script-fu-scripts.h"
#include "script-fu-server.h"
#include "siod.h"
#include "siod-wrapper.h"

View File

@ -18,7 +18,7 @@
/* NOTE: This file is autogenerated by enumcode.pl. */
#include "siod.h"
#include "siod/siod.h"
void
init_generated_constants (void)

View File

@ -37,8 +37,10 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "siod.h"
#include "siod/siod.h"
#include "script-fu-scripts.h"
#include "siod-wrapper.h"
#include "script-fu-intl.h"
@ -210,7 +212,6 @@ static GTree *script_list = NULL;
static SFInterface *sf_interface = NULL; /* there can only be at most one
interactive interface */
extern gchar siod_err_msg[];
/*
* Function definitions
@ -1993,5 +1994,5 @@ static void
script_fu_error_msg (const gchar *command)
{
g_message (_("Error while executing\n%s\n%s"),
command, siod_err_msg);
command, siod_get_error_msg ());
}

View File

@ -37,8 +37,10 @@
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "siod.h"
#include "siod/siod.h"
#include "script-fu-scripts.h"
#include "siod-wrapper.h"
#include "script-fu-intl.h"
@ -210,7 +212,6 @@ static GTree *script_list = NULL;
static SFInterface *sf_interface = NULL; /* there can only be at most one
interactive interface */
extern gchar siod_err_msg[];
/*
* Function definitions
@ -1993,5 +1994,5 @@ static void
script_fu_error_msg (const gchar *command)
{
g_message (_("Error while executing\n%s\n%s"),
command, siod_err_msg);
command, siod_get_error_msg ());
}

View File

@ -20,7 +20,6 @@
#define __SCRIPT_FU_SCRIPTS_H__
#include "script-fu-enums.h"
#include "siod.h"
void script_fu_find_scripts (void);
LISP script_fu_add_script (LISP a);

View File

@ -28,6 +28,8 @@
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include "siod/siod.h"
#include "siod-wrapper.h"
#include "script-fu-console.h"
#include "script-fu-constants.h"

View File

@ -24,12 +24,13 @@
#include "libgimp/gimp.h"
#include "siod/siod.h"
#include "script-fu-constants.h"
#include "script-fu-enums.h"
#include "script-fu-scripts.h"
#include "script-fu-server.h"
#include "siod.h"
#include "siod-wrapper.h"

View File

@ -1,424 +0,0 @@
/* Scheme In One Defun, but in C this time.
* COPYRIGHT (c) 1988-1994 BY *
* PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS. *
* See the source file SLIB.C for more information. *
$Id$
*/
#ifndef __SIOD_H__
#define __SIOD_H__
#include <stdio.h>
struct obj
{
short gc_mark;
short type;
union
{
struct
{
struct obj *car;
struct obj *cdr;
}
cons;
struct
{
double data;
}
flonum;
struct
{
char *pname;
struct obj *vcell;
}
symbol;
struct
{
char *name;
struct obj *(*f) (void);
}
subr0;
struct
{
char *name;
struct obj *(*f) (struct obj *);
}
subr1;
struct
{
char *name;
struct obj *(*f) (struct obj *, struct obj *);
}
subr2;
struct
{
char *name;
struct obj *(*f) (struct obj *, struct obj *, struct obj *);
}
subr3;
struct
{
char *name;
struct obj *(*f) (struct obj *, struct obj *, struct obj *,
struct obj *);
}
subr4;
struct
{
char *name;
struct obj *(*f) (struct obj *, struct obj *, struct obj *,
struct obj *, struct obj *);
}
subr5;
struct
{
char *name;
struct obj *(*f) (struct obj **, struct obj **);
}
subrm;
struct
{
char *name;
struct obj *(*f) (void *,...);
}
subr;
struct
{
struct obj *env;
struct obj *code;
}
closure;
struct
{
long dim;
long *data;
}
long_array;
struct
{
long dim;
double *data;
}
double_array;
struct
{
long dim;
char *data;
}
string;
struct
{
long dim;
struct obj **data;
}
lisp_array;
struct
{
FILE *f;
char *name;
}
c_file;
}
storage_as;
};
#define CAR(x) ((*x).storage_as.cons.car)
#define CDR(x) ((*x).storage_as.cons.cdr)
#define PNAME(x) ((*x).storage_as.symbol.pname)
#define VCELL(x) ((*x).storage_as.symbol.vcell)
#define SUBR0(x) (*((*x).storage_as.subr0.f))
#define SUBR1(x) (*((*x).storage_as.subr1.f))
#define SUBR2(x) (*((*x).storage_as.subr2.f))
#define SUBR3(x) (*((*x).storage_as.subr3.f))
#define SUBR4(x) (*((*x).storage_as.subr4.f))
#define SUBR5(x) (*((*x).storage_as.subr5.f))
#define SUBRM(x) (*((*x).storage_as.subrm.f))
#define SUBRF(x) (*((*x).storage_as.subr.f))
#define FLONM(x) ((*x).storage_as.flonum.data)
#define NIL ((struct obj *) 0)
#define EQ(x,y) ((x) == (y))
#define NEQ(x,y) ((x) != (y))
#define NULLP(x) EQ(x,NIL)
#define NNULLP(x) NEQ(x,NIL)
#define TYPE(x) (((x) == NIL) ? 0 : ((*(x)).type))
#define TYPEP(x,y) (TYPE(x) == (y))
#define NTYPEP(x,y) (TYPE(x) != (y))
#define tc_nil 0
#define tc_cons 1
#define tc_flonum 2
#define tc_symbol 3
#define tc_subr_0 4
#define tc_subr_1 5
#define tc_subr_2 6
#define tc_subr_3 7
#define tc_lsubr 8
#define tc_fsubr 9
#define tc_msubr 10
#define tc_closure 11
#define tc_free_cell 12
#define tc_string 13
#define tc_double_array 14
#define tc_long_array 15
#define tc_lisp_array 16
#define tc_c_file 17
#define tc_byte_array 18
#define tc_subr_4 19
#define tc_subr_5 20
#define tc_subr_2n 21
#define FO_comment 35
#define tc_user_min 50
#define tc_user_max 100
#define FO_fetch 127
#define FO_store 126
#define FO_list 125
#define FO_listd 124
#define tc_table_dim 100
typedef struct obj *LISP;
typedef LISP (*SUBR_FUNC) (void);
#define CONSP(x) TYPEP(x,tc_cons)
#define FLONUMP(x) TYPEP(x,tc_flonum)
#define SYMBOLP(x) TYPEP(x,tc_symbol)
#define NCONSP(x) NTYPEP(x,tc_cons)
#define NFLONUMP(x) NTYPEP(x,tc_flonum)
#define NSYMBOLP(x) NTYPEP(x,tc_symbol)
#define TKBUFFERN 5120
struct gen_readio
{
int (*getc_fcn) (void *);
void (*ungetc_fcn) (int, void *);
void *cb_argument;
};
struct gen_printio
{
int (*putc_fcn) (int, void *);
int (*puts_fcn) (char *, void *);
void *cb_argument;
};
#define GETC_FCN(x) (*((*x).getc_fcn))((*x).cb_argument)
#define UNGETC_FCN(c,x) (*((*x).ungetc_fcn))(c,(*x).cb_argument)
#define PUTC_FCN(c,x) (*((*x).putc_fcn))(c,(*x).cb_argument)
#define PUTS_FCN(c,x) (*((*x).puts_fcn))(c,(*x).cb_argument)
struct repl_hooks
{
void (*repl_puts) (char *);
LISP (*repl_read) (void);
LISP (*repl_eval) (LISP);
void (*repl_print) (LISP);
};
void process_cla (int argc, char **argv, int warnflag);
void print_welcome (void);
void print_hs_1 (void);
void print_hs_2 (void);
long no_interrupt (long n);
LISP get_eof_val (void);
long repl_driver (long want_sigint, long want_init, struct repl_hooks *);
void set_repl_hooks (void (*puts_f) (char *),
LISP (*read_f) (void),
LISP (*eval_f) (LISP),
void (*print_f) (LISP));
long repl (struct repl_hooks *);
LISP my_err (char *message, LISP x);
LISP errswitch (void);
char *get_c_string (LISP x);
char *get_c_string_dim (LISP x, long *);
char *try_get_c_string (LISP x);
long get_c_long (LISP x);
double get_c_double (LISP x);
LISP lerr (LISP message, LISP x);
LISP newcell (long type);
LISP cons (LISP x, LISP y);
LISP consp (LISP x);
LISP car (LISP x);
LISP cdr (LISP x);
LISP setcar (LISP cell, LISP value);
LISP setcdr (LISP cell, LISP value);
LISP flocons (double x);
LISP numberp (LISP x);
LISP plus (LISP x, LISP y);
LISP ltimes (LISP x, LISP y);
LISP difference (LISP x, LISP y);
LISP Quotient (LISP x, LISP y);
LISP greaterp (LISP x, LISP y);
LISP lessp (LISP x, LISP y);
LISP eq (LISP x, LISP y);
LISP eql (LISP x, LISP y);
LISP symcons (char *pname, LISP vcell);
LISP symbolp (LISP x);
LISP symbol_boundp (LISP x, LISP env);
LISP symbol_value (LISP x, LISP env);
LISP cintern (char *name);
LISP rintern (char *name);
LISP subrcons (long type, char *name, SUBR_FUNC f);
LISP closure (LISP env, LISP code);
void gc_protect (LISP * location);
void gc_protect_n (LISP * location, long n);
void gc_protect_sym (LISP * location, char *st);
void gc_unprotect (LISP * location);
void init_storage (void);
void init_slibu (void);
void init_subr (char *name, long type, SUBR_FUNC fcn);
void init_subr_0 (char *name, LISP (*fcn) (void));
void init_subr_1 (char *name, LISP (*fcn) (LISP));
void init_subr_2 (char *name, LISP (*fcn) (LISP, LISP));
void init_subr_2n (char *name, LISP (*fcn) (LISP, LISP));
void init_subr_3 (char *name, LISP (*fcn) (LISP, LISP, LISP));
void init_subr_4 (char *name, LISP (*fcn) (LISP, LISP, LISP, LISP));
void init_subr_5 (char *name, LISP (*fcn) (LISP, LISP, LISP, LISP, LISP));
void init_lsubr (char *name, LISP (*fcn) (LISP));
void init_fsubr (char *name, LISP (*fcn) (LISP, LISP));
void init_msubr (char *name, LISP (*fcn) (LISP *, LISP *));
LISP assq (LISP x, LISP alist);
LISP delq (LISP elem, LISP l);
void set_gc_hooks (long type,
LISP (*rel) (LISP),
LISP (*mark) (LISP),
void (*scan) (LISP),
void (*free) (LISP),
long *kind);
LISP gc_relocate (LISP x);
LISP user_gc (LISP args);
LISP gc_status (LISP args);
void set_eval_hooks (long type, LISP (*fcn) (LISP, LISP *, LISP *));
LISP leval (LISP x, LISP env);
LISP symbolconc (LISP args);
void set_print_hooks (long type, void (*fcn) (LISP, struct gen_printio *));
LISP lprin1g (LISP exp, struct gen_printio *f);
LISP lprin1f (LISP exp, FILE * f);
LISP lprint (LISP exp, LISP);
LISP lread (LISP);
LISP lreadtk (char *, long j);
LISP lreadf (FILE * f);
void set_read_hooks (char *all_set, char *end_set,
LISP (*fcn1) (int, struct gen_readio *),
LISP (*fcn2) (char *, long, int *));
LISP apropos (LISP);
LISP vload (char *fname, long cflag, long rflag);
LISP load (LISP fname, LISP cflag, LISP rflag);
LISP require (LISP fname);
LISP save_forms (LISP fname, LISP forms, LISP how);
LISP quit (void);
LISP nullp (LISP x);
LISP strcons (long length, char *data);
LISP read_from_string (LISP x);
LISP aref1 (LISP a, LISP i);
LISP aset1 (LISP a, LISP i, LISP v);
LISP cons_array (LISP dim, LISP kind);
LISP arcons (long typecode, long n, long initp);
LISP string_append (LISP args);
LISP string_length (LISP string);
LISP string_search (LISP, LISP);
LISP substring (LISP, LISP, LISP);
LISP string_trim (LISP);
LISP string_trim_left (LISP);
LISP string_trim_right (LISP);
LISP string_upcase (LISP);
LISP string_downcase (LISP);
void init_subrs (void);
LISP copy_list (LISP);
long c_sxhash (LISP, long);
LISP sxhash (LISP, LISP);
LISP href (LISP, LISP);
LISP hset (LISP, LISP, LISP);
LISP fast_print (LISP, LISP);
LISP fast_read (LISP);
LISP equal (LISP, LISP);
LISP assoc (LISP x, LISP alist);
LISP make_list (LISP x, LISP v);
void set_fatal_exit_hook (void (*fcn) (void));
LISP parse_number (LISP x);
LISP intern (LISP x);
void init_trace (void);
long repl_c_string (char *, long want_sigint, long want_init, long want_print);
char *siod_version (void);
LISP nreverse (LISP);
LISP number2string (LISP, LISP, LISP, LISP);
LISP string2number (LISP, LISP);
LISP siod_verbose (LISP);
int siod_verbose_check (int);
LISP setvar (LISP, LISP, LISP);
long allocate_user_tc (void);
LISP cadr (LISP);
LISP caar (LISP);
LISP cddr (LISP);
LISP caaar (LISP);
LISP caadr (LISP);
LISP cadar (LISP);
LISP caddr (LISP);
LISP cdaar (LISP);
LISP cdadr (LISP);
LISP cddar (LISP);
LISP cdddr (LISP);
void chk_string (LISP, char **, long *);
LISP a_true_value (void);
LISP lapply (LISP fcn, LISP args);
LISP mallocl (void *lplace, long size);
void gput_st (struct gen_printio *, char *);
void put_st (char *st);
LISP listn (long n,...);
char *must_malloc (unsigned long size);
LISP lstrbreakup (LISP str, LISP lmarker);
LISP lstrunbreakup (LISP elems, LISP lmarker);
LISP nconc (LISP, LISP);
LISP poparg (LISP *, LISP);
FILE *get_c_file (LISP p, FILE * deflt);
char *last_c_errmsg (int);
LISP llast_c_errmsg (int);
#define SAFE_STRCPY(_to,_from) safe_strcpy((_to),sizeof(_to),(_from))
#define SAFE_STRCAT(_to,_from) safe_strcat((_to),sizeof(_to),(_from))
#define SAFE_STRLEN(_buff) safe_strlen((_buff),sizeof(_buff))
char *safe_strcpy (char *s1, size_t size1, const char *s2);
char *safe_strcat (char *s1, size_t size1, const char *s2);
size_t safe_strlen (const char *s, size_t size);
LISP memq (LISP x, LISP il);
LISP lstrbreakup (LISP, LISP);
LISP lstrbreakup (LISP, LISP);
LISP nth (LISP, LISP);
LISP butlast (LISP);
LISP last (LISP);
LISP readtl (struct gen_readio *f);
LISP funcall1 (LISP, LISP);
LISP funcall2 (LISP, LISP, LISP);
LISP apply1 (LISP, LISP, LISP);
LISP lgetc (LISP p);
LISP lungetc (LISP i, LISP p);
LISP lputc (LISP c, LISP p);
LISP lputs (LISP str, LISP p);
int assemble_options (LISP,...);
LISP ccall_catch (LISP tag, LISP (*fcn) (void *), void *);
LISP lref_default (LISP li, LISP x, LISP fcn);
LISP symalist (char *item,...);
LISP encode_st_mode (LISP l);
LISP encode_open_flags (LISP l);
#endif /* __SIOD_H__ */

View File

@ -0,0 +1,6 @@
Makefile.in
Makefile
.deps
_libs
.libs
libsiod.a

View File

@ -0,0 +1,16 @@
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libsiod.a
libsiod_a_SOURCES = \
regex.c \
slib.c \
sliba.c \
trace.c \
siod.h \
siodp.h
INCLUDES = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
-I$(includedir)

View File

@ -1,203 +0,0 @@
/* Scheme In One Defun, but in C this time.
* COPYRIGHT (c) 1988-1992 BY *
* PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS. *
* See the source file SLIB.C for more information. *
Declarations which are private to SLIB.C internals.
However, some of these should be moved to siod.h
$Id$
*/
extern char *tkbuffer;
extern LISP heap, heap_end, heap_org;
extern LISP sym_t;
extern long siod_verbose_level;
extern char *siod_lib;
struct user_type_hooks
{
LISP (*gc_relocate) (LISP);
void (*gc_scan) (LISP);
LISP (*gc_mark) (LISP);
void (*gc_free) (LISP);
void (*prin1) (LISP, struct gen_printio *);
LISP (*leval) (LISP, LISP *, LISP *);
long (*c_sxhash) (LISP, long);
LISP (*fast_print) (LISP, LISP);
LISP (*fast_read) (int, LISP);
LISP (*equal) (LISP, LISP);
};
struct catch_frame
{
LISP tag;
LISP retval;
jmp_buf cframe;
struct catch_frame *next;
};
extern struct catch_frame *catch_framep;
struct gc_protected
{
LISP *location;
long length;
struct gc_protected *next;
};
#define NEWCELL(_into,_type) \
{if (gc_kind_copying == 1) \
{if ((_into = heap) >= heap_end) \
gc_fatal_error(); \
heap = _into+1;} \
else \
{if NULLP(freelist) \
gc_for_newcell(); \
_into = freelist; \
freelist = CDR(freelist); \
++gc_cells_allocated;} \
(*_into).gc_mark = 0; \
(*_into).type = (short) _type;}
#ifdef THINK_C
extern int ipoll_counter;
void full_interrupt_poll (int *counter);
#define INTERRUPT_CHECK() if (--ipoll_counter < 0) full_interrupt_poll(&ipoll_counter)
#else
#define INTERRUPT_CHECK()
#endif
extern char *stack_limit_ptr;
#define STACK_LIMIT(_ptr,_amt) (((char *)_ptr) - (_amt))
#define STACK_CHECK(_ptr) \
if (((char *) (_ptr)) < stack_limit_ptr) err_stack((char *) _ptr);
void err_stack (char *);
#if defined(VMS) && defined(VAX)
#define SIG_restargs ,...
#else
#define SIG_restargs
#endif
void handle_sigfpe (int sig SIG_restargs);
void handle_sigint (int sig SIG_restargs);
void err_ctrl_c (void);
double myruntime (void);
void fput_st (FILE * f, char *st);
void put_st (char *st);
void grepl_puts (char *, void (*)(char *));
void gc_fatal_error (void);
LISP gen_intern (char *name, long copyp);
void scan_registers (void);
void init_storage_1 (void);
struct user_type_hooks *get_user_type_hooks (long type);
LISP get_newspace (void);
void scan_newspace (LISP newspace);
void free_oldspace (LISP space, LISP end);
void gc_stop_and_copy (void);
void gc_for_newcell (void);
void gc_mark_and_sweep (void);
void gc_ms_stats_start (void);
void gc_ms_stats_end (void);
void gc_mark (LISP ptr);
void mark_protected_registers (void);
void mark_locations (LISP * start, LISP * end);
void mark_locations_array (LISP * x, long n);
void gc_sweep (void);
LISP leval_args (LISP l, LISP env);
LISP extend_env (LISP actuals, LISP formals, LISP env);
LISP envlookup (LISP var, LISP env);
LISP setvar (LISP var, LISP val, LISP env);
LISP leval_setq (LISP args, LISP env);
LISP syntax_define (LISP args);
LISP leval_define (LISP args, LISP env);
LISP leval_if (LISP * pform, LISP * penv);
LISP leval_lambda (LISP args, LISP env);
LISP leval_progn (LISP * pform, LISP * penv);
LISP leval_or (LISP * pform, LISP * penv);
LISP leval_and (LISP * pform, LISP * penv);
LISP leval_catch_1 (LISP forms, LISP env);
LISP leval_catch (LISP args, LISP env);
LISP lthrow (LISP tag, LISP value);
LISP leval_let (LISP * pform, LISP * penv);
LISP reverse (LISP l);
LISP let_macro (LISP form);
LISP leval_quote (LISP args, LISP env);
LISP leval_tenv (LISP args, LISP env);
int flush_ws (struct gen_readio *f, char *eoferr);
int f_getc (FILE * f);
void f_ungetc (int c, FILE * f);
LISP lreadr (struct gen_readio *f);
LISP lreadparen (struct gen_readio *f);
LISP arglchk (LISP x);
void init_storage_a1 (long type);
void init_storage_a (void);
LISP array_gc_relocate (LISP ptr);
void array_gc_scan (LISP ptr);
LISP array_gc_mark (LISP ptr);
void array_gc_free (LISP ptr);
void array_prin1 (LISP ptr, struct gen_printio *f);
long array_sxhaxh (LISP, long);
LISP array_fast_print (LISP, LISP);
LISP array_fast_read (int, LISP);
LISP array_equal (LISP, LISP);
long array_sxhash (LISP, long);
int rfs_getc (unsigned char **p);
void rfs_ungetc (unsigned char c, unsigned char **p);
void err1_aset1 (LISP i);
void err2_aset1 (LISP v);
LISP lreadstring (struct gen_readio *f);
LISP lreadsharp (struct gen_readio *f);
void file_gc_free (LISP ptr);
void file_prin1 (LISP ptr, struct gen_printio *f);
LISP fopen_c (char *name, char *how);
LISP fopen_cg (FILE * (*)(const char *, const char *), char *, char *);
LISP fopen_l (LISP name, LISP how);
LISP fclose_l (LISP p);
LISP lftell (LISP file);
LISP lfseek (LISP file, LISP offset, LISP direction);
LISP lfread (LISP size, LISP file);
LISP lfwrite (LISP string, LISP file);
LISP leval_while (LISP args, LISP env);
void init_subrs_a (void);
void init_subrs_1 (void);
long href_index (LISP table, LISP key);
void put_long (long, FILE *);
long get_long (FILE *);
long fast_print_table (LISP obj, LISP table);
LISP stack_limit (LISP, LISP);
void err0 (void);
void pr (LISP);
void prp (LISP *);
LISP closure_code (LISP exp);
LISP closure_env (LISP exp);
LISP lwhile (LISP form, LISP env);
long nlength (LISP obj);
LISP llength (LISP obj);
void gc_kind_check (void);
LISP allocate_aheap (void);
long looks_pointerp (LISP);
long nactive_heaps (void);
long freelist_length (void);
LISP gc_info (LISP);
LISP err_closure_code (LISP tmp);

View File

@ -59,7 +59,7 @@ print ENUMFILE <<'GPL';
GPL
print ENUMFILE <<CODE;
#include "siod.h"
#include "siod/siod.h"
void
init_generated_constants (void)