Go to the source code of this file.
|
static BOOLEAN | DumpAscii (FILE *fd, idhdl h, char ***list_of_libs) |
|
static BOOLEAN | DumpAsciiIdhdl (FILE *fd, idhdl h, char ***list_of_libs) |
|
static const char * | GetIdString (idhdl h) |
|
static int | DumpRhs (FILE *fd, idhdl h) |
|
static BOOLEAN | DumpQring (FILE *fd, idhdl h, const char *type_str) |
|
static BOOLEAN | DumpAsciiMaps (FILE *fd, idhdl h, idhdl rhdl) |
|
static BOOLEAN | CollectLibs (char *name, char ***list_of_libs) |
|
BOOLEAN | slOpenAscii (si_link l, short flag, leftv) |
|
BOOLEAN | slCloseAscii (si_link l) |
|
leftv | slReadAscii2 (si_link l, leftv pr) |
|
leftv | slReadAscii (si_link l) |
|
BOOLEAN | slWriteAscii (si_link l, leftv v) |
|
const char * | slStatusAscii (si_link l, const char *request) |
|
BOOLEAN | slDumpAscii (si_link l) |
|
BOOLEAN | slGetDumpAscii (si_link l) |
|
void | slStandardInit () |
|
◆ MAX_LIBS
◆ CollectLibs()
static BOOLEAN CollectLibs |
( |
char * |
name, |
|
|
char *** |
list_of_libs |
|
) |
| |
|
static |
Definition at line 429 of file asciiLink.cc.
431 if (*list_of_libs==
NULL)
435 (*list_of_libs)[0]=
name;
436 (*list_of_libs)[
MAX_LIBS-1]=(
char*)1;
441 char **
p=*list_of_libs;
442 while (((*p)!=
NULL)&&((*p!=(
char*)1)))
void WerrorS(const char *s)
char name(const Variable &v)
◆ DumpAscii()
static BOOLEAN DumpAscii |
( |
FILE * |
fd, |
|
|
idhdl |
h, |
|
|
char *** |
list_of_libs |
|
) |
| |
|
static |
Definition at line 239 of file asciiLink.cc.
static BOOLEAN DumpAsciiIdhdl(FILE *fd, idhdl h, char ***list_of_libs)
static BOOLEAN DumpAscii(FILE *fd, idhdl h, char ***list_of_libs)
◆ DumpAsciiIdhdl()
static BOOLEAN DumpAsciiIdhdl |
( |
FILE * |
fd, |
|
|
idhdl |
h, |
|
|
char *** |
list_of_libs |
|
) |
| |
|
static |
Definition at line 287 of file asciiLink.cc.
290 int type_id =
IDTYP(h);
294 if (strcmp(
IDID(h),
"Top")==0)
return FALSE;
300 if (strcmp(
IDID(h),
"QQ")==0)
return FALSE;
301 if (strcmp(
IDID(h),
"ZZ")==0)
return FALSE;
303 if (strcmp(
IDID(h),
"AE")==0)
return FALSE;
304 if (strcmp(
IDID(h),
"QAE")==0)
return FALSE;
309 if (type_str ==
NULL)
327 if (fprintf(
fd,
"%s %s", type_str,
IDID(h)) == EOF)
333 if (fprintf(
fd,
"[%d][%d]", id->nrows, id->ncols)== EOF)
return TRUE;
343 if (fprintf(
fd,
"[%d][%d]", (
int)id->rank,
IDELEMS(
id))== EOF)
return TRUE;
348 return (fputs(
";\n",
fd) == EOF);
352 if (fputs(
" = ",
fd) == EOF)
return TRUE;
358 if (fputs(
";\n",
fd) == EOF)
return TRUE;
static const char * GetIdString(idhdl h)
static int DumpRhs(FILE *fd, idhdl h)
static BOOLEAN CollectLibs(char *name, char ***list_of_libs)
static BOOLEAN DumpQring(FILE *fd, idhdl h, const char *type_str)
◆ DumpAsciiMaps()
Definition at line 258 of file asciiLink.cc.
271 if (fprintf(
fd,
"setring %s;\n",
IDID(rhdl)) == EOF)
return TRUE;
273 IDMAP(h)->preimage, rhs) == EOF)
static BOOLEAN DumpAsciiMaps(FILE *fd, idhdl h, idhdl rhdl)
char * String(BOOLEAN typed=FALSE)
const char * Tok2Cmdname(int tok)
◆ DumpQring()
Definition at line 410 of file asciiLink.cc.
412 char *ring_str = h->
String();
418 if (fputs(
"attrib(temp_ideal, \"isSB\", 1);\n",
fd) == EOF)
return TRUE;
419 if (fprintf(
fd,
"%s %s = temp_ideal;\n", type_str,
IDID(h)) == EOF)
421 if (fputs(
"kill temp_ring;\n",
fd) == EOF)
return TRUE;
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
char * String(BOOLEAN typed=FALSE)
const char * Tok2Cmdname(int tok)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
char * iiStringMatrix(matrix im, int dim, const ring r, char ch)
◆ DumpRhs()
static int DumpRhs |
( |
FILE * |
fd, |
|
|
idhdl |
h |
|
) |
| |
|
static |
Definition at line 461 of file asciiLink.cc.
463 int type_id =
IDTYP(h);
487 while (*pstr !=
'\0')
489 if (*pstr ==
'"' || *pstr ==
'\\') fputc(
'\\',
fd);
501 char *pstr = pi->
data.s.body;
503 while (*pstr !=
'\0')
505 if (*pstr ==
'"' || *pstr ==
'\\') fputc(
'\\',
fd);
511 else fputs(
"(null)",
fd);
517 if (rhs ==
NULL)
return EOF;
521 else if (type_id ==
IDEAL_CMD) { fputs(
"ideal(",
fd);need_klammer=
TRUE; }
523 { fputs(
"module(",
fd);need_klammer=
TRUE; }
526 if (fputs(rhs,
fd) == EOF)
return EOF;
535 if (fprintf(
fd,
"; minpoly = %s", rhs) == EOF) {
omFree(rhs);
return EOF;}
538 else if (need_klammer) fputc(
')',
fd);
char * String(BOOLEAN typed=FALSE)
static int DumpRhs(FILE *fd, idhdl h)
void StringSetS(const char *st)
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
void p_Write(poly p, ring lmRing, ring tailRing)
◆ GetIdString()
Definition at line 363 of file asciiLink.cc.
372 int i, nl = l->
nr + 1;
static const char * GetIdString(idhdl h)
const char * Tok2Cmdname(int tok)
◆ slCloseAscii()
Definition at line 95 of file asciiLink.cc.
98 if (
l->name[0] !=
'\0')
100 return (fclose((FILE *)
l->data)!=0);
#define SI_LINK_SET_CLOSE_P(l)
◆ slDumpAscii()
Definition at line 210 of file asciiLink.cc.
212 FILE *
fd = (FILE *)
l->data;
214 char **list_of_libs=
NULL;
221 char **
p=list_of_libs;
224 while((*p!=
NULL) && (*p!=(
char*)1))
226 fprintf(fd,
"load(\"%s\",\"try\");\n",*p);
231 fputs(
"RETURN();\n",fd);
static BOOLEAN DumpAsciiMaps(FILE *fd, idhdl h, idhdl rhdl)
static BOOLEAN DumpAscii(FILE *fd, idhdl h, char ***list_of_libs)
◆ slGetDumpAscii()
Definition at line 543 of file asciiLink.cc.
545 if (
l->name[0] ==
'\0')
547 WerrorS(
"getdump: Can not get dump from stdin");
569 FILE *
f = (FILE *)
l->data;
BOOLEAN newFile(char *fname)
void WerrorS(const char *s)
◆ slOpenAscii()
Definition at line 34 of file asciiLink.cc.
39 if (
l->mode[0] !=
'\0' && (strcmp(
l->mode,
"r") == 0))
45 else if (strcmp(
l->mode,
"w") == 0) mode =
"w";
49 if (
l->name[0] ==
'\0')
54 l->data = (
void *) stdin;
59 l->data = (
void *) stdout;
67 char *filename=
l->name;
84 l->data = (
void *) outfile;
#define SI_LINK_SET_OPEN_P(l, flag)
FILE * myfopen(const char *path, const char *mode)
◆ slReadAscii()
Definition at line 140 of file asciiLink.cc.
143 memset(&tmp,0,
sizeof(
sleftv));
145 tmp.
data=(
void*)
"? ";
Class used for (list of) interpreter objects.
leftv slReadAscii2(si_link l, leftv pr)
◆ slReadAscii2()
Definition at line 105 of file asciiLink.cc.
107 FILE *
fp=(FILE *)
l->data;
109 if (fp!=
NULL &&
l->name[0] !=
'\0')
117 Print(
"//Reading %ld chars\n",len);
130 WerrorS(
"read(<link>,<string>) expected");
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
Class used for (list of) interpreter objects.
void WerrorS(const char *s)
size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
int status int void * buf
const Variable & v
< [in] a sqrfree bivariate poly
◆ slStandardInit()
Definition at line 577 of file asciiLink.cc.
const CanonicalForm int s
leftv slReadAscii(si_link l)
BOOLEAN slOpenAscii(si_link l, short flag, leftv)
si_link_extension si_link_root
BOOLEAN slGetDumpAscii(si_link l)
omBin s_si_link_extension_bin
leftv slReadAscii2(si_link l, leftv pr)
const char * slStatusAscii(si_link l, const char *request)
BOOLEAN slCloseAscii(si_link l)
BOOLEAN slWriteAscii(si_link l, leftv v)
BOOLEAN slDumpAscii(si_link l)
◆ slStatusAscii()
Definition at line 193 of file asciiLink.cc.
195 if (strcmp(request,
"read") == 0)
198 else return "not ready";
200 else if (strcmp(request,
"write") == 0)
203 else return "not ready";
205 else return "unknown status request";
#define SI_LINK_R_OPEN_P(l)
#define SI_LINK_W_OPEN_P(l)
◆ slWriteAscii()
Definition at line 149 of file asciiLink.cc.
151 FILE *outfile=(FILE *)
l->data;
162 ideal I=(ideal)v->
Data();
166 fwrite(s,strlen(s),1,outfile);
168 if (
i<
IDELEMS(I)-1) fwrite(
",",1,1,outfile);
183 WerrorS(
"cannot convert to string");
const CanonicalForm int s
void WerrorS(const char *s)
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
◆ si_link_root
si_link_extension si_link_root |