elk (3.0-10) unstable; urgency=low

* Updated debhelper build dependency to >>3.0.0.
  * Shared library handling:
    + Extended load.c:General_Load() to open shared libraries.
    + Makefiles now build shared libraries.
    + Stopped distributing .o files and replaced them with the .so shared
      libraries; built the Unix, X11, Xaw and Motif extensions.
    + The interpreter is no longer linked with -lgdbm, gdbm.so is instead.
  * Replaced standalone.o and module.o with their .a equivalents.
  * Made the 'debian/arch-config' sourcing errors non-fatal so that make
    distclean works in the src/ directory.
  * Changed SCM_DIR again, from /usr/share/elk/scm to /usr/share/elk, and
    ditto with OBJ_DIR, from /usr/lib/elk/obj to /usr/lib/elk.
  * Defaulted "garbage-collect-notify?" and "autoload-notify?" to #f.
 -- Samuel Hocevar <sam@zoy.org>  Tue,  1 Apr 2003 23:34:26 +0200


git-svn-id: svn://svn.zoy.org/elk/trunk@4 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-08-19 19:25:03 +00:00
parent d51c970c8d
commit 141bca2769
86 changed files with 509 additions and 209 deletions

View File

@ -59,7 +59,7 @@ Sun-4, SunOS 5.2 (Solaris 2.2)
A bug in Solaris 2.1 causes dlopen() to fail if more than
8 shared objects are loaded (which in turn causes the "load"
primitive of Elk to signal an error). This restriction doesn't
exit in newer versions of Solaris 2.
exist in newer versions of Solaris 2.
You can use the -v option of Elk to see the actual linker options
when an object file is loaded.

View File

@ -318,7 +318,7 @@ obj_ldflags=
# The linker flags used to link the interpreter.
ldflags='-rdynamic -lm -ldl -lelf -lgdbm'
ldflags='-rdynamic -lm -ldl -lelf'
# The lint flags.

View File

