Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
'A percent sign appearing in text is a literal'
+++++++++++++++++++++++++++++++++++++++++++++++

The message "A percent sign appearing in text is a literal" can be caused by code like:

::

    xo_emit("cost: %d", cost);

This code should be replaced with code like:

::

    xo_emit("{L:cost}: {:cost/%d}", cost);

This can be a bit surprising and could be a field that was not
properly converted to a libxo-style format string.


'Unknown long name for role/modifier'
+++++++++++++++++++++++++++++++++++++

The message "Unknown long name for role/modifier" can be caused by code like:

::

    xo_emit("{,humanization:value}", value);

This code should be replaced with code like:

::

    xo_emit("{,humanize:value}", value);

The hn-* modifiers (hn-decimal, hn-space, hn-1000)
are only valid for fields with the {h:} modifier.


'Last character before field definition is a field type'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Last character before field definition is a field type" can be caused by code like:
A common typo:

::

    xo_emit("{T:Min} T{:Max}");

This code should be replaced with code like:

::

    xo_emit("{T:Min} {T:Max}");

Twiddling the "{" and the field role is a common typo.


'Encoding format uses different number of arguments'
++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Encoding format uses different number of arguments" can be caused by code like:

::

    xo_emit("{:name/%6.6s %%04d/%s}", name, number);

This code should be replaced with code like:

::

    xo_emit("{:name/%6.6s %04d/%s-%d}", name, number);

Both format should consume the same number of arguments off the stack


'Only one field role can be used'
+++++++++++++++++++++++++++++++++

The message "Only one field role can be used" can be caused by code like:

::

    xo_emit("{LT:Max}");

This code should be replaced with code like:

::

    xo_emit("{T:Max}");

'Potential missing slash after C, D, N, L, or T with format'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Potential missing slash after C, D, N, L, or T with format" can be caused by code like:

::

    xo_emit("{T:%6.6s}\n", "Max");

This code should be replaced with code like:

::

    xo_emit("{T:/%6.6s}\n", "Max");

The "%6.6s" will be a literal, not a field format.  While
it's possibly valid, it's likely a missing "/".


'An encoding format cannot be given (roles: DNLT)'
++++++++++++++++++++++++++++++++++++++++++++++++++

The message "An encoding format cannot be given (roles: DNLT)" can be caused by code like:

::

    xo_emit("{T:Max//%s}", "Max");

Fields with the C, D, N, L, and T roles are not emitted in
the 'encoding' style (JSON, XML), so an encoding format
would make no sense.


'Format cannot be given when content is present (roles: CDLN)'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Format cannot be given when content is present (roles: CDLN)" can be caused by code like:

::

    xo_emit("{N:Max/%6.6s}", "Max");

Fields with the C, D, L, or N roles can't have both
static literal content ("{L:Label}") and a
format ("{L:/%s}").
This error will also occur when the content has a backslash
in it, like "{N:Type of I/O}"; backslashes should be escaped,
like "{N:Type of I\\/O}".  Note the double backslash, one for
handling 'C' strings, and one for libxo.


'Field has color without fg- or bg- (role: C)'
++++++++++++++++++++++++++++++++++++++++++++++

The message "Field has color without fg- or bg- (role: C)" can be caused by code like:

::

    xo_emit("{C:green}{:foo}{C:}", x);

This code should be replaced with code like:

::

    xo_emit("{C:fg-green}{:foo}{C:}", x);

Colors must be prefixed by either "fg-" or "bg-".


'Field has invalid color or effect (role: C)'
+++++++++++++++++++++++++++++++++++++++++++++

The message "Field has invalid color or effect (role: C)" can be caused by code like:

::

    xo_emit("{C:fg-purple,bold}{:foo}{C:gween}", x);

This code should be replaced with code like:

::

    xo_emit("{C:fg-red,bold}{:foo}{C:fg-green}", x);

The list of colors and effects are limited.  The
set of colors includes default, black, red, green,
yellow, blue, magenta, cyan, and white, which must
be prefixed by either "fg-" or "bg-".  Effects are
limited to bold, no-bold, underline, no-underline,
inverse, no-inverse, normal, and reset.  Values must
be separated by commas.


'Field has humanize modifier but no format string'
++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Field has humanize modifier but no format string" can be caused by code like:

::

    xo_emit("{h:value}", value);

This code should be replaced with code like:

::

    xo_emit("{h:value/%d}", value);

Humanization is only value for numbers, which are not
likely to use the default format ("%s").


'Field has hn-* modifier but not 'h' modifier'
++++++++++++++++++++++++++++++++++++++++++++++

The message "Field has hn-* modifier but not 'h' modifier" can be caused by code like:

::

    xo_emit("{,hn-1000:value}", value);

This code should be replaced with code like:

::

    xo_emit("{h,hn-1000:value}", value);

The hn-* modifiers (hn-decimal, hn-space, hn-1000)
are only valid for fields with the {h:} modifier.


