當前位置: 首頁>>代碼示例>>C++>>正文


C++ DumpFunction函數代碼示例

本文整理匯總了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;
}
開發者ID:jcubic,項目名稱:ToME,代碼行數:29,代碼來源:luac.c

示例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);
}
開發者ID:atmark-techno,項目名稱:linux-3.14-at,代碼行數:30,代碼來源:dump.c

示例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);
}
開發者ID:caivega,項目名稱:Killa,代碼行數:27,代碼來源:kdump.c

示例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);
}
開發者ID:Falcon-peregrinus,項目名稱:angband-russian,代碼行數:26,代碼來源:ldump.c

示例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);
}
開發者ID:luiseduardohdbackup,項目名稱:lua4wince,代碼行數:30,代碼來源:ldump.c

示例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);
}
開發者ID:ezEngine,項目名稱:ezEngine,代碼行數:7,代碼來源:ldump.c

示例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);
}
開發者ID:Falcon-peregrinus,項目名稱:angband-russian,代碼行數:12,代碼來源:ldump.c

示例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);
}
開發者ID:jcubic,項目名稱:ToME,代碼行數:12,代碼來源:luac.c

示例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;
}
開發者ID:luiseduardohdbackup,項目名稱:lua4wince,代碼行數:15,代碼來源:ldump.c

示例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;
}
開發者ID:unixbhaskar,項目名稱:ktap,代碼行數:15,代碼來源:dump.c

示例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;
}
開發者ID:aappleby,項目名稱:Lumina,代碼行數:16,代碼來源:ldump.cpp

示例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;
}
開發者ID:BackupTheBerlios,項目名稱:xlua-svn,代碼行數:16,代碼來源:ldump.c

示例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);
}
開發者ID:klusark,項目名稱:residual-tools,代碼行數:13,代碼來源:dump.c

示例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;
}
開發者ID:LTears,項目名稱:rktotal,代碼行數:19,代碼來源:ldump.c

示例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);
}
開發者ID:descent,項目名稱:ucc-code,代碼行數:17,代碼來源:dumpast.c


注:本文中的DumpFunction函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。