Exemplo n.º 1
0
/*
 * Get blob size information.
 */
static void GetBlobSize(ILSizeInfo *info, ILProgramItem *item, ILUInt32 offset)
{
	ILUInt32 len;
	unsigned char lenbuf[IL_META_COMPRESS_MAX_SIZE];
	if(ILImageGetBlob(ILProgramItem_Image(item), offset, &len))
	{
		info->meta += len;
		info->meta += (unsigned long)(long)ILMetaCompressData(lenbuf, len);
	}
}
Exemplo n.º 2
0
void ILSerializeWriterSetString(ILSerializeWriter *writer,
								const char *str, int len)
{
	if(str)
	{
		unsigned char header[IL_META_COMPRESS_MAX_SIZE];
		int headerLen = ILMetaCompressData(header, len);
		unsigned char *buf = GetSpace(writer, headerLen + len);
		if(buf)
		{
			ILMemCpy(buf, header, headerLen);
			ILMemCpy(buf + headerLen, str, len);
		}
	}
	else
	{
		/* Encode the null string in the output */
		unsigned char *buf = GetSpace(writer, 1);
		*buf = (unsigned char)0xFF;
	}
}