int SIMD_Group_PFD_2::decode(T* des, const char* src, uint32_t decodeNum) {
	int decodeLen = 0;
	uint32_t alignDecodeNum = decodeNum / m_blockSize * m_blockSize;

	decodeLen += decodeAlign(des, src, alignDecodeNum);

	decodeLen += VarByte::decode<T>(des + alignDecodeNum, src + decodeLen, decodeNum
			- alignDecodeNum);

	return decodeLen;
}
コード例 #2
0
ファイル: CJForm.c プロジェクト: doolse/wingsos
static HTMLTable *JFormDoTable(DOMElement *table, HTMLForms *forms)
{
	DOMElement *row,*cell;
	uint nrows;
	HTMLTable *Tab;
	HTMLRow *HRow;
	uint rows=0;
	uint maxcol=0;
	uint colup;
	Tab = calloc(sizeof(HTMLTable), 1);
	forms->FirstTable = addQueueB(forms->FirstTable, forms->FirstTable, Tab);
	Tab->Name = XMLgetAttr(table, "name");
	for (row=table->Elements; row; row = XMLnextElem(row))
	{
		colup=0;
		HRow = calloc(sizeof(HTMLRow), 1);
		Tab->FirstRow = addQueueB(Tab->FirstRow, Tab->FirstRow, HRow);
		HRow->Height = decodeSize(XMLgetAttr(row, "height"));
		for (cell=row->Elements; cell; cell = XMLnextElem(cell))
		{
			int colspan;
			int rowspan;
			HTMLCell *Cell;

			Cell = calloc(sizeof(HTMLCell), 1);
			Tab->FirstCell = addQueueB(Tab->FirstCell, Tab->FirstCell, Cell);
			colspan = atoi(XMLgetAttr(cell, "colspan"));
			rowspan = atoi(XMLgetAttr(cell, "rowspan"));
			if (!colspan)
				colspan++;
			if (!rowspan)
				rowspan++;
			Cell->Width = decodeSize(XMLgetAttr(cell, "width"));
			Cell->Value = ((DOMNode *)cell)->Value;
			Cell->Name = "";
			Cell->Hints.MinX = -1;
			Cell->Hints.MinY = -1;
			Cell->Hints.PrefX = -1;
			Cell->Hints.PrefY = -1;
			Cell->Hints.MaxY = -1;
			Cell->Hints.MaxY = -1;
			if (cell->Elements)
			{
				DOMElement *inp = cell->Elements;
				char *type;
				int ctype=0;

				if (!strcmp(((DOMNode *)inp)->Name, "table"))
				{
					ctype = WT_INNER;
					Cell->Inner = JFormDoTable(inp, forms);
				}
				else 
				{
					Cell->Name = XMLgetAttr(inp, "name");
					Cell->Hints.MinX = decodeFillWidth(XMLgetAttr(inp, "minx"));
					Cell->Hints.MinY = decodeFillWidth(XMLgetAttr(inp, "miny"));
					Cell->Hints.PrefX = decodeFillWidth(XMLgetAttr(inp, "prefx"));
					Cell->Hints.PrefY = decodeFillWidth(XMLgetAttr(inp, "prefy"));
					Cell->Hints.MaxY = decodeFillWidth(XMLgetAttr(inp, "maxx"));
					Cell->Hints.MaxY = decodeFillWidth(XMLgetAttr(inp, "maxy"));
					if (!strcmp(((DOMNode *)inp)->Name, "fill"))
					{
						ctype = WT_FILLER;
					}
					else
					{
						type = XMLgetAttr(inp, "type");
						Cell->Value = XMLgetAttr(inp, "value");
						if (!strcmp(type, "text"))
							ctype = WT_TEXT;
						else
						if (!strcmp(type, "button"))
							ctype = WT_BUTTON;
						else
						if (!strcmp(type, "textarea"))
							ctype = WT_TEXTAREA;
						else
						if (!strcmp(type, "custom"))
							ctype = WT_CUSTOM;

					}
				}
				Cell->Type = ctype;
			}
			Cell->TabLay[0] = colup;
			Cell->TabLay[1] = rows;
			Cell->TabLay[2] = colspan;
			Cell->TabLay[3] = rowspan;
			Cell->TabLay[4] = decodeAlign(XMLgetAttr(cell, "align"));
			colup++;
		}
		if (colup > maxcol)
			maxcol = colup;
		rows++;
	}
	Tab->Rows = rows;
	Tab->Cols = maxcol;
	return Tab;
}