 |
My Project
debian-1:4.1.1-p2+ds-4
|
Go to the documentation of this file.
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;
99 if (
l->name[0] !=
'\0')
101 return (fclose((FILE *)
l->data)!=0);
108 FILE *
fp=(FILE *)
l->data;
118 Print(
"//Reading %ld chars\n",len);
131 WerrorS(
"read(<link>,<string>) expected");
144 memset(&tmp,0,
sizeof(
sleftv));
146 tmp.
data=(
void*)
"? ";
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");
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";
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);
272 if (fprintf(
fd,
"setring %s;\n",
IDID(rhdl)) == EOF)
return TRUE;
274 IDMAP(
h)->preimage, rhs) == EOF)
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;
367 int i, nl =
l->nr + 1;
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;
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)))
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);
509 char *rhs =
h->String();
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);
538 if (
l->name[0] ==
'\0')
540 WerrorS(
"getdump: Can not get dump from stdin");
562 FILE *
f = (FILE *)
l->data;
static BOOLEAN DumpAsciiIdhdl(FILE *fd, idhdl h, char ***list_of_libs)
static BOOLEAN DumpAsciiMaps(FILE *fd, idhdl h, idhdl rhdl)
si_link_extension si_link_root
static const char * GetIdString(idhdl h)
#define SI_LINK_SET_CLOSE_P(l)
BOOLEAN slGetDumpAscii(si_link l)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
Class used for (list of) interpreter objects.
const char * slStatusAscii(si_link l, const char *request)
static int DumpRhs(FILE *fd, idhdl h)
#define SI_LINK_W_OPEN_P(l)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
int status int void * buf
#define SI_LINK_R_OPEN_P(l)
leftv slReadAscii2(si_link l, leftv pr)
void p_Write(poly p, ring lmRing, ring tailRing)
BOOLEAN newFile(char *fname)
omBin s_si_link_extension_bin
static BOOLEAN DumpAscii(FILE *fd, idhdl h, char ***list_of_libs)
static BOOLEAN CollectLibs(char *name, char ***list_of_libs)
void StringSetS(const char *st)
FILE * myfopen(const char *path, const char *mode)
char name(const Variable &v)
void WerrorS(const char *s)
BOOLEAN slCloseAscii(si_link l)
const Variable & v
< [in] a sqrfree bivariate poly
const CanonicalForm int s
BOOLEAN slDumpAscii(si_link l)
const char * Tok2Cmdname(int tok)
leftv slReadAscii(si_link l)
BOOLEAN slWriteAscii(si_link l, leftv v)
static BOOLEAN DumpQring(FILE *fd, idhdl h, const char *type_str)
size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
#define SI_LINK_SET_OPEN_P(l, flag)
BOOLEAN slOpenAscii(si_link l, short flag, leftv)
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
char * iiStringMatrix(matrix im, int dim, const ring r, char ch)