1 #ifndef REPLXX_ESCAPE_HXX_INCLUDED
2 #define REPLXX_ESCAPE_HXX_INCLUDED 1
3 
4 namespace replxx {
5 
6 namespace EscapeSequenceProcessing {
7 
8 // This is a typedef for the routine called by doDispatch().	It takes the
9 // current character
10 // as input, does any required processing including reading more characters and
11 // calling other
12 // dispatch routines, then eventually returns the final (possibly extended or
13 // special) character.
14 //
15 typedef char32_t (*CharacterDispatchRoutine)(char32_t);
16 
17 // This structure is used by doDispatch() to hold a list of characters to test
18 // for and
19 // a list of routines to call if the character matches.	The dispatch routine
20 // list is one
21 // longer than the character list; the final entry is used if no character
22 // matches.
23 //
24 struct CharacterDispatch {
25 	unsigned int len;                   // length of the chars list
26 	const char* chars;                  // chars to test
27 	CharacterDispatchRoutine* dispatch; // array of routines to call
28 };
29 
30 char32_t doDispatch(char32_t c);
31 
32 }
33 
34 }
35 
36 #endif
37 
38