@ -18,11 +18,11 @@ $install_dir/bin/scheme /usr/bin/scheme
$install_dir/include/ /usr/include/elk/
$install_dir/runtime/scm/ /usr/share/elk/scm/
$install_dir/runtime/scm/ /usr/share/elk/
$install_dir/runtime/obj/ /usr/lib/elk/obj/
$install_dir/runtime/obj/ /usr/lib/elk/
$install_dir/lib/*.o /usr/lib/elk/*.o
$install_dir/lib/*.o /usr/lib/elk/*.{o,so}
$install_dir/lib/{linkscheme,makedl} /usr/bin/{linkscheme,makedl}

18
debian/changelog vendored
View File

@ -1,3 +1,21 @@
elk (3.0-10) unstable; urgency=low
* Updated debhelper build dependency to >>3.0.0.
* Shared library handling:
+ Extended load.c:General_Load() to open shared libraries.
+ Makefiles now build shared libraries.
+ Stopped distributing .o files and replaced them with the .so shared
libraries; built the Unix, X11, Xaw and Motif extensions.
+ The interpreter is no longer linked with -lgdbm, gdbm.so is instead.
* Replaced standalone.o and module.o with their .a equivalents.
* Made the 'debian/arch-config' sourcing errors non-fatal so that make
distclean works in the src/ directory.
* Changed SCM_DIR again, from /usr/share/elk/scm to /usr/share/elk, and
ditto with OBJ_DIR, from /usr/lib/elk/obj to /usr/lib/elk.
* Defaulted "garbage-collect-notify?" and "autoload-notify?" to #f.
-- Samuel Hocevar <sam@zoy.org> Tue, 1 Apr 2003 23:34:26 +0200
elk (3.0-9) unstable; urgency=low
* New maintainer.

7
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: elk
Section: devel
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
Build-Depends: debhelper (>> 2.0.0), libelfg0-dev, xlibs-dev, lesstif-dev, libgdbmg1-dev, libxaw7-dev
Build-Depends: debhelper (>> 3.0.0), libelfg0-dev, xlibs-dev, lesstif-dev, libgdbmg1-dev, libxaw7-dev
Standards-Version: 3.5.9.0
Package: elk
@ -17,6 +17,11 @@ Description: the Extension Language Kit, a Scheme implementation
language subsystem for applications written in C or C++.
.
Elk is also useful as a stand-alone Scheme implementation.
.
This package also contains several plugins shipped with Elk. They provide
hooks for Unix system calls, the X Window System, as well as the X Athena
Widgets and the Motif toolkits. Example scripts on how to use these plugins
are provided in the elkdoc package.
Package: elkdoc
Architecture: all

2
debian/elk.ini vendored
View File

@ -47,7 +47,7 @@
;;; the directory where any auxillary files to your Scheme
;;; implementation reside.
(define (implementation-vicinity) "/usr/share/elk/scm")
(define (implementation-vicinity) "/usr/share/elk")
;;; (library-vicinity) should be defined to be the pathname of the
;;; directory where files of Scheme library functions reside.

3
debian/rules vendored
View File

@ -54,7 +54,8 @@ install: build
mv $(CURDIR)/debian/elk/usr/bin/scheme \
$(CURDIR)/debian/elk/usr/bin/scheme-elk
install -m 755 debian/scheme-warning-elk $(CURDIR)/debian/elk/usr/bin/
install -m 644 debian/elk.ini $(CURDIR)/debian/elk/usr/share/elk/scm
install -m 644 debian/elk.ini $(CURDIR)/debian/elk/usr/share/elk
# dh_movefiles
# Build architecture-independent files here.

View File

@ -8,6 +8,6 @@ To do so, run (as root) the following command:
update-alternatives --install /usr/bin/scheme scheme /usr/bin/scheme-elk 20 \
--slave /usr/share/man/man1/scheme.1.gz scheme.1.gz /usr/share/man/man1/elk.1.gz
Press any key to continue."
Press ENTER to continue."
read foo

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../config/system ../config/site
Makefile.local: build ../config/system ../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -55,6 +55,7 @@ def_cachectl_h=undef
def_syms_begin_with=undef
def_ansi_cpp=undef
def_can_load_obj=undef
def_can_load_lib=undef
def_sigsegv_siginfo=undef
def_sigsegv_sigcontext=undef
def_sigsegv_arg4=undef
@ -168,7 +169,8 @@ case _$load_obj in
_ld) def_use_ld=define; def_can_load_obj=define;;
_rld) def_use_rld=define; def_can_load_obj=define;;
_shl) def_use_shl=define; def_can_load_obj=define;;
_dl) def_use_dlopen=define; def_can_load_obj=define;;
_dl) def_use_dlopen=define; def_can_load_obj=define
def_can_load_lib=define;;
_) ;;
*) echo Error in config file:
echo Invalid value for symbol load_obj: $load_obj; exit 1;;
@ -283,6 +285,7 @@ cat <<EOT >config.h
#$def_hp_shared_libs HPSHLIB
#$def_debug_dump DEBUG_DUMP
#$def_can_load_obj CAN_LOAD_OBJ
#$def_can_load_lib CAN_LOAD_LIB
#$def_use_ld USE_LD
#$def_use_rld USE_RLD
#$def_use_shl USE_SHL
@ -321,8 +324,8 @@ $def_bcopy
$def_bzero
$def_bcmp
#define AOUT_H $aout_h
#define SCM_DIR "$final_dir/share/elk/scm"
#define OBJ_DIR "$final_dir/lib/elk/obj"
#define SCM_DIR "$final_dir/share/elk"
#define OBJ_DIR "$final_dir/lib/elk"
#define HEAP_SIZE $default_heap_size
#define FIND_AOUT defined(USE_LD) || defined(CAN_DUMP)\\
|| defined(INIT_OBJECTS)

View File

@ -3,7 +3,7 @@
*/
typedef struct {
unsigned long data;
unsigned long int data;
int tag;
} Object;
@ -22,8 +22,8 @@ typedef struct {
#define CHAR(x) ((int)(x).data)
#define POINTER(x) ((x).data)
#define SETPOINTER(x,p) ((x).data = (unsigned long)(p))
#define SET(x,t,p) ((x).tag = (int)t << 1, (x).data = (unsigned long)(p))
#define SETPOINTER(x,p) ((x).data = (unsigned long int)(p))
#define SET(x,t,p) ((x).tag = (int)t << 1, (x).data = (unsigned long int)(p))
#define ISCONST(x) ((x).tag & CONSTBIT)
#define SETCONST(x) ((x).tag |= CONSTBIT)
@ -37,10 +37,10 @@ typedef struct {
#ifdef GENERATIONAL_GC
typedef int gcspace_t; /* type used for space and type arrays */
typedef unsigned long gcptr_t; /* type used for pointers */
typedef unsigned long pageno_t; /* type used for page numbers */
typedef unsigned long addrarith_t; /* type used for address arithmetic */
typedef int gcspace_t; /* type for space and type arrays */
typedef unsigned long int gcptr_t; /* type for pointers */
typedef unsigned long int pageno_t; /* type for page numbers */
typedef unsigned long int addrarith_t; /* type for address arithmetic */
extern gcspace_t *space;
extern gcspace_t current_space;
@ -118,8 +118,8 @@ typedef unsigned short gran_t; /* Granularity of bignums */
struct S_Bignum {
Object minusp;
unsigned size; /* Number of ushorts allocated */
unsigned usize; /* Number of ushorts actually used */
unsigned int size; /* Number of ushorts allocated */
unsigned int usize; /* Number of ushorts actually used */
gran_t data[1]; /* Data, lsw first */
};
@ -189,8 +189,8 @@ typedef struct gcnode {
typedef struct mem_node {
struct mem_node *next;
unsigned len;
unsigned long refcnt;
unsigned int len;
unsigned long int refcnt;
} MEM_NODE;
#if defined(vax) || defined(__vax__)
@ -207,13 +207,13 @@ struct S_Control {
Object gcsave; /* vector */
WIND *firstwind, *lastwind;
int tailcall;
unsigned delta;
unsigned int delta;
#ifdef GENERATIONAL_GC
int reloc;
#endif
jmp_buf j;
int size;
unsigned long intrlevel;
unsigned long int intrlevel;
char stack[1]; /* must be word aligned */
};
@ -229,7 +229,7 @@ struct S_Port {
char unread;
int ptr;
FILE *file;
unsigned lno;
unsigned int lno;
int (*closefun) P_((FILE*));
};
#define P_OPEN 1 /* flags */
@ -285,7 +285,7 @@ typedef struct {
typedef struct sym {
struct sym *next;
char *name;
unsigned long value;
unsigned long int value;
} SYM;
typedef struct {
@ -322,7 +322,7 @@ typedef struct weak_node {
typedef struct {
char *name;
unsigned long val;
unsigned long int val;
} SYMDESCR;

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -522,5 +522,6 @@ elk_init_lib_bitstring() {
Def_Prim(P_Bitstring_Andnot, "bitstring-andnot!", 2, 2, EVAL);
Def_Prim(P_Bitstring_Xor, "bitstring-xor!", 2, 2, EVAL);
Def_Prim(P_Substring_Move, "bitstring-substring-move!", 5, 5, EVAL);
P_Provide (Intern ("bitstring.so"));
P_Provide (Intern ("bitstring.o"));
}

View File

@ -4,7 +4,7 @@
if [ _$gdbm = _yes ]; then
gdbm_c="gdbm.c"
gdbm_o="gdbm.o"
gdbm_rule="gdbm.o: \$(H) gdbm.c"
gdbm_so="gdbm.so"
else
gdbm_incl=
fi
@ -54,11 +54,21 @@ O= bitstring.o\\
regexp.o\\
struct.o $gdbm_o
SO= bitstring.so\\
debug.so\\
elk-eval.so\\
hack.so\\
monitor.so\\
newhandler.so\\
record.so\\
regexp.so\\
struct.so $gdbm_so
.c.o:
\$(CC) \$(CFLAGS) -I\$(INC) $gdbm_incl -c \$<
../../scripts/makedl \$@ \$@
all: \$(O)
all: \$(SO)
bitstring.o: \$(H) bitstring.c
debug.o: \$(H) debug.c
@ -69,9 +79,39 @@ newhandler.o: \$(H) newhandler.c
record.o: \$(H) record.c
regexp.o: \$(H) regexp.c
struct.o: \$(H) struct.c
$gdbm_rule
gdbm.o: \$(H) gdbm.c
install: \$(O)
bitstring.so: bitstring.o
ld -shared -o \$@ \$< -lc
debug.so: debug.o
ld -shared -o \$@ \$< -lc
elk-eval.so: elk-eval.o
ld -shared -o \$@ \$< -lc
hack.so: hack.o
ld -shared -o \$@ \$< -lc
monitor.so: monitor.o
ld -shared -o \$@ \$< -lc
newhandler.so: newhandler.o
ld -shared -o \$@ \$< -lc
record.so: record.o
ld -shared -o \$@ \$< -lc
regexp.so: regexp.o
ld -shared -o \$@ \$< -lc
struct.so: struct.o
ld -shared -o \$@ \$< -lc
gdbm.so: gdbm.o
ld -shared -o \$@ \$< -lgdbm -lc
install: \$(SO)
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -80,22 +120,18 @@ install: \$(O)
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
fi
@for i in \$(O) ;\\
@for i in \$(SO) ;\\
do \\
echo cp \$\$i $install_dir/lib/elk/obj; \\
cp \$\$i $install_dir/lib/elk/obj; \\
echo cp \$\$i $install_dir/lib/elk; \\
cp \$\$i $install_dir/lib/elk; \\
done
lint:
lint \$(LINTFLAGS) -I\$(INC) $gdbm_incl \$(C)
clean:
rm -f *.o core
rm -f *.so *.o core
distclean:
rm -f *.o core lint.out Makefile.local
rm -f *.so *.o core lint.out Makefile.local
EOT

View File

@ -1,12 +1,12 @@
/* The function
*
*
* char *Elk_Eval(char *expr);
*
*
* is similar to Tcl_Eval() in Tcl. It is called with a Scheme expression
* encoded as a C string and returns the result of evaluating the expression
* (as another C string), or a null pointer if an error has occured
* during evaluation.
*
*
* Elk_Eval() stores its result in a static buffer of fixed size; this
* can be improved easily by passing a buffer and a length as additional
* arguments.

View File

@ -220,7 +220,7 @@ Object P_Gdbm_Firstkey (fh) Object fh; {
Disable_Interrupts;
k = gdbm_firstkey (GDBM_FH(fh)->fptr);
Enable_Interrupts;
if (k.dptr == 0)
if (k.dptr == 0)
return False;
res = Make_String (k.dptr, k.dsize);
free (k.dptr);
@ -258,5 +258,6 @@ elk_init_lib_gdbm () {
T_Gdbm_fh = Define_Type (0, "gdbm-file", NOFUNC,
sizeof (struct S_gdbm_fh), Gdbm_fh_Equal, Gdbm_fh_Equal,
Gdbm_fh_Print, NOFUNC);
P_Provide (Intern ("gdbm.so"));
P_Provide (Intern ("gdbm.o"));
}

View File

@ -10,5 +10,6 @@ static Object P_Hack_Procedure_Environment (p, e) Object p, e; {
elk_init_lib_hack () {
Define_Primitive (P_Hack_Procedure_Environment,
"hack-procedure-environment!", 2, 2, EVAL);
P_Provide (Intern ("hack.so"));
P_Provide (Intern ("hack.o"));
}

View File

@ -131,5 +131,6 @@ elk_init_lib_record () {
Def_Prim (P_Record_Type, "record-type-descriptor", 1, 1, EVAL);
Def_Prim (P_Record_Values, "record-values", 1, 1, EVAL);
Def_Prim (P_Make_Record, "make-record", 2, 2, EVAL);
P_Provide (Intern ("record.so"));
P_Provide (Intern ("record.o"));
}

View File

@ -26,7 +26,7 @@ struct S_Match {
size_t num;
regmatch_t matches[1];
};
int T_Regexp, T_Match;
static SYMDESCR Compile_Syms[] = {
@ -218,5 +218,6 @@ elk_init_lib_regexp() {
Def_Prim(P_Match_End, "regexp-match-end", 2, 2, EVAL);
P_Provide(Intern(":regular-expressions"));
#endif
P_Provide(Intern ("regexp.so"));
P_Provide(Intern ("regexp.o"));
}

View File

@ -106,5 +106,6 @@ elk_init_lib_struct () {
Define_Primitive (P_Structure_Ref, "structure-ref", 3, 3, EVAL);
Define_Primitive (P_Structure_Set, "structure-set!", 4, 4, EVAL);
Define_Primitive (P_Make_Structure, "make-structure", 2, 2, EVAL);
P_Provide (Intern ("struct.so"));
P_Provide (Intern ("struct.o"));
}

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -55,7 +55,7 @@ O= error.o\\
unix.o\\
wait.o
all: \$(O) unix.pre
all: \$(O) unix.so
.c.o:
\$(CC) \$(CFLAGS) -I\$(INC) -c \$<
@ -77,7 +77,10 @@ wait.o: \$(H) wait.c
unix.pre: \$(O)
../../scripts/makedl \$@ \$(O)
install: unix.pre
unix.so: \$(O)
ld -shared -o \$@ \$(O) -lc
install: unix.so
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -86,11 +89,7 @@ install: unix.pre
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
fi
cp unix.pre $install_dir/lib/elk/obj/unix.o
cp unix.so $install_dir/lib/elk
-@if [ ! -d $install_dir/include ]; then \\
echo mkdir $install_dir/include; \\
mkdir $install_dir/include; \\
@ -109,8 +108,8 @@ lint:
lint \$(LINTFLAGS) -I\$(INC) \$(C)
clean:
rm -f *.o unix.pre core
rm -f *.so *.o unix.pre core
distclean:
rm -f *.o unix.pre core lint.out Makefile.local
rm -f *.so *.o unix.pre core lint.out Makefile.local
EOT

View File

@ -83,7 +83,7 @@ static Object P_Read_Directory(fn) Object fn; {
}
while ((dp = readdir(d)) != NULL) {
Object x;
x = Make_String(dp->d_name, strlen(dp->d_name));
ret = Cons(x, ret);
}

View File

@ -125,7 +125,7 @@ static Object P_End_Group() {
Enable_Interrupts;
return Void;
}
elk_init_unix_passwd() {
Def_Prim(P_Get_Passwd, "unix-get-passwd-vector-fill!", 1, 2, VARARGS);
Def_Prim(P_Rewind_Passwd, "unix-rewind-passwd", 0, 0, EVAL);

View File

@ -118,7 +118,7 @@ static Object P_Getenv(e) Object e; {
static Object P_Getlogin() {
extern char *getlogin();
char *s;
Disable_Interrupts;
s = getlogin();
Enable_Interrupts;

View File

@ -34,5 +34,6 @@ void Check_Result_Vector(x, len) Object x; {
}
elk_init_unix_unix() {
P_Provide(Intern("unix.so"));
P_Provide(Intern("unix.o"));
}

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -53,6 +53,30 @@ O= ascii.o\\
tree.o\\
viewport.o
SO= ascii.so\\
box.so\\
command.so\\
dialog.so\\
form.so\\
grip.so\\
label.so\\
list.so\\
menubutton.so\\
paned.so\\
panner.so\\
porthole.so\\
repeater.so\\
scrollbar.so\\
shell.so\\
simplemenu.so\\
sme.so\\
smebsb.so\\
smeline.so\\
stripchart.so\\
toggle.so\\
tree.so\\
viewport.so
WIDGET_SET= xaw
.SUFFIXES: .d .c .o
@ -69,7 +93,7 @@ WIDGET_SET= xaw
\$(CC) \$(CFLAGS) -I\$(INC) -I../xlib $x11_incl -c \$*.c
../../scripts/makedl \$@ \$@
all: \$(O)
all: \$(SO)
ascii.o: \$(H) ascii.d
box.o: \$(H) box.d
@ -95,7 +119,77 @@ toggle.o: \$(H) toggle.d
tree.o: \$(H) tree.d
viewport.o: \$(H) viewport.d
install: \$(O)
ascii.so: ascii.o
ld -shared -o \$@ \$< $libxaw -lc
box.so: box.o
ld -shared -o \$@ \$< $libxaw -lc
command.so: command.o
ld -shared -o \$@ \$< $libxaw -lc
dialog.so: dialog.o
ld -shared -o \$@ \$< $libxaw -lc
form.so: form.o
ld -shared -o \$@ \$< $libxaw -lc
grip.so: grip.o
ld -shared -o \$@ \$< $libxaw -lc
label.so: label.o
ld -shared -o \$@ \$< $libxaw -lc
list.so: list.o
ld -shared -o \$@ \$< $libxaw -lc
menubutton.so: menubutton.o
ld -shared -o \$@ \$< $libxaw -lc
paned.so: paned.o
ld -shared -o \$@ \$< $libxaw -lc
panner.so: panner.o
ld -shared -o \$@ \$< $libxaw -lc
porthole.so: porthole.o
ld -shared -o \$@ \$< $libxaw -lc
repeater.so: repeater.o
ld -shared -o \$@ \$< $libxaw -lc
scrollbar.so: scrollbar.o
ld -shared -o \$@ \$< $libxaw -lc
shell.so: shell.o
ld -shared -o \$@ \$< $libxaw -lc
simplemenu.so: simplemenu.o
ld -shared -o \$@ \$< $libxaw -lc
sme.so: sme.o
ld -shared -o \$@ \$< $libxaw -lc
smebsb.so: smebsb.o
ld -shared -o \$@ \$< $libxaw -lc
smeline.so: smeline.o
ld -shared -o \$@ \$< $libxaw -lc
stripchart.so: stripchart.o
ld -shared -o \$@ \$< $libxaw -lc
toggle.so: toggle.o
ld -shared -o \$@ \$< $libxaw -lc
tree.so: tree.o
ld -shared -o \$@ \$< $libxaw -lc
viewport.so: viewport.o
ld -shared -o \$@ \$< $libxaw -lc
install: \$(SO)
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -104,26 +198,22 @@ install: \$(O)
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
-@if [ ! -d $install_dir/lib/elk/xaw ]; then \\
echo mkdir $install_dir/lib/elk/xaw; \\
mkdir $install_dir/lib/elk/xaw; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj/xaw ]; then \\
echo mkdir $install_dir/lib/elk/obj/xaw; \\
mkdir $install_dir/lib/elk/obj/xaw; \\
fi
@for i in \$(O) ALIASES ;\\
@for i in \$(SO) ALIASES ;\\
do \\
echo cp \$\$i $install_dir/lib/elk/obj/xaw; \\
cp \$\$i $install_dir/lib/elk/obj/xaw; \\
echo cp \$\$i $install_dir/lib/elk/xaw; \\
cp \$\$i $install_dir/lib/elk/xaw; \\
done
lint:
lint \$(LINTFLAGS) -I\$(INC) -I../xlib $x11_incl *.c
clean:
rm -f *.o *.c core
rm -f *.so *.o *.c core
distclean:
rm -f *.o *.c core lint.out Makefile.local
rm -f *.so *.o *.c core lint.out Makefile.local
EOT

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -75,7 +75,7 @@ O= client.o\\
window.o\\
wm.o
all: \$(O) xlib.pre
all: \$(O) xlib.so
.c.o:
\$(CC) \$(CFLAGS) -I\$(INC) $x11_incl -c \$<
@ -107,7 +107,10 @@ wm.o: \$(H) wm.c
xlib.pre: \$(O)
../../scripts/makedl \$@ \$(O)
install: xlib.pre
xlib.so: \$(O)
ld -shared -o \$@ \$(O) $libxlib -lc
install: xlib.so
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -116,11 +119,7 @@ install: xlib.pre
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
fi
cp xlib.pre $install_dir/lib/elk/obj/xlib.o
cp xlib.so $install_dir/lib/elk
-@if [ ! -d $install_dir/include ]; then \\
echo mkdir $install_dir/include; \\
mkdir $install_dir/include; \\
@ -139,8 +138,8 @@ lint:
lint \$(LINTFLAGS) -I\$(INC) $x11_incl \$(C)
clean:
rm -f *.o xlib.pre core
rm -f *.so *.o xlib.pre core
distclean:
rm -f *.o xlib.pre core lint.out Makefile.local
rm -f *.so *.o xlib.pre core lint.out Makefile.local
EOT

View File

@ -130,7 +130,7 @@ static Object P_Wm_Protocols (w) Object w; {
GC_Link (ret);
for (i = 0; i < n; i++) {
Object a;
a = Make_Atom (p[i]);
VECTOR(ret)->data[i] = a;
}
@ -291,7 +291,7 @@ static Object P_Icon_Sizes (w) Object w; {
int i, n;
Object v;
GC_Node;
Check_Type (w, T_Window);
Disable_Interrupts;
if (!XGetIconSizes (WINDOW(w)->dpy, WINDOW(w)->win, &p, &n))
@ -368,7 +368,7 @@ elk_init_xlib_client () {
Define_Symbol (&Sym_Size_Hints, "size-hints");
Define_Primitive (P_Iconify_Window, "iconify-window", 2, 2, EVAL);
Define_Primitive (P_Withdraw_Window, "withdraw-window", 2, 2, EVAL);
Define_Primitive (P_Reconfigure_Wm_Window,
Define_Primitive (P_Reconfigure_Wm_Window,
"xlib-reconfigure-wm-window", 3, 3, EVAL);
Define_Primitive (P_Wm_Command, "wm-command", 1, 1, EVAL);
Define_Primitive (P_Get_Text_Property,"get-text-property", 2, 2, EVAL);
@ -381,7 +381,7 @@ elk_init_xlib_client () {
Define_Primitive (P_Wm_Hints, "xlib-wm-hints", 1, 1, EVAL);
Define_Primitive (P_Set_Wm_Hints, "xlib-set-wm-hints!",2, 2, EVAL);
Define_Primitive (P_Size_Hints, "xlib-wm-size-hints",2, 2, EVAL);
Define_Primitive (P_Set_Size_Hints,
Define_Primitive (P_Set_Size_Hints,
"xlib-set-wm-size-hints!", 3, 3, EVAL);
Define_Primitive (P_Icon_Sizes, "icon-sizes", 1, 1, EVAL);
Define_Primitive (P_Set_Icon_Sizes, "set-icon-sizes!", 2, 2, EVAL);

View File

@ -91,7 +91,7 @@ static Object P_Query_Colors (cmap, v) Object cmap, v; {
GC_Link (ret);
for (i = 0; i < n; i++, p++) {
Object x;
x = Make_Color (p->red, p->green, p->blue);
VECTOR(ret)->data[i] = x;
}

View File

@ -44,7 +44,7 @@ static Object P_Alloc_Color (cmap, color) Object cmap, color; {
XColor c;
Colormap cm = Get_Colormap (cmap);
int r;
c = *Get_Color (color);
Disable_Interrupts;
r = XAllocColor (COLORMAP(cmap)->dpy, cm, &c);

View File

@ -108,7 +108,7 @@ static Object P_Display_Cells (d, scr) Object d, scr; {
static Object P_Display_Planes (d, scr) Object d, scr; {
Check_Type (d, T_Display);
return Make_Integer (DisplayPlanes (DISPLAY(d)->dpy,
return Make_Integer (DisplayPlanes (DISPLAY(d)->dpy,
Get_Screen_Number (DISPLAY(d)->dpy, scr)));
}
@ -246,7 +246,7 @@ static Object P_List_Pixmap_Formats (d) Object d; {
GC_Link (ret);
for (i = 0; i < num; i++) {
Object t;
t = P_Make_List (Make_Integer (3), Null);
VECTOR(ret)->data[i] = t;
Car (t) = Make_Integer (p[i].depth); t = Cdr (t);

View File

@ -3,7 +3,7 @@
static Object V_X_Error_Handler, V_X_Fatal_Error_Handler;
/* Default error handlers of the Xlib */
extern int _XDefaultIOError();
extern int _XDefaultIOError();
extern int _XDefaultError();
static X_Fatal_Error (d) Display *d; {
@ -81,7 +81,7 @@ static Object P_After_Function (d) Object d; {
Check_Type (d, T_Display);
return DISPLAY(d)->after;
}
elk_init_xlib_error () {
Define_Variable (&V_X_Fatal_Error_Handler, "x-fatal-error-handler", Null);
Define_Variable (&V_X_Error_Handler, "x-error-handler", Null);

View File

@ -8,7 +8,7 @@ static struct event_desc {
char *name;
int argc;
} Event_Table[] = {
{ "event-0", 1 },
{ "event-0", 1 },
{ "event-1", 1 },
{ "key-press", 12 },
{ "key-release", 12 },

View File

@ -15,7 +15,7 @@ static Object P_List_Extensions (d) Object d; {
GC_Link (ret);
for (i = 0; i < n; i++) {
Object e;
e = Make_String (p[i], strlen (p[i]));
VECTOR(ret)->data[i] = e;
}

View File

@ -248,7 +248,7 @@ static Object P_Font_Path (d) Object d; {
GC_Link (v);
for (i = 0; i < n; i++) {
Object x;
x = Make_String (ret[i], strlen (ret[i]));
VECTOR(v)->data[i] = x;
}

View File

@ -91,7 +91,7 @@ static Object P_Set_Gcontext_Clip_Rectangles (gc, x, y, v, ord)
Alloca (p, XRectangle*, n * sizeof (XRectangle));
for (i = 0; i < n; i++) {
Object rect;
rect = VECTOR(v)->data[i];
Check_Type (rect, T_Pair);
if (Fast_Length (rect) != 4)

View File

@ -103,7 +103,7 @@ static Object P_Ungrab_Key (win, key, mods) Object win, key, mods; {
static Object P_Allow_Events (d, mode, time) Object d, mode, time; {
Check_Type (d, T_Display);
XAllowEvents (DISPLAY(d)->dpy, Symbols_To_Bits (mode, 0,
XAllowEvents (DISPLAY(d)->dpy, Symbols_To_Bits (mode, 0,
Allow_Events_Syms), Get_Time (time));
return Void;
}

View File

@ -67,7 +67,7 @@ static Object Internal_Draw_Points (d, gc, v, relative, func, shape)
Alloca (p, XPoint*, n * sizeof (XPoint));
for (i = 0; i < n; i++) {
Object point;
point = VECTOR(v)->data[i];
Check_Type (point, T_Pair);
p[i].x = Get_Integer (Car (point));
@ -112,7 +112,7 @@ static Object P_Draw_Segments (d, gc, v) Object d, gc, v; {
Alloca (p, XSegment*, n * sizeof (XSegment));
for (i = 0; i < n; i++) {
Object seg;
seg = VECTOR(v)->data[i];
Check_Type (seg, T_Pair);
if (Fast_Length (seg) != 4)
@ -159,7 +159,7 @@ static Object Internal_Draw_Rectangles (d, gc, v, func)
Alloca (p, XRectangle*, n * sizeof (XRectangle));
for (i = 0; i < n; i++) {
Object rect;
rect = VECTOR(v)->data[i];
Check_Type (rect, T_Pair);
if (Fast_Length (rect) != 4)
@ -216,7 +216,7 @@ static Object Internal_Draw_Arcs (d, gc, v, func) Object d, gc, v;
Alloca (p, XArc*, n * sizeof (XArc));
for (i = 0; i < n; i++) {
Object arc;
arc = VECTOR(v)->data[i];
Check_Type (arc, T_Pair);
if (Fast_Length (arc) != 6)

View File

@ -27,6 +27,7 @@ elk_init_xlib_init () {
"xlib-release-5-or-later?", 0, 0, EVAL);
Define_Primitive (P_Xlib_Release_6_Or_Laterp,
"xlib-release-6-or-later?", 0, 0, EVAL);
P_Provide (Intern ("xlib.so"));
P_Provide (Intern ("xlib.o"));
}

View File

@ -123,7 +123,7 @@ static Object P_Rebind_Keysym (d, k, mods, str) Object d, k, mods, str; {
Alloca (p, KeySym*, n * sizeof (KeySym));
for (i = 0; i < n; i++)
p[i] = (KeySym)Get_Long (VECTOR(mods)->data[i]);
XRebindKeysym (DISPLAY(d)->dpy, (KeySym)Get_Long (k), p, n,
XRebindKeysym (DISPLAY(d)->dpy, (KeySym)Get_Long (k), p, n,
(unsigned char *)STRING(str)->data, STRING(str)->size);
Alloca_End;
return Void;

View File

@ -36,7 +36,7 @@ static Object P_Black_Pixel (d) Object d; {
static Object P_White_Pixel (d) Object d; {
Check_Type (d, T_Display);
return Make_Pixel (WhitePixel (DISPLAY(d)->dpy,
return Make_Pixel (WhitePixel (DISPLAY(d)->dpy,
DefaultScreen (DISPLAY(d)->dpy)));
}

View File

@ -64,7 +64,7 @@ static Object P_List_Properties (w) Object w; {
GC_Link (v);
for (i = 0; i < n; i++) {
Object x;
x = Make_Atom (ap[i]);
VECTOR(v)->data[i] = x;
}
@ -125,7 +125,7 @@ static Object P_Get_Property (w, prop, type, start, len, deletep)
GC_Unlink;
}
}
t = Cdr (t);
t = Cdr (t);
x = Make_Unsigned_Long (bytes_left);
Car (t) = x;
GC_Unlink;
@ -188,7 +188,7 @@ static Object P_Rotate_Properties (w, v, delta) Object w, v, delta; {
Alloca (p, Atom*, n * sizeof (Atom));
for (i = 0; i < n; i++) {
Object a;
a = VECTOR(v)->data[i];
Check_Type (a, T_Atom);
p[i] = ATOM(a)->atom;

View File

@ -1,6 +1,6 @@
#include "xlib.h"
static Object Set_Attr_Slots;
static Object Set_Attr_Slots;
static Object Conf_Slots;
static Object GC_Slots;
static Object Geometry_Slots;
@ -263,7 +263,7 @@ RECORD Size_Hints_Rec[] = {
{ (char *)&SZH.max_aspect.y, "max-aspect-y", T_INT, 0, PAspect },
{ (char *)&SZH.base_width, "base-width", T_INT, 0, PBaseSize },
{ (char *)&SZH.base_height, "base-height", T_INT, 0, PBaseSize },
{ (char *)&SZH.win_gravity, "gravity", T_SYM, Grav_Syms,
{ (char *)&SZH.win_gravity, "gravity", T_SYM, Grav_Syms,
PWinGravity },
{0, 0, T_NONE, 0, 0 }
};

View File

@ -55,7 +55,7 @@ static Object P_Create_Window (parent, x, y, width, height, border_width, attr)
Object parent, x, y, width, height, border_width, attr; {
unsigned long mask;
Window win;
Check_Type (parent, T_Window);
mask = Vector_To_Record (attr, Set_Attr_Size, Sym_Set_Attr, Set_Attr_Rec);
if ((win = XCreateWindow (WINDOW(parent)->dpy, WINDOW(parent)->win,
@ -171,7 +171,7 @@ static Object P_Query_Tree (w) Object w; {
v = Make_Vector (n, Null);
for (i = 0; i < n; i++) {
Object x;
x = Make_Window (0, dpy, children[i]);
VECTOR(v)->data[i] = x;
}

View File

@ -34,7 +34,7 @@ static Object P_List_Installed_Colormaps (w) Object w; {
GC_Link (v);
for (i = 0; i < n; i++) {
Object c;
c = Make_Colormap (0, WINDOW(w)->dpy, ret[i]);
VECTOR(v)->data[i] = c;
}

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -57,6 +57,32 @@ O= arrow-button.o\\
text.o\\
toggle-btn.o
SO= arrow-button.so\\
bulletin-brd.so\\
cascade-btn.so\\
command.so\\
drawing-area.so\\
drawn-button.so\\
file-selectn.so\\
form.so\\
frame.so\\
label.so\\
list.so\\
main-window.so\\
message-box.so\\
paned-window.so\\
push-button.so\\
row-column.so\\
scale.so\\
scroll-bar.so\\
scrolled-win.so\\
selectn-box.so\\
separator.so\\
shell.so\\
support.so\\
text.so\\
toggle-btn.so
WIDGET_SET= xm
.SUFFIXES: .d .c .o
@ -73,7 +99,7 @@ WIDGET_SET= xm
\$(CC) \$(CFLAGS) -I\$(INC) -I../xlib $sys_incl -c \$*.c
../../scripts/makedl \$@ \$@
all: \$(O)
all: \$(SO)
arrow-button.o: \$(H) arrow-button.d
bulletin-brd.o: \$(H) bulletin-brd.d
@ -101,7 +127,83 @@ support.o: \$(H) support.d
text.o: \$(H) text.d
toggle-btn.o: \$(H) toggle-btn.d
install: \$(O)
arrow-button.so: arrow-button.o
ld -shared -o \$@ \$< $libxmotif -lc
bulletin-brd.so: bulletin-brd.o
ld -shared -o \$@ \$< $libxmotif -lc
cascade-btn.so: cascade-btn.o
ld -shared -o \$@ \$< $libxmotif -lc
command.so: command.o
ld -shared -o \$@ \$< $libxmotif -lc
drawing-area.so: drawing-area.o
ld -shared -o \$@ \$< $libxmotif -lc
drawn-button.so: drawn-button.o
ld -shared -o \$@ \$< $libxmotif -lc
file-selectn.so: file-selectn.o
ld -shared -o \$@ \$< $libxmotif -lc
form.so: form.o
ld -shared -o \$@ \$< $libxmotif -lc
frame.so: frame.o
ld -shared -o \$@ \$< $libxmotif -lc
label.so: label.o
ld -shared -o \$@ \$< $libxmotif -lc
list.so: list.o
ld -shared -o \$@ \$< $libxmotif -lc
main-window.so: main-window.o
ld -shared -o \$@ \$< $libxmotif -lc
message-box.so: message-box.o
ld -shared -o \$@ \$< $libxmotif -lc
paned-window.so: paned-window.o
ld -shared -o \$@ \$< $libxmotif -lc
push-button.so: push-button.o
ld -shared -o \$@ \$< $libxmotif -lc
row-column.so: row-column.o
ld -shared -o \$@ \$< $libxmotif -lc
scale.so: scale.o
ld -shared -o \$@ \$< $libxmotif -lc
scroll-bar.so: scroll-bar.o
ld -shared -o \$@ \$< $libxmotif -lc
scrolled-win.so: scrolled-win.o
ld -shared -o \$@ \$< $libxmotif -lc
selectn-box.so: selectn-box.o
ld -shared -o \$@ \$< $libxmotif -lc
separator.so: separator.o
ld -shared -o \$@ \$< $libxmotif -lc
shell.so: shell.o
ld -shared -o \$@ \$< $libxmotif -lc
support.so: support.o
ld -shared -o \$@ \$< $libxmotif -lc
text.so: text.o
ld -shared -o \$@ \$< $libxmotif -lc
toggle-btn.so: toggle-btn.o
ld -shared -o \$@ \$< $libxmotif -lc
install: \$(SO)
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -110,26 +212,22 @@ install: \$(O)
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
-@if [ ! -d $install_dir/lib/elk/xm ]; then \\
echo mkdir $install_dir/lib/elk/xm; \\
mkdir $install_dir/lib/elk/xm; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj/xm ]; then \\
echo mkdir $install_dir/lib/elk/obj/xm; \\
mkdir $install_dir/lib/elk/obj/xm; \\
fi
@for i in \$(O) ALIASES ;\\
@for i in \$(SO) ALIASES ;\\
do \\
echo cp \$\$i $install_dir/lib/elk/obj/xm; \\
cp \$\$i $install_dir/lib/elk/obj/xm; \\
echo cp \$\$i $install_dir/lib/elk/xm; \\
cp \$\$i $install_dir/lib/elk/xm; \\
done
lint:
lint \$(LINTFLAGS) -I\$(INC) -I../xlib $sys_incl *.c
clean:
rm -f *.o *.c core
rm -f *.so *.o *.c core
distclean:
rm -f *.o *.c core lint.out Makefile.local
rm -f *.so *.o *.c core lint.out Makefile.local
EOT

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../../config/system ../../../config/site
Makefile.local: build ../../../config/system ../../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -1,6 +1,10 @@
. ../../../config/system
. ../../../config/site
if [ _$load_obj = _ld -o _$load_obj = _dl ]; then
force_load_xm="-u ${syms_begin_with}XmIsMotifWMRunning"
fi
# In HP-UX, the Motif libraries must be linked with xt-motif.o instead
# of placing them into the load-libraries (I don't know why):
@ -45,10 +49,13 @@ O= \$(XTDIR)/accelerator.o\\
@echo === Must make files in \$(XTDIR) first\! ===
@echo ""
xt-motif.so: \$(O) ../../xlib/xlib.so
ld -shared -o \$@ \$(O) ../../xlib/*.o $force_load_xm $libxmotif -lc
xt-motif.pre: \$(O) ../../xlib/xlib.pre
../../../scripts/makedl \$@ \$(O) ../../xlib/*.o $motif_link_libs
install: xt-motif.pre
install: xt-motif.so
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -57,17 +64,13 @@ install: xt-motif.pre
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
fi
cp xt-motif.pre $install_dir/lib/elk/obj/xt-motif.o
cp xt-motif.so $install_dir/lib/elk
lint:
clean:
rm -f *.o xt-motif.pre core
rm -f *.so *.o xt-motif.pre core
distclean:
rm -f *.o xt-motif.pre core Makefile.local
rm -f *.so *.o xt-motif.pre core Makefile.local
EOT

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../../config/system ../../config/site
Makefile.local: build ../../config/system ../../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -18,7 +18,7 @@ static Object P_Install_Accelerators (dst, src) Object dst, src; {
XtInstallAccelerators (WIDGET(dst)->widget, WIDGET(src)->widget);
return Void;
}
static Object P_Install_All_Accelerators (dst, src) Object dst, src; {
Check_Widget (dst);
Check_Widget (src);

View File

@ -30,7 +30,7 @@ void Action_Hook (w, client_data, name, ep, argv, argc)
params = P_Make_List (Make_Integer (*argc), Null);
for (i = 0, tail = params; i < *argc; tail = Cdr (tail), i++) {
Object tmp;
tmp = Make_String (argv[i], strlen (argv[i]));
Car (tail) = tmp;
}

View File

@ -62,7 +62,7 @@ O= accelerator.o\\
translation.o\\
widget.o
all: \$(O) xt.pre
all: \$(O) xt.so
.c.o:
\$(CC) \$(CFLAGS) -I\$(INC) -I../xlib $x11_incl -c \$<
@ -87,7 +87,10 @@ widget.o: \$(H) widget.c
xt.pre: \$(O) ../xlib/xlib.pre
../../scripts/makedl \$@ \$(O) ../xlib/*.o
install: xt.pre
xt.so: \$(O) ../xlib/xlib.so
ld -shared -o \$@ \$(O) ../xlib/*.o $libxt -lc
install: xt.so
-@if [ ! -d $install_dir/lib ]; then \\
echo mkdir $install_dir/lib; \\
mkdir $install_dir/lib; \\
@ -96,11 +99,7 @@ install: xt.pre
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
-@if [ ! -d $install_dir/lib/elk/obj ]; then \\
echo mkdir $install_dir/lib/elk/obj; \\
mkdir $install_dir/lib/elk/obj; \\
fi
cp xt.pre $install_dir/lib/elk/obj/xt.o
cp xt.so $install_dir/lib/elk
-@if [ ! -d $install_dir/include ]; then \\
echo mkdir $install_dir/include; \\
mkdir $install_dir/include; \\
@ -119,8 +118,8 @@ lint:
lint \$(LINTFLAGS) -I\$(INC) -I../xlib $x11_incl \$(C)
clean:
rm -f *.o xt.pre core
rm -f *.so *.o xt.pre core
distclean:
rm -f *.o xt.pre core lint.out Makefile.local
rm -f *.so *.o xt.pre core lint.out Makefile.local
EOT

View File

@ -15,7 +15,7 @@ static void Callback_Proc (w, client_data, call_data) Widget w;
register CLIENT_DATA *cd = (CLIENT_DATA *)client_data;
Object args;
GC_Node;
args = Null;
GC_Link (args);
if (cd->converter)

View File

@ -195,7 +195,7 @@ elk_init_xt_class () {
Generic_Define (Class, "class", "class?");
Define_Primitive (P_Find_Class, "find-class", 1, 1, EVAL);
Define_Primitive (P_Class_Resources, "class-resources", 1, 1, EVAL);
Define_Primitive (P_Class_Constraint_Resources,
Define_Primitive (P_Class_Constraint_Resources,
"class-constraint-resources", 1, 1, EVAL);
Define_Primitive (P_Class_Sub_Resources,
"class-sub-resources", 1, 1, EVAL);

View File

@ -115,7 +115,7 @@ static Object P_Set_Context_Fallback_Resources (argc, argv) Object *argv; {
register i;
struct S_String *sp;
Object con;
con = argv[0];
Check_Context (con);
if (argc > 1) {
@ -158,7 +158,7 @@ static Object P_Context_Process_Event (argc, argv) Object *argv; {
static Boolean Work_Proc (client_data) XtPointer client_data; {
Object ret;
ret = Funcall (Get_Function ((int)client_data), Null, 0);
if (Truep (ret))
Deregister_Function ((int)client_data);

View File

@ -43,5 +43,6 @@ elk_init_xt_init () {
Define_Primitive (P_Xt_Release_6_Or_Laterp, "xt-release-6-or-later?",
0, 0, EVAL);
XtToolkitInitialize ();
P_Provide (Intern ("xt.so"));
P_Provide (Intern ("xt.o"));
}

View File

@ -237,7 +237,7 @@ void Convert_Args (ac, av, to, widget, class) Object *av; ArgList to;
} else if (dt == T_Window) {
XtSetArg (to[i], res, WINDOW(val)->win);
} else Panic ("bad conversion type");
}
}
done: ;
}
Alloca_End;
@ -413,7 +413,7 @@ Object Get_Resources (c, fun, freeit) WidgetClass c; void (*fun)(); {
int nr;
Object ret, tail, tail2, x;
GC_Node3;
fun (c, &r, &nr);
/* Note:
* `r' is not freed in case of error.

View File

@ -17,7 +17,7 @@ static Object P_Augment_Translations (w, t) Object w, t; {
XtAugmentTranslations (WIDGET(w)->widget, Get_Translations (t));
return Void;
}
static Object P_Override_Translations (w, t) Object w, t; {
Check_Widget (w);
XtOverrideTranslations (WIDGET(w)->widget, Get_Translations (t));
@ -47,7 +47,7 @@ static Object P_Set_Multi_Click_Time (d, t) Object d, t; {
elk_init_xt_translation () {
Define_Primitive (P_Augment_Translations,
"augment-translations", 2, 2, EVAL);
Define_Primitive (P_Override_Translations,
Define_Primitive (P_Override_Translations,
"override-translations", 2, 2, EVAL);
Define_Primitive (P_Uninstall_Translations,
"uninstall-translations", 1, 1, EVAL);

View File

@ -81,7 +81,7 @@ static Object P_Create_Widget (argc, argv) Object *argv; {
char *name = 0;
Object x, class, parent, ret;
Alloca_Begin;
x = argv[0];
if (TYPE(x) != T_Class) {
name = Get_Strsym (x);
@ -158,7 +158,7 @@ static Object Manage_Unmanage (children, f) Object children; void (*f)(); {
Alloca (buf, Widget*, n * sizeof (Widget));
for (i = 0, tail = children; i < n; i++, tail = Cdr (tail)) {
Object w;
w = Car (tail);
Check_Widget (w);
buf[i] = WIDGET(w)->widget;

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../config/system ../config/site
Makefile.local: build ../config/system ../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -2,7 +2,7 @@
;;;
;;; The Scheme layer of the bitstring extension.
(require 'bitstring.o)
(require 'bitstring.so)
(define (bitstring-copy b)
(let ((new (make-bitstring (bitstring-length b) #f)))

View File

@ -51,14 +51,10 @@ install: \$(TARGETS)
echo mkdir $install_dir/share/elk; \\
mkdir $install_dir/share/elk; \\
fi
-@if [ ! -d $install_dir/share/elk/scm ]; then \\
echo mkdir $install_dir/share/elk/scm; \\
mkdir $install_dir/share/elk/scm; \\
fi
@for i in \$(FILES) ;\\
do \\
echo cp \$\$i $install_dir/share/elk/scm; \\
cp \$\$i $install_dir/share/elk/scm; \\
echo cp \$\$i $install_dir/share/elk; \\
cp \$\$i $install_dir/share/elk; \\
done
lint:

View File

@ -4,7 +4,7 @@
;;; Contributed by Martin Stut.
(require 'gdbm.o)
(require 'gdbm.so)
(let ((gf (gdbm-open 'test.gdbm 1024 'create)) (last "nothing"))
(if (not gf)

View File

@ -2,7 +2,7 @@
;;;
;;; A simple `OOPS' package
(require 'hack.o)
(require 'hack.so)
(provide 'oops)

View File

@ -2,7 +2,7 @@
;;;
;;; The Scheme layer of the record extension.
(require 'record.o)
(require 'record.so)
(define (record-field-index name fields)
(let loop ((fields fields) (index 0))

View File

@ -3,7 +3,7 @@
;;; The Scheme layer of the regexp extension is (almost) empty for now.
;;; It mainly exists to enable use of "(require 'regexp)".
(require 'regexp.o)
(require 'regexp.so)
(define (describe-regexp r)
(format #t "a regular expression.~%")

View File

@ -10,7 +10,7 @@
;;;
;;; slot = slot-name or (slot-name initial-value)
(require 'struct.o)
(require 'struct.so)
(define-macro (define-structure name . slot-descr)
(internal-define-structure name slot-descr #t))

View File

@ -4,7 +4,7 @@
(require 'record)
(require 'recordutil)
(require 'unix.o)
(require 'unix.so)
(define-record-type stat (type mode ino dev nlink uid gid size
atime mtime ctime))

View File

@ -5,7 +5,7 @@
(require 'siteinfo)
(fluid-let ((load-libraries (string-append site-lib-xlib " " load-libraries)))
(require 'xlib.o))
(require 'xlib.so))
(define (create-window . args)
(apply-with-keywords

View File

@ -8,10 +8,10 @@
(fluid-let ((load-libraries
(string-append site-force-load-xm " " site-lib-xmotif " "
load-libraries)))
(require 'xt.o 'xt-motif.o))
(require 'xt.so 'xt-motif.so))
(fluid-let ((load-libraries
(string-append site-lib-xt " " load-libraries)))
(require 'xt.o)))
(require 'xt.so)))
(load 'xlib.scm)

View File

@ -11,7 +11,7 @@
(define widget-aliases #f)
(define (widget-loaded? w)
(feature? (string->symbol (format #f "~a:~a.o" widget-subdirectory w))))
(feature? (string->symbol (format #f "~a:~a.so" widget-subdirectory w))))
(define-macro (load-widgets . w)
(let ((wl '()) (l '()))
@ -33,15 +33,16 @@
(begin
(if (not widget-aliases)
(load (format #f "~a/ALIASES" widget-subdirectory)))
(format #t "[Loading ")
(if autoload-notify? (format #t "[Loading "))
(do ((f l (cdr f))) ((null? f))
(let* ((file (car f))
(alias (assq (car f) widget-aliases)))
(if alias (set! file (cdr alias)))
(format #t "~a~a" file (if (null? (cdr f)) "" " "))
(set! wl (cons (format #f "~a/~a.o" widget-subdirectory file)
(if autoload-notify?
(format #t "~a~a" file (if (null? (cdr f)) "" " ")))
(set! wl (cons (format #f "~a/~a.so" widget-subdirectory file)
wl))))
(format #t "]~%")
(if autoload-notify? (format #t "]~%"))
`(fluid-let ((load-libraries
(if (feature? 'motif)
(string-append site-lib-xmotif " " load-libraries)

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../config/system ../config/site
Makefile.local: build ../config/system ../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -3,7 +3,7 @@ MAKE=make
all: default
Makefile.local: ../config/system ../config/site
Makefile.local: build ../config/system ../config/site
$(SHELL) ./build
default: Makefile.local

View File

@ -3,7 +3,7 @@
Object V_Autoload_Notifyp;
void Init_Auto (void) {
Define_Variable (&V_Autoload_Notifyp, "autoload-notify?", True);
Define_Variable (&V_Autoload_Notifyp, "autoload-notify?", False);
}
Object P_Autoload (Object sym, Object files) {

View File

@ -1,6 +1,6 @@
. ../config/system
. ../config/site
. ../debian/arch-config
. ../debian/arch-config || true
case _$aout_format in
_coff) dump=dump-vanilla.c; stab=stab-coff.c;;
@ -116,15 +116,21 @@ O1= \$(OCOMMON) main.o stab.o
O2= \$(OCOMMON) main2.o stab2.o
O3= \$(OCOMMON) main3.o stab2.o
all: scheme standalone.o module.o
all: scheme standalone.a module.a
scheme: \$(O1)
\$(CC) -o \$@ \$(CFLAGS) \$(O1) \$(LDFLAGS)
standalone.a: \$(O2)
ar cru \$@ \$<
standalone.o: \$(O2)
ld -r -o \$@ \$(O2)
chmod 644 \$@
module.a: \$(O3)
ar cru \$@ \$<
module.o: \$(O3)
ld -r -o \$@ \$(O3)
chmod 644 \$@
@ -181,7 +187,7 @@ main3.o: \$(H) main.c
\$(CC) -DINIT_OBJECTS -DNOMAIN \$(CFLAGS) -I\$(INC) -c main3.c
rm main3.c
install: scheme standalone.o module.o
install: scheme standalone.a module.a
-@if [ ! -d $install_dir/bin ]; then \\
echo mkdir $install_dir/bin; \\
mkdir $install_dir/bin; \\
@ -195,15 +201,15 @@ install: scheme standalone.o module.o
echo mkdir $install_dir/lib/elk; \\
mkdir $install_dir/lib/elk; \\
fi
cp standalone.o $install_dir/lib/elk
cp module.o $install_dir/lib/elk
cp standalone.a $install_dir/lib/elk
cp module.a $install_dir/lib/elk
lint:
lint \$(LINTFLAGS) -I\$(INC) \$(C)
clean:
rm -f *.o core main2.c stab2.c main3.c
rm -f *.o *.a core main2.c stab2.c main3.c
distclean:
rm -f *.o core main2.c stab2.c main3.c lint.out scheme Makefile.local
rm -f *.o *.a core main2.c stab2.c main3.c lint.out scheme Makefile.local
EOT

View File

@ -16,7 +16,7 @@ static Object Sym_Stop_And_Copy_GC, Sym_Generational_GC, Sym_Incremental_GC;
void Init_Heap () {
Define_Variable (&V_Garbage_Collect_Notifyp, "garbage-collect-notify?",
True);
False);
Define_Symbol (&Sym_Stop_And_Copy_GC, "stop-and-copy");
Define_Symbol (&Sym_Generational_GC, "generational");

View File

@ -12,7 +12,7 @@ void Dlopen_File (char *fn) {
if (Verb_Load)
printf ("[dlopen %s]\n", fn);
if ((handle = dlopen (fn, RTLD_NOW)) == 0) {
if ((handle = dlopen (fn, RTLD_NOW|RTLD_GLOBAL)) == 0) {
char *errstr = dlerror ();
Primitive_Error ("dlopen failed:~%~s",
Make_String (errstr, strlen (errstr)));
@ -126,6 +126,30 @@ void Load_Object (Object names) {
Alloca_End;
}
void Load_Lib (Object libs) {
Object port, name;
if (Nullp (libs))
return;
Load_Lib (Cdr (libs));
GC_Node2;
port = name = Null;
GC_Link2 (port, name);
port = General_Open_File (Car (libs), P_INPUT, Var_Get (V_Load_Path));
name = PORT(port)->name;
Dlopen_File (STRING(name)->data);
(void)P_Close_Input_Port (port);
GC_Unlink;
}
void Load_Library (Object libs) {
Disable_Interrupts;
Load_Lib (libs);
Enable_Interrupts;
}
void Finit_Load () {
int i;

View File

@ -28,7 +28,7 @@ extern char *getenv();
static char *Loader_Output;
static char *tmpdir;
Load_Object (Object names) {
void Load_Object (Object names) {
#ifdef ECOFF
struct headers hdr;
#else
@ -51,7 +51,7 @@ Load_Object (Object names) {
Loader_Output = Safe_Malloc (strlen (tmpdir) + 20);
}
sprintf (Loader_Output, "%s/ldXXXXXX", tmpdir);
(void)mkstemp (Loader_Output);
(void)mktemp (Loader_Output);
port = tail = fullnames = Null;
GC_Link3 (port, tail, fullnames);
@ -162,7 +162,7 @@ void Fork_Load () {
Disable_Interrupts;
newlink = Safe_Malloc (strlen (tmpdir) + 20);
sprintf (newlink, "%s/ldXXXXXX", tmpdir);
(void)mkstemp (newlink);
(void)mktemp (newlink);
(void)link (Loader_Input, newlink);
free (Loader_Input);
Loader_Input = newlink;

View File

@ -3,7 +3,7 @@
extern void Free_Symbols (SYMTAB *);
extern void Call_Initializers (SYMTAB *, char *, int);
Load_Object (Object names) {
void Load_Object (Object names) {
long retval;
struct mach_header *hdr;
char **filenames, *libs;

View File

@ -50,7 +50,7 @@ static void Load_Them (Object names) {
Alloca_End;
}
Load_Object (Object names) {
void Load_Object (Object names) {
Object port, tail, fullnames, str;
char *p, *libs = "";
GC_Node3;

View File

@ -64,15 +64,16 @@ void Init_Loadpath (char *s) { /* No GC possible here */
Var_Set (V_Load_Path, P_Reverse (path));
}
int Is_O_File (Object name) {
int Has_Suffix (Object name, char const *suffix) {
register char *p;
register int len = strlen(suffix);
register struct S_String *str;
if (TYPE(name) == T_Symbol)
name = SYMBOL(name)->name;
str = STRING(name);
p = str->data + str->size;
return str->size >= 2 && *--p == 'o' && *--p == '.';
p = str->data + str->size - len;
return len <= str->size && !strncasecmp(p, suffix, len);
}
void Check_Loadarg (Object x) {
@ -89,7 +90,7 @@ void Check_Loadarg (Object x) {
f = Car (tail);
if (TYPE(f) != T_Symbol && TYPE(f) != T_String)
Wrong_Type_Combination (f, "string or symbol");
if (!Is_O_File (f))
if (!Has_Suffix (f, ".o") && !Has_Suffix (f, ".so"))
Primitive_Error ("~s: not an object file", f);
}
}
@ -103,14 +104,26 @@ Object General_Load (Object what, Object env) {
GC_Link (oldenv);
Switch_Environment (env);
Check_Loadarg (what);
if (TYPE(what) == T_Pair)
if (TYPE(what) == T_Pair) {
if (Has_Suffix (Car (what), ".o"))
#ifdef CAN_LOAD_OBJ
Load_Object (what)
Load_Object (what)
#endif
;
else if (Is_O_File (what))
;
else if (Has_Suffix (Car (what), ".so"))
#ifdef CAN_LOAD_LIB
Load_Library (what)
#endif
;
}
else if (Has_Suffix (what, ".o"))
#ifdef CAN_LOAD_OBJ
Load_Object (Cons (what, Null))
#endif
;
else if (Has_Suffix (what, ".so"))
#ifdef CAN_LOAD_LIB
Load_Library (Cons (what, Null))
#endif
;
else

View File

@ -63,7 +63,7 @@ unsigned int Max_Stack;
int Interpreter_Initialized;
int GC_Debug = 0;
int Case_Insensitive;
int Verb_Load, Verb_Init;
int Verb_Load = 0, Verb_Init = 0;
char **Argv;
int Argc, First_Arg;