// file: $USFS/class/image_analysis/v1.0/imaga_close_0.cc
//

// isip include files
//
#include "image_analysis.h"

#include <integral_constants.h>

// method: close_cc
//
// arguments:
//  FILE* fp_p: file pointer
//
// return: a logical_1 value indicating status
//
// this method checks for the file pointer and closes it
//
logical_1 Image_analysis::close_cc(FILE* fp_a) {
  
  // close the file
  //
  if (fp_a != (FILE*)NULL) {
    
    if (fclose(fp_a) != (int)0) {
      return ISIP_FALSE;
    }
    
    // reset the file pointer
    //
    fp_a = (FILE*)NULL;
  }
  
  // else an error
  //
  else {
    error_handler_cc((char_1*)"close_cc",
		     (char_1*)"no open file");
    return ISIP_FALSE;
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}

