Go to the source code of this file.
|
| uacpi_size | uacpi_strlen (const uacpi_char *str) |
| |
| uacpi_size | uacpi_strnlen (const uacpi_char *str, uacpi_size max) |
| |
| uacpi_i32 | uacpi_strcmp (const uacpi_char *lhs, const uacpi_char *rhs) |
| |
| void | uacpi_memcpy_zerout (void *dst, const void *src, uacpi_size dst_size, uacpi_size src_size) |
| |
| uacpi_u8 | uacpi_bit_scan_forward (uacpi_u64 value) |
| |
| uacpi_u8 | uacpi_bit_scan_backward (uacpi_u64 value) |
| |
| void * | uacpi_builtin_alloc_zeroed (uacpi_size size) |
| |
| static void | write_one (struct fmt_buf_state *fb_state, uacpi_char c) |
| |
| static void | write_many (struct fmt_buf_state *fb_state, const uacpi_char *string, uacpi_size count) |
| |
| static uacpi_char | hex_char (uacpi_bool upper, uacpi_u64 value) |
| |
| static void | write_padding (struct fmt_buf_state *fb_state, struct fmt_spec *fm, uacpi_size repr_size) |
| |
| static void | write_integer (struct fmt_buf_state *fb_state, struct fmt_spec *fm, uacpi_u64 value) |
| |
| static uacpi_bool | string_has_at_least (const uacpi_char *string, uacpi_size characters) |
| |
| static uacpi_bool | consume_digits (const uacpi_char **string, uacpi_size *out_size) |
| |
| static uacpi_bool | parse_number (const uacpi_char **fmt, enum parse_number_mode mode, uacpi_u64 *out_value) |
| |
| static uacpi_bool | consume (const uacpi_char **string, const uacpi_char *token) |
| |
| static uacpi_bool | is_one_of (uacpi_char c, const uacpi_char *list) |
| |
| static uacpi_bool | consume_one_of (const uacpi_char **string, const uacpi_char *list, uacpi_char *consumed_char) |
| |
| static uacpi_u32 | base_from_specifier (uacpi_char specifier) |
| |
| static uacpi_bool | is_uppercase_specifier (uacpi_char specifier) |
| |
| static const uacpi_char * | find_next_conversion (const uacpi_char *fmt, uacpi_size *offset) |
| |
| uacpi_i32 | uacpi_vsnprintf (uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt, uacpi_va_list vlist) |
| |
| uacpi_i32 | uacpi_snprintf (uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt,...) |
| |
| void | uacpi_log (uacpi_log_level lvl, const uacpi_char *str,...) |
| |
◆ REPR_BUFFER_SIZE
◆ parse_number_mode
| Enumerator |
|---|
| PARSE_NUMBER_MODE_MAYBE | |
| PARSE_NUMBER_MODE_MUST | |
Definition at line 399 of file stdlib.c.
399 {
402};
@ PARSE_NUMBER_MODE_MAYBE
◆ base_from_specifier()
Definition at line 463 of file stdlib.c.
464{
466 {
467 case 'x':
468 case 'X':
469 return 16;
470 case 'o':
471 return 8;
472 default:
473 return 10;
474 }
475}
Referenced by uacpi_vsnprintf().
◆ consume()
Definition at line 419 of file stdlib.c.
420{
422
424
427
429 *string += token_size;
431 }
432
434}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
static uacpi_bool string_has_at_least(const uacpi_char *string, uacpi_size characters)
uacpi_size uacpi_strlen(const uacpi_char *str)
Referenced by uacpi_vsnprintf().
◆ consume_digits()
Definition at line 377 of file stdlib.c.
380{
382
383 for (;;) {
385 if (
c <
'0' ||
c >
'9')
386 break;
387
389 *string += 1;
390 }
391
394
397}
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
Referenced by parse_number().
◆ consume_one_of()
Definition at line 446 of file stdlib.c.
449{
453
456 *string += 1;
458 }
459
461}
static uacpi_bool is_one_of(uacpi_char c, const uacpi_char *list)
Referenced by uacpi_vsnprintf().
◆ find_next_conversion()
◆ hex_char()
Definition at line 274 of file stdlib.c.
275{
276 static const uacpi_char upper_hex[] =
"0123456789ABCDEF";
277 static const uacpi_char lower_hex[] =
"0123456789abcdef";
278
279 return (upper ? upper_hex : lower_hex)[
value];
280}
Referenced by write_integer().
◆ is_one_of()
◆ is_uppercase_specifier()
◆ parse_number()
Definition at line 404 of file stdlib.c.
407{
411
414
417}
uacpi_status uacpi_string_to_integer(const uacpi_char *str, uacpi_size max_chars, enum uacpi_base base, uacpi_u64 *out_value)
static const int digits[]
static uacpi_bool consume_digits(const uacpi_char **string, uacpi_size *out_size)
Referenced by uacpi_vsnprintf().
◆ string_has_at_least()
Definition at line 363 of file stdlib.c.
366{
367 while (*string) {
368 if (--characters == 0)
370
371 string++;
372 }
373
375}
Referenced by consume().
◆ uacpi_bit_scan_backward()
Definition at line 166 of file stdlib.c.
167{
168#if defined(_MSC_VER) && !defined(__clang__)
171
172#ifdef _WIN64
175 return 0;
176
178#else
183 return 0;
184
186 }
187
189#endif
190
191#elif defined(__WATCOMC__)
192
195
199 }
200 }
201
202 return 0;
203#else
205 return 0;
206
207 return 64 - __builtin_clzll(
value);
208#endif
209}
__INTRIN_INLINE unsigned char _BitScanReverse64(unsigned long *Index, unsigned long long Mask)
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask)
Referenced by gas_get_access_bit_width(), and handle_unary_math().
◆ uacpi_bit_scan_forward()
Definition at line 124 of file stdlib.c.
125{
126#if defined(_MSC_VER) && !defined(__clang__)
129
130#ifdef _WIN64
133 return 0;
134
136#else
141 return 0;
142
144 }
145
147#endif
148
149#elif defined(__WATCOMC__)
150
153
157 }
158 }
159
160 return 0;
161#else
162 return __builtin_ffsll(
value);
163#endif
164}
__INTRIN_INLINE unsigned char _BitScanForward64(unsigned long *Index, unsigned long long Mask)
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask)
Referenced by handle_unary_math().
◆ uacpi_builtin_alloc_zeroed()
Definition at line 212 of file stdlib.c.
213{
215
219
222}
#define uacpi_memzero(ptr, size)
void * uacpi_kernel_alloc(uacpi_size size)
◆ uacpi_log()
Definition at line 700 of file stdlib.c.
701{
704
707
711
713
716}
GLenum GLuint GLenum GLsizei const GLchar * buf
void uacpi_kernel_log(uacpi_log_level, const uacpi_char *)
uacpi_i32 uacpi_vsnprintf(uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt, uacpi_va_list vlist)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
◆ uacpi_memcpy_zerout()
Definition at line 112 of file stdlib.c.
114{
116
117 if (bytes_to_copy)
119
120 if (dst_size > bytes_to_copy)
122}
Referenced by buffer_alloc_and_store(), build_table_id(), do_aml_resource_to_native(), do_native_resource_to_aml(), exec_op(), handle_buffer(), handle_deref_of(), handle_special_field(), object_assign_with_implicit_cast(), object_to_integer(), uacpi_dispatch_opregion_io(), uacpi_read_field_unit(), uacpi_write_buffer_field(), and write_buffer_index().
◆ uacpi_snprintf()
◆ uacpi_strcmp()
Definition at line 96 of file stdlib.c.
97{
100
101 while (lhs[
i] && rhs[
i]) {
102 if (lhs[
i] != rhs[
i])
103 return *(cucp)&lhs[
i] - *(cucp)&rhs[
i];
104
106 }
107
108 return *(cucp)&lhs[
i] - *(cucp)&rhs[
i];
109}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by find_interface_unlocked(), matches_any(), and uacpi_uninstall_interface().
◆ uacpi_strlen()
◆ uacpi_strnlen()
◆ uacpi_vsnprintf()
Definition at line 499 of file stdlib.c.
503{
509
513
517 .base = 10,
518 };
520
521 if (next_offset)
523
524 if (!next_conversion)
525 break;
526
527 fmt = next_conversion;
530 continue;
531 }
532
533
535
538 case '+':
539 case ' ':
542 continue;
543 case '-':
545 continue;
546 case '0':
548 continue;
549 case '#':
551 continue;
552 default:
553 return -1;
554 }
555 }
556
560 return -1;
561 }
562
565
568 } else {
570 return -1;
571 }
572 }
573
575
579 continue;
580 }
581
585
587 string = "<null>";
588
593 continue;
594 }
595
601 goto write_int;
602 }
603
610 } else {
611 return -1;
612 }
613 goto write_int;
614 }
615
622 } else {
623 return -1;
624 }
625 goto write_int;
626 }
627
635 } else {
636 return -1;
637 }
638 goto write_int;
639 }
640
648 } else {
649 return -1;
650 }
651 goto write_int;
652 }
653
659 } else {
660 return -1;
661 }
662
663 write_int:
667 }
668
670 }
671
674
676 fb_state.
buffer[last_char] =
'\0';
677 }
678
680}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
static uacpi_bool consume(const uacpi_char **string, const uacpi_char *token)
static void write_many(struct fmt_buf_state *fb_state, const uacpi_char *string, uacpi_size count)
static const uacpi_char * find_next_conversion(const uacpi_char *fmt, uacpi_size *offset)
static uacpi_u32 base_from_specifier(uacpi_char specifier)
static uacpi_bool consume_one_of(const uacpi_char **string, const uacpi_char *list, uacpi_char *consumed_char)
static void write_one(struct fmt_buf_state *fb_state, uacpi_char c)
static uacpi_bool parse_number(const uacpi_char **fmt, enum parse_number_mode mode, uacpi_u64 *out_value)
static uacpi_bool is_uppercase_specifier(uacpi_char specifier)
static void write_integer(struct fmt_buf_state *fb_state, struct fmt_spec *fm, uacpi_u64 value)
Referenced by uacpi_log(), and uacpi_snprintf().
◆ write_integer()
Definition at line 299 of file stdlib.c.
302{
309
312
313 if (as_ll < 0) {
316 }
317 }
318
321
325
326 if (fm->
base == 16) {
328 }
else if (fm->
base == 8 || fm->
base == 10) {
330 } else {
331 repr = '?';
332 }
333
334 repr_buffer[--
index] = repr;
335 }
337
338 if (repr_size == 0) {
339 repr_buffer[--
index] =
'0';
340 repr_size = 1;
341 }
342
344 if (fm->
base == 16) {
346 repr_buffer[--
index] =
'0';
347 repr_size += 2;
348 }
else if (fm->
base == 8) {
349 repr_buffer[--
index] =
'0';
350 repr_size += 1;
351 }
352 }
353
357 } else {
360 }
361}
_ACRTIMP double __cdecl remainder(double, double)
static void write_padding(struct fmt_buf_state *fb_state, struct fmt_spec *fm, uacpi_size repr_size)
static uacpi_char hex_char(uacpi_bool upper, uacpi_u64 value)
Referenced by uacpi_vsnprintf().
◆ write_many()
◆ write_one()
◆ write_padding()
Definition at line 282 of file stdlib.c.
285{
287
288 if (mw <= repr_size)
289 return;
290
291 mw -= repr_size;
292
293 while (mw--)
295}
Referenced by write_integer().