Chameleon

Chameleon Commit Details

Date:2017-03-25 02:27:01 (2 years 2 months ago)
Author:ErmaC
Commit:2866
Parents: 2865
Message:Update ParseTagData and getBoolForKey (Micky1979)
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/stringTable.c
M/branches/ErmaC/Enoch/i386/libsaio/xml.c
M/branches/ErmaC/Enoch/i386/boot2/drivers.c
M/branches/ErmaC/Enoch/i386/libsaio/xml.h

File differences

branches/ErmaC/Enoch/i386/libsaio/xml.c
905905
906906
907907
908
909
908
909
910
910911
911
912
912913
913914
914915
......
921922
922923
923924
924
925
926
927
928
929
925
930926
931
927
928
929
932930
933931
934
935
932
936933
937934
938935
......
11001097
11011098
11021099
1100
1101
11031102
11041103
11051104
......
11351134
11361135
11371136
1137
1138
11381139
11391140
11401141
......
11761177
11771178
11781179
1180
11791181
11801182
11811183
// ParseTagData
static long ParseTagData( char *buffer, TagPtr *tag)
{
intactuallen = 0;
longlength = 0;
//intactuallen = 0;
int len = 0;
long length = 0;
TagPtrtmpTag;
char*string;
char*tmpString;
length = FixDataMatchingTag(buffer, kXMLTagData);
if (length == -1)
{
return -1;
}
//printf("ParseTagData unimplimented\n");
//printf("Data: %s\n", buffer);
//getchar();
string = BASE64Decode(buffer, strlen(buffer), &actuallen);
tmpString = NewSymbol(buffer);
tmpTag->type = kTagTypeData;
tmpTag->string = string;
tmpTag->string = tmpString;
tmpTag->data = (UInt8 *)BASE64Decode(buffer, strlen(buffer), &len);
tmpTag->dataLen = len;
tmpTag->tag = NULL;
tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0;
tmpTag->offset = /* actuallen; */ buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = NULL;
*tag = tmpTag;
{
tag[cnt].type = kTagTypeNone;
tag[cnt].string = 0;
tag[cnt].data = 0;
tag[cnt].dataLen = 0;
tag[cnt].tag = 0;
tag[cnt].tagNext = tag + cnt + 1;
}
// Clear and free the tag.
tag->type = kTagTypeNone;
tag->string = NULL;
tag->data = NULL;
tag->dataLen = 0;
tag->tag = NULL;
tag->offset = 0;
tag->tagNext = gTagsFree;
if (symbol == NULL)
{
stop("NULL symbol!");
return NULL;
}
// Set the symbol's data.
branches/ErmaC/Enoch/i386/libsaio/xml.h
6262
6363
6464
65
66
6567
6668
6769
#define kXMLTagReference "reference"
#define kXMLStringID "ID="
#define kXMLStringIDRef "IDREF="
#define kXMLStringIDRefs "IDREFS="
#define kXMLTagSIZE "size="
#define kPropCFBundleIdentifier("CFBundleIdentifier")
#define kPropCFBundleExecutable("CFBundleExecutable")
branches/ErmaC/Enoch/i386/libsaio/stringTable.c
364364
365365
366366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
367387
368388
369389
const char *key_val;
int size;
// looking for real boolean (<true/> or <false/>)
// if is a boolean tag, return immediately
TagPtr entry = XMLGetProperty(config->dictionary,key);
if(XMLIsBoolean(entry))
{
int value = XMLCastBoolean(entry);
if (value) {
*result_val = true;
return true;
}
else
{
*result_val = false;
return false;
}
}
// check if is a boolean as "string" (Yes/No)
// (IMHO this should be deprecated soon)
if (getValueForKey(key, &key_val, &size, config))
{
if ((size >= 1) && (key_val[0] == 'Y' || key_val[0] == 'y'))
branches/ErmaC/Enoch/i386/boot2/drivers.c
650650
651651
652652
653
654
655
656
657
658
653
654
655
656
657
658
659659
660660
661661
// LoadMatchedModules
long LoadMatchedModules( void )
{
TagPtr prop;
ModulePtr module;
char *fileName, segName[32];
DriverInfoPtr driver;
long length, driverAddr, driverLength;
void *executableAddr = 0;
TagPtrprop;
ModulePtrmodule;
char*fileName, segName[32];
DriverInfoPtrdriver;
longlength, driverAddr, driverLength;
void*executableAddr = 0;
module = gModuleHead;

Archive Download the corresponding diff file

Revision: 2866