<commit_before>#![feature(plugin)]
#![plugin(interpolate_idents)]

extern crate libc;

#[macro_use]
extern crate apache2;

#[macro_use]
extern crate lazy_static;

use libc::{c_void, c_char};
use apache2::{Request, Status, CmdParms, ffi};


struct ExampleConfig {
   pub first_cmd: Option<String>,
   pub second_cmd: Option<String>
}

lazy_static! {
   static ref EXAMPLE_CONFIG: ExampleConfig = ExampleConfig {
      first_cmd: None,
      second_cmd: None
   };
}


fn cmd_process(parms: &mut CmdParms) {
}


#[allow(unused_variables)]
pub extern "C" fn first_cmd(parms: *mut ffi::cmd_parms, mconfig: *mut c_void, w: *const c_char) -> *const c_char {
   std::ptr::null()
}


#[allow(unused_variables)]
pub extern "C" fn second_cmd(parms: *mut ffi::cmd_parms, mconfig: *mut c_void, w: *const c_char) -> *const c_char {
   std::ptr::null()
}

apache2_module!(conf, b"mod_conf\0", commands {
   AP_INIT_TAKE1!(b"FirstCmd\0", first_cmd, apache2::ffi::RSRC_CONF, b"First cmd error message\0");
   AP_INIT_TAKE1!(b"SecondCmd\0", second_cmd, apache2::ffi::RSRC_CONF, b"Second cmd error message\0")
});


fn conf_handler(r: &mut Request) -> Result<Status, ()> {
   if try!(r.handler()) != "conf" {
      return Ok(Status::DECLINED)
   }

   r.set_content_type("text/plain; charset=utf-8");

   try!(r.write("CONF: *****"));

   Ok(Status::OK)
}<commit_msg>mod_conf example_config C-struct.<commit_after>#![feature(plugin)]
#![plugin(interpolate_idents)]

extern crate libc;

#[macro_use]
extern crate apache2;

#[macro_use]
extern crate lazy_static;

use libc::{c_char};
use apache2::{Request, Status, ffi};
use apache2::wrapper::from_char_ptr;


#[repr(C)]
pub struct example_config {
   pub first_cmd: *const c_char,
   pub second_cmd: *const c_char
}


#[allow(unused_variables)]
pub extern "C" fn first_cmd(parms: *mut ffi::cmd_parms, config: *mut example_config, w: *const c_char) -> *const c_char {
   let val = from_char_ptr(w).unwrap();
   std::ptr::null()
}


#[allow(unused_variables)]
pub extern "C" fn second_cmd(parms: *mut ffi::cmd_parms, config: *mut example_config, w: *const c_char) -> *const c_char {
   let val = from_char_ptr(w).unwrap();
   std::ptr::null()
}

apache2_module!(conf, b"mod_conf\0", commands {
   None, None, None, None,
   AP_INIT_TAKE1!(b"FirstCmd\0", first_cmd, apache2::ffi::RSRC_CONF, b"First cmd description\0");
   AP_INIT_TAKE1!(b"SecondCmd\0", second_cmd, apache2::ffi::RSRC_CONF, b"Second cmd description\0")
});


fn conf_handler(r: &mut Request) -> Result<Status, ()> {
   if try!(r.handler()) != "conf" {
      return Ok(Status::DECLINED)
   }

   r.set_content_type("text/plain; charset=utf-8");

   try!(r.write("CONF: *****"));

   Ok(Status::OK)
}
{'fraction_non_alphanumeric': 0.17118455254363163, 'fraction_numerical': 0.010025993316004456, 'mean_word_length': 5.265116279069767, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '94839', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1035, 'n_words': 216}