-int jsoneq(const char huge *json, jsmntok_t huge *tok, const char *s) {
- if (tok->type == JSMN_STRING && (int) strlen(s) == tok->end - tok->start &&
- strncmp((char const near *)json + tok->start, s, tok->end - tok->start) == 0) {
+int jsoneq(const char huge *json, jsmntok_t huge *tok, const char huge *s) {
+ if (tok->type == JSMN_STRING && (int)_fstrlen(s) == tok->end - tok->start &&
+ _fstrncmp((char const *)json + tok->start, s, tok->end - tok->start) == 0) {
{
//---- map->height = (unsigned int)strtol(js+t->start, (char **)js+t->end, 10);
map->height = atoi((const char *)js+t->start);
{
//---- map->height = (unsigned int)strtol(js+t->start, (char **)js+t->end, 10);
map->height = atoi((const char *)js+t->start);
fprintf(stdout, "indent= [%d] ", indent);
fprintf(stdout, "h:[%d]\n", map->height);
#endif
fprintf(stdout, "indent= [%d] ", indent);
fprintf(stdout, "h:[%d]\n", map->height);
#endif
{
//---- map->width = (unsigned int)strtol(js+t->start, (char **)js+t->end, 10);
map->width = atoi((const char *)js+t->start);
{
//---- map->width = (unsigned int)strtol(js+t->start, (char **)js+t->end, 10);
map->width = atoi((const char *)js+t->start);
//map->data = malloc(sizeof(byte) * (t+1)->size);
map->tiles = /*_f*/malloc(sizeof(tiles_t));
//map->tiles->data = malloc(sizeof(bitmap_t));
//map->data = malloc(sizeof(byte) * (t+1)->size);
map->tiles = /*_f*/malloc(sizeof(tiles_t));
//map->tiles->data = malloc(sizeof(bitmap_t));
- strcpy(js_sv, "width");//strdup(js+t->start);//, t->end - t->start);
- }else strcpy(js_sv, "\0");
+ _fstrcpy(js_sv, "width");//strdup(js+t->start);//, t->end - t->start);
+ }else _fstrcpy(js_sv, "\0");
js = _frealloc(js, jslen + r + 1);
if (js == NULL) {
fprintf(stderr, "*js=%Fp\n", *js);
fprintf(stderr, "realloc(): errno = %d\n", errno);
return 3;
}
js = _frealloc(js, jslen + r + 1);
if (js == NULL) {
fprintf(stderr, "*js=%Fp\n", *js);
fprintf(stderr, "realloc(): errno = %d\n", errno);
return 3;
}
- //printf("strncpy~\n");
- //strncpy(jz + jslen, buf, r);
- //if(
- //_fstrncpy(js + jslen, &(*buff), r);
- //strncpy((char *)js + jslen, buf, r);
- // == NULL)
-// fprintf(stderr, "_fstrncpy(): errno = %d\n", errno);
- //printf("strncpy okies~~\n");
r = jsmn_parse(&p, js, jslen, tok, tokcount);
if (r < 0) {
if (r == JSMN_ERROR_NOMEM) {
r = jsmn_parse(&p, js, jslen, tok, tokcount);
if (r < 0) {
if (r == JSMN_ERROR_NOMEM) {
- printf("js=%Fp\n", (js));
- printf("*js=%Fp\n", (*(js)));
- printf("&*js=%s\n", &(*(js)));
- printf("&buf=[%Fp]\n", &buf);
+ //printf("js=%Fp\n", (js));
+ //printf("*js=%Fp\n", (*(js)));
+ //printf("&*js=%s\n", &(*(js)));
+ //printf("&buf=[%Fp]\n", &buf);
//printf("&buf_seg=[%x]\n", FP_SEG(&buf));
//printf("&buf_off=[%x]\n", FP_OFF(&buf));
//printf("&buf_fp=[%Fp]\n", MK_FP(FP_SEG(&buf), FP_OFF(&buf)));
//printf("buf=[\n%s\n]\n", buf);
//printf("&buf_seg=[%x]\n", FP_SEG(&buf));
//printf("&buf_off=[%x]\n", FP_OFF(&buf));
//printf("&buf_fp=[%Fp]\n", MK_FP(FP_SEG(&buf), FP_OFF(&buf)));
//printf("buf=[\n%s\n]\n", buf);
- printf("buff=[%Fp]\n", buff);
- printf("(*buff)=[%Fp]\n", (*buff));
+ //printf("buff=[%Fp]\n", buff);
+ //printf("(*buff)=[%Fp]\n", (*buff));
//printf("&(*buff)=[\n%s\n]\n", &(*buff));
dump(js, tok, p.toknext, incr, &js_ss, map, 0);
eof_expected = 1;
//printf("&(*buff)=[\n%s\n]\n", &(*buff));
dump(js, tok, p.toknext, incr, &js_ss, map, 0);
eof_expected = 1;