
extern "C" { 

	void IrrGUI_IGUITable_addColumn(IGUITable* tbl, const wchar_t* caption, s32 columnIndex=-1)
	{
		if (tbl) 
			tbl->addColumn(caption, columnIndex);
	}

	void IrrGUI_IGUITable_removeColumn(IGUITable* tbl, u32 columnIndex)
	{
		if (tbl) 
			tbl->removeColumn(columnIndex);
	}

	s32 IrrGUI_IGUITable_getColumnCount(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->getColumnCount();
		else return 0;
	}

	bool IrrGUI_IGUITable_setActiveColumn(IGUITable* tbl, s32 idx, bool doOrder=false)
	{
		if (tbl) 
			return tbl->setActiveColumn(idx, doOrder);
		else return false;
	}

	s32 IrrGUI_IGUITable_getActiveColumn(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->getActiveColumn();
		else return -1;
	}

	s32 IrrGUI_IGUITable_getActiveColumnOrdering(IGUITable* tbl) // returns EGUI_ORDERING_MODE 
	{
		if (tbl) 
			return tbl->getActiveColumnOrdering();
		else return -1;
	}

	void IrrGUI_IGUITable_setColumnWidth(IGUITable* tbl, u32 columnIndex, u32 width)
	{
		if (tbl) 
			tbl->setColumnWidth(columnIndex, width);
	}
	
	void IrrGUI_IGUITable_setResizableColumns(IGUITable* tbl, bool resizable)
	{
		if (tbl) 
			tbl->setResizableColumns(resizable);
	}
	
	bool IrrGUI_IGUITable_hasResizableColumns(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->hasResizableColumns();
		else return false;
	}

	void IrrGUI_IGUITable_setColumnOrdering(IGUITable* tbl, u32 columnIndex, EGUI_COLUMN_ORDERING mode)
	{
		if (tbl) 
			tbl->setColumnOrdering(columnIndex, mode);
	}

	s32 IrrGUI_IGUITable_getSelected(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->getSelected();
		else return -1;
	}

	void IrrGUI_IGUITable_setSelected( IGUITable* tbl, s32 index ) {
		if (tbl)
			tbl->setSelected(index);
	}

	s32 IrrGUI_IGUITable_getRowCount(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->getRowCount();
		else return 0;
	}

	s32 IrrGUI_IGUITable_addRow(IGUITable* tbl, u32 rowIndex)
	{
		if (tbl) 
			return tbl->addRow(rowIndex);
		else return -1;
	}

	void IrrGUI_IGUITable_removeRow(IGUITable* tbl, u32 rowIndex)
	{
		if (tbl) 
			tbl->removeRow(rowIndex);
	}

	void IrrGUI_IGUITable_clearRows(IGUITable* tbl)
	{
		if (tbl) 
			tbl->clearRows();
	}

	void IrrGUI_IGUITable_swapRows(IGUITable* tbl, u32 rowIndexA, u32 rowIndexB)
	{
		if (tbl) 
			tbl->swapRows(rowIndexA, rowIndexB);
	}

	void IrrGUI_IGUITable_orderRows(IGUITable* tbl, s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE)
	{
		if (tbl) 
			tbl->orderRows(columnIndex, mode);
	}

	void IrrGUI_IGUITable_setCellText(IGUITable* tbl, u32 rowIndex, u32 columnIndex, const wchar_t* text)
	{
		if (tbl) 
			tbl->setCellText(rowIndex, columnIndex, text);
	}

	void IrrGUI_IGUITable_setCellTextAndColor(IGUITable* tbl, u32 rowIndex, u32 columnIndex, const wchar_t* text, SColor* color)
	{
		if (tbl) 
			tbl->setCellText(rowIndex,columnIndex, text, *color);
	}

	void IrrGUI_IGUITable_setCellData(IGUITable* tbl, u32 rowIndex, u32 columnIndex, void *data)
	{
		if (tbl) 
			tbl->setCellData(rowIndex, columnIndex, data);
	}

	void IrrGUI_IGUITable_setCellColor(IGUITable* tbl, u32 rowIndex, u32 columnIndex, SColor* color)
	{
		if (tbl) 
			tbl->setCellColor(rowIndex, columnIndex, *color);
	}

	const wchar_t* IrrGUI_IGUITable_getCellText(IGUITable* tbl, u32 rowIndex, u32 columnIndex )
	{
		if (tbl) 
			return tbl->getCellText(rowIndex, columnIndex);
		else return L"";
	}

	void* IrrGUI_IGUITable_getCellData(IGUITable* tbl, u32 rowIndex, u32 columnIndex )
	{
		if (tbl) 
			return tbl->getCellData(rowIndex, columnIndex);
		else return 0;
	}

	void IrrGUI_IGUITable_clear(IGUITable* tbl)
	{
		if (tbl) 
			tbl->clear();
	}

	void IrrGUI_IGUITable_setDrawFlags(IGUITable* tbl, s32 flags)
	{
		if (tbl) 
			tbl->setDrawFlags(flags);
	}

	s32 IrrGUI_IGUITable_getDrawFlags(IGUITable* tbl)
	{
		if (tbl) 
			return tbl->getDrawFlags();
		else return 0;
	}
	
}
