1 /*
2  * vircommandpriv.h: Functions for testing virCommand APIs
3  *
4  * Copyright (C) 2014 Red Hat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library.  If not, see
18  * <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef LIBVIRT_VIRCOMMANDPRIV_H_ALLOW
23 # error "vircommandpriv.h may only be included by vircommand.c or test suites"
24 #endif /* LIBVIRT_VIRCOMMANDPRIV_H_ALLOW */
25 
26 #pragma once
27 
28 #include "vircommand.h"
29 
30 typedef void (*virCommandDryRunCallback)(const char *const*args,
31                                          const char *const*env,
32                                          const char *input,
33                                          char **output,
34                                          char **error,
35                                          int *status,
36                                          void *opaque);
37 
38 typedef struct _virCommandDryRunToken virCommandDryRunToken;
39 
40 virCommandDryRunToken * virCommandDryRunTokenNew(void);
41 void virCommandDryRunTokenFree(virCommandDryRunToken *token);
42 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCommandDryRunToken, virCommandDryRunTokenFree);
43 
44 void virCommandSetDryRun(virCommandDryRunToken *tok,
45                          virBuffer *buf,
46                          bool bufArgLinebreaks,
47                          bool bufCommandStripPath,
48                          virCommandDryRunCallback cb,
49                          void *opaque);
50