SANEI 1.3.1.74-c434
sanei.h File Reference

Convenience macros and function declarations for backends. More...

Go to the source code of this file.

Public macros and functions

#define __sane_unused__
 Mark parameters as potentially unused.
 
#define NELEMS(a)
 Return number of elements of an array.
 
#define STRINGIFY1(x)
 Mark parameters as potentially unused.
 
#define STRINGIFY(x)
 Turn parameter into string.
 
#define PASTE1(x, y)
 Mark parameters as potentially unused.
 
#define PASTE(x, y)
 Concatenate parameters.
 
SANE_Status sanei_check_value (const SANE_Option_Descriptor *opt, void *value)
 Check the constraints of a SANE option. More...
 
SANE_Status sanei_constrain_value (const SANE_Option_Descriptor *opt, void *value, SANE_Word *info)
 Check the constraints of a SANE option and adjust its value if necessary. More...
 

Detailed Description

Convenience macros and function declarations for backends.

See also
sanei_backend.h sanei_thread.h

Function Documentation

◆ sanei_check_value()

SANE_Status sanei_check_value ( const SANE_Option_Descriptor *  opt,
void *  value 
)

Check the constraints of a SANE option.

Parameters
optoption to check
valuevalue of the option
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if the value doesn't fit inside the constraint or any other error occurred
See also
sanei_constrain_value()

◆ sanei_constrain_value()

SANE_Status sanei_constrain_value ( const SANE_Option_Descriptor *  opt,
void *  value,
SANE_Word *  info 
)

Check the constraints of a SANE option and adjust its value if necessary.

Depending on the type of the option and constraint, value is modified to fit inside constraint.

Parameters
optoption to check
valuevalue of the option
infoinfo is set to SANE_INFO_INEXACT if value was changed
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if the function wasn't able to fit value into the constraint or any other error occurred
See also
sanei_check_value()