source: vendor/3.5.0/source4/scripting/python/modules.c

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 2.1 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Samba utility functions
4 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
5
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.
10
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.
15
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/>.
18*/
19
20#include "includes.h"
21#include "scripting/python/modules.h"
22#include <Python.h>
23
24extern void init_ldb(void);
25extern void init_security(void);
26extern void init_registry(void);
27extern void init_param(void);
28extern void init_misc(void);
29extern void init_ldb(void);
30extern void init_auth(void);
31extern void init_credentials(void);
32extern void init_tdb(void);
33extern void init_dcerpc(void);
34extern void init_events(void);
35extern void inituuid(void);
36extern void init_net(void);
37extern void initecho(void);
38extern void initdfs(void);
39extern void initdrsuapi(void);
40extern void initwinreg(void);
41extern void initepmapper(void);
42extern void initinitshutdown(void);
43extern void initmgmt(void);
44extern void initnet(void);
45extern void initatsvc(void);
46extern void initsamr(void);
47extern void initlsa(void);
48extern void initsvcctl(void);
49extern void initwkssvc(void);
50extern void initunixinfo(void);
51extern void init_libcli_nbt(void);
52extern void init_libcli_smb(void);
53
54static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };
55
56void py_load_samba_modules(void)
57{
58 int i;
59 for (i = 0; i < ARRAY_SIZE(py_modules); i++) {
60 PyImport_ExtendInittab(&py_modules[i]);
61 }
62}
63
64void py_update_path(const char *bindir)
65{
66 char *newpath;
67 asprintf(&newpath, "%s/python:%s/../scripting/python:%s", bindir, bindir, Py_GetPath());
68 PySys_SetPath(newpath);
69 free(newpath);
70}
Note: See TracBrowser for help on using the repository browser.