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

Functions


Define Documentation

#define MAXERRORMESSAGE   256

Note:
File: efio.cpp
Utility I/O routines
Author:
Dan Johnson
Date:
5/21/89, DSJ, Created.
 **	(c) Copyright Hewlett-Packard Company, 1988.
 ** Licensed under the Apache License, Version 2.0 (the "License");
 ** you may not use this file except in compliance with the License.
 ** You may obtain a copy of the License at
 ** http://www.apache.org/licenses/LICENSE-2.0
 ** Unless required by applicable law or agreed to in writing, software
 ** distributed under the License is distributed on an "AS IS" BASIS,
 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ** See the License for the specific language governing permissions and
 ** limitations under the License.

Definition at line 27 of file efio.cpp.

Referenced by Efopen().


Function Documentation

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

Attempts to open the specified file in the specified mode.

Parameters:
Name Name of file to be opened
Mode Mode to be used to open file
Returns:
Pointer to open file.
If the file can be opened, a pointer to the open file is returned. If the file cannot be opened, an error is trapped.
Note:
Exceptions: FOPENERROR Unable to open specified file
Date:
5/21/89, DSJ, Created.

Definition at line 45 of file efio.cpp.

References DoError(), FOPENERROR, MAXERRORMESSAGE, and NULL.

Referenced by FillAmbigTable(), GetNormProtos(), InitAdaptiveClassifier(), LearnBlob(), ReadNewCutoffs(), WriteClusteredTrainingSamples(), WriteMergedTrainingSamples(), WriteMicrofeat(), WriteNormProtos(), WritePFFMTable(), and WriteTrainingSamples().

00045                                                  { 
00046   FILE *File;
00047   char ErrorMessage[MAXERRORMESSAGE];
00048 
00049   File = fopen (Name, Mode);
00050   if (File == NULL) {
00051     sprintf (ErrorMessage, "Unable to open %s", Name);
00052     DoError(FOPENERROR, ErrorMessage); 
00053     return (NULL);
00054   }
00055   else
00056     return (File);
00057 }                                /* Efopen */


Generated on Wed Feb 28 19:49:21 2007 for Tesseract by  doxygen 1.5.1