|
TPCCLIB
|
I/O functions for TPC parameter files. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpcextensions.h"#include "tpccsv.h"#include "tpcift.h"#include "tpcpar.h"Go to the source code of this file.
Functions | |
| char * | parFormattxt (parformat c) |
| int | parFormatIdentify (const char *s) |
| int | parFormatFromExtension (const char *s) |
| char * | parDefaultExtension (parformat c) |
| int | parWrite (PAR *par, FILE *fp, parformat format, int extra, TPCSTATUS *status) |
| int | parRead (PAR *par, const char *fname, TPCSTATUS *status) |
| void | parListLimits (PAR *par, FILE *fp) |
| int | parWriteLimits (PAR *par, const char *fname, const int verbose) |
| int | parReadLimits (PAR *par, const char *fname, const int verbose) |
I/O functions for TPC parameter files.
Definition in file pario.c.
| char * parDefaultExtension | ( | parformat | c | ) |
Return pointer to default PAR file name extension, including the dot, based on the PAR format code.
| c | PAR format code |
Definition at line 133 of file pario.c.
| int parFormatFromExtension | ( | const char * | s | ) |
Identify the PAR file format from the extension of file name.
| s | Pointer to file name with or without path; mere extension is not accepted here. For example /path/filename.res or filename.fit.bak are accepted. |
Definition at line 102 of file pario.c.
| int parFormatIdentify | ( | const char * | s | ) |
Identify the string representations of the PAR file format.
| s | PAR format as a string. |
Definition at line 74 of file pario.c.
| char * parFormattxt | ( | parformat | c | ) |
Return pointer to PAR file format description with the format code.
| c | PAR format code. |
Definition at line 59 of file pario.c.
Referenced by parRead(), parWrite(), and parWriteCSV().
| void parListLimits | ( | PAR * | par, |
| FILE * | fp ) |
List parameter limits in PAR structure.
| par | Pointer to PAR structure, from which the limits are printed. |
| fp | File pointer for the output; usually stdout. |
Definition at line 406 of file pario.c.
Read parameter file contents into PAR data structure. This function reads RES and FIT format, and some CSV formats.
| par | Pointer to initiated PAR struct where parameter data will be written; any old content is deleted. Call parInit() before first use. |
| fname | Pointer to the file name; this string is not modified. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 232 of file pario.c.
| int parReadLimits | ( | PAR * | par, |
| const char * | fname, | ||
| const int | verbose ) |
Read the specified file and try to find constraints and tolerance for parameters listed in PAR structure.
| par | Pointer to PAR structure, into which the limits are saved. This must also list the parameter names that are searched for from the file. |
| fname | Input file name. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 489 of file pario.c.
Write PAR data into specified file in specified format.
| par | Pointer to PAR struct, contents of which are to be written. |
| fp | Output file pointer. |
| format | File format code; enter PAR_FORMAT_UNKNOWN (0) to write data in the format specified inside the PAR struct. |
| extra | Write (1) or do not write (0) also extra header fields found in PAR; only effective with CSV formats. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 148 of file pario.c.
| int parWriteLimits | ( | PAR * | par, |
| const char * | fname, | ||
| const int | verbose ) |
Write parameter constraints from PAR structure into specified file.
| par | Pointer to PAR structure, from which the limits are to be written. |
| fname | Output file name. Enter 'stdout' to print to stdout. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout |
Definition at line 432 of file pario.c.