Exemple #1
0
void luazmq_socket_initlib (lua_State *L, int nup){
#ifdef LUAZMQ_DEBUG
  int top = lua_gettop(L);
#endif

  luazmq_createmeta(L, LUAZMQ_SOCKET, luazmq_skt_methods, nup);
  lua_pop(L, 1);

#ifdef LUAZMQ_DEBUG
  assert(top == (lua_gettop(L) + nup));
#endif

  luazmq_register_consts(L, skt_types);
  luazmq_register_consts(L, skt_options);
  luazmq_register_consts(L, skt_flags);
  luazmq_register_consts(L, skt_security_mechanism);
}
Exemple #2
0
void luazmq_error_initlib(lua_State *L, int nup){
#ifdef LUAZMQ_DEBUG
  int top = lua_gettop(L);
#endif

  luazmq_createmeta(L, LUAZMQ_ERROR, luazmq_err_methods, nup);
  lua_pop(L, 1);

#ifdef LUAZMQ_DEBUG
  assert(top == (lua_gettop(L) + nup));
#endif

  luazmq_register_consts(L, zmq_err_codes);

  lua_newtable(L);
  luazmq_register_consts(L, zmq_err_codes);
  luazmq_register_consts_invers(L,zmq_err_codes);
  lua_setfield(L,-2, "errors");
}
Exemple #3
0
void luazmq_message_initlib(lua_State *L, int nup){
#ifdef LUAZMQ_DEBUG
  int top = lua_gettop(L);
#endif

  luazmq_createmeta(L, LUAZMQ_MESSAGE, luazmq_msg_methods, nup);
  lua_pop(L, 1);

#ifdef LUAZMQ_DEBUG
  assert(top == (lua_gettop(L) + nup));
#endif

  luazmq_register_consts(L, msg_options);
}