#ifndef DK4EDSTM_H_INCLUDED #define DK4EDSTM_H_INCLUDED 1 /** @file dk4edstm.h Output values for state machines used to encode and decode data or for BOM detection. Several tasks in encoding, decoding and BOM detection are implemented using state machines. When using the state machine you pass byte by byte (or word by word in UTF-16 decoding) to the state machine. The state machines response is one from DK4_EDSTM_ACCEPT, DK4_EDSTM_FINISHED, DK4_EDSTM_FINISHED_WITH_UNUSED, or DK4_EDSTM_ERROR. You should perform an adequate action for the response. See the documentation of the specific state machine for possible actions. */ /** Results when adding bytes to an encoder, decoder or BOM detector. */ enum { /** Byte(s) added successfully, stored in the decoders internal state. No further action necessary. */ DK4_EDSTM_ACCEPT = 0, /** Byte(s) added successfully, you can retrieve output. */ DK4_EDSTM_FINISHED , /** Detection/encoding/decoding finished, you can retrieve the result but unused data is is saved in the state machine. You should retrieve and process the unused data before continuing to process the data stream. */ DK4_EDSTM_FINISHED_WITH_UNUSED , /** An EOD marker was found during decoding (i.e. when decoding ASCII85 data). You should retrieve and process output available in the state machine. */ DK4_EDSTM_STOP , /** An error occured while adding byte(s). */ DK4_EDSTM_ERROR = -1 }; #endif