dis_sql/src/esql.cxx
/* return allocated lowercase string if input is all uppercase */
return allocated lowercase string if input is all uppercase
return allocated lowercase string if input is all uppercase
static char* lowercase_string(const char* filename) {
   char* result = 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 (all_uppercase) {
#ifdef ISO_CPP_HEADERS
      result = (char*) std::malloc (len + 1);
#else
      result = (char*) malloc (len + 1);
#endif
      int i;
      for (i = 0, p = filename; i < len ; ++i, ++p) {
	 result[i] = (isupper(*p)) ? tolower(*p) : *p;
      }
      result[i] = '\0';
   }
   return (result);
}
static char * lowercase_string ( const char * filename ) { char * result = 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 ( all_uppercase ) { #ifdef ISO_CPP_HEADERS result = ( char * ) std :: malloc ( len + 1 ) ; #else result = ( char * ) malloc ( len + 1 ) ; #endif int i ; for ( i = 0 , p = filename ; i < len ; ++ i , ++ p ) { result [ i ] = ( isupper ( * p ) ) ? tolower ( * p ) : * p ; } result [ i ] = ' \0 ' ; } return ( result ) ; }
return allocated lowercase string if input is all uppercase
return allocated lowercase string if input is all uppercase