pub fn compile_with_options(pattern: &str, options: &EnumSet<CompileOption>) -> Result<Pcre, CompilationError> {
        let pattern_cstring = CString::new(pattern).unwrap();
        unsafe {
            // Use the default character tables.
            let tableptr: *const c_uchar = ptr::null();
            match detail::pcre_compile(pattern_cstring.as_ptr(), options, tableptr) {
                Err((opt_err, erroffset)) => Err(CompilationError {
                    opt_err: opt_err,
                    erroffset: erroffset
                }),
                Ok(mut_code) => {
                    let code = mut_code as *const detail::pcre;
                    assert!(!code.is_null());
                    // Take a reference.
                    detail::pcre_refcount(code as *mut detail::pcre, 1);

                    let extra: *mut PcreExtra = ptr::null_mut();

                    let mut capture_count: c_int = 0;
                    detail::pcre_fullinfo(code, extra as *const PcreExtra, libpcre_sys::PCRE_INFO_CAPTURECOUNT,
                        &mut capture_count as *mut c_int as *mut c_void);

                    Ok(Pcre {
                        code: code,
                        extra: extra,
                        capture_count_: capture_count,
                        mark_: ptr::null_mut()
                    })
                }
            }
        }
    }
/// Compiles a regular expression using the given bitwise-OR'd options `options`.
///
/// # Arguments
/// * `pattern` - The regular expression.
/// * `options` - Bitwise-OR'd compilation options. See the libpcre manpages,
///   `man 3 pcre_compile`, for more information.
Compiles a regular expression using the given bitwise-OR'd options `options`.
Compiles a regular expression using the given bitwise - OR ' d options ` options ` .
pub fn compile_with_options(pattern: &str, options: &EnumSet<CompileOption>) -> Result<Pcre, CompilationError> {
        let pattern_cstring = CString::new(pattern).unwrap();
        unsafe {
            // Use the default character tables.
            let tableptr: *const c_uchar = ptr::null();
            match detail::pcre_compile(pattern_cstring.as_ptr(), options, tableptr) {
                Err((opt_err, erroffset)) => Err(CompilationError {
                    opt_err: opt_err,
                    erroffset: erroffset
                }),
                Ok(mut_code) => {
                    let code = mut_code as *const detail::pcre;
                    assert!(!code.is_null());
                    // Take a reference.
                    detail::pcre_refcount(code as *mut detail::pcre, 1);
                    let extra: *mut PcreExtra = ptr::null_mut();
                    let mut capture_count: c_int = 0;
                    detail::pcre_fullinfo(code, extra as *const PcreExtra, libpcre_sys::PCRE_INFO_CAPTURECOUNT,
                        &mut capture_count as *mut c_int as *mut c_void);
                    Ok(Pcre {
                        code: code,
                        extra: extra,
                        capture_count_: capture_count,
                        mark_: ptr::null_mut()
                    })
                }
            }
        }
    }
pub fn compile_with_options ( pattern : & str , options : & EnumSet < CompileOption > ) -> Result < Pcre , CompilationError > { let pattern_cstring = CString :: new ( pattern ) . unwrap ( ) ; unsafe { // Use the default character tables. let tableptr : * const c_uchar = ptr :: null ( ) ; match detail :: pcre_compile ( pattern_cstring . as_ptr ( ) , options , tableptr ) { Err ( ( opt_err , erroffset ) ) => Err ( CompilationError { opt_err : opt_err , erroffset : erroffset } ) , Ok ( mut_code ) => { let code = mut_code as * const detail :: pcre ; assert ! ( code is_null ( ) ) ; // Take a reference. detail :: pcre_refcount ( code as * mut detail :: pcre , 1 ) ; let extra : * mut PcreExtra = ptr :: null_mut ( ) ; let mut capture_count : c_int = 0 ; detail :: pcre_fullinfo ( code , extra as * const PcreExtra , libpcre_sys :: PCRE_INFO_CAPTURECOUNT , & mut capture_count as * mut c_int as * mut c_void ) ; Ok ( Pcre { code : code , extra : extra , capture_count_ : capture_count , mark_ : ptr :: null_mut ( ) } ) } } } }
Compiles a regular expression using the given bitwise-OR'd options `options`.
Compiles a regular expression using the given bitwise - OR ' d options ` options ` .
pattern
&str
options
&EnumSet<CompileOption>
pattern
&str
options
&EnumSet<CompileOption>