-------------------------------------------------------------------------*/ @brief Get the string associated to a key @param d Dictionary to search @param key Key string to look for @param def Default value to return if key not found. @return pointer to statically allocated character string This function queries a dictionary for a key. A key as read from an
| 726 | */ |
| 727 | /*--------------------------------------------------------------------------*/ |
| 728 | char * iniparser_getstring(dictionary * d, char * key, char * def) |
| 729 | { |
| 730 | char * lc_key ; |
| 731 | char * sval ; |
| 732 | |
| 733 | if (d==NULL || key==NULL) |
| 734 | return def ; |
| 735 | |
| 736 | lc_key = strdup(strlwc(key)); |
| 737 | sval = dictionary_get(d, lc_key, def); |
| 738 | free(lc_key); |
| 739 | return sval ; |
| 740 | } |
| 741 | |
| 742 | |
| 743 |
no test coverage detected