src/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c
/**
 * @brief Test input string is encoded by the GNU 2 style.
 *
 * @return True if input string is encoded by the GNU 2 style.
 */
@brief Test input string is encoded by the GNU 2 style.
@return True if input string is encoded by the GNU 2 style.
@brief Test input string is encoded by the GNU 2 style . @return True if input string is encoded by the GNU 2 style .
bool
is_cpp_mangled_gnu2(const char *org)
{
	char *str;
	bool rtn = false;
	if (org == NULL)
		return (false);
	str = strstr(org, "__");
	while (str != NULL) {
		if (*(str + 2) != '\0') {
			if (*(str + 2) == 'C' ||
			    *(str + 2) == 'F' ||
			    *(str + 2) == 'Q' ||
			    ELFTC_ISDIGIT(*(str + 2))) {
				rtn |= true;
				break;
			}
			if (*(str + 3) != '\0') {
				switch (SIMPLE_HASH(*(str + 2), *(str + 3))) {
				case SIMPLE_HASH('m', 'l') :
				case SIMPLE_HASH('d', 'v') :
				case SIMPLE_HASH('m', 'd') :
				case SIMPLE_HASH('p', 'l') :
				case SIMPLE_HASH('m', 'i') :
				case SIMPLE_HASH('l', 's') :
				case SIMPLE_HASH('r', 's') :
				case SIMPLE_HASH('e', 'q') :
				case SIMPLE_HASH('n', 'e') :
				case SIMPLE_HASH('l', 't') :
				case SIMPLE_HASH('g', 't') :
				case SIMPLE_HASH('l', 'e') :
				case SIMPLE_HASH('g', 'e') :
				case SIMPLE_HASH('a', 'd') :
				case SIMPLE_HASH('o', 'r') :
				case SIMPLE_HASH('e', 'r') :
				case SIMPLE_HASH('a', 'a') :
				case SIMPLE_HASH('o', 'o') :
				case SIMPLE_HASH('n', 't') :
				case SIMPLE_HASH('c', 'o') :
				case SIMPLE_HASH('p', 'p') :
				case SIMPLE_HASH('m', 'm') :
				case SIMPLE_HASH('a', 's') :
				case SIMPLE_HASH('r', 'f') :
				case SIMPLE_HASH('a', 'p') :
				case SIMPLE_HASH('a', 'm') :
				case SIMPLE_HASH('a', 'l') :
				case SIMPLE_HASH('a', 'r') :
				case SIMPLE_HASH('a', 'o') :
				case SIMPLE_HASH('a', 'e') :
				case SIMPLE_HASH('c', 'm') :
				case SIMPLE_HASH('r', 'm') :
				case SIMPLE_HASH('c', 'l') :
				case SIMPLE_HASH('v', 'c') :
				case SIMPLE_HASH('n', 'w') :
				case SIMPLE_HASH('d', 'l') :
				case SIMPLE_HASH('o', 'p') :
				case SIMPLE_HASH('t', 'f') :
				case SIMPLE_HASH('t', 'i') :
					rtn |= true;
					break;
				}
			}
		}
		str = strstr(str + 2, "__");
	}
	rtn |= strstr(org, "_$_") != NULL;
	rtn |= strstr(org, "_vt$") != NULL;
	return (rtn);
}
bool is_cpp_mangled_gnu2 ( const char * org ) { char * str ; bool rtn = false ; if ( org == NULL ) return ( false ) ; str = strstr ( org , " " ) ; while ( str != NULL ) { if ( * ( str + 2 ) != ' \0 ' ) { if ( * ( str + 2 ) == ' ' || * ( str + 2 ) == ' ' || * ( str + 2 ) == ' ' || ELFTC_ISDIGIT ( * ( str + 2 ) ) ) { rtn |= true ; break ; } if ( * ( str + 3 ) != ' \0 ' ) { switch ( SIMPLE_HASH ( * ( str + 2 ) , * ( str + 3 ) ) ) { case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : case SIMPLE_HASH ( ' ' , ' ' ) : rtn |= true ; break ; } } } str = strstr ( str + 2 , " " ) ; } rtn |= strstr ( org , " " ) != NULL ; rtn |= strstr ( org , " " ) != NULL ; return ( rtn ) ; }
@brief Test input string is encoded by the GNU 2 style.
@brief Test input string is encoded by the GNU 2 style .
/* search valid text to end */