Changeset 5bf243f7a20f4b0718b616e7bda35cccf609d095
- Timestamp:
- 06/02/08 22:16:15
(5 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
| rf921b22 |
r5bf243f |
|
| 24 | 24 | top_srcdir=@top_srcdir@ |
|---|
| 25 | 25 | |
|---|
| 26 | | SUBS=utils eventer modules noitedit |
|---|
| | 26 | SUBS=lua utils eventer modules noitedit |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | NOIT_OBJS=noitd.o noit_listener.o \ |
|---|
| ra504323 |
r5bf243f |
|
| 18 | 18 | |
|---|
| 19 | 19 | MODULES=ping_icmp.@MODULEEXT@ http.@MODULEEXT@ postgres.@MODULEEXT@ \ |
|---|
| | 20 | lua.@MODULEEXT@ \ |
|---|
| 20 | 21 | @BUILD_MODULES@ |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | all: $(MODULES) |
|---|
| | 24 | |
|---|
| | 25 | lua.@MODULEEXT@: lua.lo lua_noit.lo |
|---|
| | 26 | @$(MODULELD) $(LDFLAGS) -o $@ lua.lo lua_noit.lo ../lua/liblua.lo |
|---|
| | 27 | @echo "- linking $@" |
|---|
| | 28 | |
|---|
| | 29 | lua.lo: lua.c |
|---|
| | 30 | @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua.c -o $@ |
|---|
| | 31 | @echo "- compiling $<" |
|---|
| | 32 | |
|---|
| | 33 | lua_noit.lo: lua_noit.c |
|---|
| | 34 | @$(CC) $(CPPFLAGS) $(SHCFLAGS) -I$(top_srcdir)/src/lua/src -c lua_noit.c -o $@ |
|---|
| | 35 | @echo "- compiling $<" |
|---|
| 23 | 36 | |
|---|
| 24 | 37 | postgres.@MODULEEXT@: postgres.lo |
|---|
| rc39dbcd |
r5bf243f |
|
| 63 | 63 | if (NOIT_IMAGE_MAGIC(obj) != NOIT_LOADER_MAGIC) return -1; |
|---|
| 64 | 64 | if (NOIT_IMAGE_VERSION(obj) != NOIT_LOADER_ABI_VERSION) return -1; |
|---|
| | 65 | return 0; |
|---|
| | 66 | } |
|---|
| | 67 | |
|---|
| | 68 | noit_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 | |
|---|
| | 75 | int noit_register_module(noit_module_t *mod) { |
|---|
| | 76 | noit_hash_store(&modules, mod->hdr.name, strlen(mod->hdr.name), mod); |
|---|
| 65 | 77 | return 0; |
|---|
| 66 | 78 | } |
|---|
| rc39dbcd |
r5bf243f |
|
| 51 | 51 | API_EXPORT(noit_module_t *) |
|---|
| 52 | 52 | noit_module_lookup(const char *name); |
|---|
| | 53 | API_EXPORT(noit_module_t *) |
|---|
| | 54 | noit_blank_module(); |
|---|
| | 55 | API_EXPORT(int) |
|---|
| | 56 | noit_register_module(noit_module_t *mod); |
|---|
| 53 | 57 | |
|---|
| 54 | 58 | API_EXPORT(void *) |
|---|