Struct crfsuite_sys::tag_crfsuite_params
[−]
[src]
#[repr(C)]pub struct tag_crfsuite_params { pub internal: *mut c_void, pub nref: c_int, pub addref: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>, pub release: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>, pub num: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>, pub name: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, i: c_int, ptr_name: *mut *mut c_char) -> c_int>, pub set: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: *const c_char) -> c_int>, pub get: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut *mut c_char) -> c_int>, pub set_int: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: c_int) -> c_int>, pub set_float: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: floatval_t) -> c_int>, pub set_string: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: *const c_char) -> c_int>, pub get_int: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut c_int) -> c_int>, pub get_float: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut floatval_t) -> c_int>, pub get_string: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut *mut c_char) -> c_int>, pub help: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_type: *mut *mut c_char, ptr_help: *mut *mut c_char) -> c_int>, pub free: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, str: *const c_char)>, }
CRFSuite parameter interface.
Fields
internal: *mut c_void
Pointer to the instance data (internal use only).
nref: c_int
Reference counter (internal use only).
addref: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>
Increment the reference counter.
params
The pointer to this parameter instance.
Returns the reference count after this increment.
release: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>
Decrement the reference counter.
params
The pointer to this parameter instance.
Returns the reference count after this operation.
num: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t) -> c_int>
Obtain the number of available parameters.
params
The pointer to this parameter instance.
Returns the number of parameters maintained by this object.
name: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, i: c_int, ptr_name: *mut *mut c_char) -> c_int>
Obtain the name of a parameter.
params
The pointer to this parameter instance.i
The parameter index.ptr_name
*ptr_name points to the parameter name.
Returns int \c 0 always.
set: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: *const c_char) -> c_int>
Set a parameter value.
params
The pointer to this parameter instance.name
The parameter name.value
The parameter value in string format.
Returns int \c 0 if the parameter is found, \c -1 otherwise.
get: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut *mut c_char) -> c_int>
Get a parameter value.
params
The pointer to this parameter instance.name
The parameter name.ptr_value
*ptr_value presents the parameter value in string format.
Returns int \c 0 if the parameter is found, \c -1 otherwise.
set_int: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: c_int) -> c_int>
Set an integer value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.value
The parameter value.
Returns int \c 0 if the parameter value is set successfully, \c -1 otherwise (unknown parameter or incompatible type).
set_float: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: floatval_t) -> c_int>
Set a float value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.value
The parameter value.
Returns int \c 0 if the parameter value is set successfully, \c -1 otherwise (unknown parameter or incompatible type).
set_string: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, value: *const c_char) -> c_int>
Set a string value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.value
The parameter value.
Returns int \c 0 if the parameter value is set successfully, \c -1 otherwise (unknown parameter or incompatible type).
get_int: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut c_int) -> c_int>
Get an integer value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.ptr_value
The pointer to a variable that receives the integer value.
Returns int \c 0 if the parameter value is obtained successfully, \c -1 otherwise (unknown parameter or incompatible type).
get_float: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut floatval_t) -> c_int>
Get a float value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.ptr_value
The pointer to a variable that receives the float value.
Returns int \c 0 if the parameter value is obtained successfully, \c -1 otherwise (unknown parameter or incompatible type).
get_string: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_value: *mut *mut c_char) -> c_int>
Get a string value of a parameter.
params
The pointer to this parameter instance.name
The parameter name.ptr_value
*ptr_value presents the parameter value.
Returns int \c 0 if the parameter value is obtained successfully, \c -1 otherwise (unknown parameter or incompatible type).
help: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, name: *const c_char, ptr_type: *mut *mut c_char, ptr_help: *mut *mut c_char) -> c_int>
Get the help message of a parameter.
params
The pointer to this parameter instance.name
The parameter name.ptr_type
The pointer to \c char* to which this function store the type of the parameter.ptr_help
The pointer to \c char* to which this function store the help message of the parameter.
Returns int \c 0 if the parameter is found, \c -1 otherwise.
free: Option<unsafe extern "C" fn(params: *mut crfsuite_params_t, str: *const c_char)>
Free the memory block of a string allocated by this object.
params
The pointer to this parameter instance.str
The pointer to the string.
Trait Implementations
impl Debug for tag_crfsuite_params
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for tag_crfsuite_params
[src]
impl Clone for tag_crfsuite_params
[src]
fn clone(&self) -> tag_crfsuite_params
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more