// file: $USFS/util/segment_image/v1.0/si_gfs_2.cc
//

// system include files
//
#include <string.h>

// isip include files
//
#include "segment_image.h"
#include "segment_image_constants.h"

// method: get_next_outfname_cc
//
// arguments:
//   char_1* image_file: (input) the image file name
//   char_1* output_ext: (input) the extension for the output file name
//   char_1*& output_file: (output) the corresponding output file name
//
// return:
//  a logical_1 value indicating status
//
// this method builds the output file name by adding the specified
// extension to the input image file name
//
logical_1 get_next_outfname_cc(char_1* image_file_a, char_1* output_ext_a,
			       char_1*& output_file_a) {

  // declare a temporary string buffer
  //
  int_4 str_len = strlen((char*)image_file_a) + strlen((char*)output_ext_a);
  char_1* tmp_string = new char_1[str_len + 1];

  strcpy((char*)tmp_string, (char*)image_file_a);
  strcat((char*)tmp_string, (char*)output_ext_a);

  strcpy((char*)output_file_a, (char*)tmp_string);
  
  // release memory
  //
  delete [] tmp_string;
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
