[DGD]1.1.119

Felix A. Croes felix at dworkin.nl
Sat Nov 4 22:25:40 CET 2000


diff -c dgd/src/Changelog:1.226 dgd/src/Changelog:1.227
*** dgd/src/Changelog:1.226     Thu Nov  2 17:19:20 2000
--- dgd/src/Changelog   Sat Nov  4 21:54:13 2000
***************
*** 1399,1401 ****
--- 1399,1407 ----
   - Fixed a minor memory leak in comm.c.
   - Runtime_error() would erroneously not be called on an error during mudlib
     initialization.
+  - Got the precompiler to work again.
+  - Got the editor to work properly on MacOS and Windows.
+  - Changed some fatal errors into configuration errors.
+  - Do not allow a restart after a fatal error.
+  - Removed support for stand-alone compilations of editor and lexical scanner.
+  - Implemented DGD runtime extension interface.

ftp://ftp.dworkin.nl/pub/dgd/experimental/1.1.118-1.1.119.gz


While I still have to write proper documentation for the extension
interface, here is a quick overview:

When compiled with the macro DGD_MODULES defined, DGD will call the
function module_init() at configuration time.  From this function, two
calls can be made:

    kf_ext_kfun(): add extra kfuns to DGD
    conf_ext_callback(): add callbacks to the functions given as arguments

The function kf_ext_kfun() is defined in dgd/src/kfun/table.c, it takes
an array of kfun definitions and an integer, the number of kfuns in the
array, as arguments.  The prototype for these kfuns is simplified; an
example prototype for a kfun `void foo(int i, varargs string str)' would
be:

    char foo_prototype[] = { T_VOID, T_INT, T_VARARGS, T_STRING, 0 };

For `string bar(object obj, string optional...)' it would be:

    char bar_prototype[] = { T_STRING, T_OBJECT, T_STRING, T_ELLIPSIS, 0 };

Kfuns should be declared in C as follows:

    void kfun_foo(frame *f, int nargs, value *retval)
    {
	/* ... */
    }

They should use the stack only for fetching arguments.  No values should
be pushed on, or popped from the stack.  The return value, if any, should
be assigned to the value retval using, for instance, PUT_STRVAL(retval, s);

See dgd/src/config.h for the prototypes of the callback functions.
The functions ext_restore, ext_swapout and ext_destruct are called
when a special object -- that is, an object that has been marked as
special by setting O_SPECIAL in its flags -- is restored from statedump,
swapped out, or destructed, respectively.

The function ext_funcall is called when an LPC function is called
in the program of a special object.  It has a prototype similar to
a kfun, but it returns a boolean value, TRUE if the LPC function should
not be called thereafter, or FALSE otherwise.  It also has an extra
argument, the name of the LPC function called.


If the above looks confusing, please wait for the documentation :)
I only included it so DGD hackers can get started right away.

Regards,
Dworkin

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list