Author: jelmer
Date: 2007-11-21 12:31:35 +0000 (Wed, 21 Nov 2007)
New Revision: 26076

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26076

Log:
Remove some SWIG code that is already commonly available.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
   branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i
   branches/SAMBA_4_0/source/scripting/swig/samba.i


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i
===================================================================
--- branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-11-21 12:31:32 UTC 
(rev 26075)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i  2007-11-21 12:31:35 UTC 
(rev 26076)
@@ -39,30 +39,9 @@
 
 %}
 
-%apply bool { bool };
-%apply int { uint8_t };
-%apply int { int8_t };
-%apply unsigned int { uint16_t };
-%apply int { int16_t };
+%import "stdint.i"
+%import "../../lib/talloc/talloc.i"
 
-%typemap(in) uint32_t {
-       if (PyLong_Check($input))
-               $1 = PyLong_AsUnsignedLong($input);
-       else if (PyInt_Check($input))
-               $1 = PyInt_AsLong($input);
-       else {
-               PyErr_SetString(PyExc_TypeError,"Expected a long or an int");
-               return NULL;
-       }
-}
-
-%typemap(out) uint32_t {
-       $result = PyLong_FromUnsignedLong($1);
-}
-
-%apply unsigned long long { uint64_t };
-%apply long long { int64_t };
-
 %typemap(in) NTSTATUS {
         if (PyLong_Check($input))
                 $1 = NT_STATUS(PyLong_AsUnsignedLong($input));
@@ -78,9 +57,6 @@
         $result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
 }
 
-TALLOC_CTX *talloc_init(char *name);
-int talloc_free(TALLOC_CTX *ptr);
-
 /* Function prototypes */
 
 struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
@@ -138,7 +114,3 @@
        return nbt_name_query(nbtsock, mem_ctx, io);
 }
 %}
-
-%init %{
-      lp_load();
-%}

Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i
===================================================================
--- branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i  2007-11-21 12:31:32 UTC 
(rev 26075)
+++ branches/SAMBA_4_0/source/libcli/swig/libcli_smb.i  2007-11-21 12:31:35 UTC 
(rev 26076)
@@ -1,14 +1,13 @@
 %module libcli_smb
 
+%import "../../lib/talloc/talloc.i"
+
 %{
 #include "includes.h"
-#include "lib/talloc/talloc.h"
 #include "lib/events/events.h"
 #include "libcli/raw/libcliraw.h"
 %}
 
-TALLOC_CTX *talloc_init(char *name);
-int talloc_free(TALLOC_CTX *ptr);
 struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
 
 struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,

Modified: branches/SAMBA_4_0/source/scripting/swig/samba.i
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/samba.i    2007-11-21 12:31:32 UTC 
(rev 26075)
+++ branches/SAMBA_4_0/source/scripting/swig/samba.i    2007-11-21 12:31:35 UTC 
(rev 26076)
@@ -23,28 +23,6 @@
    License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
-%apply int { uint8_t };
-%apply int { int8_t };
-%apply unsigned int { uint16_t };
-%apply int { int16_t };
-%apply unsigned long long { uint64_t };
-%apply long long { int64_t };
-
-%typemap(in) uint32_t {
-       if (PyLong_Check($input))
-               $1 = PyLong_AsUnsignedLong($input);
-       else if (PyInt_Check($input))
-               $1 = PyInt_AsLong($input);
-       else {
-               PyErr_SetString(PyExc_TypeError,"Expected a long or an int");
-               return NULL;
-       }
-}
-
-%typemap(out) uint32_t {
-       $result = PyLong_FromUnsignedLong($1);
-}
-
 %typemap(in) NTSTATUS {
        if (PyLong_Check($input))
                $1 = NT_STATUS(PyLong_AsUnsignedLong($input));
@@ -56,13 +34,8 @@
        }
 }
 
-%typemap(out) NTSTATUS {
-        $result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
-}
-
 %typemap(in) struct cli_credentials * {
        $1 = cli_credentials_init(arg1);
-       cli_credentials_set_conf($1);
        if ($input == Py_None) {
                cli_credentials_set_anonymous($1);
        } else {

Reply via email to