2 * This file is part of ltrace.
3 * Copyright (C) 2011,2012 Petr Machata, Red Hat Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 /* Value dictionary is used to store actual function arguments. It
28 * supports both numbered and named arguments. */
35 /* Initialize DICT. */
36 void val_dict_init(struct value_dict *dict);
38 /* Clone SOURCE into TARGET. Return 0 on success or a negative value
40 int val_dict_clone(struct value_dict *target, struct value_dict *source);
42 /* Push next numbered value, VAL. The value is copied over and the
43 * dictionary becomes its owner, and is responsible for destroying it
44 * later. Returns 0 on success and a negative value on failure. */
45 int val_dict_push_next(struct value_dict *dict, struct value *val);
47 /* Return count of numbered arguments. */
48 size_t val_dict_count(struct value_dict *dict);
50 /* Push value VAL named NAME. See notes at val_dict_push_next about
51 * value ownership. The name is owned and freed if OWN_NAME is
53 int val_dict_push_named(struct value_dict *dict, struct value *val,
54 const char *name, int own_name);
56 /* Get NUM-th numbered argument, or NULL if there's not that much
58 struct value *val_dict_get_num(struct value_dict *dict, size_t num);
60 /* Get argument named NAME, or NULL if there's no such argument. */
61 struct value *val_dict_get_name(struct value_dict *dict, const char *name);
63 /* Destroy the dictionary and all the values in it. Note that DICT
64 * itself (the pointer) is not freed. */
65 void val_dict_destroy(struct value_dict *dict);