httpmessage  0.4.0
HTTP message parsing library
Enumerations | Functions
httpmessage.h File Reference

Library main header. More...

#include "httpmessage/message.h"
#include "httpmessage/header.h"
#include "httpmessage/text.h"
#include "httpmessage/grammar.h"
#include "httpmessage/preprocessor.h"
Include dependency graph for httpmessage.h:

Go to the source code of this file.

Enumerations

enum  httpmessage_result_code {
  HTTPMESSAGE_OK = 0, HTTPMESSAGE_ERROR_INVALID_ARGUMENT = -1000, HTTPMESSAGE_ERROR_OVERFLOW = -1100, HTTPMESSAGE_ERROR_WRITE = -1101,
  HTTPMESSAGE_ERROR_ALLOCATION = -1102, HTTPMESSAGE_ERROR_SYNTAX = -1200, HTTPMESSAGE_ERROR_INCOMPLETE = -1201
}
 
enum  httpmessage_message_type { HTTPMESSAGE_TYPE_UNKNOWN = -1, HTTPMESSAGE_TYPE_REQUEST = 'q', HTTPMESSAGE_TYPE_RESPONSE = 'r' }
 HTTP message type. More...
 
enum  httpmessage_option_flags { HTTPMESSAGE_CONSUME_IGNORE_MISSING_CRLF = (1 << 0), HTTPMESSAGE_CLEAR_NO_FREE = (1 << 1), HTTPMESSAGE_NO_ALLOCATION = (1 << 2) }
 Option flags. More...
 

Functions

HMAPI const char * httpmessage_result_get_text (int code)
 Get the error message associated to the given result code. More...
 

Detailed Description

Library main header.

Enumeration Type Documentation

◆ httpmessage_option_flags

Option flags.

Enumerator
HTTPMESSAGE_CONSUME_IGNORE_MISSING_CRLF 

Accept text input where an expected trailing CRLF is missing.

Applies to all *_consume functions.

HTTPMESSAGE_CLEAR_NO_FREE 

Instead of freeing structure members, set them to a value that mark them as unused.

Ex. Set header value sublines length to zero.

HTTPMESSAGE_NO_ALLOCATION 

Do not allocate new objects during function process.

If the function needs to allocate something, a HTTPMESSAGE_ERROR_ALLOCATION error code will be returned.

◆ httpmessage_result_code

httpmessage function result codes

Enumerator
HTTPMESSAGE_OK 

Successful operation

HTTPMESSAGE_ERROR_INVALID_ARGUMENT 

One or more function arguments are invalid

HTTPMESSAGE_ERROR_OVERFLOW 

Output buffer will overflow

HTTPMESSAGE_ERROR_WRITE 

I/O Write error

HTTPMESSAGE_ERROR_ALLOCATION 

A object failed to be allocated due to memory issue or allocation option rules

HTTPMESSAGE_ERROR_SYNTAX 

The text given in argument does not match the expected syntax

Function Documentation

◆ httpmessage_result_get_text()

HMAPI const char* httpmessage_result_get_text ( int  code)

Get the error message associated to the given result code.

Parameters
codeResult code
Returns
Result message