main.cpp

来自「著名的LUA脚本语言的Symbian S60平台的移植版本」· C++ 代码 · 共 37 行

CPP
37
字号
// SLHELLO.C
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

/* 
 * The classic "Hello World" program
 */

#include <stdio.h>
#include <lua/lua.h>
#include <lua/lualib.h>
#include <lua/lauxlib.h>
#include <lua/tolua.h>

IMPORT_C int tolua_shape_open (lua_State* tolua_S);

int main (int argc, char *argv[])
	{
	argc=0;
	argv=NULL;
	lua_State *pst;
	pst = lua_open();
	luaopen_base(pst);
	luaopen_table(pst);
	luaopen_io(pst);
	luaopen_string(pst);
	luaopen_math(pst);
	luaopen_debug(pst);
	tolua_shape_open (pst);
	lua_dofile(pst, "z:/shape.lua");
	char *p = "print (\"hello from lua\")";
	lua_dostring(pst, p);
	printf("Hello World\n");
	return 0;
	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?