Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 51) sorted by relevance

123

/scripts/dtc/
Ddata.c51 while ((d.len + xlen) > newsize) in data_grow_for()
59 struct data data_copy_mem(const char *mem, int len) in data_copy_mem() argument
63 d = data_grow_for(empty_data, len); in data_copy_mem()
65 d.len = len; in data_copy_mem()
66 memcpy(d.val, mem, len); in data_copy_mem()
71 struct data data_copy_escape_string(const char *s, int len) in data_copy_escape_string() argument
80 while (i < len) { in data_copy_escape_string()
86 q[d.len++] = c; in data_copy_escape_string()
89 q[d.len++] = '\0'; in data_copy_escape_string()
97 while (!feof(f) && (d.len < maxlen)) { in data_copy_file()
[all …]
Dutil.h36 static inline void *xmalloc(size_t len) in xmalloc() argument
38 void *new = malloc(len); in xmalloc()
46 static inline void *xrealloc(void *p, size_t len) in xrealloc() argument
48 void *new = realloc(p, len); in xrealloc()
51 die("realloc() failed (len=%d)\n", len); in xrealloc()
66 int util_is_printable_string(const void *data, int len);
Dfdtput.c76 int len; /* length of this cell/string/byte */ in encode_value() local
89 for (; arg_count > 0; arg++, arg_count--, upto += len) { in encode_value()
92 len = strlen(*arg) + 1; in encode_value()
94 len = disp->size == -1 ? 4 : disp->size; in encode_value()
97 if (upto + len > value_size) { in encode_value()
98 value_size = (upto + len) + 500; in encode_value()
109 memcpy(ptr, *arg, len); in encode_value()
115 if (len == 4) in encode_value()
135 const char *property, const char *buf, int len) in store_key_value() argument
146 err = fdt_setprop(blob, node, property, buf, len); in store_key_value()
[all …]
Dutil.c40 int len = strlen(s) + 1; in xstrdup() local
41 char *dup = xmalloc(len); in xstrdup()
43 memcpy(dup, s, len); in xstrdup()
52 int len; in join_path() local
56 len = lenp + lenn + 2; in join_path()
59 len--; in join_path()
62 str = xmalloc(len); in join_path()
72 int util_is_printable_string(const void *data, int len) in util_is_printable_string() argument
78 if (len == 0) in util_is_printable_string()
82 if (s[len - 1] != '\0') in util_is_printable_string()
[all …]
Dflattree.c67 static void bin_emit_string(void *e, char *str, int len) in bin_emit_string() argument
71 if (len == 0) in bin_emit_string()
72 len = strlen(str); in bin_emit_string()
74 *dtbuf = data_append_data(*dtbuf, str, len); in bin_emit_string()
89 *dtbuf = data_append_data(*dtbuf, d.val, d.len); in bin_emit_data()
147 static void asm_emit_string(void *e, char *str, int len) in asm_emit_string() argument
152 if (len != 0) { in asm_emit_string()
154 c = str[len]; in asm_emit_string()
155 str[len] = '\0'; in asm_emit_string()
160 if (len != 0) { in asm_emit_string()
[all …]
Dfdtget.c67 static int show_data(struct display_info *disp, const char *data, int len) in show_data() argument
77 if (len == 0) in show_data()
81 (!disp->type && util_is_printable_string(data, len)); in show_data()
83 if (data[len - 1] != '\0') { in show_data()
87 for (s = data; s - data < len; s += strlen(s) + 1) { in show_data()
96 size = (len % 4) == 0 ? 4 : 1; in show_data()
97 } else if (len % size) { in show_data()
105 for (i = 0; i < len; i += size, p += size) { in show_data()
210 int len, err = 0; in show_data_for_item() local
223 value = fdt_getprop(blob, node, property, &len); in show_data_for_item()
[all …]
Dtreesource.c70 assert(str[val.len-1] == '\0'); in write_propval_string()
79 for (i = 0; i < (val.len-1); i++) { in write_propval_string()
132 assert (m->offset == val.len); in write_propval_string()
139 void *propend = val.val + val.len; in write_propval_cells()
161 assert (m->offset == val.len); in write_propval_cells()
169 void *propend = val.val + val.len; in write_propval_bytes()
189 assert (m->offset == val.len); in write_propval_bytes()
197 int len = prop->val.len; in write_propval() local
204 if (len == 0) { in write_propval()
209 for (i = 0; i < len; i++) { in write_propval()
[all …]
Dfdtdump.c20 static void print_data(const char *data, int len) in print_data() argument
26 if (len == 0) in print_data()
29 if (util_is_printable_string(data, len)) { in print_data()
31 } else if ((len % 4) == 0) { in print_data()
33 for (i = 0; i < len; i += 4) in print_data()
35 i < (len - 4) ? " " : ""); in print_data()
39 for (i = 0; i < len; i++) in print_data()
40 printf("%02x%s", *p++, i < len - 1 ? " " : ""); in print_data()
Ddtc.h86 int len; member
104 struct data data_copy_mem(const char *mem, int len);
105 struct data data_copy_escape_string(const char *s, int len);
106 struct data data_copy_file(FILE *f, size_t len);
108 struct data data_append_data(struct data d, const void *p, int len);
110 const void *p, int len);
117 struct data data_append_zeroes(struct data d, int len);
232 struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len);
Dsrcpos.c42 int len = slash - path; in dirname() local
43 char *dir = xmalloc(len + 1); in dirname()
45 memcpy(dir, path, len); in dirname()
46 dir[len] = '\0'; in dirname()
214 void srcpos_update(struct srcpos *pos, const char *text, int len) in srcpos_update() argument
223 for (i = 0; i < len; i++) in srcpos_update()
/scripts/dtc/libfdt/
Dfdt_ro.c59 const char *s, int len) in _fdt_nodename_eq() argument
61 const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); in _fdt_nodename_eq()
67 if (memcmp(p, s, len) != 0) in _fdt_nodename_eq()
70 if (p[len] == '\0') in _fdt_nodename_eq()
72 else if (!memchr(s, '@', len) && (p[len] == '@')) in _fdt_nodename_eq()
84 const char *s, int len) in _fdt_string_eq() argument
88 return (strlen(p) == len) && (memcmp(p, s, len) == 0); in _fdt_string_eq()
201 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len) in fdt_get_name() argument
210 if (len) in fdt_get_name()
211 *len = strlen(nh->name); in fdt_get_name()
[all …]
Dfdt_wip.c59 const void *val, int len) in fdt_setprop_inplace() argument
68 if (proplen != len) in fdt_setprop_inplace()
71 memcpy(propval, val, len); in fdt_setprop_inplace()
75 static void _fdt_nop_region(void *start, int len) in _fdt_nop_region() argument
79 for (p = start; (char *)p < ((char *)start + len); p++) in _fdt_nop_region()
86 int len; in fdt_nop_property() local
88 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property()
90 return len; in fdt_nop_property()
92 _fdt_nop_region(prop, len + sizeof(*prop)); in fdt_nop_property()
Dfdt_rw.c155 int len = strlen(s) + 1; in _fdt_find_add_string() local
164 err = _fdt_splice_string(fdt, len); in _fdt_find_add_string()
168 memcpy(new, s, len); in _fdt_find_add_string()
206 int len, struct fdt_property **prop) in _fdt_resize_property() argument
216 FDT_TAGALIGN(len)))) in _fdt_resize_property()
219 (*prop)->len = cpu_to_fdt32(len); in _fdt_resize_property()
224 int len, struct fdt_property **prop) in _fdt_add_property() argument
239 proplen = sizeof(**prop) + FDT_TAGALIGN(len); in _fdt_add_property()
247 (*prop)->len = cpu_to_fdt32(len); in _fdt_add_property()
275 const void *val, int len) in fdt_setprop() argument
[all …]
Dfdt_sw.c73 static void *_fdt_grab_space(void *fdt, size_t len) in _fdt_grab_space() argument
81 if ((offset + len < offset) || (offset + len > spaceleft)) in _fdt_grab_space()
84 fdt_set_size_dt_struct(fdt, offset + len); in _fdt_grab_space()
173 int len = strlen(s) + 1; in _fdt_find_add_string() local
181 offset = -strtabsize - len; in _fdt_find_add_string()
186 memcpy(strtab + offset, s, len); in _fdt_find_add_string()
187 fdt_set_size_dt_strings(fdt, strtabsize + len); in _fdt_find_add_string()
191 int fdt_property(void *fdt, const char *name, const void *val, int len) in fdt_property() argument
202 prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len)); in fdt_property()
208 prop->len = cpu_to_fdt32(len); in fdt_property()
[all …]
Dfdt.c77 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
82 if (((offset + len) < offset) in fdt_offset_ptr()
83 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
88 if (p + len < p) in fdt_offset_ptr()
203 int len = strlen(s) + 1; in _fdt_find_string() local
204 const char *last = strtab + tabsize - len; in _fdt_find_string()
208 if (memcmp(p, s, len) == 0) in _fdt_find_string()
/scripts/mod/
Dsumversion.c170 const unsigned char *data, unsigned int len) in md4_update() argument
174 mctx->byte_count += len; in md4_update()
176 if (avail > len) { in md4_update()
178 data, len); in md4_update()
187 len -= avail; in md4_update()
189 while (len >= sizeof(mctx->block)) { in md4_update()
193 len -= sizeof(mctx->block); in md4_update()
196 memcpy(mctx->block, data, len); in md4_update()
199 static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len) in md4_final_ascii() argument
221 snprintf(out, len, "%08X%08X%08X%08X", in md4_final_ascii()
[all …]
/scripts/
Dkallsyms.c34 unsigned int len; member
147 s->len = strlen(str) + 1; in read_symbol()
148 s->sym = malloc(s->len + 1); in read_symbol()
263 static int expand_symbol(unsigned char *data, int len, char *result) in expand_symbol() argument
267 while (len) { in expand_symbol()
281 len--; in expand_symbol()
347 printf("\t.byte 0x%02x", table[i].len); in write_src()
348 for (k = 0; k < table[i].len; k++) in write_src()
352 off += table[i].len + 1; in write_src()
383 static void learn_symbol(unsigned char *symbol, int len) in learn_symbol() argument
[all …]
Dsign-file50 my $len;
56 $len = read(FD, $contents, $st[7]) || die $file;
58 die "$file: Wanted length ", $st[7], ", got ", $len, "\n"
59 if ($len != $st[7]);
129 my ($tag, $len) = unpack("CC", substr(${$cursor->[2]}, $cursor->[0], 2));
144 if ($len == 0x80);
146 if ($len > 0x80) {
147 my $l = $len - 0x80;
152 $len = unpack("C", substr(${$cursor->[2]}, $cursor->[0], 1));
154 $len = unpack("n", substr(${$cursor->[2]}, $cursor->[0], 2));
[all …]
/scripts/kconfig/lxdialog/
Dinputbox.c49 int show_x, len, pos; in dialog_inputbox() local
101 len = strlen(instr); in dialog_inputbox()
102 pos = len; in dialog_inputbox()
104 if (len >= box_width) { in dialog_inputbox()
105 show_x = len - box_width + 1; in dialog_inputbox()
111 input_x = len; in dialog_inputbox()
137 if (pos < len) { in dialog_inputbox()
138 for (i = pos - 1; i < len; i++) { in dialog_inputbox()
144 len--; in dialog_inputbox()
145 instr[len] = '\0'; in dialog_inputbox()
[all …]
/scripts/basic/
Dfixdep.c143 unsigned int len; member
164 static int is_defined_config(const char *name, int len, unsigned int hash) in is_defined_config() argument
169 if (aux->hash == hash && aux->len == len && in is_defined_config()
170 memcmp(aux->name, name, len) == 0) in is_defined_config()
179 static void define_config(const char *name, int len, unsigned int hash) in define_config() argument
181 struct item *aux = malloc(sizeof(*aux) + len); in define_config()
187 memcpy(aux->name, name, len); in define_config()
188 aux->len = len; in define_config()
236 static void parse_config_file(const char *map, size_t len) in parse_config_file() argument
238 const int *end = (const int *) (map + len); in parse_config_file()
[all …]
/scripts/kconfig/
Dnconf.gui.c226 int len = get_line_length(line); in fill_window() local
227 strncpy(tmp, line, min(len, x)); in fill_window()
228 tmp[len] = '\0'; in fill_window()
272 int len = get_line_length(line); in btn_dialog() local
273 if (msg_width < len) in btn_dialog()
274 msg_width = len; in btn_dialog()
382 int len = get_line_length(line); in dialog_inputbox() local
383 prompt_width = max(prompt_width, len); in dialog_inputbox()
427 int len = strlen(result); in dialog_inputbox() local
440 len-cursor_position+1); in dialog_inputbox()
[all …]
Dkxgettext.c12 static char *escape(const char* text, char *bf, int len) in escape() argument
23 --len; in escape()
29 len -= 3; in escape()
32 while (*text != '\0' && len > 1) { in escape()
41 len -= 5; in escape()
47 len--; in escape()
51 --len; in escape()
Dutil.c85 gs.len = 64; in str_new()
96 gs.len = strlen(s) + 1; in str_assign()
107 gs->len = 0; in str_free()
116 if (l > gs->len) { in str_append()
118 gs->len = l; in str_append()
Dzconf.hash.c_shipped34 static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
45 kconf_id_hash (register const char *str, register unsigned int len)
76 register int hval = len;
88 return hval + asso_values[(unsigned char)str[len - 1]];
169 kconf_id_lookup (register const char *str, register unsigned int len)
267 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
269 register int key = kconf_id_hash (str, len);
278 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
/scripts/genksyms/
Dkeywords.hash.c_shipped34 static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
47 is_reserved_hash (register const char *str, register unsigned int len)
78 …return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values…
88 is_reserved_word (register const char *str, register unsigned int len)
207 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
209 register int key = is_reserved_hash (str, len);

123