Lines Matching defs:bytes
60 #define GET_CHILD_MAX_COUNT(node) (short)((int)(node)->bytes / sizeof(cfg_node))
64 #define GET_NODE_COUNT(bytes) (bytes / sizeof(cfg_node))
81 short bytes;
102 const char* value, short bytes, short type);
105 static short find_next_node(const cfg_node* p, short start, char* name, int* bytes);
118 bdld("%s, p->name:%s, child/value:%p, bytes:%d",
119 title, p->name, p->child, p->bytes);
186 int btif_config_get(const char* section, const char* key, const char* name, char* value, int* bytes, int* type)
189 bdla(section && *section && key && *key && name && *name && bytes && type);
190 bdld("section:%s, key:%s, name:%s, value:%p, bytes:%d, type:%d",
191 section, key, name, value, *bytes, *type);
192 if(section && *section && key && *key && name && *name && bytes && type)
199 if(*type == node->type && value && *bytes >= node->used)
206 *bytes = node->used;
212 if(value && *bytes < node->used)
213 bdle("value:%s, not enough size: %d bytes, need %d bytes",
214 name, node->used, *bytes);
221 int btif_config_set(const char* section, const char* key, const char* name, const char* value, int bytes, int type)
225 bdla(bytes < MAX_NODE_BYTES);
226 if(section && *section && key && *key && name && *name && bytes < MAX_NODE_BYTES)
229 ret = set_node(section, key, name, value, (short)bytes, (short)type);
274 short btif_config_next_key(short pos, const char* section, char * name, int* bytes)
282 next = find_next_node(section_node, pos, name, bytes);
287 short btif_config_next_value(short pos, const char* section, const char* key, char* name, int* bytes)
299 next = find_next_node(key_node, pos, name, bytes);
358 int new_bytes = p->bytes + grow;
364 short old_bytes = p->bytes;
367 p->bytes = old_bytes + grow;
371 else bdle("realloc failed, old_bytes:%d, grow:%d, total:%d", p->bytes, grow, p->bytes + grow);
389 p->used = p->bytes = p->flag = p->type = 0;
443 const char* value, short bytes, short type)
455 if(value_node->bytes < bytes)
459 value_node->value = (char*)malloc(bytes);
461 value_node->bytes = bytes;
465 value_node->bytes = 0;
469 if(value_node->value && value != NULL && bytes > 0)
470 memcpy(value_node->value, value, bytes);
472 value_node->used = bytes;
506 bytes)
521 if(name && bytes && *bytes >= name_bytes)
526 *bytes = name_bytes;
528 else if(bytes)
530 *bytes = name_bytes;