8 + * XXX: GNU and BSD handle the forward declaration of crypt() in different
9 + * and annoying ways (especially GNU). Declare it here just to make sure
12 +char *crypt(const char *, const char *);
14 +static int Pcrypt(lua_State *L)
16 + const char *str, *salt;
19 + str = luaL_checkstring(L, 1);
20 + salt = luaL_checkstring(L, 2);
21 + if (strlen(salt) < 2)
22 + luaL_error(L, "not enough salt");
24 + res = crypt(str, salt);
25 + lua_pushstring(L, res);
30 static const luaL_reg R[] =
38 {"ctermid", Pctermid},
39 {"dirname", Pdirname},
46 LDFLAGS_SHARED=-bundle -undefined dynamic_lookup
49 LDFLAGS_SHARED=-shared
58 - $(CC) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $(OBJS)
59 + $(CC) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $(OBJS) $(LIBS)
61 $(OBJS): modemuncher.c