通过Lua中自带的table来实现一个Map,可以根据键值来插入移除取值 map = {} local this = map function this:new() o = {} setmetatable(o, self) self.__index = self self.count = return o end function this:insert(k, v) if nil == self[k] then self[k] = v self.count = self.count + end
一.安装配置Openresty 1,安装 wget https://openresty.org/download/ngx_openresty-1.9.7.1.tar.gz # 下载 tar xzvf ngx_openresty-1.9.7.1.tar.gz # 解压 cd ngx_openresty-1.9.7.1/ ./configure make make install 2,配置nginx.conf 按照上一步安装的默认路径为:/usr/local/openresty/nginx/conf
Lua脚本是一种可用于C程序开发/测试的工具,本篇介绍一下C程序与Lua脚本如何进行相互调用,更加详细的操作参见<Programing in Lua>.本文分为3个部分:1.Windows环境下Lua的下载以及安装注意事项:2.Visual C++6.0中Lua的配置:3.C程序与Lua脚本相互调用实例. 1.Windows环境下Lua的下载以及安装注意事项 a.下载Lua for Windows,笔者用的版本是V5.1.4-35: b.上微软官网,下载Visual C++运行库——vcred