Initialize Tizen 2.3
[external/ragel.git] / test / mailbox1.h
1 #ifndef _MAILBOX1_H
2 #define _MAILBOX1_H
3
4 #include <stdio.h>
5 #include <string.h>
6 #include "vector.h"
7
8 struct MBox
9 {
10         int cs;
11
12         Vector<char> headName;
13         Vector<char> headContent;
14
15         // Initialize the machine. Invokes any init statement blocks. Returns 0
16         // if the machine begins in a non-accepting state and 1 if the machine
17         // begins in an accepting state.
18         void init( );
19
20         // Execute the machine on a block of data. Returns -1 if after processing
21         // the data, the machine is in the error state and can never accept, 0 if
22         // the machine is in a non-accepting state and 1 if the machine is in an
23         // accepting state.
24         void execute( const char *data, int len );
25
26         // Indicate that there is no more data. Returns -1 if the machine finishes
27         // in the error state and does not accept, 0 if the machine finishes
28         // in any other non-accepting state and 1 if the machine finishes in an
29         // accepting state.
30         int finish( );
31 };
32
33 #endif