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 240 of file silink.cc.
241{
242
245
248 if (
l->m->Close !=
NULL)
249 {
250 res =
l->m->Close(
l);
252 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
253 l->m->type,
l->mode,
l->name);
254 }
259}
void Werror(const char *fmt,...)
#define SI_LINK_SET_CLOSE_P(l)
◆ slDump()
Definition at line 344 of file silink.cc.
345{
347
349 {
351 }
352
354 {
355 if (
l->m->Dump !=
NULL)
357 else
359
361 Werror(
"dump: Error for link of type %s, mode: %s, name: %s",
362 l->m->type,
l->mode,
l->name);
365 }
366 else
367 {
368 Werror(
"dump: Error to open link of type %s, mode: %s, name: %s for writing",
369 l->m->type,
l->mode,
l->name);
371 }
372}
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 374 of file silink.cc.
375{
377
379 {
381 }
382
384 {
385 if (
l->m->GetDump !=
NULL)
386 res =
l->m->GetDump(
l);
387 else
389
391 Werror(
"getdump: Error for link of type %s, mode: %s, name: %s",
392 l->m->type,
l->mode,
l->name);
393
395 }
396 else
397 {
398 Werror(
"dump: Error open link of type %s, mode: %s, name: %s for reading",
399 l->m->type,
l->mode,
l->name);
401 }
402}
◆ 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}
EXTERN_VAR si_link_extension si_link_root
const CanonicalForm int s
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
202 const char *c="_";;
204
206 {
207 Warn(
"open: link of type: %s, mode: %s, name: %s is already open",
208 l->m->type,
l->mode,
l->name);
210 }
211 else if (
l->m->Open !=
NULL)
212 {
213 res =
l->m->Open(
l, flag,
h);
215 Werror(
"open: Error for link %s of type: %s, mode: %s, name: %s",
216 c,
l->m->type,
l->mode,
l->name);
217 }
219 }
221}
BOOLEAN slInit(si_link l, char *istr)
BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN)
◆ slPrepClose()
Definition at line 223 of file silink.cc.
224{
225
228
230 if (
l->m->PrepClose !=
NULL)
231 {
232 res =
l->m->PrepClose(
l);
234 Werror(
"close: Error for link of type: %s, mode: %s, name: %s",
235 l->m->type,
l->mode,
l->name);
236 }
238}
◆ slRead()
Definition at line 261 of file silink.cc.
262{
265 {
266#ifdef HAVE_DBM
267#ifdef USE_GDBM
269 {
271 }
272#endif
273#endif
275 }
276
278 {
280 {
281 if (
l->m->Read !=
NULL)
v =
l->m->Read(
l);
282 }
283 else
284 {
285 if (
l->m->Read2 !=
NULL)
v =
l->m->Read2(
l,a);
286 }
287 }
288 else
289 {
290 Werror(
"read: Error to open link of type %s, mode: %s, name: %s for reading",
291 l->m->type,
l->mode,
l->name);
293 }
294
295
297 {
300 }
301 else
302 Werror(
"read: Error for link of type %s, mode: %s, name: %s",
303 l->m->type,
l->mode,
l->name);
305}
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
#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 407 of file silink.cc.
408{
412
413 if (0)
414 ;
415#ifdef HAVE_DBM
416 else if (strcmp(type, "DBM") == 0)
418#endif
419#if 1
420 else if (strcmp(type, "ssi") == 0)
422#endif
423#if 1
424 else if (strcmp(type, "|") == 0)
426#endif
427 else
428 {
429 Warn(
"Found unknown link type: %s", type);
433 }
434
436 {
437 Werror(
"Can not initialize link type %s", type);
440 }
442}
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 307 of file silink.cc.
308{
310
312 {
313#ifdef HAVE_DBM
314#ifdef USE_GDBM
316 {
318 }
319#endif
320#endif
322 }
323
325 {
326 if (
l->m->Write !=
NULL)
328 else
330
332 Werror(
"write: Error for link of type %s, mode: %s, name: %s",
333 l->m->type,
l->mode,
l->name);
335 }
336 else
337 {
338 Werror(
"write: Error to open link of type %s, mode: %s, name: %s for writing",
339 l->m->type,
l->mode,
l->name);
341 }
342}
◆ 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