Changeset 2bc357abaca0cfec2814a8e2892c5c9775e46dfc

Show
Ignore:
Timestamp:
02/20/10 20:36:12 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1266698172 +0000
git-parent:

[7d70182829211f6a49777014122994e32dc0cd43]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1266698172 +0000
Message:

add a string.pack and string.unpack.

this code is public domain, I've reviewed it and it should be safe. It's
a variant on a plethora of other implementations out there and would be
trivial to rewrite should the need arise.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/Makefile.in

    r8d8df04 r2bc357a  
    3838selfcheck.lo:   selfcheck.xmlh 
    3939 
    40 lua.@MODULEEXT@:        lua.lo lua_noit.lo 
    41         @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo ../lua/liblua.lo 
     40lua.@MODULEEXT@:        lua.lo lua_noit.lo lua_lpack.lo 
     41        @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo lua_lpack.lo ../lua/liblua.lo 
    4242        @echo "- linking $@" 
    4343 
     
    4848lua_noit.lo:    lua_noit.c 
    4949        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_noit.c -o $@ 
     50        @echo "- compiling $<" 
     51 
     52lua_lpack.lo:   lua_lpack.c 
     53        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_lpack.c -o $@ 
    5054        @echo "- compiling $<" 
    5155 
  • src/modules/lua.c

    r7d70182 r2bc357a  
    780780  lua_gc(L, LUA_GCSTOP, 0);  /* stop collector during initialization */ 
    781781  luaL_openlibs(L);  /* open libraries */ 
     782  luaopen_pack(L); 
    782783  luaopen_noit(L); 
    783784 
  • src/modules/lua_noit.h

    r7d70182 r2bc357a  
    102102void noit_lua_init(); 
    103103int luaopen_noit(lua_State *L); 
     104int luaopen_pack(lua_State *L); /* from lua_lpack.c */ 
    104105noit_lua_check_info_t *get_ci(lua_State *L); 
    105106int noit_lua_yield(noit_lua_check_info_t *ci, int nargs);