httpmessage  0.4.0
HTTP message parsing library
grammar.h
Go to the documentation of this file.
1 /**************************************************************************************$
2  * httpmessage
3  ***************************************************************************************
4  * Copyright © 2022 by Renaud Guillard (dev@nore.fr)
5  * Distributed under the terms of the MIT License, see LICENSE
6  ***************************************************************************************
7  */
8 
14 #if !defined (LIBHTTPMESSAGGE_GRAMMAR_H__)
15 #define LIBHTTPMESSAGGE_GRAMMAR_H__
16 
18 
19 #include <unistd.h>
20 
22 
35 
48 
61 
74 
87 
101 HMAPI int httpmessage_text_is_CTL(int c);
102 
115 HMAPI int httpmessage_text_is_LWS(int c);
116 
133 HMAPI int httpmessage_text_is_CRLF(const char *text, size_t length);
134 
148 int httpmessage_text_is_TEXT(int c);
149 
168 
184 
204 HMAPI int httpmessage_token_consume(const char **token,
205  size_t *token_length,
206  const char *text,
207  size_t length);
208 
231  const char *text,
232  size_t length);
233 
258  char *output,
259  size_t output_size,
260  const char *text,
261  size_t length);
262 
264 
265 #endif /* LIBHTTPMESSAGGE_GRAMMAR_H__ */
266 
HMAPI int httpmessage_quoted_string_consume(char *output, size_t output_size, const char *text, size_t length)
Unescape a quoted string text.
#define HTTPMESSAGE_C_END
End exter C block.
Definition: preprocessor.h:44
HMAPI ssize_t httpmessage_quoted_string_length(const char *text, size_t length)
Get the unescaped string length of a quoted string.
HMAPI int httpmessage_text_is_LWS(int c)
Indicates if the given character is a linear white space.
HMAPI int httpmessage_text_is_DIGIT(int c)
Indicates if the given character is a digit.
HMAPI int httpmessage_text_is_ALPHA(int c)
Indicates if the given character is a ASCII letter.
HTTPMESSAGE_C_BEGIN HMAPI int httpmessage_text_is_CHAR(int c)
Indicates if the given character is a character.
HMAPI int httpmessage_text_is_separator(int c)
Indicates if the given character is a token separator.
HMAPI int httpmessage_text_is_UPALPHA(int c)
Indicates if the given character is an uppercase ASCII letter.
HMAPI int httpmessage_text_is_CRLF(const char *text, size_t length)
Indicates if the given text is an end of line sequence.
HMAPI int httpmessage_token_consume(const char **token, size_t *token_length, const char *text, size_t length)
Read a RFC2616 token.
HMAPI int httpmessage_text_is_CTL(int c)
Indicases if the given character is a control character.
Preprocessor macro definitions.
#define HTTPMESSAGE_C_BEGIN
Begin extern C block.
Definition: preprocessor.h:40
HMAPI int httpmessage_text_is_token_char(int c)
Indicates if the given character is a valid token character.
HMAPI int httpmessage_text_is_LUALPHA(int c)
Indicates if the given character is a lowercase ASCII letter.
#define HMAPI
C API exposition macro.
Definition: preprocessor.h:23
int httpmessage_text_is_TEXT(int c)
Indicates if the given character mathc the TEXT rule.