po: Update German man pages translation
[dpkg.git] / lib / dpkg / command.h
blobb681d6559406464874aca74b3787f2ca8592a9e0
1 /*
2 * libdpkg - Debian packaging suite library routines
3 * command.h - command execution support
5 * Copyright © 2010, 2012, 2015 Guillem Jover <guillem@debian.org>
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU 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, see <https://www.gnu.org/licenses/>.
21 #ifndef LIBDPKG_COMMAND_H
22 #define LIBDPKG_COMMAND_H
24 #include <dpkg/macros.h>
26 #include <stdarg.h>
27 #include <stdbool.h>
29 DPKG_BEGIN_DECLS
31 /**
32 * @defgroup command Command execution
33 * @ingroup dpkg-internal
34 * @{
37 /**
38 * Describe a command to execute.
40 struct command {
41 /** Descriptive name of the command, used when printing. */
42 const char *name;
43 /** Filename to execute; either a path or the progname. */
44 const char *filename;
45 int argc;
46 int argv_size;
47 const char **argv;
50 void command_init(struct command *cmd, const char *filename, const char *name);
51 void command_destroy(struct command *cmd);
53 void command_add_arg(struct command *cmd, const char *arg);
54 void command_add_argl(struct command *cmd, const char **argv);
55 void command_add_argv(struct command *cmd, va_list args);
56 void command_add_args(struct command *cmd, ...) DPKG_ATTR_SENTINEL;
58 void command_exec(struct command *cmd) DPKG_ATTR_NORET;
60 void command_shell(const char *cmd, const char *name) DPKG_ATTR_NORET;
62 bool command_in_path(const char *cmd);
64 /** @} */
66 DPKG_END_DECLS
68 #endif /* LIBDPKG_COMMAND_H */