#include <stdio.h>#include <string.h>#include <stdlib.h>#include <time.h>#include <unistd.h>#include "libtpcmisc.h"#include "include/interfile.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) |
| 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 82 of file interfile.c.
| int interfileExists | ( | const char * | fname, |
| char * | hdrfile, | ||
| char * | imgfile, | ||
| int | verbose | ||
| ) |
Check if specified image filename is a Interfile data.
| fname | Filename, either header file, image file, or base name without extensions. If file is found, then |
| hdrfile | If fname is Interfile, then header filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
| imgfile | If fname is Interfile, then image filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. Note that filename is stored without path. |
| verbose | Verbose level; if zero, then nothing is printed into stdout or stderr |
Definition at line 226 of file interfile.c.
References interfileIsHeader().
Referenced by imgFormatDetermine(), and imgReadHeader().
| int interfileIsHeader | ( | const char * | hdrfile, |
| char * | imgfile | ||
| ) |
Verify that given file is a valid Interfile header file.
| hdrfile | Interfile header filename, with correct extension |
| imgfile | Pointer to allocated string where Interfile image data filename is written if found in header; enter NULL if not needed. |
Definition at line 189 of file interfile.c.
Referenced by interfileExists().
1.8.0