Chameleon

Chameleon Commit Details

Date:2010-10-23 19:45:10 (9 years 28 days ago)
Author:Evan Lojewski
Commit:605
Parents: 604
Message:More XML changes, ugly hack to get offset from real buffer (to allow for modification to buffer).
Changes:
M/branches/meklort/i386/libsaio/xml.h
M/branches/meklort/i386/libsaio/xml.c

File differences

branches/meklort/i386/libsaio/xml.c
2727
2828
2929
30
30
3131
32
33
3234
3335
3436
......
267269
268270
269271
272
273
270274
271275
272276
277
278
273279
274280
275281
......
392398
393399
394400
401
395402
396403
397404
......
464471
465472
466473
474
475
467476
468477
469478
......
575584
576585
577586
587
578588
579589
580590
......
617627
618628
619629
630
620631
621632
622633
......
650661
651662
652663
664
653665
654666
655667
......
676688
677689
678690
691
679692
680693
681694
......
749762
750763
751764
765
752766
753767
754768
......
781795
782796
783797
798
784799
785800
786801
......
809824
810825
811826
827
812828
813829
814830
......
830846
831847
832848
849
833850
834851
835852
......
951968
952969
953970
971
954972
955973
956974
......
10981116
10991117
11001118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
11011134
11021135
11031136
#include "sl.h"
#include "xml.h"
string_ref* ref_strings = NULL;
string_ref *ref_strings = NULL;
/// TODO: remove below
static char* buffer_start = NULL;
// TODO: redo the next two functions
void SaveRefString(char* string, int id)
{
pos = 0;
char *configBuffer;
configBuffer = malloc(strlen(buffer)+1);
strcpy(configBuffer, buffer);
buffer_start = configBuffer;
while (1)
{
length = XMLParseNextTag(configBuffer + pos, &tag);
tmpTag->string = str;
tmpTag->tag = 0;
tmpTag->tagNext = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0;
*tag = tmpTag;
length = 0;
tmpTag->string = (char*) integer;
tmpTag->tag = 0;
tmpTag->tagNext = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0;
*tag = tmpTag;
length = 0;
tmpTag->type = type;
tmpTag->string = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start : 0;
tmpTag->tag = tagList;
tmpTag->tagNext = 0;
tmpTag->type = kTagTypeKey;
tmpTag->string = string;
tmpTag->tag = subTag;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = kTagTypeString;
tmpTag->string = string;
tmpTag->tag = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = kTagTypeInteger;
tmpTag->string = 0;
tmpTag->tag = 0;
tmpTag->offset = 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = kTagTypeInteger;
tmpTag->string = (char *)integer;
tmpTag->tag = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = kTagTypeData;
tmpTag->string = string;
tmpTag->tag = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = kTagTypeDate;
tmpTag->string = 0;
tmpTag->tag = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tmpTag->type = type;
tmpTag->string = 0;
tmpTag->tag = 0;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
*tag = tmpTag;
tag->type = kTagTypeNone;
tag->string = 0;
tag->tag = 0;
tag->offset = 0;
tag->tagNext = gTagsFree;
gTagsFree = tag;
#else
return NULL;
}
long XMLCastStringOffset(TagPtr dict)
{
if(dict &&
((dict->type == kTagTypeString) ||
(dict->type == kTagTypeKey)))
{
return dict->offset;
}
else
{
return -1;
}
}
bool XMLCastBoolean(TagPtr dict)
{
if(!dict) return false;
branches/meklort/i386/libsaio/xml.h
9292
9393
9494
95
9596
9697
9798
bool XMLCastBoolean( TagPtr dict );
char* XMLCastString( TagPtr dict );
long XMLCastStringOffset(TagPtr dict);
int XMLCastInteger ( TagPtr dict );
TagPtr XMLCastDict ( TagPtr dict );
TagPtr XMLCastArray( TagPtr dict );

Archive Download the corresponding diff file

Revision: 605