Tesseract  3.02
tesseract-ocr/cutil/efio.cpp File Reference
#include "efio.h"
#include "danerror.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Defines

#define MAXERRORMESSAGE   256

Functions

FILE * Efopen (const char *Name, const char *Mode)

Define Documentation

#define MAXERRORMESSAGE   256

---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------

Definition at line 26 of file efio.cpp.


Function Documentation

FILE* Efopen ( const char *  Name,
const char *  Mode 
)

---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------

Definition at line 32 of file efio.cpp.

                                                 { 
/*
 **     Parameters:
 **             Name    name of file to be opened
 **             Mode    mode to be used to open file
 **     Globals:
 **             None
 **     Operation:
 **             This routine attempts to open the specified file in the
 **             specified mode.  If the file can be opened, a pointer to
 **             the open file is returned.  If the file cannot be opened,
 **             an error is trapped.
 **     Return:
 **             Pointer to open file.
 **     Exceptions:
 **             FOPENERROR              unable to open specified file
 **     History:
 **             5/21/89, DSJ, Created.
 */
  FILE *File;
  char ErrorMessage[MAXERRORMESSAGE];

  File = fopen (Name, Mode);
  if (File == NULL) {
    sprintf (ErrorMessage, "Unable to open %s", Name);
    DoError(FOPENERROR, ErrorMessage); 
    return (NULL);
  }
  else
    return (File);
}                                /* Efopen */