mirror of
git://git.psyced.org/git/psyclpc
synced 2024-08-15 03:20:16 +00:00
bringing pkg-psyc up-to-date with libpsyc
This commit is contained in:
parent
89608125ce
commit
76c91004b3
2 changed files with 8 additions and 6 deletions
|
@ -176,7 +176,7 @@ fill_header_from_mapping (svalue_t *key, svalue_t *val, void *extra) {
|
|||
}
|
||||
}
|
||||
|
||||
psyc_list_init(&list, elems, VEC_SIZE(val->u.vec), PSYC_LIST_CHECK_LENGTH);
|
||||
psyc_list_init(&list, elems, VEC_SIZE(val->u.vec));
|
||||
valuelen = list.length;
|
||||
value = pxalloc(valuelen);
|
||||
if (!value) {
|
||||
|
@ -294,7 +294,7 @@ f_psyc_parse (svalue_t *sp) {
|
|||
vector_t *v, *list;
|
||||
mapping_t *map;
|
||||
char oper = 0;
|
||||
PsycString name = {0,0}, value = {0,0}, elems[MAX_LIST_SIZE], elem;
|
||||
PsycString name = {0,0}, value = {0,0}, elems[MAX_LIST_SIZE], elem, elem_type;
|
||||
PsycParseListState listState;
|
||||
int ret, retl, type = -1, error = 0;
|
||||
size_t size, i;
|
||||
|
@ -461,19 +461,19 @@ f_psyc_parse (svalue_t *sp) {
|
|||
|
||||
switch (type) {
|
||||
case PSYC_TYPE_DATE: // number + PSYC_EPOCH
|
||||
if (psyc_parse_date(PSYC_S2ARG(value), &timmy))
|
||||
if (psyc_parse_uint(PSYC_S2ARG(value), &timmy))
|
||||
put_number(sv, timmy);
|
||||
else
|
||||
error = PSYC_PARSE_ERROR_DATE;
|
||||
break;
|
||||
case PSYC_TYPE_TIME: // number
|
||||
if (psyc_parse_time(PSYC_S2ARG(value), &timmy))
|
||||
if (psyc_parse_uint(PSYC_S2ARG(value), &timmy))
|
||||
put_number(sv, timmy);
|
||||
else
|
||||
error = PSYC_PARSE_ERROR_TIME;
|
||||
break;
|
||||
case PSYC_TYPE_AMOUNT: // number
|
||||
if (psyc_parse_number(PSYC_S2ARG(value), &n))
|
||||
if (psyc_parse_uint(PSYC_S2ARG(value), &n))
|
||||
put_number(sv, n);
|
||||
else
|
||||
error = PSYC_PARSE_ERROR_AMOUNT;
|
||||
|
@ -496,8 +496,9 @@ f_psyc_parse (svalue_t *sp) {
|
|||
psyc_parse_list_state_init(&listState);
|
||||
psyc_parse_list_buffer_set(&listState, PSYC_S2ARG(value));
|
||||
elem = (PsycString){0, 0};
|
||||
elem_type = (PsycString){0, 0};
|
||||
do {
|
||||
retl = psyc_parse_list(&listState, &elem);
|
||||
retl = psyc_parse_list(&listState, &elem_type, &elem);
|
||||
switch (retl) {
|
||||
case PSYC_PARSE_LIST_END:
|
||||
retl = 0;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* or int* where necessary.
|
||||
*/
|
||||
|
||||
# include <psyc.h>
|
||||
# include <psyc/packet.h>
|
||||
# include <psyc/parse.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue