mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
add LUAMOD_API
This commit is contained in:
@@ -82,6 +82,8 @@ A million repetitions of "a"
|
||||
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
|
||||
*/
|
||||
|
||||
#define LUA_LIB
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
@@ -269,7 +271,7 @@ xor_key(uint8_t key[BLOCKSIZE], uint32_t xor) {
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
lhmac_sha1(lua_State *L) {
|
||||
size_t key_sz = 0;
|
||||
const uint8_t * key = (const uint8_t *)luaL_checklstring(L, 1, &key_sz);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
@@ -1257,7 +1259,7 @@ lobjectid(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_bson(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
int i;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// It's only for demo, limited feature. Don't use it in your project.
|
||||
// Rewrite socket library by yourself .
|
||||
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <string.h>
|
||||
@@ -183,7 +185,7 @@ lreadstdin(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_clientsocket(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <string.h>
|
||||
@@ -475,7 +477,7 @@ lconcat(lua_State *L) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_cluster_core(lua_State *L) {
|
||||
luaL_Reg l[] = {
|
||||
{ "packrequest", lpackrequest },
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
@@ -901,7 +903,7 @@ lxor_str(lua_State *L) {
|
||||
int lsha1(lua_State *L);
|
||||
int lhmac_sha1(lua_State *L);
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_crypt(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
static int init = 0;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
// only for debug use
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
@@ -268,7 +270,7 @@ static int db_sethook (lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_debugchannel(lua_State *L) {
|
||||
luaL_Reg l[] = {
|
||||
{ "create", lcreate }, // for write
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
@@ -47,7 +49,7 @@ lcurrent(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_memory(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet_malloc.h"
|
||||
|
||||
#include <lua.h>
|
||||
@@ -529,7 +531,7 @@ reply_length(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_mongo_driver(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] ={
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet.h"
|
||||
|
||||
#include <lua.h>
|
||||
@@ -143,7 +145,7 @@ mc_nextid(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_multicast_core(lua_State *L) {
|
||||
luaL_Reg l[] = {
|
||||
{ "pack", mc_packlocal },
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
//
|
||||
// lua_mysqlaux.c
|
||||
//
|
||||
// Created by changfeng on 6/17/14.
|
||||
// Copyright (c) 2014 changfeng. All rights reserved.
|
||||
//
|
||||
#define LUA_LIB
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -162,7 +158,7 @@ static struct luaL_Reg mysqlauxlib[] = {
|
||||
};
|
||||
|
||||
|
||||
int luaopen_mysqlaux_c (lua_State *L) {
|
||||
LUAMOD_API int luaopen_mysqlaux_c (lua_State *L) {
|
||||
lua_newtable(L);
|
||||
luaL_setfuncs(L, mysqlauxlib, 0);
|
||||
return 1;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet_malloc.h"
|
||||
|
||||
#include "skynet_socket.h"
|
||||
@@ -462,7 +464,7 @@ ltostring(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_netpack(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <stdio.h>
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
@@ -198,7 +200,7 @@ lyield_co(lua_State *L) {
|
||||
return timing_yield(L);
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_profile(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] = {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
modify from https://github.com/cloudwu/lua-serialize
|
||||
*/
|
||||
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet_malloc.h"
|
||||
|
||||
#include <lua.h>
|
||||
@@ -594,7 +596,7 @@ luaseri_unpack(lua_State *L) {
|
||||
return lua_gettop(L) - 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaseri_pack(lua_State *L) {
|
||||
struct block temp;
|
||||
temp.next = NULL;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -762,7 +764,7 @@ lupdate(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_sharedata_core(lua_State *L) {
|
||||
luaL_Reg l[] = {
|
||||
// used by host
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet.h"
|
||||
#include "lua-seri.h"
|
||||
|
||||
@@ -366,7 +368,7 @@ lnow(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_skynet_core(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include "skynet_malloc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -674,7 +676,7 @@ ludp_address(lua_State *L) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_socketdriver(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <stdlib.h>
|
||||
@@ -232,7 +234,7 @@ lread(lua_State *L) {
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
LUAMOD_API int
|
||||
luaopen_stm(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
lua_createtable(L, 0, 3);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define LUA_LIB
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "msvcint.h"
|
||||
|
||||
Reference in New Issue
Block a user