| 217 | */ |
| 218 | |
| 219 | const char * /* O - Option value or @code NULL@ */ |
| 220 | cupsGetOption(const char *name, /* I - Name of option */ |
| 221 | int num_options,/* I - Number of options */ |
| 222 | cups_option_t *options) /* I - Options */ |
| 223 | { |
| 224 | int diff, /* Result of comparison */ |
| 225 | match; /* Matching index */ |
| 226 | |
| 227 | |
| 228 | DEBUG_printf(("2cupsGetOption(name=\"%s\", num_options=%d, options=%p)", name, num_options, (void *)options)); |
| 229 | |
| 230 | if (!name || num_options <= 0 || !options) |
| 231 | { |
| 232 | DEBUG_puts("3cupsGetOption: Returning NULL"); |
| 233 | return (NULL); |
| 234 | } |
| 235 | |
| 236 | match = cups_find_option(name, num_options, options, -1, &diff); |
| 237 | |
| 238 | if (!diff) |
| 239 | { |
| 240 | DEBUG_printf(("3cupsGetOption: Returning \"%s\"", options[match].value)); |
| 241 | return (options[match].value); |
| 242 | } |
| 243 | |
| 244 | DEBUG_puts("3cupsGetOption: Returning NULL"); |
| 245 | return (NULL); |
| 246 | } |
| 247 | |
| 248 | |
| 249 | /* |