1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

refactoring - more renames

This commit is contained in:
tg(x) 2011-11-01 12:06:58 +01:00
parent f25e768482
commit 344cdb7996
21 changed files with 215 additions and 199 deletions

View file

@ -113,7 +113,7 @@ PsycModifierFlag psyc_modifier_length_check (PsycModifier *m)
if (m->value.length > PSYC_MODIFIER_SIZE_THRESHOLD)
flag = PSYC_MODIFIER_NEED_LENGTH;
else if (memchr(m->value.ptr, (int)'\n', m->value.length))
else if (memchr(m->value.data, (int)'\n', m->value.length))
flag = PSYC_MODIFIER_NEED_LENGTH;
else
flag = PSYC_MODIFIER_NO_LENGTH;

View file

@ -77,17 +77,17 @@
* // Name, value and operator of the variable can now be found in the
* // respective variables:
* printf("Variable: %.*s Value: %.*s Operator: %c\n",
* name.length, name.ptr,
* value.length, value.ptr,
* name.length, name.data,
* value.length, value.data,
* oper);
* // Note that the .ptr member still points at your original buffer. If
* // Note that the .data member still points at your original buffer. If
* // 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.
* break;
* case PSYC_PARSE_BODY: // it is the method and the body of the packet.
* printf("Method Name: %.*s Body: %.*s\n",
* name.length, name.ptr, // name of the method
* value.length, value.ptr); // value of the body
* name.length, name.data, // name of the method
* value.length, value.data); // value of the body
* break;
* case PSYC_PARSE_COMPLETE: // parsing of this packet is complete
* // You can simply continue parsing till you get the
@ -345,7 +345,7 @@ size_t psyc_parse_remaining_length (PsycParseState *state)
static inline
const char * psyc_parse_remaining_buffer (PsycParseState *state)
{
return state->buffer.ptr + state->cursor;
return state->buffer.data + state->cursor;
}
/**

View file

@ -58,7 +58,7 @@ typedef struct
* Callback for psyc_text() that produces a value for a match.
*
* The application looks up a match such as _fruit from [_fruit] and
* if found sets value->ptr & value->length to point to the found value,
* if found sets value->data & value->length to point to the found value,
* "Apple" for example. 0 is a legal value for the length.
* The callbacks returns either PSYC_TEXT_VALUE_FOUND or
* PSYC_TEXT_VALUE_NOT_FOUND if no match found in which case psyc_text

View file

@ -68,6 +68,7 @@ typedef enum {
} PsycTransport;
typedef enum {
PSYC_ENTITY_ROOT = 0,
PSYC_ENTITY_PERSON = '~',
PSYC_ENTITY_PLACE = '@',
PSYC_ENTITY_SERVICE = '$',

View file

@ -8,7 +8,7 @@
extern const PsycString psyc_routing_vars[];
// Variable types in alphabetical order.
extern const PsycMatchVar psyc_var_types[];
extern const PsycDictInt psyc_var_types[];
extern const size_t psyc_routing_vars_num;
extern const size_t psyc_var_types_num;