Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8801d55f5f
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (27 sloc) 0.762 kb
#include "lua.h"
#include "lauxlib.h"
#include "chasen.h"
static int chasenlib_sparse (lua_State *L) {
lua_pushstring(L, chasen_sparse_tostr((char *)luaL_checkstring(L, 1)));
return 1;
}
static int chasenlib_init (lua_State *L) {
const char *format = luaL_checkstring(L, 1);
int result;
char *opt[6] = {"chasen", "-i", "w", "-F", NULL, NULL};
opt[4] = (char *)format;
result = chasen_getopt_argv(opt, NULL);
lua_pushboolean(L, result == 0);
return 1;
}
static const luaL_reg chasenlib[] = {
{"sparse", chasenlib_sparse},
{"init", chasenlib_init},
{NULL, NULL},
};
LUALIB_API int luaopen_chasen (lua_State *L) {
luaL_register(L, "chasen", chasenlib);
char *opt[4] = {"chasen", "-i", "w", NULL};
chasen_getopt_argv(opt, NULL);
return 1;
}
Jump to Line
Something went wrong with that request. Please try again.