Go to the source code of this file.
◆ newstruct_desc_size()
int newstruct_desc_size |
( |
| ) |
|
◆ newstruct_set_proc()
Definition at line 846 of file newstruct.cc.
847{
848 int id=0;
851 {
852 Werror(
">>%s<< is not a newstruct type",bbname);
854 }
856 newstruct_desc desc=(newstruct_desc)bb->data;
857 newstruct_proc
p=(newstruct_proc)
omAlloc(
sizeof(*
p));
858 p->next=desc->procs; desc->procs=
p;
859
862
863 int tt;
864 if(!(tt=
IsCmd(func,
p->t)))
865 {
866 int t;
868 {
873 ||(t=='='))
875 else if (t=='(')
877 else if (t=='-')
879 }
880 else
881 {
884 Werror(
">>%s<< is not a kernel command",func);
887 }
888 }
889 switch(tt)
890 {
891
898
900 if(args!=1) {
Warn(
"args must be 1 for %s in %s",func,
my_yylinebuf);args=1;}
901 break;
904 break;
907 break;
910 break;
913 break;
916 break;
919 break;
923 break;
924 default:
926 break;
927 }
930 {
934 }
937 pr->is_static=0;
939}
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
VAR char my_yylinebuf[80]
int IsCmd(const char *n, int &tok)
int iiOpsTwoChar(const char *s)
#define omFreeSize(addr, size)
void Werror(const char *fmt,...)
◆ newstruct_setup()
void newstruct_setup |
( |
const char * |
name, |
|
|
newstruct_desc |
d |
|
) |
| |
Definition at line 688 of file newstruct.cc.
689{
690 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
691
692
693
702
710 d->id=rt;
711
712}
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
BOOLEAN newstruct_Op2(int op, leftv res, leftv a1, leftv a2)
BOOLEAN newstruct_deserialize(blackbox **, void **d, si_link f)
void newstruct_destroy(blackbox *, void *d)
char * newstruct_String(blackbox *b, void *d)
BOOLEAN newstruct_Op1(int op, leftv res, leftv arg)
BOOLEAN newstruct_Assign(leftv l, leftv r)
BOOLEAN newstruct_serialize(blackbox *b, void *d, si_link f)
void * newstruct_Copy(blackbox *, void *d)
void * newstruct_Init(blackbox *b)
BOOLEAN newstruct_OpM(int op, leftv res, leftv args)
BOOLEAN newstruct_CheckAssign(blackbox *, leftv L, leftv R)
void newstruct_Print(blackbox *b, void *d)
◆ newstructChildFromString()
newstruct_desc newstructChildFromString |
( |
const char * |
p, |
|
|
const char * |
s |
|
) |
| |
Definition at line 799 of file newstruct.cc.
800{
801
802 int parent_id=0;
805 {
806 Werror(
">>%s< not found",parent);
808 }
810
812 {
813 Werror(
">>%s< is not a user defined type",parent);
815 }
816
818 newstruct_desc parent_desc=(newstruct_desc)parent_bb->data;
819 res->size=parent_desc->size;
820 res->member=parent_desc->member;
821 res->parent=parent_desc;
822
824}
const CanonicalForm int s
static newstruct_desc scanNewstructFromString(const char *s, newstruct_desc res)
◆ newstructFromString()
newstruct_desc newstructFromString |
( |
const char * |
s | ) |
|
◆ newstructShow()
void newstructShow |
( |
newstruct_desc |
d | ) |
|
Definition at line 826 of file newstruct.cc.
827{
828 newstruct_member elem;
829 Print(
"id: %d\n",d->id);
830 elem=d->member;
832 {
833 Print(
">>%s<< at pos %d, type %d (%s)\n",elem->name,elem->pos,elem->typ,
Tok2Cmdname(elem->typ));
835 Print(
">>r_%s<< at pos %d, shadow ring\n",elem->name,elem->pos-1);
836 elem=elem->next;
837 }
838 newstruct_proc
p=d->procs;
840 {
841 Print(
"op:%d(%s) with %d args -> %s\n",
p->t,
iiTwoOps(
p->t),
p->args,
p->p->procname);
843 }
844}
const char * iiTwoOps(int t)
const char * Tok2Cmdname(int tok)
static int NeedShadowRing(int t)