Functions
iftsrch.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "include/ift.h"
#include "include/substitutions.h"
Include dependency graph for iftsrch.c:

Functions

int iftGet (IFT *ift, char *key)
 
int iftGetNth (IFT *ift, char *key, int n)
 
int iftFindNthKey (IFT *ift, char *str, int n)
 
int iftFindNthValue (IFT *ift, char *str, int n)
 

Function Documentation

◆ iftFindNthKey()

int iftFindNthKey ( IFT ift,
char *  str,
int  n 
)

Find the Nth item of IFT where the specified string is found in the key. Comparison is case sensitive.

Parameters
iftPointer to existing IFT
strPointer to the case-sensitive (partial) key string
nNth (1..keyNr-1) insidence of value is searched.
Returns
-1 if key was not found, or other negative value in case of an error, and the index [0..keyNr-1] if matching key is found.

References IFT_TEST, iftSetStatus(), IFT::item, IFT_KEY_AND_VALUE::key, and IFT::keyNr.

Here is the call graph for this function:

◆ iftFindNthValue()

int iftFindNthValue ( IFT ift,
char *  str,
int  n 
)

Find the Nth item of IFT where the specified string is found in the value. Comparison is case sensitive.

Parameters
iftPointer to existing IFT
strPointer to the case-sensitive (partial) value string
nNth (1..keyNr-1) insidence of value is searched.
Returns
-1 if key was not found, or other negative value in case of an error, and the index [0..keyNr-1] if matching value is found.

References IFT_TEST, iftSetStatus(), IFT::item, IFT::keyNr, and IFT_KEY_AND_VALUE::value.

Here is the call graph for this function:

◆ iftGet()

int iftGet ( IFT ift,
char *  key 
)

Find the key in the IFT and return the index [0..keyNr-1]. Key is case insensitive.

Parameters
iftPointer to existing IFT
keyPointer to the key string; contents are replaced by the correct key string
Returns
-1 if key was not found, or other negative value in case of an error

References IFT_TEST, iftSetStatus(), IFT::item, IFT_KEY_AND_VALUE::key, and IFT::keyNr.

Here is the call graph for this function:

◆ iftGetNth()

int iftGetNth ( IFT ift,
char *  key,
int  n 
)

Find the Nth key with similar name in the IFT and return the index [0..keyNr-1]. Key is case insensitive.

Parameters
iftPointer to existing IFT
keyPointer to the key string; contents are replaced by the correct key string
nNth (1..) insidence of key is searched.
Returns
-1 if key was not found, or other negative value in case of an error

References IFT_TEST, iftSetStatus(), IFT::item, IFT_KEY_AND_VALUE::key, and IFT::keyNr.

Here is the call graph for this function: