summaryrefslogtreecommitdiff
path: root/support/dktools/dk4tsp.h
blob: d231af5a5a4314bac463d2c608a68610bf2d99d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef DK4TSP_H_INCLUDED
#define	DK4TSP_H_INCLUDED	1

/**	@file	dk4tsp.h	Text stream processing.
*/

#ifndef DK4CONF_H_INCLUDED
#include "dk4conf.h"
#endif

#ifndef DK4TYPES_H_INCLUDED
#include "dk4types.h"
#endif

/**	Position in a data stream.
*/
typedef struct {
  dk4_um_t	bytes;		/**< Number of bytes successfully processed. */
  dk4_um_t	chars;		/**< Number of current character. */
  dk4_um_t	lineno;		/**< Current line number. */
  dk4_um_t	charil;		/**< Number of current character in line. */
} dk4_text_stream_position_t;

/**	Results from processing a text character or a line.
*/
enum {
			/**	Text processing succeeded.
			*/
  DK4_TSP_RES_OK	=	1,

			/**	There was an error while applying
				the information, but we can continue.
			*/
  DK4_TSP_RES_ERROR	=	0,

			/**	Fatal error while applying information,
				abort processing.
			*/
  DK4_TSP_RES_FATAL	=	-1
};

#endif