Ejemplo n.º 1
0
primitiveGetStringKeyedBy(void)
{
	char *aKey;
	char aString[1025];
	sqInt i;
	sqInt keyLength;
	sqInt oop;
	char *ptr;
	sqInt size;

	success(isBytes(stackValue(0)));
	aKey = ((char *) (firstIndexableField(stackValue(0))));
	if (failed()) {
		return null;
	}
	keyLength = byteSizeOf(((sqInt)(sqIntptr_t)(aKey) - BaseHeaderSize));
	size = sqInternetConfigurationGetStringKeyedBykeySizeinto(aKey, keyLength, aString);
	oop = instantiateClassindexableSize(classString(), size);
	ptr = firstIndexableField(oop);
	for (i = 0; i < size; i += 1) {
		ptr[i] = (aString[i]);
	}
	if (failed()) {
		return null;
	}
	popthenPush(2, oop);
	return null;
}
Ejemplo n.º 2
0
EXPORT(sqInt) primitiveGetStringKeyedBy(void) {
	char * ptr;
	sqInt oop;
	sqInt size;
	sqInt i;
	sqInt keyLength;
	char aString[1025];
	char *aKey;

	interpreterProxy->success(interpreterProxy->isBytes(interpreterProxy->stackValue(0)));
	aKey = ((char *) (interpreterProxy->firstIndexableField(interpreterProxy->stackValue(0))));
	if (interpreterProxy->failed()) {
		return null;
	}
	keyLength = interpreterProxy->byteSizeOf((oopForPointer( aKey ) - 4));
	size = sqInternetConfigurationGetStringKeyedBykeySizeinto(aKey, keyLength, aString);
	oop = interpreterProxy->instantiateClassindexableSize(interpreterProxy->classString(), size);
	ptr = interpreterProxy->firstIndexableField(oop);
	for (i = 0; i <= (size - 1); i += 1) {
		ptr[i] = (aString[i]);
	}
	if (interpreterProxy->failed()) {
		return null;
	}
	interpreterProxy->popthenPush(2, oop);
	return null;
}