Changeset 5bf243f7a20f4b0718b616e7bda35cccf609d095

Show
Ignore:
Timestamp:
06/02/08 22:16:15 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1212444975 +0000
git-parent:

[edf3f13e11443570a92c3dd4436839bc516181ad]

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

Baby steps.

lua checks can now be written. Simple wrappers for check manipulation are
in place. I need to figure out how to make lua resume into a coroutine and
invoke lua_error on resumption (so we can force a timeout).

noit.sleep(number) was implemanted as a proof-of-concept coro... It works!

Need to do sockets next -- will be slightly more complicated, but I do not
see it being traumatic.

refs #28

Files:

Legend:

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

    rf921b22 r5bf243f  
    2424top_srcdir=@top_srcdir@ 
    2525 
    26 SUBS=utils eventer modules noitedit 
     26SUBS=lua utils eventer modules noitedit 
    2727 
    2828NOIT_OBJS=noitd.o noit_listener.o \ 
  • src/modules/Makefile.in

    ra504323 r5bf243f  
    1818 
    1919MODULES=ping_icmp.@MODULEEXT@ http.@MODULEEXT@ postgres.@MODULEEXT@ \ 
     20        lua.@MODULEEXT@ \ 
    2021        @BUILD_MODULES@ 
    2122 
    2223all:    $(MODULES) 
     24 
     25lua.@MODULEEXT@:        lua.lo lua_noit.lo 
     26        @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo ../lua/liblua.lo 
     27        @echo "- linking $@" 
     28 
     29lua.lo: lua.c 
     30        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua.c -o $@ 
     31        @echo "- compiling $<" 
     32 
     33lua_noit.lo:    lua_noit.c 
     34        @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_noit.c -o $@ 
     35        @echo "- compiling $<" 
    2336 
    2437postgres.@MODULEEXT@:   postgres.lo 
  • src/noit_module.c

    rc39dbcd r5bf243f  
    6363  if (NOIT_IMAGE_MAGIC(obj) != NOIT_LOADER_MAGIC) return -1; 
    6464  if (NOIT_IMAGE_VERSION(obj) != NOIT_LOADER_ABI_VERSION) return -1; 
     65  return 0; 
     66} 
     67 
     68noit_module_t *noit_blank_module() { 
     69  noit_module_t *obj; 
     70  obj = calloc(1, sizeof(*obj)); 
     71  obj->hdr.opaque_handle = calloc(1, sizeof(struct __extended_image_data)); 
     72  return obj; 
     73} 
     74 
     75int noit_register_module(noit_module_t *mod) { 
     76  noit_hash_store(&modules, mod->hdr.name, strlen(mod->hdr.name), mod); 
    6577  return 0; 
    6678} 
  • src/noit_module.h

    rc39dbcd r5bf243f  
    5151API_EXPORT(noit_module_t *) 
    5252  noit_module_lookup(const char *name); 
     53API_EXPORT(noit_module_t *) 
     54  noit_blank_module(); 
     55API_EXPORT(int) 
     56  noit_register_module(noit_module_t *mod); 
    5357 
    5458API_EXPORT(void *)