📄 box.c
字号:
#line 96 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx"#include "mal_config.h"#include "mal_exception.h"#include "mal_box.h"#include "mal_interpreter.h"#include "box.h"strBOXopen(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; (void) mb; /*fool compiler */ name = (str) getArgValue(stk, pci, 1); if (openBox(name) != 0) return MAL_SUCCEED; throw(MAL, "box.open", "failed to open box");}strBOXclose(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; (void) mb; /*fool compiler */ name = (str) getArgValue(stk, pci, 1); if (closeBox(name, FALSE) == 0) return MAL_SUCCEED; throw(MAL, "box.close", "failed to close box");}strBOXdestroy(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ Box box; str name; (void) mb; (void) stk; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.destroy","box is not open");#line 135 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" destroyBox(name); return MAL_SUCCEED;}#line 150 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx"strBOXdeposit(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; ValPtr v; Box box; (void) mb; #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.deposit","box is not open");#line 158 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk, pci, 2); v = &stk->stk[getArg(pci, 3)]; if (depositBox(box, name, v)) throw(MAL, "box.deposit", "failed to deposit into box"); return MAL_SUCCEED;}strBOXtake(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; ValPtr v; #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.take","box is not open");#line 173 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk, pci, 2); v = &stk->stk[getArg(pci, 0)]; if (takeBox(box, name, v, (int) getArgType(mb, pci, 0))) throw(MAL, "box.take", "failed to take object from box"); (void) mb; return MAL_SUCCEED;}strBOXrelease(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; (void) mb; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.release","box is not open");#line 189 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk, pci, 2); releaseBox(box, name); return MAL_SUCCEED;}strBOXreleaseAll(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; (void) mb; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.releaseAll","box is not open");#line 202 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" releaseAllBox(box); return MAL_SUCCEED;}strBOXdiscard(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; (void) mb; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.discard","box is not open");#line 214 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk, pci, 2); if (discardBox(box, name)) throw(MAL, "box.discard", "failed to discard object from box"); return MAL_SUCCEED;}strBOXtoString(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; (void) mb; (void) stk; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.toString","box is not open");#line 229 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" return MAL_SUCCEED;}strBOXgetBoxNames(int *bid){ return getBoxNames(bid);}strBOXiterator(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){ str name; Box box; lng *cursor; ValPtr v; (void) mb; /*fool compiler */ #line 144 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" name = (str) getArgValue(stk,pci,1); box= findBox(name); if( box ==0) throw(MAL, "box.iterator","box is not open");#line 248 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx" cursor = (lng *) getArgValue(stk, pci, 0); v = &stk->stk[getArg(pci, 2)]; nextBoxElement(box, cursor, v); return MAL_SUCCEED;}#line 256 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/box.mx"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -