mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
enhancement in the documentation
This commit is contained in:
parent
bb40bba061
commit
5eec69d752
2 changed files with 13 additions and 6 deletions
|
@ -82,10 +82,17 @@ typedef enum
|
||||||
PSYC_LIST_BINARY = 2,
|
PSYC_LIST_BINARY = 2,
|
||||||
} psycListType;
|
} psycListType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String struct.
|
||||||
|
*
|
||||||
|
* Contains pointer and length for a buffer.
|
||||||
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
size_t length;
|
/// Length of the data pointed to by ptr
|
||||||
const char *ptr;
|
size_t length;
|
||||||
|
/// pointer to the data
|
||||||
|
const char *ptr;
|
||||||
} psycString;
|
} psycString;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* Note that there is also psyc_initParseState2 if you want to fine-tune what
|
* Note that there is also psyc_initParseState2 if you want to fine-tune what
|
||||||
* should be parsed.
|
* part of the packet should be parsed. @see psycParseFlag
|
||||||
*
|
*
|
||||||
* Next, you have to tell the parser what it should parse. Assuming the variable
|
* Next, you have to tell the parser what it should parse. Assuming the variable
|
||||||
* raw_data points to our packet and raw_len contains the length, you can pass
|
* raw_data points to our packet and raw_len contains the length, you can pass
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
* printf("Variable: %.*s Value: %.*s Operator: %c\n",
|
* printf("Variable: %.*s Value: %.*s Operator: %c\n",
|
||||||
* name.length, name.ptr,
|
* name.length, name.ptr,
|
||||||
* value.length, value.ptr,
|
* value.length, value.ptr,
|
||||||
* operator);
|
* oper);
|
||||||
* // Note that the .ptr member still points at your original buffer. If
|
* // Note that the .ptr member still points at your original buffer. If
|
||||||
* // you want to reuse that buffer for the next packet, you better copy it
|
* // you want to reuse that buffer for the next packet, you better copy it
|
||||||
* // before passing it to the parser or you copy each variable now.
|
* // before passing it to the parser or you copy each variable now.
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
* recieve incomplete packets but still want to access the data. This code would
|
* recieve incomplete packets but still want to access the data. This code would
|
||||||
* simply reject incomplete packets as error. A more detailed tutorial for
|
* simply reject incomplete packets as error. A more detailed tutorial for
|
||||||
* incomplete packets will follow, in the mean time, have look at the return
|
* incomplete packets will follow, in the mean time, have look at the return
|
||||||
* codes in psycParseRC and their explainations.
|
* codes in psycParseRC and their explainations. @see psycParseRC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @{ */ // end of parser group
|
/** @{ */ // end of parser group
|
||||||
|
@ -109,7 +109,7 @@ typedef enum
|
||||||
{
|
{
|
||||||
/// Parse only the header
|
/// Parse only the header
|
||||||
PSYC_PARSE_ROUTING_ONLY = 1,
|
PSYC_PARSE_ROUTING_ONLY = 1,
|
||||||
/// Expects only the content part of a packet. The buffer should contain the whole content in this case.
|
/// Parse only the content. This means that there is no header and parsing will fail if there is one. The beginning of the content is expected.
|
||||||
PSYC_PARSE_START_AT_CONTENT = 2,
|
PSYC_PARSE_START_AT_CONTENT = 2,
|
||||||
} psycParseFlag;
|
} psycParseFlag;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue