find_str_value.c File Reference

Find string in vector and return index. More...

#include <utils.h>
Include dependency graph for find_str_value.c:

Go to the source code of this file.

Functions

int find_str_value (char *str, char **str_vect, int nelem)
 Find string in vector and return index.

Detailed Description

Find string in vector and return index.

Definition in file find_str_value.c.


Function Documentation

int find_str_value ( char *  str,
char **  str_vect,
int  nelem 
)

Find string in vector and return index.

Parameters:
[in] str String value to search
[in] str_vect Vector of strings
[in] nelem Number of elements in str_vect
Returns:
Vector index

Definition at line 58 of file find_str_value.c.

Referenced by output_downscaled_analog(), and read_obs_period().

00058                                                       {
00067   int n; /* Loop counter */
00068   
00069   /* Loop over elements */
00070   for (n=0; n<nelem; n++)
00071     if ( !strcmp(str, str_vect[n]) )
00072       /* Found string */
00073       return n;
00074 
00075   /* String not found */
00076   return -1;
00077 }


Generated on 12 May 2016 for DSCLIM by  doxygen 1.6.1