diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-10-13 19:14:30 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-10-13 19:14:30 +0000 |
commit | eafd7a3974e8605fd02794269db6114a3446e016 (patch) | |
tree | 064737b35dbe10f2995753ead92f95bac30ba048 /test/mailbox1.h | |
download | ragel-tarball-eafd7a3974e8605fd02794269db6114a3446e016.tar.gz |
ragel-6.9ragel-6.9
Diffstat (limited to 'test/mailbox1.h')
-rw-r--r-- | test/mailbox1.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/mailbox1.h b/test/mailbox1.h new file mode 100644 index 0000000..e7cd37c --- /dev/null +++ b/test/mailbox1.h @@ -0,0 +1,33 @@ +#ifndef _MAILBOX1_H +#define _MAILBOX1_H + +#include <stdio.h> +#include <string.h> +#include "vector.h" + +struct MBox +{ + int cs; + + Vector<char> headName; + Vector<char> headContent; + + // Initialize the machine. Invokes any init statement blocks. Returns 0 + // if the machine begins in a non-accepting state and 1 if the machine + // begins in an accepting state. + void init( ); + + // Execute the machine on a block of data. Returns -1 if after processing + // the data, the machine is in the error state and can never accept, 0 if + // the machine is in a non-accepting state and 1 if the machine is in an + // accepting state. + void execute( const char *data, int len ); + + // Indicate that there is no more data. Returns -1 if the machine finishes + // in the error state and does not accept, 0 if the machine finishes + // in any other non-accepting state and 1 if the machine finishes in an + // accepting state. + int finish( ); +}; + +#endif |