chiark / gitweb /
ident.pyx: Remove traces of bogus `failed' and `eof' callbacks.
[mLib-python] / ident.pyx
index d19c3a4599c8a8ae3423294089b736a8628aea65..1c2789e48ceeb9b841da5df3c6cb37205058ac6f 100644 (file)
--- a/ident.pyx
+++ b/ident.pyx
@@ -1,29 +1,27 @@
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Ident client
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Ident client
+###
+### (c) 2005 Straylight/Edgeware
+###
 
-#----- Licensing notice -----------------------------------------------------
-#
-# This file is part of the Python interface to mLib.
-#
-# mLib/Python is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-# 
-# mLib/Python is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with mLib/Python; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the Python interface to mLib.
+###
+### mLib/Python is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### mLib/Python is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with mLib/Python; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 import socket
 
@@ -50,16 +48,13 @@ cdef class SelIdentify:
   cdef _user
   cdef _bad
   cdef _error
-  cdef _failed
   cdef _bogus
-  def __new__(me, sk,
-              userproc = None, bogusproc = None,
-              badproc = None, errorproc = None, failedproc = None,
-              *hunoz, **hukairz):
+  def __cinit__(me, sk, userproc = None, bogusproc = None,
+                badproc = None, errorproc = None, *hunoz, **hukairz):
     cdef sockaddr_in s_in, s_out
-    cdef size_t sz_in, sz_out
+    cdef socklen_t sz_in, sz_out
     cdef int fd
-    if PyObject_TypeCheck(sk, socket.SocketType):
+    if typecheck(sk, socket.SocketType):
       fd = sk.fileno()
       sz_in = PSIZEOF(&s_in)
       sz_out = PSIZEOF(&s_out)
@@ -80,7 +75,6 @@ cdef class SelIdentify:
     me._user = _checkcallable(userproc, 'user proc')
     me._bad = _checkcallable(badproc, 'bad proc')
     me._error = _checkcallable(errorproc, 'error proc')
-    me._failed = _checkcallable(failedproc, 'failed proc')
     me._bogus = _checkcallable(bogusproc, 'bogus proc')
   def __dealloc__(me):
     if me._activep:
@@ -95,13 +89,6 @@ cdef class SelIdentify:
       me._user = _checkcallable(proc, 'user proc')
     def __del__(me):
       me._user = None
-  property eofproc:
-    def __get__(me):
-      return me._eof
-    def __set__(me, proc):
-      me._eof = _checkcallable(proc, 'eof proc')
-    def __del__(me):
-      me._eof = None
   property badproc:
     def __get__(me):
       return me._bad
@@ -116,13 +103,6 @@ cdef class SelIdentify:
       me._error = _checkcallable(proc, 'error proc')
     def __del__(me):
       me._error = None
-  property failedproc:
-    def __get__(me):
-      return me._failed
-    def __set__(me, proc):
-      me._failed = _checkcallable(proc, 'failed proc')
-    def __del__(me):
-      me._failed = None
   property bogusproc:
     def __get__(me):
       return me._bogus
@@ -150,10 +130,6 @@ cdef class SelIdentify:
     if me._error is not None:
       return me._error(error)
     return me.bogus()
-  def failed(me, errno, strerror):
-    if me._failed is not None:
-      return me._failed(errno, strerror)
-    return me.bogus()
   def bogus(me):
     return _maybecall(me._bogus, ())
 
@@ -168,4 +144,4 @@ cdef void _identfunc(ident_reply *i, void *arg):
   elif i.type == IDENT_USERID:
     id.user(i.u.userid.os, i.u.userid.user)
 
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------