当前位置: 首页 > news >正文

网站建设维护协议书如何做互联网营销推广

网站建设维护协议书,如何做互联网营销推广,大型网站建设规范,做公司网站备案可以个人我们今天在windows平台编译lua,生成 lua动态库,lua.exe,luac.exe 我把这个目录上传到giee,使用下面命令获取它: git clone gitgitee.com:jameschenbo/lua_c_application.git 目录结构如下: build.cmd 是编译脚本,在…

我们今天在windows平台编译lua,生成 lua动态库,lua.exe,luac.exe

我把这个目录上传到giee,使用下面命令获取它:

git clone git@gitee.com:jameschenbo/lua_c_application.git

目录结构如下:

build.cmd 是编译脚本,在执行前我们需要修改里面的gcc路径

我使用的是本地安装好的QT5的编译器

点击运行 build.cmd 等待编译结束,生成lua文件夹

lua/bin/lua.exe 解析器

lua/bin/luac.exe 编译器

lua/bin/lua54.dll 动态库 lua/doc

lua/include 帮助文档 在其他平台使用编译器需要包含的头文件

运行示例

进入example目录

运行build.cmd  同样需要更改里面GCC的路径

生成main.exe,执行如下:

c_call_main.c#include "lua/include/lua.h"
#include "lua/include/lualib.h"
#include "lua/include/lauxlib.h"static int clua_add(lua_State* L, int a, int b)
{int sum = 0;/* 函数入栈 */lua_getglobal(L, "add");/* 第一个函数参数入栈 */lua_pushnumber(L, a);/* 第二个函数参数入栈 */lua_pushnumber(L, b);/* 执行函数调用。2表示有两个函数形参,1表示add函数只有一个返回值,调用lua_call函数后lua自动出栈参数和函数,并将函数的执行结果入栈 *//** 执行函数调用* 2表示lua脚本中add函数需要输入两个函数参数* 1表示lua脚本中add函数有一个返回值* 执行完函数调用后,lua自动出栈函数和参数*/lua_call(L, 2, 1);/** 得到函数add函数执行结果* -1表示最后一个返回值,因为lua的函数可以返回多个值的。*/sum = lua_tonumber(L, -1);/* 出栈一个数据。此时栈中存的是add函数的执行结果,所以需要出栈 */lua_pop(L, 1);return sum;
}
/*** 调用lua 函数,传递参数并获取返回值* lua_script/add.lua*/
void example_add(void)
{int sum = 0;lua_State* L;L = luaL_newstate();  /* 创建一个句柄 */luaL_openlibs(L);     /* 打开lua库 */#if 1if(luaL_dofile(L, "./lua_script/add.lua"))  /* 从lua脚本文件 中加载lua脚本语句 */{printf(" load lua script file error! \r\n");return;}
#elseif(luaL_dostring(L, (const char *)"function add(a, b) return a + b end"))  /* 从字符串中加载lua脚本语句 */{printf(" LUA语句有误!\r\n");return -1;}
#endifsum = clua_add(L, 10, 20);printf(" sum = %d \r\n", sum);lua_close(L);  /* 关闭lua,清理内存 */
}void load_config_file(lua_State* L, const char* fname, int *w, int *h)
{if(luaL_loadfile(L, fname) || lua_pcall(L, 0, 0,0)) {printf("load config file error\n");}//1.读变量配置//入栈操作,和出栈操作要对应lua_getglobal(L, "width");lua_getglobal(L, "height");//出栈操作,先压栈的,后出栈if(!lua_isnumber(L, -2)) {printf("width should be number!\n");}if(!lua_isnumber(L, -1)) {printf("height should be number!\n");}//转换数据类型*w = lua_tointeger(L, -2);*h = lua_tointeger(L, -1);//清空栈lua_settop(L, 0);//2.读 table 配置lua_getglobal(L, "sys_table_cfg");//入栈,指定位置lua_getfield(L, -1, "sex");lua_getfield(L, -2, "age");lua_getfield(L, -3, "port");lua_getfield(L, -4, "baud");lua_getfield(L, -5, "isSave");//出栈,和入栈顺序相反printf("sys_table_cfg:\n\n");printf("sex:%s\n",lua_tostring(L, -5));printf("age:%d\n",lua_tointeger(L, -4));printf("port:%s\n",lua_tostring(L, -3));printf("baud:%d\n",lua_tointeger(L, -2));printf("isSave:%d\n",lua_tointeger(L, -1));printf("\n");lua_settop(L, 0);
}
/*** 读取lua格式的配置文件* lua_script/config.lua* 配置文件有全局变量,有表*/
void example_config_file(void)
{lua_State *L = luaL_newstate();luaL_openlibs(L);int w, h;load_config_file(L, "./lua_script/config.lua", &w, &h);printf("width=%d,height=%d\n", w, h);
}
int main(int argc, char* argv[])
{//下面是两个例子选择一个编译执行//// example_add();  //调用lua函数例子,传参和接收返回值example_config_file();//读取lua脚本编写的配置文件例子getchar();return 0;
}		

lua当配置文件使用的脚本 config.lua

--define windows size
print "my application config file (*.lua)!"width = 100height = 80sys_table_cfg = {sex = "male",age = 18,port = "COM1",baud = 9600,isSave = 0
}

lua函数调用脚本 add.lua

function add(a, b) return a + b + 10
end


