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 NELEMS(a)
 Return number of elements of an array.
#define STRINGIFY(x)
 Turn parameter into string.
#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.
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.


Detailed Description

Convenience macros and function declarations for backends.

See also:
sanei_backend.h sanei_thread.h

Function Documentation

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

Check the constraints of a SANE option.

Parameters:
opt option to check
value value 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 occured
See also:
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:
opt option to check
value value of the option
info info 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 occured
See also:
sanei_check_value()


Generated on Mon Jan 31 21:43:30 2011 for SANEI by  doxygen 1.5.6