2 * This file is part of ltrace.
3 * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc.
4 * Copyright (C) 2010 Joe Damato
5 * Copyright (C) 2009 Juan Cespedes
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28 #include <sys/types.h>
37 #include "ltrace-elf.h"
38 #include "read_config_file.h"
42 extern char * command;
44 extern int exiting; /* =1 if we have to exit ASAP */
46 extern char *PLTs_initialized_by_here;
52 extern Event * next_event(void);
53 extern void handle_event(Event * event);
55 extern pid_t execute_program(const char * command, char ** argv);
58 struct library_symbol;
60 /* Format VALUE into STREAM. The dictionary of all arguments is given
61 * for purposes of evaluating array lengths and other dynamic
62 * expressions. Returns number of characters outputted, -1 in case of
64 int format_argument(FILE *stream, struct value *value,
65 struct value_dict *arguments);
67 /* Set *RET to either a duplicate of STR (if WHETHER), or STR
68 * (otherwise). Return 0 on success or a negative value on failure.
69 * The duplication is not done if STR is NULL. */
70 int strdup_if(const char **ret, const char *str, int whether);