Lines Matching refs:len
36 while ((d.len + xlen) > newsize) in data_grow_for()
44 struct data data_copy_mem(const char *mem, int len) in data_copy_mem() argument
48 d = data_grow_for(empty_data, len); in data_copy_mem()
50 d.len = len; in data_copy_mem()
51 memcpy(d.val, mem, len); in data_copy_mem()
56 struct data data_copy_escape_string(const char *s, int len) in data_copy_escape_string() argument
63 d = data_grow_for(d, len + 1); in data_copy_escape_string()
66 while (i < len) { in data_copy_escape_string()
72 q[d.len++] = c; in data_copy_escape_string()
75 q[d.len++] = '\0'; in data_copy_escape_string()
84 while (!feof(f) && (d.len < maxlen)) { in data_copy_file()
90 chunksize = maxlen - d.len; in data_copy_file()
93 ret = fread(d.val + d.len, 1, chunksize, f); in data_copy_file()
98 if (d.len + ret < d.len) in data_copy_file()
101 d.len += ret; in data_copy_file()
107 struct data data_append_data(struct data d, const void *p, int len) in data_append_data() argument
109 d = data_grow_for(d, len); in data_append_data()
110 memcpy(d.val + d.len, p, len); in data_append_data()
111 d.len += len; in data_append_data()
116 const void *p, int len) in data_insert_at_marker() argument
118 d = data_grow_for(d, len); in data_insert_at_marker()
119 memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset); in data_insert_at_marker()
120 memcpy(d.val + m->offset, p, len); in data_insert_at_marker()
121 d.len += len; in data_insert_at_marker()
126 m->offset += len; in data_insert_at_marker()
146 d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2); in data_merge()
150 m2->offset += d1.len; in data_merge()
212 struct data data_append_zeroes(struct data d, int len) in data_append_zeroes() argument
214 d = data_grow_for(d, len); in data_append_zeroes()
216 memset(d.val + d.len, 0, len); in data_append_zeroes()
217 d.len += len; in data_append_zeroes()
223 int newlen = ALIGN(d.len, align); in data_append_align()
224 return data_append_zeroes(d, newlen - d.len); in data_append_align()
232 m->offset = d.len; in data_add_marker()
243 int len = d.len; in data_is_one_string() local
245 if (len == 0) in data_is_one_string()
248 for (i = 0; i < len-1; i++) in data_is_one_string()
252 if (d.val[len-1] != '\0') in data_is_one_string()