2 * This file is part of ltrace.
3 * Copyright (C) 2011 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
28 /* Format VALUE into STREAM. The dictionary of all arguments
29 * is given for purposes of evaluating array lengths and other
30 * dynamic expressions. Returns number of characters
31 * outputted, -1 in case of failure. */
32 int (*format_cb)(struct lens *lens, FILE *stream, struct value *value,
33 struct value_dict *arguments);
35 /* Erase any memory allocated for LENS. Keep the LENS pointer
37 void (*destroy_cb)(struct lens *lens);
40 /* Extracts a lens from VALUE and calls lens_format on that. */
41 int format_argument(FILE *stream, struct value *value,
42 struct value_dict *arguments);
44 /* Calls format callback associated with LENS. */
45 int lens_format(struct lens *lens, FILE *stream, struct value *value,
46 struct value_dict *arguments);
48 /* Calls destroy callback associated with LENS. */
49 void lens_destroy(struct lens *lens);