Loading...
Searching...
No Matches
ipid.h
Go to the documentation of this file.
#ifndef IPID_H
#define IPID_H
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: identifier handling
*/
#include "misc/options.h"
#include "Singular/idrec.h"
#include "Singular/subexpr.h"
#include "Singular/lists.h"
EXTERN_VAR idhdl currPackHdl;
EXTERN_VAR idhdl basePackHdl;
EXTERN_VAR package currPack;
EXTERN_VAR package basePack;
#define IDROOT (currPack->idroot)
struct sip_command;
typedef struct sip_command ip_command;
typedef ip_command * command;
struct sip_command
{
sleftv arg1; /*arg1 to build_in, proc to proc_call*/
sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
sleftv arg3; /*NULL or arg3*/
short argc; /*0,1,2,3 to build_in, -1 otherwise*/
short op; /* build_in or PROC_CMD*/
};
struct sip_package
{
idhdl idroot; /* local objects */
char *libname;
short ref;
language_defs language;
BOOLEAN loaded;
void *handle;
};
inline package paCopy(package pack)
{
pack->ref++;
return pack;
}
inline void paKill(package pack)
{
pack->ref--;
}
class proclevel
{
public:
proclevel * next;
idhdl cPackHdl;
package cPack;
char * name;
proclevel() { memset(this,0,sizeof(*this)); }
void push(char *);
void pop();
};
EXTERN_VAR proclevel *procstack;
typedef struct
{
int (*iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic,
BOOLEAN(*func)(leftv res, leftv v));
int (*iiArithAddCmd)(const char *szName, short nAlias, short nTokval,
short nToktype, short nPos);
} SModulFunctions;
EXTERN_VAR idhdl currRingHdl;
/* ================================================================== */
/* module support */
typedef int (*SModulFunc_t)(SModulFunctions*);
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init);
void module_help_main(const char *newlib,const char *help);
void module_help_proc(const char *newlib,const char *p, const char *help);
/* ================================================================== */
/*extern ring currRing; in ring.h */
idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE, BOOLEAN search=TRUE);
idhdl ggetid(const char *n);
//idhdl ggetid(const char *n, idhdl *packhdl);
void killid(const char * a, idhdl * i);
void killhdl(idhdl h, package prooti=currPack);
void killhdl2(idhdl h, idhdl * ih, ring r);
lists ipNameList(idhdl root);
lists ipNameListLev(idhdl root, int lev);
void ipMoveId(idhdl h);
BOOLEAN checkPackage(package pack);
idhdl packFindHdl(package r);
poly jj_NormalizeQRingP(poly p, const ring r);
void jjNormalizeQRingId(leftv I);
#define jjNormalizeQRingP(p) jj_NormalizeQRingP(p,currRing)
void *idrecDataInit(int t);
#define FLAG_STD 0 // is a SB wrt. currRing ("isSB")
#define FLAG_TWOSTD 3 // is a 2-sided SB wrt. currRing (" 2SB")
#define FLAG_QRING 4 // is normalized wrt. qring ("qringNF")
#define FLAG_QRING_DEF 5 // is a qring to be defined
#define FLAG_OTHER_RING 6 // mark newstruct parts as "write-only"
#define FLAG_RING 7 // mark newstruct parts as "ring dep."
#define hasFlag(A,F) Sy_inset((F),(A)->flag)
#define setFlag(A,F) (A)->flag|=Sy_bit(F)
#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
void ipListFlag(idhdl h);
#define IDNEXT(a) ((a)->next)
#define IDTYP(a) ((a)->typ)
#define IDFLAG(a) ((a)->flag)
#define IDLEV(a) ((a)->lev)
#define IDID(a) ((a)->id)
#define IDATTR(a) ((a)->attribute)
#define IDINT(a) ((int)(long)((a)->data.ustring))
#define IDDATA(a) ((a)->data.ustring)
#define IDRING(a) ((a)->data.uring)
#define IDINTVEC(a) ((a)->data.iv)
#define IDBIMAT(a) ((a)->data.bim)
#define IDPOLY(a) ((a)->data.p)
#define IDBIGINT(a) ((a)->data.n)
#define IDNUMBER(a) ((a)->data.n)
#define IDIDEAL(a) ((a)->data.uideal)
#define IDMATRIX(a) ((a)->data.umatrix)
#define IDMAP(a) ((a)->data.umap)
#define IDSTRING(a) ((a)->data.ustring)
#define IDLIST(a) ((a)->data.l)
#define IDLINK(a) ((a)->data.li)
#define IDPACKAGE(a) ((a)->data.pack)
#define IDPROC(a) ((a)->data.pinf)
EXTERN_VAR omBin sip_command_bin;
EXTERN_VAR omBin sip_package_bin;
EXTERN_VAR omBin idrec_bin;
EXTERN_VAR omBin sleftv_bin;
/* options */
struct soptionStruct
{
const char * name;
unsigned setval;
unsigned resetval;
};
extern const struct soptionStruct optionStruct[];
extern const struct soptionStruct verboseStruct[];
#endif
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
proclevel
Definition ipid.h:56
proclevel::name
char * name
Definition ipid.h:61
proclevel::next
proclevel * next
Definition ipid.h:58
proclevel::cPackHdl
idhdl cPackHdl
Definition ipid.h:59
proclevel::proclevel
proclevel()
Definition ipid.h:62
sleftv
Class used for (list of) interpreter objects.
Definition subexpr.h:83
res
CanonicalForm res
Definition facAbsFact.cc:60
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
search
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
Definition facSparseHensel.h:566
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
idrec.h
jjNormalizeQRingId
void jjNormalizeQRingId(leftv I)
Definition ipassign.cc:2461
jj_NormalizeQRingP
poly jj_NormalizeQRingP(poly p, const ring r)
Definition ipassign.cc:2496
sip_command_bin
VAR omBin sip_command_bin
Definition ipid.cc:45
ipNameListLev
lists ipNameListLev(idhdl root, int lev)
Definition ipid.cc:650
sip_package_bin
VAR omBin sip_package_bin
Definition ipid.cc:46
killid
void killid(const char *id, idhdl *ih)
Definition ipid.cc:387
ggetid
idhdl ggetid(const char *n)
Definition ipid.cc:581
killhdl2
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition ipid.cc:445
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
idrec_bin
VAR omBin idrec_bin
Definition ipid.cc:48
ipListFlag
void ipListFlag(idhdl h)
Definition ipid.cc:619
procstack
VAR proclevel * procstack
Definition ipid.cc:50
currRingHdl
VAR idhdl currRingHdl
Definition ipid.cc:57
currPack
VAR package currPack
Definition ipid.cc:55
killhdl
void killhdl(idhdl h, package proot)
Definition ipid.cc:414
idrecDataInit
void * idrecDataInit(int t)
Definition ipid.cc:138
currPackHdl
VAR idhdl currPackHdl
Definition ipid.cc:53
packFindHdl
idhdl packFindHdl(package r)
Definition ipid.cc:828
basePackHdl
VAR idhdl basePackHdl
Definition ipid.cc:54
ipNameList
lists ipNameList(idhdl root)
Definition ipid.cc:627
ipMoveId
void ipMoveId(idhdl tomove)
Definition ipid.cc:704
sip_package::idroot
idhdl idroot
Definition ipid.h:36
sip_command::arg1
sleftv arg1
Definition ipid.h:27
sip_package::handle
void * handle
Definition ipid.h:41
sleftv_bin
EXTERN_VAR omBin sleftv_bin
Definition ipid.h:145
sip_command::arg2
sleftv arg2
Definition ipid.h:28
command
ip_command * command
Definition ipid.h:23
sip_package::language
language_defs language
Definition ipid.h:39
verboseStruct
const struct soptionStruct verboseStruct[]
Definition misc_ip.cc:539
sip_package::libname
char * libname
Definition ipid.h:37
sip_package::ref
short ref
Definition ipid.h:38
SModulFunctions::iiArithAddCmd
int(* iiArithAddCmd)(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition ipid.h:72
sip_package::loaded
BOOLEAN loaded
Definition ipid.h:40
checkPackage
BOOLEAN checkPackage(package pack)
sip_command::op
short op
Definition ipid.h:31
load_builtin
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition iplib.cc:1304
soptionStruct::resetval
unsigned resetval
Definition ipid.h:152
module_help_main
void module_help_main(const char *newlib, const char *help)
Definition iplib.cc:1357
soptionStruct::setval
unsigned setval
Definition ipid.h:151
SModulFunc_t
int(* SModulFunc_t)(SModulFunctions *)
Definition ipid.h:81
paKill
void paKill(package pack)
Definition ipid.h:50
module_help_proc
void module_help_proc(const char *newlib, const char *p, const char *help)
Definition iplib.cc:1372
optionStruct
const struct soptionStruct optionStruct[]
Definition misc_ip.cc:508
sip_command::arg3
sleftv arg3
Definition ipid.h:29
sip_command::argc
short argc
Definition ipid.h:30
SModulFunctions::iiAddCproc
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition ipid.h:70
soptionStruct::name
const char * name
Definition ipid.h:150
SModulFunctions
Definition ipid.h:69
sip_command
Definition ipid.h:26
sip_package
Definition ipid.h:35
soptionStruct
Definition ipid.h:149
h
STATIC_VAR Poly * h
Definition janet.cc:971
help
#define help
Definition libparse.cc:1230
lists.h
lists
slists * lists
Definition mpr_numeric.h:146
omBin
omBin_t * omBin
Definition omStructs.h:12
options.h
idhdl
idrec * idhdl
Definition ring.h:22
package
ip_package * package
Definition structs.h:39
leftv
sleftv * leftv
Definition structs.h:53
subexpr.h
language_defs
language_defs
Definition subexpr.h:22