MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / fdt_get_string_offset

Function fdt_get_string_offset

tinyemu/riscv_machine.c:416–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416static int fdt_get_string_offset(FDTState *s, const char *name)
417{
418 int pos, new_size, name_size, new_len;
419
420 pos = 0;
421 while (pos < s->string_table_len) {
422 if (!strcmp(s->string_table + pos, name))
423 return pos;
424 pos += strlen(s->string_table + pos) + 1;
425 }
426 /* add a new string */
427 name_size = strlen(name) + 1;
428 new_len = s->string_table_len + name_size;
429 if (new_len > s->string_table_size) {
430 new_size = max_int(new_len, s->string_table_size * 3 / 2);
431 s->string_table = realloc(s->string_table, new_size);
432 s->string_table_size = new_size;
433 }
434 pos = s->string_table_len;
435 memcpy(s->string_table + pos, name, name_size);
436 s->string_table_len = new_len;
437 return pos;
438}
439
440static void fdt_prop(FDTState *s, const char *prop_name,
441 const void *data, int data_len)

Callers 2

fdt_propFunction · 0.85
fdt_prop_tab_u32Function · 0.85

Calls 1

max_intFunction · 0.85

Tested by

no test coverage detected