Changes between Version 21 and Version 22 of StructuredBinaryData
- Timestamp:
- 2012-08-08T04:42:00Z (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StructuredBinaryData
v21 v22 166 166 it is decoded. 167 167 168 == Expressions == 169 168 170 Transforms can have parameters that affect how they decode data: 169 171 {{{ … … 176 178 }}} 177 179 When such a transform is used, expressions must be given to calculate its 178 parameters. Currently, the only possible expressions are parameters given to179 the current transform, boolean and integer literals, and previously decoded 180 fieldsin the current `struct` or an outer `struct`:180 parameters. The basic terms used in expressions are parameters given to the 181 current transform, boolean and integer literals, and previously decoded fields 182 in the current `struct` or an outer `struct`: 181 183 {{{ 182 184 transform item(little_endian) = struct { … … 186 188 }; 187 189 }}} 190 You can also use `+`, `-`, `*`, and parentheses as you would expect. 191 192 Expressions can also be used as transforms themselves, in two ways. First, an 193 expression referring to `in` can be used to decode a value, such as 194 `.num_bytes <- (in * 4) <- uint32le;`. Second, an expression that doesn’t refer 195 to `in` can be used as a transform that takes an empty blob and evaluates the 196 expression: for example, `.num_total <- (.num_short + .num_long);` could be 197 used in a `struct`. In both cases, the parentheses are mandatory. 188 198 189 199 == Structs == … … 277 287 printed instead; Bithenge should not try to look in the `if` when searching 278 288 for `.non_existent`. 279 Complex expressions:: Expressions that use operators orcall transforms.289 Complex expressions:: More operators, and expressions that call transforms. 280 290 Better error reporting:: errno.h is intended for system call errors; when 281 291 other errors occur, a more helpful error message should be printed, like