chiark / gitweb /
Announce 1.0.2.
[mLib-python] / defs.pxi
index f452b28ad44e6457b28b5d30d016b9f194d277fe..2dd50b7eac43d3a9a1a58387bc46309d77ca9453 100644 (file)
--- a/defs.pxi
+++ b/defs.pxi
 # 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.
@@ -250,7 +250,7 @@ cdef extern from 'mLib/lbuf.h':
   void lbuf_enable(lbuf *b)
   void lbuf_disable(lbuf *b)
   void lbuf_init(lbuf *b,
-                 void (*func)(char *s, size_t len, void *arg), void *arg)
+                void (*func)(char *s, size_t len, void *arg), void *arg)
   void lbuf_destroy(lbuf *b)
 
 #----- Packet buffer --------------------------------------------------------
@@ -266,9 +266,9 @@ cdef extern from 'mLib/pkbuf.h':
   size_t pkbuf_free(pkbuf *pk, unsigned char **p)
   void pkbuf_want(pkbuf *pk, size_t sz)
   void pkbuf_init(pkbuf *b,
-                  void (*func)(unsigned char *s, size_t len,
-                               pkbuf *pk, size_t *keep, void *arg),
-                  void *arg)
+                 void (*func)(unsigned char *s, size_t len,
+                              pkbuf *pk, size_t *keep, void *arg),
+                 void *arg)
   void pkbuf_destroy(pkbuf *b)
 
 #----- Select stuff ---------------------------------------------------------
@@ -288,14 +288,14 @@ cdef extern from 'mLib/sel.h':
     _SEL_EXC "SEL_EXC"
   void sel_init(sel_state *s)
   void sel_initfile(sel_state *s, sel_file *f, int fd, unsigned mode,
-                    void (*func)(int fd, unsigned mode, void *arg),
-                    void *arg)
+                   void (*func)(int fd, unsigned mode, void *arg),
+                   void *arg)
   void sel_force(sel_file *f)
   void sel_addfile(sel_file *f)
   void sel_rmfile(sel_file *f)
   void sel_addtimer(sel_state *s, sel_timer *t, timeval *tv,
-                    void (*func)(timeval *tv, void *arg),
-                    void *arg)
+                   void (*func)(timeval *tv, void *arg),
+                   void *arg)
   void sel_rmtimer(sel_timer *t)
   int sel_select(sel_state *s) except *
 
@@ -305,7 +305,7 @@ cdef extern from 'mLib/conn.h':
   ctypedef struct conn:
     pass
   int conn_fd(conn *c, sel_state *s, int fd,
-              void (*func)(int fd, void *arg), void *arg)
+             void (*func)(int fd, void *arg), void *arg)
   void conn_kill(conn *c)
 
 # --- Background name resolver ---
@@ -314,9 +314,9 @@ cdef extern from 'mLib/bres.h':
   ctypedef struct bres_client:
     pass
   void bres_byname(bres_client *r, char *name,
-                   void (*func)(hostent *h, void *arg), void *arg)
+                  void (*func)(hostent *h, void *arg), void *arg)
   void bres_byaddr(bres_client *r, in_addr addr,
-                   void (*func)(hostent *h, void *arg), void *arg)
+                  void (*func)(hostent *h, void *arg), void *arg)
   void bres_abort(bres_client *r)
   void bres_exec(char *null)
   void bres_init(sel_state *s)
@@ -340,7 +340,7 @@ cdef extern from 'mLib/selbuf.h':
   void selbuf_disable(selbuf *b)
   void selbuf_setsize(selbuf *b, size_t sz)
   void selbuf_init(selbuf *b, sel_state *s, int fd,
-                   void (*func)(char *s, size_t len, void *arg), void *arg)
+                  void (*func)(char *s, size_t len, void *arg), void *arg)
   void selbuf_destroy(selbuf *b)
 
 # --- Packet buffer ---
@@ -353,9 +353,9 @@ cdef extern from 'mLib/selpk.h':
   void selpk_disable(selpk *b)
   void selpk_want(selpk *b, size_t sz)
   void selpk_init(selpk *b, sel_state *s, int fd,
-                  void (*func)(unsigned char *p, size_t n,
-                               pkbuf *pk, size_t *keep, void *arg),
-                  void *arg)
+                 void (*func)(unsigned char *p, size_t n,
+                              pkbuf *pk, size_t *keep, void *arg),
+                 void *arg)
   void selpk_destroy(selpk *b)
 
 # --- Ident client ---
@@ -379,9 +379,9 @@ cdef extern from 'mLib/ident.h':
     int type
     ident_u u
   void ident(ident_request *rq, sel_state *s,
-             sockaddr_in *local, sockaddr_in *remote,
-             void (*func)(ident_reply *r, void *arg),
-             void *arg)
+            sockaddr_in *local, sockaddr_in *remote,
+            void (*func)(ident_reply *r, void *arg),
+            void *arg)
   void ident_abort(ident_request *rq)
 
 #----- Error reporting ------------------------------------------------------
@@ -407,13 +407,19 @@ cdef extern from 'mLib/fwatch.h':
 
 cdef extern from 'mLib/fdflags.h':
   int _fdflags "fdflags"(int fd,
-                         unsigned fbic, unsigned fxor,
-                         unsigned fdbic, unsigned fdxor)
+                        unsigned fbic, unsigned fxor,
+                        unsigned fdbic, unsigned fdxor)
 
 cdef extern from 'mLib/fdpass.h':
   int fdpass_send(int sock, int fd, void *p, size_t sz)
   int fdpass_recv(int sock, int *fd, void *p, size_t sz)
 
+cdef extern from 'mLib/mdup.h':
+  ctypedef struct mdup_fd:
+    int cur
+    int want
+  int _mdup "mdup"(mdup_fd *v, size_t n)
+
 #----- Daemon utilities -----------------------------------------------------
 
 cdef extern from 'mLib/daemonize.h':