mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
r26658: pidl: Register Python modules.
This commit is contained in:
parent
f1960ca7c4
commit
f47044aacc
@ -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
|
||||
|
@ -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("}");
|
||||
|
@ -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 };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user