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) |
|
static BOOLEAN | DumpNCring (FILE *fd, idhdl h) |
|
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 483 of file asciiLink.cc.
485 if (*list_of_libs==
NULL)
489 (*list_of_libs)[0]=
name;
490 (*list_of_libs)[
MAX_LIBS-1]=(
char*)1;
495 char **
p=*list_of_libs;
496 while (((*
p)!=
NULL)&&((*
p!=(
char*)1)))
char name(const Variable &v)
void WerrorS(const char *s)
◆ DumpAscii()
static BOOLEAN DumpAscii |
( |
FILE * |
fd, |
|
|
idhdl |
h, |
|
|
char *** |
list_of_libs |
|
) |
| |
|
static |
Definition at line 255 of file asciiLink.cc.
static BOOLEAN DumpAscii(FILE *fd, idhdl h, char ***list_of_libs)
static BOOLEAN DumpAsciiIdhdl(FILE *fd, idhdl h, char ***list_of_libs)
◆ DumpAsciiIdhdl()
static BOOLEAN DumpAsciiIdhdl |
( |
FILE * |
fd, |
|
|
idhdl |
h, |
|
|
char *** |
list_of_libs |
|
) |
| |
|
static |
Definition at line 303 of file asciiLink.cc.
326 if (type_str ==
NULL)
348 if (fprintf(
fd,
"%s %s", type_str,
IDID(
h)) == EOF)
354 if (fprintf(
fd,
"[%d][%d]", id->nrows, id->ncols)== EOF)
return TRUE;
364 if (fprintf(
fd,
"[%d][%d]", (
int)id->rank,
IDELEMS(
id))== EOF)
return TRUE;
369 return (fputs(
";\n",
fd) == EOF);
373 if (fputs(
" = ",
fd) == EOF)
return TRUE;
379 if (fputs(
";\n",
fd) == EOF)
return TRUE;
static const char * GetIdString(idhdl h)
static BOOLEAN CollectLibs(char *name, char ***list_of_libs)
static BOOLEAN DumpNCring(FILE *fd, idhdl h)
static int DumpRhs(FILE *fd, idhdl h)
static BOOLEAN DumpQring(FILE *fd, idhdl h)
static BOOLEAN rIsNCRing(const ring r)
◆ DumpAsciiMaps()
Definition at line 274 of file asciiLink.cc.
287 if (fprintf(
fd,
"setring %s;\n",
IDID(rhdl)) == EOF)
return TRUE;
289 IDMAP(
h)->preimage, rhs) == EOF)
static BOOLEAN DumpAsciiMaps(FILE *fd, idhdl h, idhdl rhdl)
const char * Tok2Cmdname(int tok)
◆ DumpNCring()
Definition at line 434 of file asciiLink.cc.
436 char *ring_str =
h->String();
441 if (fprintf(
fd,
"ring temp_ring = %s;\n", ring_str)
443 if (fprintf(
fd,
"ideal temp_C = %s;\n",
446 if (fprintf(
fd,
"ideal temp_D = %s;\n",
449 if (fprintf(
fd,
"def %s = nc_algebra(temp_C,temp_D);\n",
IDID(
h)) == EOF)
451 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 * iiStringMatrix(matrix im, int dim, const ring r, char ch)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static BOOLEAN rIsLPRing(const ring r)
◆ DumpQring()
Definition at line 464 of file asciiLink.cc.
466 char *ring_str =
h->String();
468 if (fprintf(
fd,
"ring temp_ring = %s;\n", ring_str) == EOF)
return TRUE;
469 if (fprintf(
fd,
"ideal temp_ideal = %s;\n",
472 if (fputs(
"attrib(temp_ideal, \"isSB\", 1);\n",
fd) == EOF)
return TRUE;
473 if (fprintf(
fd,
"qring %s = temp_ideal;\n",
IDID(
h)) == EOF)
475 if (fputs(
"kill temp_ring;\n",
fd) == EOF)
return TRUE;
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
◆ DumpRhs()
static int DumpRhs |
( |
FILE * |
fd, |
|
|
idhdl |
h |
|
) |
| |
|
static |
Definition at line 515 of file asciiLink.cc.
541 while (*
pstr !=
'\0')
543 if (*
pstr ==
'"' || *
pstr ==
'\\') fputc(
'\\',
fd);
555 char *
pstr =
pi->data.s.body;
557 while (*
pstr !=
'\0')
559 if (*
pstr ==
'"' || *
pstr ==
'\\') fputc(
'\\',
fd);
565 else fputs(
"(null)",
fd);
569 char *rhs =
h->String();
571 if (rhs ==
NULL)
return EOF;
575 else if (type_id ==
IDEAL_CMD) { fputs(
"ideal(",
fd);need_klammer=
TRUE; }
577 { fputs(
"module(",
fd);need_klammer=
TRUE; }
580 if (fputs(rhs,
fd) == EOF)
return EOF;
589 if (fprintf(
fd,
"; minpoly = %s", rhs) == EOF) {
omFree(rhs);
return EOF;}
592 else if (need_klammer) fputc(
')',
fd);
@ n_algExt
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)
void StringSetS(const char *st)
◆ GetIdString()
◆ 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 226 of file asciiLink.cc.
228 FILE *
fd = (FILE *)
l->data;
230 char **list_of_libs=
NULL;
237 char **
p=list_of_libs;
240 while((*
p!=
NULL) && (*
p!=(
char*)1))
242 fprintf(
fd,
"load(\"%s\",\"try\");\n",*
p);
247 fputs(
"RETURN();\n",
fd);
◆ slGetDumpAscii()
Definition at line 597 of file asciiLink.cc.
599 if (
l->name[0] ==
'\0')
601 WerrorS(
"getdump: Can not get dump from stdin");
623 FILE *
f = (FILE *)
l->data;
BOOLEAN newFile(char *fname)
◆ 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;
FILE * myfopen(const char *path, const char *mode)
#define SI_LINK_SET_OPEN_P(l, flag)
◆ slReadAscii()
Definition at line 141 of file asciiLink.cc.
144 memset(&tmp,0,
sizeof(
sleftv));
146 tmp.
data=(
void*)
"? ";
leftv slReadAscii2(si_link l, leftv pr)
Class used for (list of) interpreter objects.
◆ slReadAscii2()
Definition at line 106 of file asciiLink.cc.
108 FILE *
fp=(FILE *)
l->data;
118 Print(
"//Reading %ld chars\n",len);
131 WerrorS(
"read(<link>,<string>) expected");
const Variable & v
< [in] a sqrfree bivariate poly
size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
EXTERN_VAR omBin sleftv_bin
int status int void * buf
◆ slStandardInit()
Definition at line 631 of file asciiLink.cc.
BOOLEAN slGetDumpAscii(si_link l)
BOOLEAN slCloseAscii(si_link l)
EXTERN_VAR si_link_extension si_link_root
leftv slReadAscii(si_link l)
BOOLEAN slWriteAscii(si_link l, leftv v)
BOOLEAN slDumpAscii(si_link l)
const char * slStatusAscii(si_link l, const char *request)
BOOLEAN slOpenAscii(si_link l, short flag, leftv)
const CanonicalForm int s
VAR omBin s_si_link_extension_bin
◆ slStatusAscii()
Definition at line 209 of file asciiLink.cc.
211 if (strcmp(request,
"read") == 0)
214 else return "not ready";
216 else if (strcmp(request,
"write") == 0)
219 else return "not ready";
221 else return "unknown status request";
#define SI_LINK_W_OPEN_P(l)
#define SI_LINK_R_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);
177 for(
int i=0;
i<
l->nr;
i++)
179 char *
s=
l->m[
i].String();
180 fwrite(
s,strlen(
s),1,outfile);
182 if (
i!=
l->nr-1) fputc(
',',outfile);
199 WerrorS(
"cannot convert to string");
◆ si_link_root