|
TPCCLIB
|
IFT struct processing. 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 | |
| void | iftInit (IFT *ift) |
| void | iftFree (IFT *ift) |
| int | iftPut (IFT *ift, const char *key, const char *value, char comment, TPCSTATUS *status) |
| int | iftPutDouble (IFT *ift, const char *key, const double value, char comment, TPCSTATUS *status) |
| int | iftPutInt (IFT *ift, const char *key, const int value, char comment, TPCSTATUS *status) |
| int | iftPutUInt (IFT *ift, const char *key, const unsigned int value, char comment, TPCSTATUS *status) |
| int | iftDelete (IFT *ift, int index) |
| int | iftDuplicate (IFT *ift1, IFT *ift2) |
| int | iftReplaceValue (IFT *ift, int i, const char *value, TPCSTATUS *status) |
| int | iftReplaceKey (IFT *ift, int i, const char *key, TPCSTATUS *status) |
| int | iftDeleteDuplicateKeys (IFT *ift, TPCSTATUS *status) |
| int | iftCopyItems (IFT *ift1, IFT *ift2, int is_key_required, int is_value_required, int is_comment_accepted, TPCSTATUS *status) |
| int iftCopyItems | ( | IFT * | ift1, |
| IFT * | ift2, | ||
| int | is_key_required, | ||
| int | is_value_required, | ||
| int | is_comment_accepted, | ||
| TPCSTATUS * | status ) |
Copy items from one IFT struct into another.
Duplicates, empty source, or no copied items are not considered as errors.
| ift1 | Pointer to target IFT. |
| ift2 | Pointer to source IFT. |
| is_key_required | Specifies whether items without key name are copied (0) or not (1). |
| is_value_required | Specifies whether items without value are copied (0) or not (1). |
| is_comment_accepted | Specifies whether comment items are copied or not.
|
| status | Pointer to status data; enter NULL if not needed |
Definition at line 386 of file ift.c.
| int iftDelete | ( | IFT * | ift, |
| int | index ) |
Remove the specified item from IFT struct.
| ift | Pointer to existing IFT |
| index | Index [0..keyNr-1] of key and value |
Definition at line 206 of file ift.c.
Referenced by dcmFileList(), iftDeleteDuplicateKeys(), iftDeleteKey(), parReadCSV(), parSetStudyNr(), tacReadAllogg(), tacReadGEMS(), tacReadOldAllogg(), tacReadScanditronics(), tacSetHeaderDecayCorrection(), tacSetHeaderInjectiontime(), tacSetHeaderIsotope(), tacSetHeaderScanstarttime(), tacSetHeaderStudynr(), tacSetHeaderTimeunit(), and tacSetHeaderUnit().
Find and delete items that have similar key names.
The first occurrence of the key is kept. Search is case-insensitive, but otherwise key name match must be exact.
| ift | Pointer to IFT. |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 348 of file ift.c.
Make a copy (duplicate) of an IFT struct.
| ift1 | Pointer to source IFT struct to be copied |
| ift2 | Pointer to initiated target IFT struct; any previous contents are deleted. |
Definition at line 236 of file ift.c.
Referenced by imgFillOHeader(), parReadCSV(), tacCopyHdr(), tacReadAllogg(), tacReadCSV(), tacReadDFT(), tacReadGEMS(), tacReadOldAllogg(), tacReadPMOD(), tacReadScanditronics(), tacReadSimple(), tacWriteCSV(), and tacWriteDFT().
| void iftFree | ( | IFT * | ift | ) |
Free memory allocated for IFT data. All contents are destroyed.
| ift | Pointer to IFT |
Definition at line 37 of file ift.c.
Referenced by dcmFileList(), dcmFileRemove(), iftDuplicate(), imgFree(), imgRead(), micropetExists(), micropetHeaderRead(), parFree(), parRead(), parReadLimits(), parWriteIFT(), parWriteLimits(), pathRemoveFiles(), tacCopyHdr(), tacFree(), tacRead(), tacWriteCSV(), and tacWriteDFT().
| void iftInit | ( | IFT * | ift | ) |
Initiate the IFT struct before any use.
| ift | Pointer to IFT |
Definition at line 21 of file ift.c.
Referenced by dcmFileRemove(), iftFree(), imgInit(), imgRead(), micropetExists(), micropetHeaderRead(), parInit(), parRead(), parReadLimits(), parWriteIFT(), parWriteLimits(), pathRemoveFiles(), tacInit(), tacRead(), tacWriteCSV(), and tacWriteDFT().
Add specified key and its value to the IFT.
Either key or value can be empty, but not both of them.
| ift | Pointer to initiated IFT; previous contents are not changed |
| key | Key string; can be empty ("" or NULL) |
| value | Value string; can be empty ("" or NULL) |
| comment | Is this comment line, or line that is commented out?
|
| status | Pointer to status data; enter NULL if not needed |
Definition at line 63 of file ift.c.
Referenced by dcmFileList(), ecatReadMainheader(), iftCopyItems(), iftDuplicate(), iftPutDouble(), iftPutFromString(), iftPutFromStringWithSpaceSeparator(), iftPutInt(), iftPutUInt(), imgFillOHeader(), parAllocateWithTAC(), parExamplePerfectBolus(), parExampleTTACs(), parFromIFT(), parReadFIT(), parReadRES(), parSetStudyNr(), parToIFT(), parWriteCSV(), pathFileList(), tacAllocateWithPAR(), tacReadGEMS(), tacReadScanditronics(), tacSetHeaderDecayCorrection(), tacSetHeaderInjectiontime(), tacSetHeaderIsotope(), tacSetHeaderScanstarttime(), tacSetHeaderStudynr(), tacSetHeaderTimeunit(), and tacSetHeaderUnit().
| int iftPutDouble | ( | IFT * | ift, |
| const char * | key, | ||
| const double | value, | ||
| char | comment, | ||
| TPCSTATUS * | status ) |
Add specified key and its floating point (double) value to the IFT.
| ift | Pointer to initiated IFT; previous contents are not changed |
| key | Key string; can be empty ("" or NULL). |
| value | Value as double. |
| comment | Is this comment line, or line that is commented out?
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 128 of file ift.c.
Referenced by parWriteLimits().
Add specified key and its integer (signed) value to the IFT.
| ift | Pointer to initiated IFT; previous contents are not changed |
| key | Key string; can be empty ("" or NULL). |
| value | Value as int. |
| comment | Is this comment line, or line that is commented out?
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 154 of file ift.c.
| int iftPutUInt | ( | IFT * | ift, |
| const char * | key, | ||
| const unsigned int | value, | ||
| char | comment, | ||
| TPCSTATUS * | status ) |
Add specified key and its integer (unsigned) value to the IFT.
| ift | Pointer to initiated IFT; previous contents are not changed |
| key | Key string; can be empty ("" or NULL). |
| value | Value as int. |
| comment | Is this comment line, or line that is commented out?
|
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 180 of file ift.c.
Referenced by imgFillOHeader().
Replace the key name of a specified IFT item.
| ift | Pointer to IFT containing at least the item to be edited. |
| i | IFT item index [0..keyNr-1] to be edited. |
| key | New key string; can be empty ("" or NULL) |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 307 of file ift.c.
Replace the value of specified IFT item.
| ift | Pointer to IFT containing at least the item to be edited. |
| i | IFT item index [0..keyNr-1] to be edited. |
| value | New value string; can be empty ("" or NULL) |
| status | Pointer to status data; enter NULL if not needed |
Definition at line 268 of file ift.c.