本文整理匯總了C++中DumpFunction函數的典型用法代碼示例。如果您正苦於以下問題:C++ DumpFunction函數的具體用法?C++ DumpFunction怎麽用?C++ DumpFunction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DumpFunction函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DumpHeader
char *luaU_dumpchunk_buffer(const Proto* Main, size_t *len)
{
char *buf;
/* First calculate the total size*/
__lua_dumper_size = 0;
DumpByte = DumpByte_calc_size;
DumpSig = DumpSig_calc_size;
DumpBlock = DumpBlock_calc_size;
DumpVector = DumpVector_calc_size;
DumpHeader(NULL);
DumpFunction(Main, NULL);
/* Allocate the buffer */
*len = __lua_dumper_size;
C_MAKE(buf, __lua_dumper_size, char);
/* Now dump it for real */
__lua_dumper_size = 0;
DumpByte = DumpByte_buffer;
DumpSig = DumpSig_buffer;
DumpBlock = DumpBlock_buffer;
DumpVector = DumpVector_buffer;
DumpHeader(buf);
DumpFunction(Main, buf);
return buf;
}
示例2: DumpConstants
static void DumpConstants(const ktap_proto *f, DumpState *D)
{
int i, n = f->sizek;
DumpInt(n, D);
for (i = 0; i < n; i++) {
const ktap_value* o=&f->k[i];
DumpChar(ttypenv(o), D);
switch (ttypenv(o)) {
case KTAP_TNIL:
break;
case KTAP_TBOOLEAN:
DumpChar(bvalue(o), D);
break;
case KTAP_TNUMBER:
DumpNumber(nvalue(o), D);
break;
case KTAP_TSTRING:
DumpString(rawtsvalue(o), D);
break;
default:
printf("ktap: DumpConstants with unknown vaule type %d\n", ttypenv(o));
ktap_assert(0);
}
}
n = f->sizep;
DumpInt(n, D);
for (i = 0; i < n; i++)
DumpFunction(f->p[i], D);
}
示例3: DumpConstants
static void DumpConstants(const killa_Proto* f, DumpState* D)
{
int i,n=f->sizek;
DumpInt(n,D);
for (i=0; i<n; i++)
{
const killa_TValue* o=&f->k[i];
DumpChar(killa_ttype(o),D);
switch (killa_ttype(o))
{
case KILLA_TNULL:
break;
case KILLA_TBOOLEAN:
DumpChar(killa_bvalue(o),D);
break;
case KILLA_TNUMBER:
DumpNumber(killa_nvalue(o),D);
break;
case KILLA_TSTRING:
DumpString(killa_rawtsvalue(o),D);
break;
}
}
n=f->sizep;
DumpInt(n,D);
for (i=0; i<n; i++) DumpFunction(f->p[i],D);
}
示例4: DumpConstants
static void DumpConstants(const Proto* f, DumpState* D)
{
int i,n;
DumpInt(n=f->sizek,D);
for (i=0; i<n; i++)
{
const TObject* o=&f->k[i];
DumpByte(ttype(o),D);
switch (ttype(o))
{
case LUA_TNUMBER:
DumpNumber(nvalue(o),D);
break;
case LUA_TSTRING:
DumpString(tsvalue(o),D);
break;
case LUA_TNIL:
break;
default:
lua_assert(0); /* cannot happen */
break;
}
}
DumpInt(n=f->sizep,D);
for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);
}
示例5: DumpConstants
static void DumpConstants(const Proto* f, DumpState* D)
{
int i,n=f->sizek;
DumpInt(n,D);
for (i=0; i<n; i++)
{
const TValue* o=&f->k[i];
DumpChar(ttype(o),D);
switch (ttype(o))
{
case LUA_TNIL:
break;
case LUA_TBOOLEAN:
DumpChar(bvalue(o),D);
break;
case LUA_TNUMBER:
DumpNumber(nvalue(o),D);
break;
case LUA_TSTRING:
DumpString(rawtsvalue(o),D);
break;
default:
lua_assert(0); /* cannot happen */
break;
}
}
n=f->sizep;
DumpInt(n,D);
for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);
}
示例6: DumpProtos
static void DumpProtos (const Proto *f, DumpState *D) {
int i;
int n = f->sizep;
DumpInt(n, D);
for (i = 0; i < n; i++)
DumpFunction(f->p[i], f->source, D);
}
示例7: luaU_dump
/*
** dump function as precompiled chunk
*/
void luaU_dump (lua_State* L, const Proto* Main, lua_Chunkwriter w, void* data)
{
DumpState D;
D.L=L;
D.write=w;
D.data=data;
DumpHeader(&D);
DumpFunction(Main,NULL,&D);
}
示例8: DumpConstants
static void DumpConstants(const Proto* tf, void* D)
{
int i,n;
DumpInt(n=tf->nkstr,D);
for (i=0; i<n; i++)
DumpString(tf->kstr[i],D);
DumpInt(tf->nknum,D);
DumpVector(tf->knum,tf->nknum,sizeof(*tf->knum),D);
DumpInt(n=tf->nkproto,D);
for (i=0; i<n; i++)
DumpFunction(tf->kproto[i],D);
}
示例9: luaU_dump
/*
** dump Lua function as precompiled chunk
*/
int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
{
DumpState D;
D.L=L;
D.writer=w;
D.data=data;
D.strip=strip;
D.status=0;
DumpHeader(&D);
DumpFunction(f,NULL,&D);
return D.status;
}
示例10: ktapc_dump
/*
* dump ktap function as precompiled chunk
*/
int ktapc_dump(const ktap_proto *f, ktap_writer w, void *data, int strip)
{
DumpState D;
D.writer = w;
D.data = data;
D.strip = strip;
D.status = 0;
DumpHeader(&D);
DumpFunction(f, &D);
return D.status;
}
示例11: luaU_dump
/*
** dump Lua function as precompiled chunk
*/
int luaU_dump (LuaThread* L, const LuaProto* f, lua_Writer w, void* data, int strip)
{
THREAD_CHECK(L);
DumpState D;
D.L=L;
D.writer=w;
D.data=data;
D.strip=strip;
D.status=0;
DumpHeader(&D);
DumpFunction(f,&D);
return D.status;
}
示例12: luaU_dump_crosscompile
/*
** dump Lua function as precompiled chunk with specified target
*/
int luaU_dump_crosscompile (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip, DumpTargetInfo target)
{
DumpState D;
D.L=L;
D.writer=w;
D.data=data;
D.strip=strip;
D.status=0;
D.target=target;
DumpHeader(&D);
DumpFunction(f,NULL,&D);
return D.status;
}
示例13: DumpSubFunctions
static void DumpSubFunctions(TProtoFunc* tf, FILE* D) {
int i,n;
n = tf->nconsts;
for (i=0; i<n; i++) {
TObject* o=tf->consts+i;
if (ttype(o) == LUA_T_PROTO) {
fputc('#',D);
DumpWord(i,D);
DumpFunction(tfvalue(o),D);
}
}
fputc('$',D);
}
示例14: luaU_dump
/*
** dump Lua function as precompiled chunk
*/
int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip, char endian)
{
DumpState D;
D.L=L;
D.writer=w;
D.data=data;
D.strip=strip;
D.status=0;
D.swap=doendian(endian);
D.endian=endian;
luaZ_initbuffer(L, &D.b);
DumpHeader(&D);
DumpFunction(f,NULL,&D);
luaZ_freebuffer(L, &D.b);
return D.status;
}
示例15: DumpTranslationUnit
void DumpTranslationUnit(AstTranslationUnit transUnit)
{
AstNode p;
ASTFile = CreateOutput(Input.filename, ".ast");
p = transUnit->extDecls;
while (p)
{
if (p->kind == NK_Function)
{
DumpFunction((AstFunction)p);
}
p = p->next;
}
fclose(ASTFile);
}