Library.h
musicmud-2.1.6/include/Library.h · 895 B
From the archive musicmud2.1.6.tar.gz
Download the archive « Back to the archive contents
#ifndef LIBRARY_H
#define LIBRARY_H
//! a void(void) function
typedef void (*procedure)();
//! a shared library
class Library : public Object {
bool valid, exported;
void * dlhandle;
public:
bool is_valid() const { return valid; }
bool is_export() const { return exported; }
//! grab timestamp from given file
void stamp(const char *buffer);
//! load a library from /filename/
Library(const char *filename, bool exprt=false, bool trap=false);
//! obtain the symbol /name/ from the library
void *find_symbol(const char *name) const;
procedure get_sym(const char *name) const {
return (procedure) find_symbol(name);
}
virtual ~Library();
void cleanup();
//! obtain the symbol /symbol/ from library /libname/
static void *find_symbol(const char *libname, const char *symbol);
void after_reset();
};
//! all the loaded library
extern World<Library> *libs;
#endif