## LibinsaneScanSession LibinsaneScanSession |

## Functions

LibinsaneScanParameters * | libinsane_scan_session_get_scan_parameters ()
gboolean | libinsane_scan_session_end_of_feed ()
gboolean | libinsane_scan_session_end_of_page ()
gssize | libinsane_scan_session_read ()
GBytes * | libinsane_scan_session_read_bytes ()
void | libinsane_scan_session_cancel ()

## Types and Values

#define | LIBINSANE_SCAN_SESSION_TYPE

## Description

## Functions

### libinsane_scan_session_get_scan_parameters ()

    LibinsaneScanParameters *
    libinsane_scan_session_get_scan_parameters
                                   (LibinsaneScanSession *self,
                                    GError **error);

### libinsane_scan_session_end_of_feed ()

    gboolean
    libinsane_scan_session_end_of_feed (LibinsaneScanSession *self);

### libinsane_scan_session_end_of_page ()

    gboolean
    libinsane_scan_session_end_of_page (LibinsaneScanSession *self);

### libinsane_scan_session_read ()

    gssize
    libinsane_scan_session_read (LibinsaneScanSession *self,
                                 void *buffer,
                                 gsize lng,
                                 GError **error);

You must call `libinsane_scan_session_end_of_feed()` and `libinsane_scan_session_end_of_page()` after each call to this function before calling it again.

#### Parameters

self | Scan session |
buffer | buffer to read data. | [array length=lng][element-type guint8]
lng | length of buffer |
error | location to store the error if any occurs |

#### Returns

Number of bytes read, or -1 on error

### libinsane_scan_session_read_bytes ()

    GBytes *
    libinsane_scan_session_read_bytes (LibinsaneScanSession *self,
                                       gsize lng,
                                       GError **error);

#### Parameters

self | scan session |
lng | number of bytes wanted |
error | set if an error occurs |

#### Returns

a new GBytes, or `NULL` if an error occured.

[transfer full]

### libinsane_scan_session_cancel ()

    void
    libinsane_scan_session_cancel (LibinsaneScanSession *self);

## Types and Values

### LIBINSANE_SCAN_SESSION_TYPE

    #define             LIBINSANE_SCAN_SESSION_TYPE