msOWSPrintParam() ** ** Same as printMetadata() but applied to mapfile parameters. **/
| 1196 | ** Same as printMetadata() but applied to mapfile parameters. |
| 1197 | **/ |
| 1198 | int msOWSPrintParam(FILE *stream, const char *name, const char *value, |
| 1199 | int action_if_not_found, const char *format, |
| 1200 | const char *default_value) |
| 1201 | { |
| 1202 | int status = MS_NOERR; |
| 1203 | |
| 1204 | if(value && strlen(value) > 0) |
| 1205 | { |
| 1206 | msIO_fprintf(stream, format, value); |
| 1207 | } |
| 1208 | else |
| 1209 | { |
| 1210 | if (action_if_not_found == OWS_WARN) |
| 1211 | { |
| 1212 | msIO_fprintf(stream, "<!-- WARNING: Mandatory mapfile parameter '%s' was missing in this context. -->\n", name); |
| 1213 | status = action_if_not_found; |
| 1214 | } |
| 1215 | |
| 1216 | if (default_value) |
| 1217 | msIO_fprintf(stream, format, default_value); |
| 1218 | } |
| 1219 | |
| 1220 | return status; |
| 1221 | } |
| 1222 | |
| 1223 | /* msOWSPrintEncodeParam() |
| 1224 | ** |
nothing calls this directly
no test coverage detected