Go to the source code of this file.
◆ slCleanUp()
Definition at line 126 of file silink.cc.
127{
131 {
133 {
134 if (
l->m->Close !=
NULL)
l->m->Close(
l);
135 }
136 if ((
l->data !=
NULL) && (
l->m->Kill !=
NULL))
l->m->Kill(
l);
139 memset((
void *)
l, 0,
sizeof(ip_link));
140 }
143}
VAR volatile BOOLEAN do_shutdown
VAR volatile int defer_shutdown
#define SI_LINK_OPEN_P(l)
◆ slClose()
Definition at line 241 of file silink.cc.
242{
243
246
249 if (
l->m->Close !=
NULL)
250 {
251 res =
l->m->Close(
l);
253 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
254 l->m->type,
l->mode,
l->name);
255 }
260}
void Werror(const char *fmt,...)
#define SI_LINK_SET_CLOSE_P(l)
◆ slDump()
Definition at line 345 of file silink.cc.
346{
348
350 {
352 }
353
355 {
356 if (
l->m->Dump !=
NULL)
358 else
360
362 Werror(
"dump: Error for link of type %s, mode: %s, name: %s",
363 l->m->type,
l->mode,
l->name);
366 }
367 else
368 {
369 Werror(
"dump: Error to open link of type %s, mode: %s, name: %s for writing",
370 l->m->type,
l->mode,
l->name);
372 }
373}
BOOLEAN slClose(si_link l)
BOOLEAN slOpen(si_link l, short flag, leftv h)
#define SI_LINK_W_OPEN_P(l)
#define SI_LINK_R_OPEN_P(l)
◆ slGetDump()
Definition at line 375 of file silink.cc.
376{
378
380 {
382 }
383
385 {
386 if (
l->m->GetDump !=
NULL)
387 res =
l->m->GetDump(
l);
388 else
390
392 Werror(
"getdump: Error for link of type %s, mode: %s, name: %s",
393 l->m->type,
l->mode,
l->name);
394
396 }
397 else
398 {
399 Werror(
"dump: Error open link of type %s, mode: %s, name: %s for reading",
400 l->m->type,
l->mode,
l->name);
402 }
403}
◆ slInit()
Definition at line 47 of file silink.cc.
48{
51
52
54 {
55
57 while (istr[
i] !=
':' && istr[
i] !=
'\0')
i++;
59 {
60
62 {
66 }
67
69 while (istr[
j] !=
' ' && istr[
j] !=
'\0')
j++;
71 {
74 }
75
76 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
78 }
79 else
80 {
82 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
84 }
85 }
86
87
89 {
91 si_link_extension prev =
s;
92
93 while (strcmp(
s->type, type) != 0)
94 {
96 {
99 break;
100 }
101 else
102 {
104 }
105 }
106
109 else
110 {
112 }
114 }
115 else
117
119
124}
const CanonicalForm int s
VAR si_link_extension si_link_root
static si_link_extension slTypeInit(si_link_extension s, const char *type)
char name(const Variable &v)
◆ slKill()
Definition at line 145 of file silink.cc.
146{
149 if ((
l!=
NULL) &&(
l->ref == 0))
153}
#define omFreeBin(addr, bin)
void slCleanUp(si_link l)
◆ slOpen()
Definition at line 193 of file silink.cc.
194{
197 {
198
200
202
203 const char *c="_";;
205
207 {
208 Warn(
"open: link of type: %s, mode: %s, name: %s is already open",
209 l->m->type,
l->mode,
l->name);
211 }
212 else if (
l->m->Open !=
NULL)
213 {
214 res =
l->m->Open(
l, flag,
h);
216 Werror(
"open: Error for link %s of type: %s, mode: %s, name: %s",
217 c,
l->m->type,
l->mode,
l->name);
218 }
220 }
222}
void WerrorS(const char *s)
static void * feOptValue(feOptIndex opt)
BOOLEAN slInit(si_link l, char *istr)
BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN)
◆ slPrepClose()
Definition at line 224 of file silink.cc.
225{
226
229
231 if (
l->m->PrepClose !=
NULL)
232 {
233 res =
l->m->PrepClose(
l);
235 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
236 l->m->type,
l->mode,
l->name);
237 }
239}
◆ slRead()
Definition at line 262 of file silink.cc.
263{
266 {
267#ifdef HAVE_DBM
268#ifdef USE_GDBM
270 {
272 }
273#endif
274#endif
276 }
277
279 {
281 {
282 if (
l->m->Read !=
NULL)
v =
l->m->Read(
l);
283 }
284 else
285 {
286 if (
l->m->Read2 !=
NULL)
v =
l->m->Read2(
l,a);
287 }
288 }
289 else
290 {
291 Werror(
"read: Error to open link of type %s, mode: %s, name: %s for reading",
292 l->m->type,
l->mode,
l->name);
294 }
295
296
298 {
301 }
302 else
303 Werror(
"read: Error for link of type %s, mode: %s, name: %s",
304 l->m->type,
l->mode,
l->name);
306}
Class used for (list of) interpreter objects.
const Variable & v
< [in] a sqrfree bivariate poly
#define SI_LINK_CLOSE_P(l)
◆ slSetRingDummy()
Definition at line 188 of file silink.cc.
189{
192}
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
◆ slStatus()
Definition at line 155 of file silink.cc.
156{
157 if (
l ==
NULL)
return "empty link";
158 else if (
l->m ==
NULL)
return "unknown link type";
159 else if (strcmp(request,
"type") == 0)
return l->m->type;
160 else if (strcmp(request,
"mode") == 0)
return l->mode;
161 else if (strcmp(request,
"name") == 0)
return l->name;
162 else if (strcmp(request, "exists") ==0)
163 {
165 if (si_lstat(
l->name,&
buf)==0)
return "yes";
166 else return "no";
167 }
168 else if (strcmp(request, "open") == 0)
169 {
171 else return "no";
172 }
173 else if (strcmp(request, "openread") == 0)
174 {
176 else return "no";
177 }
178 else if (strcmp(request, "openwrite") == 0)
179 {
181 else return "no";
182 }
183 else if (
l->m->Status ==
NULL)
return "unknown status request";
184 else return l->m->Status(
l, request);
185}
int status int void * buf
◆ slTypeInit()
static si_link_extension slTypeInit |
( |
si_link_extension |
s, |
|
|
const char * |
type |
|
) |
| |
|
static |
Definition at line 408 of file silink.cc.
409{
413
414 if (0)
415 ;
416#ifdef HAVE_DBM
417 else if (strcmp(type, "DBM") == 0)
419#endif
420#if 1
421 else if (strcmp(type, "ssi") == 0)
423#endif
424#if 1
425 else if (strcmp(type, "|") == 0)
427#endif
428 else
429 {
430 Warn(
"Found unknown link type: %s", type);
434 }
435
437 {
438 Werror(
"Can not initialize link type %s", type);
441 }
443}
si_link_extension slInitPipeExtension(si_link_extension s)
VAR omBin s_si_link_extension_bin
si_link_extension slInitDBMExtension(si_link_extension s)
si_link_extension slInitSsiExtension(si_link_extension s)
◆ slWrite()
Definition at line 308 of file silink.cc.
309{
311
313 {
314#ifdef HAVE_DBM
315#ifdef USE_GDBM
317 {
319 }
320#endif
321#endif
323 }
324
326 {
327 if (
l->m->Write !=
NULL)
329 else
331
333 Werror(
"write: Error for link of type %s, mode: %s, name: %s",
334 l->m->type,
l->mode,
l->name);
336 }
337 else
338 {
339 Werror(
"write: Error to open link of type %s, mode: %s, name: %s for writing",
340 l->m->type,
l->mode,
l->name);
342 }
343}
◆ ip_link_bin
◆ s_si_link_extension_bin
◆ si_link_root
VAR si_link_extension si_link_root =NULL |
◆ sip_link_bin