1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r26658: pidl: Register Python modules.

(This used to be commit f47044aacc)
This commit is contained in:
Jelmer Vernooij 2008-01-03 21:45:18 -06:00 committed by Stefan Metzmacher
parent 0dbdfc2218
commit 1548d8d2be
3 changed files with 16 additions and 1 deletions

View File

@ -594,3 +594,7 @@ PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC
[PYTHON::swig_dcerpc]
SWIG_FILE = rpc/dcerpc.i
PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
[PYTHON::python_echo]
OBJ_FILES = gen_ndr/py_echo.o
PRIVATE_DEPENDENCIES = NDR_ECHO

View File

@ -54,7 +54,7 @@ sub Parse($$$$)
my($self,$basename,$ndr,$hdr) = @_;
my $py_hdr = $hdr;
$py_hdr =~ s/^/py_/g;
$py_hdr =~ s/ndr_([^\/]+)$/py_$1/g;
$self->pidl_hdr("/* header auto-generated by pidl */\n\n");
@ -66,10 +66,20 @@ sub Parse($$$$)
#include \"$py_hdr\"
");
$self->pidl("static PyMethodDef $basename\_methods[] = {");
$self->indent;
$self->pidl("{ NULL, NULL, 0, NULL }");
$self->deindent;
$self->pidl("};");
$self->pidl("");
$self->pidl("void init$basename(void)");
$self->pidl("{");
$self->indent;
$self->pidl("PyObject *m;");
$self->pidl("m = Py_InitModule((char *)\"$basename\", $basename\_methods);");
# FIXME
$self->deindent;
$self->pidl("}");

View File

@ -34,6 +34,7 @@ extern void init_dcerpc(void);
extern void init_events(void);
extern void inituuid(void);
extern void init_net(void);
extern void initecho(void);
static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };