|
|
FCode (p4_uselibrary)
{
extern int uselib (const char* lib);
|
|
|
|
typedef struct { unsigned nargs :4; |
|
|
|
static void call_c (p4code * sub) { int i, high, low, result_type; p4udcell *tmp; control_word x = *(control_word *) SP++; i = x.nargs; result_type = x.restype; |
FCode (p4_call_c) { call_c ((p4code *) * SP++); } |
|
|
|
|
struct slot_info { int* var; |
static struct slot_info p4_slot_table[P4_MOPTRS] = {{0}}; |
|
|
|
|
|
|
typedef void* (*p4_llist_f)(void); |
|
struct dlslot p4_dlslot_table [P4_DLSLOTS] = {{ |
|
static int
p4_dlslot_find (const char* nameptr, int namelen)
{
int slot;
int len;
char name[256];
module_makename (name, nameptr, namelen);
len = strlen (name);
for (slot = 1; slot < P4_DLSLOTS; slot++)
{
if (!memcmp (p4_dlslot_table[slot].name, name, len+1))
return slot; |
static int p4_dlslot_create (const char* nameptr, int namelen) { int slot; char len; char name[PATH_MAX+1]; module_makename (name, nameptr, namelen); len = strlen (name); for (slot = 1; slot < P4_DLSLOTS; slot++) { if (!memcmp (p4_dlslot_table[slot].name, name, len+1)) { return slot; |
static void
p4_dlslot_remove (int slot)
{
if (!INBETWEEN(slot, 0, P4_DLSLOTS))
{
P4_warn1 ( |
static int p4_dlslot_isnt_unique_llist (int slot) { int i; if (!INBETWEEN(slot, 0, P4_DLSLOTS)) return -EINVAL; if (!p4_dlslot_table[slot].use || !p4_dlslot_table[slot].llist) return -ENOENT; for (i = 1; i < P4_DLSLOTS; i++) { if (i == slot) continue; if (p4_dlslot_table[slot].llist && p4_dlslot_table[i].llist && p4_dlslot_table[slot].llist == p4_dlslot_table[i].llist) return 1; |
|
extern int p4_dlinit(void); extern const char* p4_dlerror (void); extern void* p4_dlopenext (const char* name); extern int p4_dlclose (const void* lib); extern void* p4_dlsym (const void* lib, const char* symbol); |
|
|
|
void p4_dlslot_close (int slot) { if (!INBETWEEN(slot,0,P4_DLSLOTS)) { P4_warn1 ( |
void p4_forget_loadm (void) |
void p4_forget_loadm_prelinked (void) |
void* p4_loadm (const p4char* nm, int l) { int slot; P4_enter2( |
/** (LOADM) |
void* p4_loadm_once(const p4char* nm, int l) { char name[260]; if (! nm || l<2) return 0; module_makename (name, nm, l); strcat (name, |
|
/** lt_dlinit |
/** lt_dlclose |
/** lt_dlerror |
|
|