My Project
Loading...
Searching...
No Matches
slInit_Dynamic.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/***************************************************************
5 * File: slInit_Dynamic.cc
6 * Purpose: link initialization for dynamic linking
7 * Author: obachman (Olaf Bachmann)
8 * Created: 12/00
9 *******************************************************************/
10
11
12
13
14#include "kernel/mod2.h"
17#include "Singular/mod_lib.h"
18
19#ifdef HAVE_DL
20
21#ifdef HAVE_DBM
22#include "dbm_sl.h"
23
25static void* slInitDBMHandle()
26{
27 if (dbm_so_handle == NULL)
29
30 return dbm_so_handle;
31}
32
33si_link_extension slInitDBMExtension(si_link_extension s)
34{
35 void* handle = slInitDBMHandle();
36
37 if (handle == NULL) return NULL;
38
39 s->Open=(slOpenProc)dynl_sym_warn(handle, "dbOpen");
40 s->Close=(slCloseProc)dynl_sym_warn(handle, "dbClose");
41 s->Kill=NULL;
42 s->Read=(slReadProc)dynl_sym_warn(handle, "dbRead1");
43 s->Read2=(slRead2Proc)dynl_sym_warn(handle, "dbRead2");
44 s->Write=(slWriteProc)dynl_sym_warn(handle, "dbWrite");
45
46 if (s->Open == NULL || s->Close == NULL ||
47 s->Read == NULL || s->Read2 == NULL)
48 return NULL;
49
50 s->Status=slStatusAscii;
51 s->type="DBM";
52 return s;
53}
54
55#endif
56#endif
57
const CanonicalForm int s
Definition: facAbsFact.cc:51
#define STATIC_VAR
Definition: globaldefs.h:7
void * dynl_open_binary_warn(const char *binary_name, const char *msg)
Definition: mod_raw.cc:45
void * dynl_sym_warn(void *handle, const char *proc, const char *msg)
Definition: mod_raw.cc:89
#define NULL
Definition: omList.c:12
STATIC_VAR void * dbm_so_handle
si_link_extension slInitDBMExtension(si_link_extension s)
static void * slInitDBMHandle()