Loading...
Searching...
No Matches
slInit_Dynamic.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: slInit_Dynamic.cc
* Purpose: link initialization for dynamic linking
* Author: obachman (Olaf Bachmann)
* Created: 12/00
*******************************************************************/
#include "kernel/mod2.h"
#include "Singular/links/silink.h"
#include "Singular/links/slInit.h"
#include "Singular/mod_lib.h"
#ifdef HAVE_DL
#ifdef HAVE_DBM
#include "dbm_sl.h"
STATIC_VAR void* dbm_so_handle = NULL;
static void* slInitDBMHandle()
{
if (dbm_so_handle == NULL)
dbm_so_handle = dynl_open_binary_warn("dbmsr");
return dbm_so_handle;
}
si_link_extension slInitDBMExtension(si_link_extension s)
{
void* handle = slInitDBMHandle();
if (handle == NULL) return NULL;
s->Open=(slOpenProc)dynl_sym_warn(handle, "dbOpen");
s->Close=(slCloseProc)dynl_sym_warn(handle, "dbClose");
s->Kill=NULL;
s->Read=(slReadProc)dynl_sym_warn(handle, "dbRead1");
s->Read2=(slRead2Proc)dynl_sym_warn(handle, "dbRead2");
s->Write=(slWriteProc)dynl_sym_warn(handle, "dbWrite");
if (s->Open == NULL || s->Close == NULL ||
s->Read == NULL || s->Read2 == NULL)
return NULL;
s->Status=slStatusAscii;
s->type="DBM";
return s;
}
#endif
#endif
slStatusAscii
const char * slStatusAscii(si_link l, const char *request)
Definition asciiLink.cc:211
dbm_sl.h
s
const CanonicalForm int s
Definition facAbsFact.cc:51
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
mod2.h
mod_lib.h
dynl_open_binary_warn
void * dynl_open_binary_warn(const char *binary_name, const char *msg)
Definition mod_raw.cc:45
dynl_sym_warn
void * dynl_sym_warn(void *handle, const char *proc, const char *msg)
Definition mod_raw.cc:89
NULL
#define NULL
Definition omList.c:12
silink.h
slRead2Proc
leftv(* slRead2Proc)(si_link l, leftv a)
Definition silink.h:30
slWriteProc
BOOLEAN(* slWriteProc)(si_link l, leftv lv)
Definition silink.h:25
slReadProc
leftv(* slReadProc)(si_link l)
Definition silink.h:29
slOpenProc
BOOLEAN(* slOpenProc)(si_link l, short flag, leftv h)
Definition silink.h:24
slCloseProc
BOOLEAN(* slCloseProc)(si_link l)
Definition silink.h:26
slInit.h
dbm_so_handle
STATIC_VAR void * dbm_so_handle
Definition slInit_Dynamic.cc:24
slInitDBMExtension
si_link_extension slInitDBMExtension(si_link_extension s)
Definition slInit_Dynamic.cc:33
slInitDBMHandle
static void * slInitDBMHandle()
Definition slInit_Dynamic.cc:25