dis_sql/src/esql.cxx
/* The following routine implements the Oracle convention that included
 * files with no extension are assumed to end in ".h".  If a ".h" is
 * added, the result is malloced and must be freed by the caller;
 * otherwise, the input is returned as the result.  (The caller must
 * compare the result and the argument to decide whether to free the
 * result.)
 */
The following routine implements the Oracle convention that included
files with no extension are assumed to end in ".h".  If a ".h" is
added, the result is malloced and must be freed by the caller;
otherwise, the input is returned as the result.  (The caller must
compare the result and the argument to decide whether to free the
result.)
The following routine implements the Oracle convention that included files with no extension are assumed to end in " . h " . If a " . h " is added the result is malloced and must be freed by the caller ; otherwise the input is returned as the result . ( The caller must compare the result and the argument to decide whether to free the result . )
static char* add_dot_h(const char* filename) {
    char* result;
    if (strchr(filename, '.') == 0) {
	int all_uppercase = 1;
	size_t len = strlen(filename);
	const char* p;
	for (p = filename + len - 1; p >= filename; p--) {
	    if (islower(*p)) {
		all_uppercase = 0;
		break;
	    }
	    if (*p == PATH_SEPARATOR) {
		break;
	    }
	}
#ifdef ISO_CPP_HEADERS
	result = (char*) std::malloc(len + 3);
#else
	result = (char*) malloc(len + 3);
#endif
	strcpy(result, filename);
	if (all_uppercase) {
	    strcat(result, ".H");
	}
	else strcat(result, ".h");
    }
    else result = (char*) filename;
    return result;
}
static char * add_dot_h ( const char * filename ) { char * result ; if ( strchr ( filename , ' ' ) == 0 ) { int all_uppercase = 1 ; size_t len = strlen ( filename ) ; const char * p ; for ( p = filename + len - 1 ; p >= filename ; p -- ) { if ( islower ( * p ) ) { all_uppercase = 0 ; break ; } if ( * p == PATH_SEPARATOR ) { break ; } } #ifdef ISO_CPP_HEADERS result = ( char * ) std :: malloc ( len + 3 ) ; #else result = ( char * ) malloc ( len + 3 ) ; #endif strcpy ( result , filename ) ; if ( all_uppercase ) { strcat ( result , " " ) ; } else strcat ( result , " " ) ; } else result = ( char * ) filename ; return result ; }
The following routine implements the Oracle convention that included
 files with no extension are assumed to end in ".h".
The following routine implements the Oracle convention that included files with no extension are assumed to end in " . h " .