------------------------------------------------------------------------- RecConfigReadConfigPath -------------------------------------------------------------------------
| 1079 | // RecConfigReadConfigPath |
| 1080 | //------------------------------------------------------------------------- |
| 1081 | std::string |
| 1082 | RecConfigReadConfigPath(const char *file_variable, const char *default_value) |
| 1083 | { |
| 1084 | std::string sysconfdir(RecConfigReadConfigDir()); |
| 1085 | |
| 1086 | // If the file name is in a configuration variable, look it up first ... |
| 1087 | if (file_variable) { |
| 1088 | char buf[PATH_NAME_MAX]; |
| 1089 | |
| 1090 | buf[0] = '\0'; |
| 1091 | RecGetRecordString(file_variable, buf, PATH_NAME_MAX); |
| 1092 | if (strlen(buf) > 0) { |
| 1093 | return Layout::get()->relative_to(sysconfdir, buf); |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | // Otherwise take the default ... |
| 1098 | if (default_value) { |
| 1099 | return Layout::get()->relative_to(sysconfdir, default_value); |
| 1100 | } |
| 1101 | |
| 1102 | return {}; |
| 1103 | } |
| 1104 | |
| 1105 | //------------------------------------------------------------------------- |
| 1106 | // RecConfigReadPersistentStatsPath |
no test coverage detected