Example #1
0
void
LexBase::searchForFunction(
	const char *		spelling,
	bool &				found,
	short &				funcType,
	short &				symbol)
{
	FuncInfo			searchItem;
	FuncInfo *			result = 0;

	if (m_funcInfoArraySize == 0) {
		found = false;
		return;
	}
	searchItem.m_spelling = spelling;
	result = (FuncInfo *)bsearch(&searchItem, m_funcInfoArray,
	                             m_funcInfoArraySize, sizeof(searchItem),
	                             CONFIG4CPP_C_PREFIX(funcInfoCmp_c));
	if (result == 0) {
		found = false;
	} else {
		found = true;
		funcType = result->m_funcType;
		symbol   = result->m_symbol;
	}
}
Example #2
0
bool
StringVector::bSearchContains(const char * str) const
{
	void *				result;

	result = bsearch(&str, m_array, m_currSize, sizeof(char *),
					 CONFIG4CPP_C_PREFIX(compareFn));
	return (result != 0);
}
Example #3
0
void
LexBase::searchForKeyword(
	const char *			spelling,
	bool &					found,
	short &					symbol)
{
	LexBase::KeywordInfo	searchItem;
	LexBase::KeywordInfo *	result = 0;

	searchItem.m_spelling = spelling;
	if (m_keywordInfoArraySize == 0) {
		found = false;
		return;
	}
	result = (LexBase::KeywordInfo *)
				bsearch(&searchItem, m_keywordInfoArray, m_keywordInfoArraySize,
				        sizeof(searchItem),CONFIG4CPP_C_PREFIX(keywordInfoCmp));
	if (result == 0) {
		found = false;
	} else {
		found  = true;
		symbol = result->m_symbol;
	}
}
Example #4
0
void
StringVector::sort()
{
	qsort(m_array, m_currSize, sizeof(char *), CONFIG4CPP_C_PREFIX(compareFn));
}