1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00
This commit is contained in:
Gabor Adam Toth 2011-04-19 12:26:51 +02:00
parent 1e3e7c2f78
commit eb34439925
2 changed files with 10 additions and 10 deletions

View file

@ -43,24 +43,24 @@ enum PSYC_Parts
typedef struct typedef struct
{ {
unsigned int length; size_t length;
const uint8_t * ptr; const uint8_t * ptr;
} PSYC_Array; } PSYC_Array;
typedef struct typedef struct
{ {
unsigned int cursor; /** current position in buffer */ size_t cursor; /** current position in buffer */
unsigned int startc; /** line start position */ size_t startc; /** line start position */
PSYC_Array buffer; PSYC_Array buffer;
uint8_t flags; uint8_t flags;
char part; /** part of the packet being parsed currently, see PSYC_Parts */ char part; /** part of the packet being parsed currently, see PSYC_Parts */
unsigned int contentParsed; /** number of bytes parsed from the content so far */ size_t contentParsed; /** number of bytes parsed from the content so far */
unsigned int contentLength; /** expected length of the content */ size_t contentLength; /** expected length of the content */
char contentLengthFound; /** is there a length given for this packet? */ char contentLengthFound; /** is there a length given for this packet? */
unsigned int valueParsed; /** number of bytes parsef from the value so far */ size_t valueParsed; /** number of bytes parsef from the value so far */
unsigned int valueLength; /** expected length of the value */ size_t valueLength; /** expected length of the value */
} PSYC_State; } PSYC_State;
#ifndef PSYC_COMPILE_LIBRARY #ifndef PSYC_COMPILE_LIBRARY
@ -70,7 +70,7 @@ typedef struct
* @param length length of that buffer * @param length length of that buffer
* *
* @returns an instance of the PSYC_Array struct */ * @returns an instance of the PSYC_Array struct */
inline PSYC_Array PSYC_createArray (uint8_t* const memory, unsigned int length) inline PSYC_Array PSYC_createArray (uint8_t* const memory, size_t length)
{ {
PSYC_Array arr = {length, memory}; PSYC_Array arr = {length, memory};
@ -101,7 +101,7 @@ inline void PSYC_nextBuffer (PSYC_State* state, PSYC_Array newBuf)
state->cursor = 0; state->cursor = 0;
} }
inline unsigned int PSYC_getContentLength (PSYC_State* s) inline size_t PSYC_getContentLength (PSYC_State* s)
{ {
return s->contentLength; return s->contentLength;
} }

View file

@ -49,7 +49,7 @@ inline char isAlphaNumeric(uint8_t c)
inline char isKwChar(uint8_t c) inline char isKwChar(uint8_t c)
{ {
return c == '_' || isAlphaNumeric(c); return isAlphaNumeric(c) || c == '_';
} }
/** /**