/* Initialization */ int status_init() { bsp_spin_init(&slock); memset(&s, 0, sizeof(BSP_STATUS)); s.start_time = time(NULL); return BSP_RTN_SUCCESS; }
static int new_word_filter(lua_State *s) { if (!s) { return 0; } struct word_filter_t *flt = bsp_malloc(sizeof(struct word_filter_t)); if (!flt) { trace_msg(TRACE_LEVEL_FATAL, "Filter : Alloc new word filter error"); return 0; } flt->node_used = 0; bsp_spin_init(&flt->node_lock); flt->node_list = NULL; flt->node_list_size = 0; // Make root flt->root = _get_new_node(flt); lua_pushlightuserdata(s, (void *) flt); return 1; }