<commit_before>#![feature(untagged_unions)]
#![feature(conservative_impl_trait)]
#[macro_use]
extern crate bitflags;
extern crate libc;
use std::slice;
pub mod raw;
pub mod command;




#[macro_export]
macro_rules! redis_module (
    ($name:expr,$module_version:expr, $commands:expr) => (

        #[no_mangle]
        #[allow(non_snake_case)]
        pub extern "C" fn RedisModule_OnLoad(ctx: *mut redismodule::raw::RedisModuleCtx) -> redismodule::raw::Status {
            unsafe {
              if redismodule::raw::RedisModule_Init(ctx,format!("{}\0",$name).as_ptr() as *const i8, $module_version, redismodule::raw::REDISMODULE_APIVER_1) == redismodule::raw::Status::Err {
                  return redismodule::raw::Status::Err;
              }
              for command in $commands {


                if redismodule::raw::RedisModule_CreateCommand(ctx,
                                                            format!("{}\0", command.name).as_ptr() as *const i8,
                                                            command.handler,
                                                            format!("write\0").as_ptr() as *const i8,
                                                            1,
                                                            1,
                                                            1) == redismodule::raw::Status::Err {
                    return redismodule::raw::Status::Err;
                }
              }
              return redismodule::raw::Status::Ok;
            }
        }
    )
);



pub fn wrap_command(command: fn(ctx: *mut raw::RedisModuleCtx, args: &[&str]) -> RedisResult)
                -> impl Fn(*mut raw::RedisModuleCtx, *mut *mut raw::RedisModuleString, libc::c_int) -> raw::Status{<commit_msg>command<commit_after>#![feature(untagged_unions)]
#![feature(conservative_impl_trait)]
#[macro_use]
extern crate bitflags;
extern crate libc;
use std::slice;
pub mod raw;
pub mod command;

// #[macro_export]
// macro_rules! command (
//      ($name:expr) => (
//         fn $name() {
//             // match cmd(ctx, &["a"]) {
//             //     Ok(redisvalue) => raw::Status::Ok,
//             //     Err(e) => raw::Status::Err,
//             // }
//         };
//      )
// );

#[macro_export]
macro_rules! redis_module (
    ($name:expr,$module_version:expr, $commands:expr) => (

        #[no_mangle]
        #[allow(non_snake_case)]
        pub extern "C" fn RedisModule_OnLoad(ctx: *mut redismodule::raw::RedisModuleCtx) -> redismodule::raw::Status {
            unsafe {
              if redismodule::raw::RedisModule_Init(ctx,format!("{}\0",$name).as_ptr() as *const i8, $module_version, redismodule::raw::REDISMODULE_APIVER_1) == redismodule::raw::Status::Err {
                  return redismodule::raw::Status::Err;
              }
              for command in $commands {


                
                if redismodule::raw::RedisModule_CreateCommand(ctx,
                                                            format!("{}\0", command.name).as_ptr() as *const i8,
                                                            command.handler,
                                                            format!("write\0").as_ptr() as *const i8,
                                                            1,
                                                            1,
                                                            1) == redismodule::raw::Status::Err {
                    return redismodule::raw::Status::Err;
                }
              }
              return redismodule::raw::Status::Ok;
            }
        }
    )
);



pub fn wrap_command(command: fn(ctx: *mut raw::RedisModuleCtx, args: &[&str]) -> RedisResult)
                -> impl Fn(*mut raw::RedisModuleCtx, *mut *mut raw::RedisModuleString, libc::c_int) -> raw::Status{
{'fraction_non_alphanumeric': 0.1345954356846473, 'fraction_numerical': 0.005186721991701245, 'mean_word_length': 1.4426852438252058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3127067', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1039, 'n_words': 180}