mirror of
https://github.com/lxsang/antd-lua-plugin
synced 2025-02-22 10:42:48 +01:00
fix wurl bug
This commit is contained in:
parent
36f4dd0941
commit
27d2cbfbfb
BIN
dist/lua-0.5.2b.tar.gz
vendored
BIN
dist/lua-0.5.2b.tar.gz
vendored
Binary file not shown.
@ -35,6 +35,21 @@ typedef struct{
|
||||
unsigned char* data ;
|
||||
} wurl_header_t;
|
||||
|
||||
byte_array_t *l_check_barray (lua_State *L,int idx) {
|
||||
void *ud = luaL_checkudata(L, idx, BYTEARRAY);
|
||||
luaL_argcheck(L, ud != NULL, idx, "`byte array' expected");
|
||||
return (byte_array_t *)ud;
|
||||
}
|
||||
|
||||
void lua_new_byte_array(lua_State*L, int n)
|
||||
{
|
||||
size_t nbytes = sizeof(byte_array_t) + (n-1)*sizeof(unsigned char);
|
||||
byte_array_t *a = (byte_array_t *)lua_newuserdata(L, nbytes);
|
||||
luaL_getmetatable(L, BYTEARRAY);
|
||||
lua_setmetatable(L, -2);
|
||||
a->size = n;
|
||||
}
|
||||
|
||||
/*get the ip by hostname*/
|
||||
int wurl_ip_from_hostname(const char * hostname , char* ip)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user