Show
Ignore:
Timestamp:
01/28/08 06:44:04 (11 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1201502644 +0000
git-parent:

[80235b3f11f72d0a54a7ae6df1139d23ed59e2ac]

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

I can ping things...whahahahahaha

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_module.c

    r80235b3 rb09f3a7  
    1313#include "utils/noit_hash.h" 
    1414#include "utils/noit_log.h" 
     15 
     16struct __extended_module_data { 
     17  void *userdata; 
     18}; 
    1519 
    1620static noit_hash_table modules = NOIT_HASH_EMPTY; 
     
    5660  module = calloc(1, sizeof(*module)); 
    5761  memcpy(module, dlsymbol, sizeof(*module)); 
     62  module->opaque_handle = calloc(1, sizeof(struct __extended_module_data)); 
    5863 
    5964  if(module->onload(module)) { 
     
    109114      continue; 
    110115    } 
     116    if(module->init(module)) { 
     117      noit_log(noit_stderr, NULL, 
     118               "Initialized failed on %s:%s\n", module_file, module_name); 
     119      continue; 
     120    } 
    111121    noit_log(noit_stderr, NULL, "Module %s:%s successfully loaded.\n", 
    112122             module_file, module_name); 
    113123  } 
    114124} 
     125 
     126void *noit_module_get_userdata(noit_module_t *mod) { 
     127  struct __extended_module_data *emd; 
     128  emd = (struct __extended_module_data *)mod->opaque_handle; 
     129  return emd->userdata; 
     130} 
     131void noit_module_set_userdata(noit_module_t *mod, void *newdata) { 
     132  struct __extended_module_data *emd; 
     133  emd = (struct __extended_module_data *)mod->opaque_handle; 
     134  emd->userdata = newdata; 
     135} 
     136