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 423 of file asciiLink.cc.
425 if (*list_of_libs==
NULL)
429 (*list_of_libs)[0]=
name;
430 (*list_of_libs)[
MAX_LIBS-1]=(
char*)1;
435 char **
p=*list_of_libs;
436 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 240 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 288 of file asciiLink.cc.
291 int type_id =
IDTYP(h);
295 if (strcmp(
IDID(h),
"Top")==0)
return FALSE;
301 if (strcmp(
IDID(h),
"QQ")==0)
return FALSE;
302 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;
305 if (strcmp(
IDID(h),
"flint_poly_Q")==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 return (fputs(
";\n",
fd) == EOF);
347 if (fputs(
" = ",
fd) == EOF)
return TRUE;
353 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 259 of file asciiLink.cc.
272 if (fprintf(
fd,
"setring %s;\n",
IDID(rhdl)) == EOF)
return TRUE;
274 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 404 of file asciiLink.cc.
406 char *ring_str = h->
String();
412 if (fputs(
"attrib(temp_ideal, \"isSB\", 1);\n",
fd) == EOF)
return TRUE;
413 if (fprintf(
fd,
"%s %s = temp_ideal;\n", type_str,
IDID(h)) == EOF)
415 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 455 of file asciiLink.cc.
457 int type_id =
IDTYP(h);
481 while (*pstr !=
'\0')
483 if (*pstr ==
'"' || *pstr ==
'\\') fputc(
'\\',
fd);
495 char *pstr = pi->
data.s.body;
497 while (*pstr !=
'\0')
499 if (*pstr ==
'"' || *pstr ==
'\\') fputc(
'\\',
fd);
505 else fputs(
"(null)",
fd);
511 if (rhs ==
NULL)
return EOF;
515 else if (type_id ==
IDEAL_CMD) { fputs(
"ideal(",
fd);need_klammer=
TRUE; }
516 else if (type_id ==
MODUL_CMD) { fputs(
"module(",
fd);need_klammer=
TRUE; }
519 if (fputs(rhs,
fd) == EOF)
return EOF;
528 if (fprintf(
fd,
"; minpoly = %s", rhs) == EOF) {
omFree(rhs);
return EOF;}
531 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 358 of file asciiLink.cc.
367 int i, nl = l->
nr + 1;
static const char * GetIdString(idhdl h)
const char * Tok2Cmdname(int tok)
◆ slCloseAscii()
Definition at line 96 of file asciiLink.cc.
99 if (
l->name[0] !=
'\0')
101 return (fclose((FILE *)
l->data)!=0);
#define SI_LINK_SET_CLOSE_P(l)
◆ slDumpAscii()
Definition at line 211 of file asciiLink.cc.
213 FILE *
fd = (FILE *)
l->data;
215 char **list_of_libs=
NULL;
222 char **
p=list_of_libs;
225 while((*p!=
NULL) && (*p!=(
char*)1))
227 fprintf(fd,
"load(\"%s\",\"try\");\n",*p);
232 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 536 of file asciiLink.cc.
538 if (
l->name[0] ==
'\0')
540 WerrorS(
"getdump: Can not get dump from stdin");
562 FILE *
f = (FILE *)
l->data;
BOOLEAN newFile(char *fname)
void WerrorS(const char *s)
◆ slOpenAscii()
Definition at line 35 of file asciiLink.cc.
40 if (
l->mode[0] !=
'\0' && (strcmp(
l->mode,
"r") == 0))
46 else if (strcmp(
l->mode,
"w") == 0) mode =
"w";
50 if (
l->name[0] ==
'\0')
55 l->data = (
void *) stdin;
60 l->data = (
void *) stdout;
68 char *filename=
l->name;
85 l->data = (
void *) outfile;
#define SI_LINK_SET_OPEN_P(l, flag)
FILE * myfopen(const char *path, const char *mode)
◆ slReadAscii()
Definition at line 141 of file asciiLink.cc.
144 memset(&tmp,0,
sizeof(
sleftv));
146 tmp.
data=(
void*)
"? ";
Class used for (list of) interpreter objects.
leftv slReadAscii2(si_link l, leftv pr)
◆ slReadAscii2()
Definition at line 106 of file asciiLink.cc.
108 FILE *
fp=(FILE *)
l->data;
110 if (fp!=
NULL &&
l->name[0] !=
'\0')
118 Print(
"//Reading %ld chars\n",len);
131 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 570 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 194 of file asciiLink.cc.
196 if (strcmp(request,
"read") == 0)
199 else return "not ready";
201 else if (strcmp(request,
"write") == 0)
204 else return "not ready";
206 else return "unknown status request";
#define SI_LINK_R_OPEN_P(l)
#define SI_LINK_W_OPEN_P(l)
◆ slWriteAscii()
Definition at line 150 of file asciiLink.cc.
152 FILE *outfile=(FILE *)
l->data;
163 ideal I=(ideal)v->
Data();
167 fwrite(s,strlen(s),1,outfile);
169 if (
i<
IDELEMS(I)-1) fwrite(
",",1,1,outfile);
184 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 |