1optionLoadLine(3) Programmer's Manual optionLoadLine(3)
2
3
4
6 optionLoadLine - process a string for an option name and value
7
8
10 #include <your-opts.h>
11 cc [...] -o outfile infile.c -lopts [...]
12
13 void optionLoadLine(tOptions * opts, char const * line);
14
15
17 This is a client program callable routine for setting options from, for
18 example, the contents of a file that they read in. Only one option may
19 appear in the text. It will be treated as a normal (non-preset) op‐
20 tion.
21
22 When passed a pointer to the option struct and a string, it will find
23 the option named by the first token on the string and set the option
24 argument to the remainder of the string. The caller must NUL terminate
25 the string. The caller need not skip over any introductory hyphens.
26 Any embedded new lines will be included in the option argument. If the
27 input looks like one or more quoted strings, then the input will be
28 "cooked". The "cooking" is identical to the string formation used in
29 AutoGen definition files (@pxref{basic expression}), except that you
30 may not use backquotes.
31
32 opts program options descriptor
33
34 line NUL-terminated text
35
36
38 Invalid options are silently ignored. Invalid option arguments will
39 cause a warning to print, but the function should return.
40
42 The info documentation for the -lopts library.
43 ao_string_tokenize(3), configFileLoad(3), optionFileLoad(3), option‐
44 FindNextValue(3), optionFindValue(3), optionFree(3), optionGetValue(3),
45 optionMemberList(3), optionNextValue(3), optionOnlyUsage(3), option‐
46 PrintVersion(3), optionPrintVersionAndReturn(3), optionProcess(3), op‐
47 tionRestore(3), optionSaveFile(3), optionSaveState(3), optionUnload‐
48 Nested(3), optionVersion(3), strequate(3), streqvcmp(3), streqvmap(3),
49 strneqvcmp(3), strtransform(3),
50
51
52
53 2023-05-19 optionLoadLine(3)