src/table.c
bool
is_expanded_header(char *str, int *ei_minx, int *ei_maxx)
{
	int		pos = 0;

	if (*str == '+')
	{
		str += 1;
		pos += 1;
	}
	else if (strncmp(str, "\342\224\214", 3) == 0 || /* ┌ */
			 strncmp(str, "\342\225\224", 3) == 0 || /* ╔ */
			 strncmp(str, "\342\224\234", 3) == 0 || /* ├╟ */
			 strncmp(str, "\342\225\237", 3) == 0 ||
			 strncmp(str, "\342\225\236", 3) == 0 || /* ╞╠ */
			 strncmp(str, "\342\225\240", 3) == 0)
	{
		str += 3;
		pos += 1;
	}

	if (*str == '-')
	{
		str += 1;
		pos += 1;
	}
	else if (strncmp(str, "\342\224\200", 3) == 0 || /* ─ */
			 strncmp(str, "\342\225\220", 3) == 0) /* ═ */
	{
		str += 3;
		pos += 1;
	}

	if (strncmp(str, "[ ", 2) != 0)
		return false;

	pos += 2;
	str += 2;

	if (ei_minx)
		*ei_minx = pos - 1;

	while (*str != ']' && *str != '\0')
	{
		pos += 1;
		str += charlen(str);
	}

	if (strncmp(str - 1, " ]", 2) != 0)
		return false;

	if (ei_maxx)
		*ei_maxx = pos - 1;

	return true;
}
/*
 * detect different faces of headline in extended mode
 */
detect different faces of headline in extended mode
detect different faces of headline in extended mode
bool
is_expanded_header(char *str, int *ei_minx, int *ei_maxx)
{
	int		pos = 0;
	if (*str == '+')
	{
		str += 1;
		pos += 1;
	}
	else if (strncmp(str, "\342\224\214", 3) == 0 || 
			 strncmp(str, "\342\225\224", 3) == 0 || 
			 strncmp(str, "\342\224\234", 3) == 0 || 
			 strncmp(str, "\342\225\237", 3) == 0 ||
			 strncmp(str, "\342\225\236", 3) == 0 || 
			 strncmp(str, "\342\225\240", 3) == 0)
	{
		str += 3;
		pos += 1;
	}
	if (*str == '-')
	{
		str += 1;
		pos += 1;
	}
	else if (strncmp(str, "\342\224\200", 3) == 0 || 
			 strncmp(str, "\342\225\220", 3) == 0) 
	{
		str += 3;
		pos += 1;
	}
	if (strncmp(str, "[ ", 2) != 0)
		return false;
	pos += 2;
	str += 2;
	if (ei_minx)
		*ei_minx = pos - 1;
	while (*str != ']' && *str != '\0')
	{
		pos += 1;
		str += charlen(str);
	}
	if (strncmp(str - 1, " ]", 2) != 0)
		return false;
	if (ei_maxx)
		*ei_maxx = pos - 1;
	return true;
}
bool is_expanded_header ( char * str , int * ei_minx , int * ei_maxx ) { int pos = 0 ; if ( * str == ' ' ) { str += 1 ; pos += 1 ; } else if ( strncmp ( str , " \342 \224 \214 " , 3 ) == 0 || strncmp ( str , " \342 \225 \224 " , 3 ) == 0 || strncmp ( str , " \342 \224 \234 " , 3 ) == 0 || strncmp ( str , " \342 \225 \237 " , 3 ) == 0 || strncmp ( str , " \342 \225 \236 " , 3 ) == 0 || strncmp ( str , " \342 \225 \240 " , 3 ) == 0 ) { str += 3 ; pos += 1 ; } if ( * str == ' ' ) { str += 1 ; pos += 1 ; } else if ( strncmp ( str , " \342 \224 \200 " , 3 ) == 0 || strncmp ( str , " \342 \225 \220 " , 3 ) == 0 ) { str += 3 ; pos += 1 ; } if ( strncmp ( str , " " , 2 ) != 0 ) return false ; pos += 2 ; str += 2 ; if ( ei_minx ) * ei_minx = pos - 1 ; while ( * str != ' ' && * str != ' \0 ' ) { pos += 1 ; str += charlen ( str ) ; } if ( strncmp ( str - 1 , " " , 2 ) != 0 ) return false ; if ( ei_maxx ) * ei_maxx = pos - 1 ; return true ; }
detect different faces of headline in extended mode
detect different faces of headline in extended mode
/* ┌ */ /* ╔ */ /* ├╟ */ /* ╞╠ */ /* ─ */ /* ═ */