'Value field must have a name (as content)")'
+++++++++++++++++++++++++++++++++++++++++++++

The message "Value field must have a name (as content)")" can be caused by code like:

::

    xo_emit("{:/%s}", "value");

This code should be replaced with code like:

::

    xo_emit("{:tag-name/%s}", "value");

The field name is used for XML and JSON encodings.  These
tags names are static and must appear directly in the
field descriptor.


'Use hyphens, not underscores, for value field name'
++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Use hyphens, not underscores, for value field name" can be caused by code like:

::

    xo_emit("{:no_under_scores}", "bad");

This code should be replaced with code like:

::

    xo_emit("{:no-under-scores}", "bad");

Use of hyphens is traditional in XML, and the XOF_UNDERSCORES
flag can be used to generate underscores in JSON, if desired.
But the raw field name should use hyphens.


'Value field name cannot start with digit'
++++++++++++++++++++++++++++++++++++++++++

The message "Value field name cannot start with digit" can be caused by code like:

::

    xo_emit("{:10-gig/}");

This code should be replaced with code like:

::

    xo_emit("{:ten-gig/}");

XML element names cannot start with a digit.


'Value field name should be lower case'
+++++++++++++++++++++++++++++++++++++++

The message "Value field name should be lower case" can be caused by code like:

::

    xo_emit("{:WHY-ARE-YOU-SHOUTING}", "NO REASON");

This code should be replaced with code like:

::

    xo_emit("{:why-are-you-shouting}", "no reason");

Lower case is more civilized.  Even TLAs should be lower case
to avoid scenarios where the differences between "XPath" and
"Xpath" drive your users crazy.  Lower case rules the seas.


'Value field name should be longer than two characters'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Value field name should be longer than two characters" can be caused by code like:

::

    xo_emit("{:x}", "mumble");

This code should be replaced with code like:

::

    xo_emit("{:something-meaningful}", "mumble");

Field names should be descriptive, and it's hard to
be descriptive in less than two characters.  Consider
your users and try to make something more useful.
Note that this error often occurs when the field type
is placed after the colon ("{:T/%20s}"), instead of before
it ("{T:/20s}").


'Value field name contains invalid character'
+++++++++++++++++++++++++++++++++++++++++++++

The message "Value field name contains invalid character" can be caused by code like:

::

    xo_emit("{:cost-in-$$/%u}", 15);

This code should be replaced with code like:

::

    xo_emit("{:cost-in-dollars/%u}", 15);

An invalid character is often a sign of a typo, like "{:]}"
instead of "{]:}".  Field names are restricted to lower-case
characters, digits, and hyphens.


'decoration field contains invalid character'
+++++++++++++++++++++++++++++++++++++++++++++

The message "decoration field contains invalid character" can be caused by code like:

::

    xo_emit("{D:not good}");

This code should be replaced with code like:

::

    xo_emit("{D:((}{:good}{D:))}", "yes");

This is minor, but fields should use proper roles.  Decoration
fields are meant to hold punctuation and other characters used
to decorate the content, typically to make it more readable
to human readers.


'Anchor content should be decimal width'
++++++++++++++++++++++++++++++++++++++++

The message "Anchor content should be decimal width" can be caused by code like:

::

    xo_emit("{[:mumble}");

This code should be replaced with code like:

::

    xo_emit("{[:32}");

Anchors need an integer value to specify the width of
the set of anchored fields.  The value can be positive
(for left padding/right justification) or negative (for
right padding/left justification) and can appear in
either the start or stop anchor field descriptor.


'Anchor format should be "%d"'
++++++++++++++++++++++++++++++

The message "Anchor format should be "%d"" can be caused by code like:

::

    xo_emit("{[:/%s}");

This code should be replaced with code like:

::

    xo_emit("{[:/%d}");

Anchors only grok integer values, and if the value is not static,
if must be in an 'int' argument, represented by the "%d" format.
Anything else is an error.


'Anchor cannot have both format and encoding format")'
++++++++++++++++++++++++++++++++++++++++++++++++++++++

The message "Anchor cannot have both format and encoding format")" can be caused by code like:

::

    xo_emit("{[:32/%d}");

This code should be replaced with code like:

::

    xo_emit("{[:32}");

Anchors can have a static value or argument for the width,
but cannot have both.


'Max width only valid for strings'
++++++++++++++++++++++++++++++++++

The message "Max width only valid for strings" can be caused by code like:

::

    xo_emit("{:tag/%2.4.6d}", 55);

This code should be replaced with code like:

::

    xo_emit("{:tag/%2.6d}", 55);

libxo allows a true 'max width' in addition to the traditional
printf-style 'max number of bytes to use for input'.  But this
is supported only for string values, since it makes no sense
for non-strings.  This error may occur from a typo,
like "{:tag/%6..6d}" where only one period should be used.