Jeff Thompson | 76317aa | 2013-06-25 19:11:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Author: Jeff Thompson |
| 3 | * |
| 4 | * BSD license, See the LICENSE file for more information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NDN_BINARYXMLSTRUCTUREDECODER_H |
| 8 | #define NDN_BINARYXMLSTRUCTUREDECODER_H |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | struct ndn_BinaryXMLStructureDecoder { |
Jeff Thompson | 4e27899 | 2013-06-26 18:59:17 -0700 | [diff] [blame^] | 15 | int gotElementEnd; /**< boolean */ |
Jeff Thompson | 76317aa | 2013-06-25 19:11:48 -0700 | [diff] [blame] | 16 | unsigned int offset; |
| 17 | int level; |
| 18 | int state; |
| 19 | unsigned int headerLength; |
Jeff Thompson | 4e27899 | 2013-06-26 18:59:17 -0700 | [diff] [blame^] | 20 | int useHeaderBuffer; /**< boolean */ |
Jeff Thompson | 76317aa | 2013-06-25 19:11:48 -0700 | [diff] [blame] | 21 | // 10 bytes is enough to hold an encoded header with a type and a 64 bit value. |
| 22 | unsigned char headerBuffer[10]; |
| 23 | int nBytesToRead; |
| 24 | }; |
| 25 | |
| 26 | const int ndn_BinaryXMLStructureDecoder_READ_HEADER_OR_CLOSE = 0; |
| 27 | const int ndn_BinaryXMLStructureDecoder_READ_BYTES = 1; |
| 28 | |
| 29 | void ndn_BinaryXMLStructureDecoder_init(struct ndn_BinaryXMLStructureDecoder *self); |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif |