Home | History | Annotate | Download | only in src

Lines Matching defs:bytes

63 #define GET_CHILD_MAX_COUNT(node) (short)((int)(node)->bytes / sizeof(cfg_node))
67 #define GET_NODE_COUNT(bytes) (bytes / sizeof(cfg_node))
84 short bytes;
104 const char* value, short bytes, short type);
107 static short find_next_node(const cfg_node* p, short start, char* name, int* bytes);
119 bdld("%s, p->name:%s, child/value:%p, bytes:%d",
120 title, p->name, p->child, p->bytes);
187 int btif_config_get(const char* section, const char* key, const char* name, char* value, int* bytes, int* type)
190 bdla(section && *section && key && *key && name && *name && bytes && type);
191 bdld("section:%s, key:%s, name:%s, value:%p, bytes:%d, type:%d",
192 section, key, name, value, *bytes, *type);
193 if(section && *section && key && *key && name && *name && bytes && type)
200 if(*type == node->type && value && *bytes >= node->used)
207 *bytes = node->used;
213 if(value && *bytes < node->used)
214 bdle("value:%s, not enough size: %d bytes, need %d bytes",
215 name, node->used, *bytes);
222 int btif_config_set(const char* section, const char* key, const char* name, const char* value, int bytes, int type)
226 bdla(bytes < MAX_NODE_BYTES);
227 if(section && *section && key && *key && name && *name && bytes < MAX_NODE_BYTES)
230 ret = set_node(section, key, name, value, (short)bytes, (short)type);
275 short btif_config_next_key(short pos, const char* section, char * name, int* bytes)
283 next = find_next_node(section_node, pos, name, bytes);
288 short btif_config_next_value(short pos, const char* section, const char* key, char* name, int* bytes)
300 next = find_next_node(key_node, pos, name, bytes);
410 int new_bytes = p->bytes + grow;
416 short old_bytes = p->bytes;
419 p->bytes = old_bytes + grow;
423 else bdle("realloc failed, old_bytes:%d, grow:%d, total:%d", p->bytes, grow, p->bytes + grow);
441 p->used = p->bytes = p->flag = p->type = 0;
495 const char* value, short bytes, short type)
507 if(value_node->bytes < bytes)
511 value_node->value = (char*)malloc(bytes);
513 bytes = bytes;
517 value_node->bytes = 0;
521 if(value_node->value && value != NULL && bytes > 0)
522 memcpy(value_node->value, value, bytes);
524 value_node->used = bytes;
558 static short find_next_node(const cfg_node* p, short start, char* name, int* bytes)
573 if(name && bytes && *bytes >= name_bytes)
578 *bytes = name_bytes;
580 else if(bytes)
582 *bytes = name_bytes;