|
TPCCLIB
|
Function(s) for interfile headers. More...
#include "libtpcimgio.h"Go to the source code of this file.
Functions | |
| int | interfile_read (char headerName[256], char searchWord[256], char returnValue[256], char errorMessage[300]) |
| int | interfileIsHeader (const char *hdrfile, char *imgfile) |
| int | interfileExists (const char *fname, char *hdrfile, char *imgfile, int verbose) |
Function(s) for interfile headers.
Definition in file interfile.c.
| int interfile_read | ( | char | headerName[256], |
| char | searchWord[256], | ||
| char | returnValue[256], | ||
| char | errorMessage[300] ) |
The function searches the keyword in the header and passes the value belonging to that value back to the main program. The name of the header (string 'headerName') and the requested keyword (string 'searchWord') are passed to the function. It passes back the value of the keyword (string 'returnValue') and possibly an error message or warning (string 'errorMessage'). So the values are passed back as strings. The interpretation (conversion to integer, float, time etc) is up to the programmer.
The interfile header has to comply to the following rules:
| headerName | header file name |
| searchWord | keyword to look for |
| returnValue | value for keyword in header |
| errorMessage | error message/warnings. In case there is a error message it will be returnd as string in the variable 'errmsg'. |
Definition at line 43 of file interfile.c.
| int interfileExists | ( | const char * | fname, |
| char * | hdrfile, | ||
| char * | imgfile, | ||
| int | verbose ) |
Check if specified image file name is a Interfile data.
| fname | File name, either header file, image file, or base name without extensions. |
| hdrfile | If fname is Interfile, then header file name will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
| imgfile | If fname is Interfile, then image file name will be written in this char pointer (space needs to allocated by caller); NULL if not needed. Note that file name is stored without path. |
| verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 193 of file interfile.c.
Referenced by imgFormatDetermine().
| int interfileIsHeader | ( | const char * | hdrfile, |
| char * | imgfile ) |
Verify that given file is a valid Interfile header file.
| hdrfile | Interfile header file name, with correct extension |
| imgfile | Pointer to allocated string where Interfile image data file name is written if found in header; enter NULL if not needed. |
Definition at line 154 of file interfile.c.
Referenced by interfileExists().