Beispiel #1
0
int jam_stricmp(char *left, char *right)
{
	int result = 0;
	char l, r;

	do
	{
		l = jam_toupper(*left);
		r = jam_toupper(*right);
		result = l - r;
		++left;
		++right;
	}
	while ((result == 0) && (l != '\0') && (r != '\0'));

	return (result);
}
Beispiel #2
0
BOOL jam_check_init_list
(
	char *name,
	long *value
)

/*																			*/
/*	Description:	Compares variable name to names in initialization list	*/
/*					and, if name is found, returns the corresponding		*/
/*					initialization value for the variable.					*/
/*																			*/
/*	Returns:		TRUE if variable was found, else FALSE					*/
/*																			*/
/****************************************************************************/
{
	char r, l;
	int ch_index = 0;
	int init_entry = 0;
	char *init_string = NULL;
	long val;
	BOOL match = FALSE;
	BOOL negate = FALSE;
	BOOL status = FALSE;

	if (jam_init_list != NULL)
	{
		while ((!match) && (jam_init_list[init_entry] != NULL))
		{
			init_string = jam_init_list[init_entry];
			match = TRUE;
			ch_index = 0;
			do
			{
				r = jam_toupper(init_string[ch_index]);
				if (!jam_is_name_char(r)) r = '\0';
				l = name[ch_index];
				match = (r == l);
				++ch_index;
			}
			while (match && (r != '\0') && (l != '\0'));

			if (match)
			{
				--ch_index;
				while (jam_isspace(init_string[ch_index])) ++ch_index;
				if (init_string[ch_index] == JAMC_EQUAL_CHAR)
				{
					++ch_index;
					while (jam_isspace(init_string[ch_index])) ++ch_index;

					if (init_string[ch_index] == JAMC_MINUS_CHAR)
					{
						++ch_index;
						negate = TRUE;
					}

					if (jam_isdigit(init_string[ch_index]))
					{
						val = jam_atol(&init_string[ch_index]);

						if (negate) val = 0L - val;

						if (value != NULL) *value = val;

						status = TRUE;
					}
				}
			}
			else
			{
				++init_entry;
			}
		}
	}

	return (status);
}