4 * [Generated from options, 08 November 1995]
7 #pragma include_only_once
8 #pragma force_top_level
13 /*----- Overview ----------------------------------------------------------*
27 /* --- options_read --- *
29 * On entry: R0 == chunk file handle
30 * R1 == pointer to a chunk name
31 * R2 == pointer to options definition
32 * R3,R4 specify address of output block
36 * Use: Claims the specified options chunk, and reads the data in
37 * it into a binary block. Because the output data might be
38 * in a flex block, the two registers R3,R4 which define its
39 * address work as follows:
41 * R3 == address or offset of data
42 * R4 == -1 if R3 is address, else flex anchor address
45 extern routine options_read;
47 /* --- options_write --- *
49 * On entry: R0 == terminator character to write, 0 for none, or -1 for
51 * R1 == pointer to name to save
53 * On exit: May return an error
55 * Use: Writes out an option name, terminated with the character
56 * given in R0 (which will normally be a space or an `=' sign).
59 extern routine options_write;
61 /* --- optType_string --- *
65 * Data: (word) buffer size of string
67 * Use: Handles string data. The binary representation is a ctrl
68 * terminated string. The textual representation is a sequence
69 * of characters, which is always output in single quotes,
70 * although this is not necessary for the input. The string
71 * will be truncated to fit in the buffer during reading.
74 extern routine optType_string;
76 /* --- optType_integer --- *
78 * Flags: bit 8 == use given default base
80 * Data: (word) default base, if bit 8 set
82 * Use: Handles integer data. The binary representation is a 32-
83 * bit integer value. The textual representation is the normal
84 * RISC OS style of numbers (i.e. the base_value notation is
85 * supported). Numbers are always output in the default base
86 * given (or in decimal if there is none given). Numbers
87 * being read may always have a sign; numbers will only be
88 * output with a sign if the default base is decimal. Uppercase
89 * letters will be used for output, but any case is acceptable
92 * Special prefixes allowed are `%' for binary and `&' for hex.
93 * Such numbers are always output with these prefixes.
96 extern routine optType_integer;
98 /* --- optType_literal --- *
102 * Data: (string) data to write out (*null* terminated)
104 * Use: Reads nothing; leave the name blank. Writes out the data
105 * literally. Note that an extra linefeed is added to the
106 * end, so don't overdo it.
109 extern routine optType_literal;
111 /* --- optType_enum --- *
113 * Flags: bit 8 == quote output string
114 * bit 9 == don't put an `=' sign in output
118 * Use: The data is a collection of ctrl-terminated strings, itself
119 * terminated by a zero-length entry. The textual
120 * representation is one of these strings, or an abbreviation
121 * of one. The binary representation is a word containing the
122 * index into the list.
125 extern routine optType_enum;
127 /* --- optType_bool --- *
129 * Flags: bit 8 == make flag active low
130 * bit 9 == use `on'/`off' rather than `true'/`false'; also
131 * suppresses the `=' sign
133 * Data: (word) bit mask to OR or BIC within word
135 * Use: Handles a boolean option. It will translate between the
136 * strings `true' or `false' and a bit (or set of bits) within
140 extern routine optType_bool;
142 /* --- optType_version --- *
148 * Use: Converts between version number strings (of the form
149 * <int>[.[<digit>[<digit>]]]) and integers. The version
150 * number is stored multiplied by 100.
153 extern routine optType_version;
155 /*----- Data structures ---------------------------------------------------*/
157 /* --- Options definition block --- */
165 /* --- Option block flags --- */
167 #define optFlag_last ((1<<0))
168 #define optFlag_ignore ((1<<1))
170 /* --- Integer type flags --- */
172 #define intFlag_base ((1<<8))
174 /* --- Enumeration type flags --- */
176 #define enumFlag_quote ((1<<8))
177 #define enumFlag_noEq ((1<<9))
179 /* --- Boolean type flags --- */
181 #define boolFlag_cpl ((1<<8))
182 #define boolFlag_onOff ((1<<9))
184 /* --- Type handler reason codes --- *
189 * R7 == flags read from table
190 * R8 == address of option name
191 * R9 == address of type-specific data
192 * R10 == address of binary option
195 #define optReason_read 0
197 #define optReason_write 1
199 /*----- That's all, folks -------------------------------------------------*/