Lines Matching defs:map

198 /* Maps descriptor type -> upb map size.  */
534 upb_map *map = *map_p;
538 if (!map) {
539 /* Lazily create map. */
547 map = _upb_map_new(d->arena, key_size, val_size);
548 *map_p = map;
551 /* Parse map entry. */
562 /* Insert into map. */
563 _upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, d->arena);
1066 const upb_map *map = *(const upb_map**)field_mem;
1071 if (map == NULL) {
1075 upb_strtable_begin(&i, &map->table);
1082 map->key_size == UPB_MAPTYPE_STRING ? (void *)&key : key.data;
1084 map->val_size == UPB_MAPTYPE_STRING ? upb_value_getptr(val) : &val;
1346 upb_map *map = upb_arena_malloc(a, sizeof(upb_map));
1348 if (!map) {
1352 upb_strtable_init2(&map->table, UPB_CTYPE_INT32, upb_arena_alloc(a));
1353 map->key_size = key_size;
1354 map->val_size = value_size;
1356 return map;
3037 /* Is this a map-entry message? */
5253 ret.map = upb_map_new(a, upb_fielddef_type(key), upb_fielddef_type(value));
5303 /* Continue on empty array or map. */
5369 size_t upb_map_size(const upb_map *map) {
5370 return _upb_map_size(map);
5373 bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val) {
5374 return _upb_map_get(map, &key, map->key_size, val, map->val_size);
5377 bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
5379 return _upb_map_set(map, &key, map->key_size, &val, map->val_size, arena);
5382 bool upb_map_delete(upb_map *map, upb_msgval key) {
5383 return _upb_map_delete(map, &key, map->key_size);
5386 bool upb_mapiter_next(const upb_map *map, size_t *iter) {
5387 return _upb_map_next(map, iter);
5390 /* Returns the key and value for this entry of the map. */
5391 upb_msgval upb_mapiter_key(const upb_map *map, size_t iter) {
5394 i.t = &map->table;
5396 _upb_map_fromkey(upb_strtable_iter_key(&i), &ret, map->key_size);
5400 upb_msgval upb_mapiter_value(const upb_map *map, size_t iter) {
5403 i.t = &map->table;
5405 _upb_map_fromvalue(upb_strtable_iter_value(&i), &ret, map->val_size);
5409 /* void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value); */
9155 /* We are in a map-entry message context. This flag is set when parsing the
9156 * value field of a single map entry and indicates to all value-field parsers
9157 * (subobjects, strings, numbers, and bools) that the map-entry submessage
9162 * message's map field that we're currently parsing. This differs from |f|
9163 * because |f| is the field in the *current* message (i.e., the map-entry
9164 * message itself), not the parent's field that leads to this map. */
10854 upb_status_seterrmsg(p->status, "Invalid field type for map key");
10861 /* Helper: emit one map entry (as a submessage in the map field sequence). This
10862 * is invoked from end_membername(), at the end of the map entry's key string,
10863 * with the map key in the accumulate buffer. It parses the key from that
10876 * for the mapentry itself, and then set |f| in that frame so that the map
10878 * map-entry value is parsed. */
10894 * would have just seen the map-entry value, not key). */
10903 /* Set up the value field to receive the map-entry value. */
10967 /* If we just parsed a map-entry value, end that frame too. */
11011 /* Beginning of a map. Start a new parser frame in a repeated-field
12625 /* Print a map key given a field name. Called by scalar field handlers and by
12685 /* double and float are not allowed to be map keys. */
13020 * in a map).