diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-08-28 03:22:19 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-08-28 03:22:19 -0400 |
commit | c10bcfa7def7a1093d78dcb15fd95388a633fc99 (patch) | |
tree | af553857dd28a0c2e3880a15390de3c16afb6a74 /include | |
parent | e0b6b017ce80f468499ed60b1b6a95b5218fa814 (diff) | |
download | libfhp-c10bcfa7def7a1093d78dcb15fd95388a633fc99.tar.bz2 libfhp-c10bcfa7def7a1093d78dcb15fd95388a633fc99.zip |
add cl-parser.c
Diffstat (limited to 'include')
-rw-r--r-- | include/fhp/fhp.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/fhp/fhp.h b/include/fhp/fhp.h index 46efb44..1e32a0d 100644 --- a/include/fhp/fhp.h +++ b/include/fhp/fhp.h @@ -41,6 +41,12 @@ typedef enum { FHP_ERR_TE_PARSER_DONE, FHP_ERR_NULL_TE_BUF, FHP_ERR_SMALL_TE_BUF, + FHP_ERR_INVALID_CHAR_BEFORE_CL, + FHP_ERR_INVALID_CHAR_IN_CL, + FHP_ERR_INVALID_CHAR_AFTER_CL, + FHP_ERR_CL_PARSER_DONE, + FHP_ERR_BAD_CL_STATE, + FHP_ERR_CL_OVERFLOW, FHP_ERR_LAST } fhp_err_t; @@ -114,6 +120,25 @@ void fhp_env_init(fhp_env_t * const env); fhp_env_t *fhp_get_default_env(void); // +// content length parser functions +// + +typedef enum { + FHP_CL_STATE_INIT, + FHP_CL_STATE_DATA, + FHP_CL_STATE_TRAILING_SPACES, + FHP_CL_STATE_ERROR, + FHP_CL_STATE_DONE, + FHP_CL_STATE_LAST +} fhp_cl_state_t; + +typedef struct { + fhp_cl_state_t state; + fhp_err_t err; + uint64_t val; +} fhp_cl_parser_t; + +// // transfer encoding parser functions // |