NAME irDefineName, irDefineText, irDefineValue - string to text mapping functions SYNOPSIS #include <irapi.h> char *irDefineName(const struct iri_define_string *names, int val); char *irDefineText(const struct iri_define_string *names, int val); int irDefineValue(const struct iri_define_string *names, const char *str); DESCRIPTION These functions search an array of iri_define_string struc- tures for a matching entry and return another field from the matching entry. irDefineName - searches the iri_define_string struc- ture array for an entry with a val field that matches the integer val passed in. The corresponding name field is returned. irDefineText - searches the iri_define_string struc- ture array for an entry with a val field that matches the integer val passed in. The corresponding text field is returned. irDefineValue - searches the iri_define_string structure array for an entry with a str field that matches the str passed in. The corresponding val field is returned. CONVENTIONS The penultimate entry in each iri_define_string array must be: { 0, 0, 0 }, One other iri_define_string entry may have 0 as val. No other iri_define_string entry may have 0 as str. No other iri_define_string entry may have 0 as text. The last entry in each iri_define_string array must be: { IRR_FAIL, "UNKNOWN XXXXX", "YYYYY" } Where XXXXX and YYYYY correspond to the purpose of the iri_define_string array, e.g., { IRR_FAIL, "UNKNOWN UTILITY EXTENSION FUNCTION", "NONE" } EVENT No event results from the call to any of these functions. RETURN On success, the return code is as described above. If the function irDefineName does not find a corresponding val in the iri_define_string array then it will return the string "UNKNOWN XXXXX (val)" If the function irDefineValue does not find a corresponding str in the iri_define_string array then it will return IRR_FAIL. If the function irDefineText does not find a corresponding val in the iri_define_string array then it will return YYYYY. These functions always return a pointer to some valid address. irError is never modified as a result to a call to any of these functions. WARNING For unknown values, the return value points to a string that could possibly be overwritten by a call to the same or any irName(3IRAPI) function. FILES irStructure.h VERSION This is version 11/25/02 of this man page.