diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-26 12:16:35 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-26 19:17:40 +0000 |
commit | 788de8d55891cd023f1eb7d588aa9b90bd88d211 (patch) | |
tree | f33c3141e3215ca26a52b77d3689fcdf495779f8 /tools | |
parent | d720fe8f77fb7a5a1d1aed10f60f33284029d481 (diff) |
Update to current version from Samba Git repository.
Changes from Samba Git log:
commit d29c143fae4b67c9680a0b9773db3461f2d0d2b7
Author: Stefan Metzmacher <metze@samba.org>
Date: Thu Mar 27 14:56:23 2014 +0100
pidl:Samba4/Python: add interface.abstract_syntax() to each interface
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I9f4650c603ea8b2eff05e7b79d7f44452e1337ab
Reviewed-on: https://code.wireshark.org/review/4315
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/Python.pm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm b/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm index 39884ab278..d603176391 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -768,6 +768,45 @@ sub Interface($$$) my $dcerpc_typename = $self->import_type_variable("samba.dcerpc.base", "ClientConnection"); $self->register_module_prereadycode(["$if_typename.tp_base = $dcerpc_typename;", ""]); $self->register_module_postreadycode(["if (!PyInterface_AddNdrRpcMethods(&$if_typename, py_ndr_$interface->{NAME}\_methods))", "\treturn;", ""]); + + + $self->pidl("static PyObject *syntax_$interface->{NAME}_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)"); + $self->pidl("{"); + $self->indent; + $self->pidl("return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_$interface->{NAME}.syntax_id);"); + $self->deindent; + $self->pidl("}"); + + $self->pidl(""); + + my $signature = "\"abstract_syntax()\\n\""; + + my $docstring = $self->DocString($interface, $interface->{NAME}."_syntax"); + + if ($docstring) { + $docstring = "$signature$docstring"; + } else { + $docstring = $signature; + } + + my $syntax_typename = "$interface->{NAME}_SyntaxType"; + + $self->pidl("static PyTypeObject $syntax_typename = {"); + $self->indent; + $self->pidl("PyObject_HEAD_INIT(NULL) 0,"); + $self->pidl(".tp_name = \"$basename.$interface->{NAME}\","); + $self->pidl(".tp_basicsize = sizeof(pytalloc_Object),"); + $self->pidl(".tp_doc = $docstring,"); + $self->pidl(".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,"); + $self->pidl(".tp_new = syntax_$interface->{NAME}_new,"); + $self->deindent; + $self->pidl("};"); + + $self->pidl(""); + + $self->register_module_typeobject("abstract_syntax", "&$syntax_typename"); + my $ndr_typename = $self->import_type_variable("samba.dcerpc.misc", "ndr_syntax_id"); + $self->register_module_prereadycode(["$syntax_typename.tp_base = $ndr_typename;", ""]); } $self->pidl_hdr("\n"); |