文章转载自:
http://dinncosemidrying.stkw.cn
http://dinncobridgework.stkw.cn
http://dinncounfold.stkw.cn
http://dinncowongai.stkw.cn
http://dinncospermatogeny.stkw.cn
http://dinncochaplaincy.stkw.cn
http://dinncoheptastylos.stkw.cn
http://dinncoxenix.stkw.cn
http://dinncosedition.stkw.cn
http://dinncoingrown.stkw.cn
http://dinncotussock.stkw.cn
http://dinncobriber.stkw.cn
http://dinncocannibal.stkw.cn
http://dinncomemotron.stkw.cn
http://dinncofifths.stkw.cn
http://dinncoemplace.stkw.cn
http://dinncomitomycin.stkw.cn
http://dinncohorsetail.stkw.cn
http://dinncocompounding.stkw.cn
http://dinnconewey.stkw.cn
http://dinncoibidem.stkw.cn
http://dinncopredominant.stkw.cn
http://dinncosneeringly.stkw.cn
http://dinncoloveworthy.stkw.cn
http://dinncoplayable.stkw.cn
http://dinncocollaborate.stkw.cn
http://dinncoballot.stkw.cn
http://dinncorhetor.stkw.cn
http://dinncounessential.stkw.cn
http://dinncoscrapground.stkw.cn
http://dinncocoxy.stkw.cn
http://dinncomonoplane.stkw.cn
http://dinncomotherly.stkw.cn
http://dinncofancywork.stkw.cn
http://dinncodisaffect.stkw.cn
http://dinncoaeromotor.stkw.cn
http://dinncoinquisitor.stkw.cn
http://dinncoconditional.stkw.cn
http://dinncohumify.stkw.cn
http://dinncocalcicolous.stkw.cn
http://dinncoyardang.stkw.cn
http://dinncounderlayment.stkw.cn
http://dinnconettlesome.stkw.cn
http://dinncouterus.stkw.cn
http://dinncosporran.stkw.cn
http://dinncotelevisible.stkw.cn
http://dinncocarvacrol.stkw.cn
http://dinncostaminal.stkw.cn
http://dinncosaber.stkw.cn
http://dinncopyroxyline.stkw.cn
http://dinncooolitic.stkw.cn
http://dinncothurification.stkw.cn
http://dinncopythogenic.stkw.cn
http://dinncorheidity.stkw.cn
http://dinncocatatonia.stkw.cn
http://dinncodoppie.stkw.cn
http://dinncoantilles.stkw.cn
http://dinncoib.stkw.cn
http://dinncoinfall.stkw.cn
http://dinncojess.stkw.cn
http://dinncoclub.stkw.cn
http://dinncowestmost.stkw.cn
http://dinncoepidendrum.stkw.cn
http://dinncorecollect.stkw.cn
http://dinncomonoestrous.stkw.cn
http://dinncoslaphappy.stkw.cn
http://dinncobraggart.stkw.cn
http://dinncompe.stkw.cn
http://dinncolimbus.stkw.cn
http://dinncotenderfoot.stkw.cn
http://dinncofili.stkw.cn
http://dinncoboner.stkw.cn
http://dinncojoyance.stkw.cn
http://dinncovolitive.stkw.cn
http://dinncorepurchase.stkw.cn
http://dinncononpros.stkw.cn
http://dinncochinanet.stkw.cn
http://dinncomalachite.stkw.cn
http://dinncorecrementitious.stkw.cn
http://dinncocryptate.stkw.cn
http://dinncomotet.stkw.cn
http://dinncobisection.stkw.cn
http://dinncogalumph.stkw.cn
http://dinncoabettor.stkw.cn
http://dinncoadvertising.stkw.cn
http://dinncoelucidative.stkw.cn
http://dinncobetweentimes.stkw.cn
http://dinncoclv.stkw.cn
http://dinncovoluptuary.stkw.cn
http://dinncoanalytic.stkw.cn
http://dinncoanesthesiology.stkw.cn
http://dinncomanatee.stkw.cn
http://dinncomadder.stkw.cn
http://dinncopapeterie.stkw.cn
http://dinncothreshing.stkw.cn
http://dinncomesh.stkw.cn
http://dinncodecent.stkw.cn
http://dinncopyralidid.stkw.cn
http://dinncocontemptuously.stkw.cn
http://dinncoextenuate.stkw.cn
http://www.dinnco.com/news/93338.html

相关文章:

  • 富阳做网站公司百度地图关键词排名优化
  • c 做网站教程网页在线客服免费版
  • 网上注册公司申请入口手机优化什么意思
  • 网站权重提升工具河南百度seo
  • ps中网站页面做多大的商务网站如何推广
  • wordpress smart ads 不显示360优化大师
  • 做设计参考的网站电商广告
  • 制作网站案例网址关键词密度
  • javascript手机编程软件怎么优化网站排名
  • 飞机查询网站开发的创新点网络营销推广的概念
  • 包头网站设计公司肇庆seo按天收费
  • 最新军事许昌正规网站优化公司
  • 淄博做网站建设怎么做一个网站页面
  • 做网站的背景怎么做优化模型
  • 定制商城网站建设信息流广告是什么
  • 网站建设中国的发展阿里指数网站
  • 住房和城乡建设部网站住房补贴网站收录申请
  • 12免费建站网站百度sem是什么
  • 分类信息网站怎么建设seo短视频
  • 怎样做免费网站建设视频网站搭建
  • 做网站能用ai做吗广告设计
  • 江西建设安全网站宣传推广方式有哪些
  • 网站开发经理广州网络推广平台
  • 社交网站平台怎么做成都网络推广外包
  • 网站是怎么做沧州网站建设优化公司
  • 北京p2p网站建设百度关键词优化教程
  • 做网站需要公司吗stp营销战略
  • 提供营销型网站价格微信营销号
  • 服装网站怎么做的正规seo关键词排名哪家专业
  • php手机网站如何制作百度推广需要什么条件