Logo Search packages:      
Sourcecode: inkscape version File versions

enum CRStatus cr_input_read_byte ( CRInput a_this,
guchar *  a_byte 
)

Returns the next byte of the input. Update the state of the input so that the next invocation of this method returns the next coming byte.

Parameters:
a_this the current instance of CRInput.
a_byte out parameter the returned byte.
Returns:
CR_OK upon successful completion, an error code otherwise. All the out parameters of this method are valid if and only if this method returns CR_OK.

Definition at line 386 of file cr-input.c.

Referenced by cr_tknzr_read_byte().

{
        g_return_val_if_fail (a_this && PRIVATE (a_this)
                              && a_byte, CR_BAD_PARAM_ERROR);

        g_return_val_if_fail (PRIVATE (a_this)->next_byte_index <=
                              PRIVATE (a_this)->nb_bytes, CR_BAD_PARAM_ERROR);

        if (PRIVATE (a_this)->end_of_input == TRUE)
                return CR_END_OF_INPUT_ERROR;

        *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index];

        if (PRIVATE (a_this)->nb_bytes -
            PRIVATE (a_this)->next_byte_index < 2) {
                PRIVATE (a_this)->end_of_input = TRUE;
        } else {
                PRIVATE (a_this)->next_byte_index++;
        }

        return CR_OK;
}


Generated by  Doxygen 1.6.0   Back to index