https://github.com/teuben/nemo
Raw File
Tip revision: 27d447ea1e0c092be8e577a3569a022c11e2c3bc authored by Peter Teuben on 07 April 2021, 03:16:34 UTC
dynamic loader should be simpler (i5-11x?) clang
Tip revision: 27d447e
module.h
/*
 * MODULE.H: data structure with slots for major operations.
 */

typedef struct {
    string  modname;
    void    (*modinit)(/* itemptr, stream */);
    itemptr (*modwork)(/* itemptr, itemptr, stream */);
    void    (*modsave)(/* stream, stream */);
    void    (*modrestore)(/* stream, stream */);
} module, *modptr;

/*
 * Standard accessor macros used to extract the name 
 * and/or invoke the functions of a module.
 */

#define ModName(mp)       ((mp)->modname)
#define ModInit(mp)       (* (mp)->modinit)
#define ModWork(mp)	  (* (mp)->modwork)
#define ModSave(mp)       (* (mp)->modsave)
#define ModRestore(mp)    (* (mp)->modrestore)
back to top