2 * Copyright (c) 2020 Andreas Schneider <asn@samba.org>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef _CMDLINE_PRIVATE_H
19 #define _CMDLINE_PRIVATE_H
21 #include "lib/cmdline/cmdline.h"
26 * @brief Initialize the commandline interface for parsing options.
28 * This the common function to initialize the command line interface. This
32 * - logging system sening logs to stdout
33 * - talloc leak reporting
35 * @param[in] mem_ctx The talloc memory context to use for allocating memory.
36 * This should be a long living context till the client
39 * @return true on success, false if an error occured.
41 bool samba_cmdline_init_common(TALLOC_CTX *mem_ctx);
46 * @brief Set the talloc context for the command line interface.
48 * This is stored as a static pointer.
50 * @param[in] mem_ctx The talloc memory context.
52 * @return true on success, false if an error occured.
54 bool samba_cmdline_set_talloc_ctx(TALLOC_CTX *mem_ctx);
59 * @brief Get the talloc context for the cmdline interface.
61 * @return A talloc context.
63 TALLOC_CTX *samba_cmdline_get_talloc_ctx(void);
68 * @brief Set the loadparm context for the command line interface.
70 * @param[in] lp_ctx The loadparm context to use.
72 * @return true on success, false if an error occured.
74 bool samba_cmdline_set_lp_ctx(struct loadparm_context *lp_ctx);
79 * @brief Set the client credentials for the commandline interface.
81 * @param[in] creds The client credentials to use.
83 * @return true on success, false if an error occured.
85 bool samba_cmdline_set_creds(struct cli_credentials *creds);
87 #endif /* _CMDLINE_PRIVATE_H */