Changeset d5db0b89dd6ef5ab8baaa06225cd92898bd0dcea

Show
Ignore:
Timestamp:
03/27/12 22:01:14 (2 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1332885674 +0000
git-parent:

[e8c10f943d9af8cb08aeb8cbbb05769d7b2f439c]

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

automatic registration of module namespaces

Files:

Legend:

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

    r204ecdc rd5db0b8  
    15681568  i = reg_module_id++; 
    15691569  reg_module_names[i] = strdup(name); 
     1570  noit_conf_set_namespace(reg_module_names[i]); 
    15701571  return i; 
    15711572} 
  • src/noit_conf.c

    r3de78ae rd5db0b8  
    125125} 
    126126 
     127void 
     128noit_conf_set_namespace(const char *ns) { 
     129  xmlNsPtr nsptr; 
     130  xmlNodePtr root; 
     131  root = xmlDocGetRootElement(master_config); 
     132  nsptr = xmlSearchNs(master_config, root, (xmlChar *)ns); 
     133  if(!nsptr) { 
     134    char url[128]; 
     135    snprintf(url, sizeof(url), "noit://module/%s", ns); 
     136    nsptr = xmlNewNs(root, (xmlChar *)url, (xmlChar *)ns); 
     137  } 
     138} 
     139 
    127140static int 
    128141noit_conf_watch_config_and_journal(eventer_t e, int mask, void *closure, 
  • src/noit_conf.h

    r80f4747 rd5db0b8  
    136136API_EXPORT(void) noit_conf_backingstore_dirty(noit_conf_section_t node); 
    137137 
     138API_EXPORT(void) noit_conf_set_namespace(const char *ns); 
     139 
    138140#define CONF_REMOVE(n) do { \ 
    139141  noit_conf_backingstore_remove(n); \