2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Guenther Deschner 2007
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #include "lib/netapi/netapi.h"
23 extern bool AllowDebugChange;
25 static bool libnetapi_initialized = false;
27 WERROR libnetapi_init(struct libnetapi_ctx **context)
29 struct libnetapi_ctx *ctx = NULL;
30 TALLOC_CTX *frame = NULL;
32 if (libnetapi_initialized) {
36 frame = talloc_stackframe();
38 ctx = talloc_zero(frame, struct libnetapi_ctx);
45 DEBUGLEVEL_CLASS[DBGC_ALL] = 0;
47 x_setbuf(x_stderr, NULL);
48 AllowDebugChange = false;
52 setup_logging("libnetapi", true);
54 if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) {
56 return WERR_GENERAL_FAILURE;
63 BlockSignals(True, SIGPIPE);
65 libnetapi_initialized = true;
72 WERROR libnetapi_free(struct libnetapi_ctx *ctx)