#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libCfg/CfgItem.c $ %D% SwRI" #include #include "libCfg.h" #include "libCfg_local.h" /* * StrHier Source - to node to start the query for the 'item'. * SDDAS_CHAR *item - what is being queried. * SDDAS_INT elmt - index into array of return values for desired string pointer. * * return a pointer to the string value associated with the 'item'. There may be * more than one string value, therefore elmt acts as an index into the array of * string values. */ SDDAS_CHAR *CfgItem (StrHier Source, SDDAS_CHAR *item, SDDAS_INT elmt) { StrHier S; SDDAS_CHAR *Item = NULL; for (S = Source; S; S = S->parent) if ((Item = ValueFromItem (S, item, elmt))) break; if (!S) return NULL; return Item; }