source: git/Singular/links/slInit_Dynamic.cc @ 72df18

fieker-DuValspielwiese
Last change on this file since 72df18 was a3f0fea, checked in by Reimer Behrends <behrends@…>, 5 years ago
Modify variable declarions for pSingular.
  • Property mode set to 100644
File size: 1.3 KB
Line 
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"
15#include "Singular/links/silink.h"
16#include "Singular/links/slInit.h"
17#include "Singular/mod_lib.h"
18
19#ifdef HAVE_DL
20
21#ifdef HAVE_DBM
22#include "dbm_sl.h"
23
24STATIC_VAR void* dbm_so_handle = NULL;
25static void* slInitDBMHandle()
26{
27  if (dbm_so_handle == NULL)
28    dbm_so_handle = dynl_open_binary_warn("dbmsr");
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
Note: See TracBrowser for help on using the repository browser.