[MUD-Dev] Re: DevMUD: Inheritable modules

The Arrow arrow at trelleborg.mail.telia.com
Sat Oct 31 01:14:20 New Zealand Daylight Time 1998


Well, this DevMUD thing really got me started... ;)
So, at the end of this mail I have included the first (?) 'Official
Proposal' to the DevMUD and MUD-Dev community.
It is about module interfaces and inheritance of those interfaces.
Since this only is a proposal (and the first version of it), I doubt that
anything of this will ever make it to the release of DevMUD.

Anyway, let the discussion begin!

/ Joachim
======================================================================
The Arrow                   Email: arrow at trelleborg.mail.telia.com
Joachim Pileborg              WWW: http://w1.410.telia.com/~u41003102/
======================================================================
"They say I don't give a shit about anything," -- Magnus Uggla
"but I don't give a shit about that."        (translated from swedish)

---------------------------------------------------------------------

This file is the first version of a proposition for module interfaces for
DevMUD.


DevMUD modules must have one public C function named get_interfaces.
This functions returns a pointer to a NULL terminated array of pointers to
module_interface structures.

The module_interface structure contains the following fields:
  o Interface type
  o An array of functions
  o Interface name

The function array is a NULL terminated array of pointers to
interface_function structures.  The interface_function struture contains
the following fields:
  o Funciton name
  o Pointer to the function
The function name is a predefined constant that is interface specific.
For example:  The Net basic module could have the following function
names:  MOD_NET_CONNECTTO, MOD_NET_WRITETO, and MOD_NET_READFROM.

All modules must at least implement the Module interface.


MUDs must have at least the following interfaces to be DevMUD compliant:
  o Module
      The Module interface contains functions to get info about the
      module and configuring the module.
  o Net
     The Net module is an abstract interface, containing just dummy net
     functions.  Modules inheriting this interface must provide real
     implementations for these functions.

The following interfaces are considered standard, and should either come
with the DevMUD package, or be easily found and added:
  o TCPIP
      A module for TCP/IP networks.  Inherits from the Net interface.
  o Telnet
      A fully telnet compliant module.  Inherits from the TCPIP interface.
  o Command Parser
      A basic command parser.  The basic Command Parser module read
      commands from the Telnet module.
  o DB
      Generic and abstract interface to databases.  Modules inheriting
      this interface must provide real implementation of theinterface.
  o Compilation
      Abstract interface for all MUD-language compilers.  Modules
      inheriting this interface must provide real implementation of the
      interface.
  o Virtual Machine
      Abstract interface for all MUD-language interpreters.  Modules
      inheriting this interface must provide real implementation of the
      interface.


The Module interface have functions for:
  o Fetching name of the module
  o Module instanciation
  o Fetching what interface this module inherits
  o Intermodule messaging
  o Driver messaging


If the interface(s) this module provides is not recognised by the DevMUD
driver, the driver should store the interface(s) in a private database.
This database is not defined by this standard, and it is up to each DevMUD
implenetation on how to implement this database.  The minimum requirement
for this database, is that it should store interface name and a complete
path to the loadable module.

Modules may be compiled in together with the driver (internal modules).
In this case, they need not be in the module database.

If a module inherits an interface not in the interface database, the
module is unloaded and an error message should be logged on the console
and sent as a message to all loaded modules.





More information about the MUD-Dev mailing list