Functions | Variables
iftfile.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "include/ift.h"
#include "include/quots.h"
#include "include/substitutions.h"
#include "include/datetime.h"
Include dependency graph for iftfile.c:

Functions

int iftRead (IFT *ift, char *filename, int is_key_required)
int iftWriteItem (IFT *ift, int item, FILE *fp)
int iftWrite (IFT *ift, char *filename)

Variables

int IFT_SPACE_BEFORE_EQ_SIGN = 1
int IFT_SPACE_AFTER_EQ_SIGN = 1

Function Documentation

int iftRead ( IFT ift,
char *  filename,
int  is_key_required 
)

Read IFT file keys and values. Previous contents of IFT are preserved. This function can read the initial ASCII part of files that contain also binary data.

Parameters:
iftPointer to initiated but empty IFT
filenameInput filename
is_key_required0=key name is not required, 1=only lines with key and equals sign are read
Returns:
Returns 0 if ok. Sets ift->status.

References IFT_TEST, iftEmpty(), iftPut(), iftSetStatus(), istime(), IFT::keyNr, strstr_noquotation(), and IFT::type.

Here is the call graph for this function:

int iftWrite ( IFT ift,
char *  filename 
)

Write all keys and values.

Parameters:
iftPointer to initiated but empty IFT
filenameOutput filename; string "stdout" is identified
Returns:
0 if ok.

References IFT_TEST, iftSetStatus(), iftWriteItem(), and IFT::keyNr.

Here is the call graph for this function:

int iftWriteItem ( IFT ift,
int  item,
FILE *  fp 
)

Write one item in IFT to the specified file pointer.

Parameters:
iftPointer to initiated but empty IFT
itemIndex [0..keyNr-1] of key and value to print
fpOutput file pointer
Returns:
0 if ok.

References IFT_SPACE_AFTER_EQ_SIGN, IFT_SPACE_BEFORE_EQ_SIGN, IFT_TEST, iftSetStatus(), IFT::item, IFT_KEY_AND_VALUE::key, IFT::keyNr, IFT_KEY_AND_VALUE::type, IFT::type, and IFT_KEY_AND_VALUE::value.

Referenced by iftWrite().

Here is the call graph for this function:


Variable Documentation

int IFT_SPACE_AFTER_EQ_SIGN = 1

Referenced by iftWriteItem().

int IFT_SPACE_BEFORE_EQ_SIGN = 1

Referenced by iftWriteItem().