Go to the source code of this file.
◆ slCleanUp()
Definition at line 127 of file silink.cc.
128{
132 {
134 {
135 if (
l->m->Close !=
NULL)
l->m->Close(
l);
136 }
137 if ((
l->data !=
NULL) && (
l->m->Kill !=
NULL))
l->m->Kill(
l);
140 memset((
void *)
l, 0,
sizeof(ip_link));
141 }
144}
VAR volatile BOOLEAN do_shutdown
VAR volatile int defer_shutdown
#define SI_LINK_OPEN_P(l)
◆ slClose()
Definition at line 242 of file silink.cc.
243{
244
247
250 if (
l->m->Close !=
NULL)
251 {
252 res =
l->m->Close(
l);
254 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
255 l->m->type,
l->mode,
l->name);
256 }
261}
void Werror(const char *fmt,...)
#define SI_LINK_SET_CLOSE_P(l)
◆ slDump()
Definition at line 346 of file silink.cc.
347{
349
351 {
353 }
354
356 {
357 if (
l->m->Dump !=
NULL)
359 else
361
363 Werror(
"dump: Error for link of type %s, mode: %s, name: %s",
364 l->m->type,
l->mode,
l->name);
367 }
368 else
369 {
370 Werror(
"dump: Error to open link of type %s, mode: %s, name: %s for writing",
371 l->m->type,
l->mode,
l->name);
373 }
374}
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 376 of file silink.cc.
377{
379
381 {
383 }
384
386 {
387 if (
l->m->GetDump !=
NULL)
388 res =
l->m->GetDump(
l);
389 else
391
393 Werror(
"getdump: Error for link of type %s, mode: %s, name: %s",
394 l->m->type,
l->mode,
l->name);
395
397 }
398 else
399 {
400 Werror(
"dump: Error open link of type %s, mode: %s, name: %s for reading",
401 l->m->type,
l->mode,
l->name);
403 }
404}
◆ slInit()
Definition at line 48 of file silink.cc.
49{
52
53
55 {
56
58 while (istr[
i] !=
':' && istr[
i] !=
'\0')
i++;
60 {
61
63 {
67 }
68
70 while (istr[
j] !=
' ' && istr[
j] !=
'\0')
j++;
72 {
75 }
76
77 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
79 }
80 else
81 {
83 while (istr[
j] ==
' '&& istr[
j] !=
'\0')
j++;
85 }
86 }
87
88
90 {
92 si_link_extension prev =
s;
93
94 while (strcmp(
s->type, type) != 0)
95 {
97 {
100 break;
101 }
102 else
103 {
105 }
106 }
107
110 else
111 {
113 }
115 }
116 else
118
120
125}
const CanonicalForm int s
VAR si_link_extension si_link_root
static si_link_extension slTypeInit(si_link_extension s, const char *type)
int name
New type name for int.
◆ slKill()
Definition at line 146 of file silink.cc.
147{
150 if ((
l!=
NULL) &&(
l->ref == 0))
154}
#define omFreeBin(addr, bin)
void slCleanUp(si_link l)
◆ slOpen()
Definition at line 194 of file silink.cc.
195{
198 {
199
201
203
204 const char *c="_";;
206
208 {
209 Warn(
"open: link of type: %s, mode: %s, name: %s is already open",
210 l->m->type,
l->mode,
l->name);
212 }
213 else if (
l->m->Open !=
NULL)
214 {
215 res =
l->m->Open(
l, flag,
h);
217 Werror(
"open: Error for link %s of type: %s, mode: %s, name: %s",
218 c,
l->m->type,
l->mode,
l->name);
219 }
221 }
223}
void WerrorS(const char *s)
BOOLEAN slInit(si_link l, char *istr)
GLOBAL_VAR BOOLEAN FE_OPT_NO_SHELL_FLAG
BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN)
◆ slPrepClose()
Definition at line 225 of file silink.cc.
226{
227
230
232 if (
l->m->PrepClose !=
NULL)
233 {
234 res =
l->m->PrepClose(
l);
236 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
237 l->m->type,
l->mode,
l->name);
238 }
240}
◆ slRead()
Definition at line 263 of file silink.cc.
264{
267 {
268#ifdef HAVE_DBM
269#ifdef USE_GDBM
271 {
273 }
274#endif
275#endif
277 }
278
280 {
282 {
283 if (
l->m->Read !=
NULL)
v =
l->m->Read(
l);
284 }
285 else
286 {
287 if (
l->m->Read2 !=
NULL)
v =
l->m->Read2(
l,a);
288 }
289 }
290 else
291 {
292 Werror(
"read: Error to open link of type %s, mode: %s, name: %s for reading",
293 l->m->type,
l->mode,
l->name);
295 }
296
297
299 {
302 }
303 else
304 Werror(
"read: Error for link of type %s, mode: %s, name: %s",
305 l->m->type,
l->mode,
l->name);
307}
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 189 of file silink.cc.
190{
193}
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 156 of file silink.cc.
157{
158 if (
l ==
NULL)
return "empty link";
159 else if (
l->m ==
NULL)
return "unknown link type";
160 else if (strcmp(request,
"type") == 0)
return l->m->type;
161 else if (strcmp(request,
"mode") == 0)
return l->mode;
162 else if (strcmp(request,
"name") == 0)
return l->name;
163 else if (strcmp(request, "exists") ==0)
164 {
166 if (si_lstat(
l->name,&
buf)==0)
return "yes";
167 else return "no";
168 }
169 else if (strcmp(request, "open") == 0)
170 {
172 else return "no";
173 }
174 else if (strcmp(request, "openread") == 0)
175 {
177 else return "no";
178 }
179 else if (strcmp(request, "openwrite") == 0)
180 {
182 else return "no";
183 }
184 else if (
l->m->Status ==
NULL)
return "unknown status request";
185 else return l->m->Status(
l, request);
186}
int status int void * buf
◆ slTypeInit()
static si_link_extension slTypeInit |
( |
si_link_extension |
s, |
|
|
const char * |
type |
|
) |
| |
|
static |
Definition at line 409 of file silink.cc.
410{
414
415 if (0)
416 ;
417#ifdef HAVE_DBM
418 else if (strcmp(type, "DBM") == 0)
420#endif
421#if 1
422 else if (strcmp(type, "ssi") == 0)
424#endif
425#if 1
426 else if (strcmp(type, "|") == 0)
428#endif
429 else
430 {
431 Warn(
"Found unknown link type: %s", type);
435 }
436
438 {
439 Werror(
"Can not initialize link type %s", type);
442 }
444}
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 309 of file silink.cc.
310{
312
314 {
315#ifdef HAVE_DBM
316#ifdef USE_GDBM
318 {
320 }
321#endif
322#endif
324 }
325
327 {
328 if (
l->m->Write !=
NULL)
330 else
332
334 Werror(
"write: Error for link of type %s, mode: %s, name: %s",
335 l->m->type,
l->mode,
l->name);
337 }
338 else
339 {
340 Werror(
"write: Error to open link of type %s, mode: %s, name: %s for writing",
341 l->m->type,
l->mode,
l->name);
343 }
344}
◆ FE_OPT_NO_SHELL_FLAG
◆ ip_link_bin
◆ s_si_link_extension_bin
◆ si_link_root
VAR si_link_extension si_link_root =NULL |
◆ sip_link_bin