Esempio n. 1
0
/*Verifies wether the next string is command 
 * ie: "\\[a-zA-Z]+" or "\\[a-zA-Z]+\*" */
int bidi_is_command(FriBidiChar *text,int *command_length)
{
	int len;
	if(*text != '\\' || !bidi_is_cmd_char(text[1])) {
		return FALSE;
	}
	len=1;
	while(bidi_is_cmd_char(text[len])) {
		len++;
	}
	if(text[len] == '*') {
		len++;
	}
	*command_length = len;
	return TRUE;
}
Esempio n. 2
0
static int is_ascii_tag(char buffer[MAX_COMMAND_LEN],FriBidiChar **ptr)
{
	FriBidiChar *tmp_ptr = *ptr;
	int size=0;
	if(!bidi_is_cmd_char(*tmp_ptr)) {
		return FALSE;
	}
	while(bidi_is_cmd_char(*tmp_ptr)) {
		if(size<MAX_COMMAND_LEN-1) {
			buffer[size]=*tmp_ptr;
			tmp_ptr++;
			size++;
		}
		else {
			/* No warning need - no limit */
			return FALSE;
		}
	}
	buffer[size]=0;
	*ptr=tmp_ptr;
	return TRUE;
	
}
Esempio n. 3
0
/*Verifies wether the next string is command 
 * ie: "\\[a-zA-Z]+" or "\\[a-zA-Z]+\*" */
int bidi_is_command(FriBidiChar *text,int *command_length)
{
	int len;
	
	if(bidi_is_latex_special_char(text)) {
		/* Charrecters like \\ or \$ that should be treated
		 * as `commands' */
		*command_length=2;
		return TRUE;
	}
	
	if(*text != '\\' || !bidi_is_cmd_char(text[1])) {
		return FALSE;
	}
	len=1;
	while(bidi_is_cmd_char(text[len])) {
		len++;
	}
	if(text[len] == '*') {
		len++;
	}
	*command_length = len;
	return TRUE;
}