|
TPCCLIB
|
IFT file i/o functions. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpcift.h"Go to the source code of this file.
Functions | |
| int | iftWriteItem (IFT *ift, int item, FILE *fp, TPCSTATUS *status) |
| int | iftWrite (IFT *ift, FILE *fp, TPCSTATUS *status) |
| int | iftRead (IFT *ift, FILE *fp, int is_key_required, int is_comment_accepted, TPCSTATUS *status) |
| int | iftPutFromString (IFT *ift, const char *line, int is_key_required, int is_comment_accepted, TPCSTATUS *status) |
| int | iftPutFromStringWithSpaceSeparator (IFT *ift, const char *line, int is_comment_accepted, TPCSTATUS *status) |
| int iftPutFromString | ( | IFT * | ift, |
| const char * | line, | ||
| int | is_key_required, | ||
| int | is_comment_accepted, | ||
| TPCSTATUS * | status ) |
Process a given string to add key and value to IFT.
Either key or value can be empty, but not both of them.
| ift | Pointer to initiated IFT; previous contents are not changed. |
| line | Pointer to the string to be processed, e.g. "key := value"; extra space characters are excluded from key and value. |
| is_key_required | Specifies whether key name is required or not. If not required, then line contents without equals sign are assumed to represent a value string and key name in IFT struct is left empty.
|
| is_comment_accepted | Specifies whether comment lines are processed or not.
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 229 of file iftio.c.
Referenced by iftRead().
| int iftPutFromStringWithSpaceSeparator | ( | IFT * | ift, |
| const char * | line, | ||
| int | is_comment_accepted, | ||
| TPCSTATUS * | status ) |
Process a given string to add key and value to IFT.
Key and value must be present, with space character as the field separator.
| ift | Pointer to initiated IFT; previous contents are not changed. |
| line | Pointer to the string to be processed, e.g. "key value"; extra space characters are excluded from key and value. |
| is_comment_accepted | Specifies whether comment lines are processed or not.
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 339 of file iftio.c.
Referenced by iftPutFromString(), and iftRead().
| int iftRead | ( | IFT * | ift, |
| FILE * | fp, | ||
| int | is_key_required, | ||
| int | is_comment_accepted, | ||
| TPCSTATUS * | status ) |
Read IFT data into IFT structure.
Any previous contents of IFT are preserved. This function can read the initial ASCII part of files that contain also binary data in the end (from some Interfile images), but not the binary data itself.
| ift | Pointer to IFT. |
| fp | Input file pointer. |
| is_key_required | Specifies whether key name is required or not. If not required, then line contents without equals sign are assumed to represent a value string and key name in IFT struct is left empty.
|
| is_comment_accepted | Specifies whether comment lines are processed or not.
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 130 of file iftio.c.
Referenced by micropetHeaderRead(), parRead(), parReadLimits(), and tacRead().
Write the contents of IFT to the specified file pointer.
| ift | Pointer to IFT. |
| fp | Output file pointer. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 98 of file iftio.c.
Referenced by parReadFIT(), parReadRES(), parWriteCSV(), parWriteIFT(), parWriteLimits(), tacWriteCSV(), tacWriteDFT(), tacWritePMOD(), and tacWriteSimple().
Write one item in IFT to the specified file pointer.
Use iftWrite() to write all IFT items.
| ift | Pointer to IFT. |
| item | Index [0..keyNr-1] of key and value to print. |
| fp | Output file pointer. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 25 of file iftio.c.
Referenced by abssWrite(), and iftWrite().