Remove CVS droppings and fiddle with comments.
/* -*-c-*-
- *
- * $Id$
*
* Double-ended arrays
*
/* -*-c-*-
- *
- * $Id$
*
* Double-ended arrays
*
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Association tables
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Association tables
+###
+### (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.
cdef struct _assoc_entry:
sym_base _b
cdef void *_next(me):
return assoc_next(&me.i)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
/* -*-c-*-
- *
- * $Id$
*
* Atom stuff
*
/* -*-c-*-
- *
- * $Id$
*
* Atom stuff
*
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Atom tables
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Atom tables
+###
+### (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.
cdef class AtomIter:
cdef atom_iter _i
def atoms():
return AtomIter()
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Background name resolution
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Background name resolution
+###
+### (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.
cdef class SelResolve:
cdef bres_client r
bres_exec(NULL)
bres_init(&_sel)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Generic encoder/decoder
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Generic encoder/decoder
+###
+### (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.
-
-#----- External dependencies ------------------------------------------------
+###----- 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.
cdef extern from 'mLib/%PREFIX%.h':
ctypedef struct %PREFIX%_ctx:
d = %CLASS%Decode(*arg, **kw)
return d.decode(text) + d.done()
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Non-blocking connections
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Non-blocking connections
+###
+### (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.
cdef class SelConnect:
cdef conn c
else:
c.connected()
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Cyclic redundancy checker
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Cyclic redundancy checker
+###
+### (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.
cdef class CRC32:
cdef uint32 _a
c = c_crc32(0, p, n)
return _u32(c)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Basic definitions, used all over
-#
-# (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.
-
-#----- C library ------------------------------------------------------------
+### -*-pyrex-*-
+###
+### Basic definitions, used all over
+###
+### (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.
+
+###----- C library ----------------------------------------------------------
cdef extern from 'errno.h':
int errno
char *strerror(int err)
size_t strlen(char *p)
-#----- Unix interface -------------------------------------------------------
+###----- Unix interface -----------------------------------------------------
cdef extern from 'sys/types.h':
pass
char *h_addr
int h_errno
-#----- Python ---------------------------------------------------------------
+###----- Python -------------------------------------------------------------
cdef extern from 'Python.h':
void Py_INCREF(PyObject *obj)
void Py_DECREF(PyObject *obj)
-#----- mLib basic stuff -----------------------------------------------------
+###----- mLib basic stuff ---------------------------------------------------
cdef extern from 'mLib/alloc.h':
char *xstrdup(char *p)
void DCREATE(dstr *d)
void dstr_destroy(dstr *d)
-#----- CRC32 ----------------------------------------------------------------
+###----- CRC32 --------------------------------------------------------------
cdef extern from 'mLib/crc32.h':
uint32 c_crc32 "crc32" (uint32 a, void *p, int sz)
-#----- Universal hashing ----------------------------------------------------
+###----- Universal hashing --------------------------------------------------
cdef extern from 'mLib/unihash.h':
ctypedef struct unihash_info:
uint32 unihash_hash(unihash_info *i, uint32 a, void *p, int sz)
unihash_info unihash_global
-#----- Symbol tables --------------------------------------------------------
+###----- Symbol tables ------------------------------------------------------
cdef extern from 'mLib/sym.h':
ctypedef struct sym_table:
void sym_mkiter(sym_iter *i, sym_table *t)
void *sym_next(sym_iter *i)
-#----- String utilities -----------------------------------------------------
+###----- String utilities ---------------------------------------------------
cdef extern from 'mLib/str.h':
enum:
cdef extern from 'mLib/versioncmp.h':
int _versioncmp "versioncmp"(char *va, char *vb)
-#----- Form-urlencoding functions -------------------------------------------
+###----- Form-urlencoding functions -----------------------------------------
cdef extern from 'mLib/url.h':
struct url_ectx:
void url_initdec(url_dctx *ctx, char *p)
int url_dec(url_dctx *ctx, dstr *n, dstr *v)
-#----- Atom stuff -----------------------------------------------------------
-
-# --- Atoms ---
-#
-# Partly written in `real' C.
+###----- Atom stuff ---------------------------------------------------------
+## Atoms.
+##
+## Partly written in `real' C.
cdef extern from 'atom.h':
ctypedef struct atom:
pass
atom *ATOM_A(obj)
PyTypeObject atom_pytype
-# --- Association tables ---
-
+## Association tables.
cdef extern from 'mLib/assoc.h':
ctypedef struct assoc_table:
pass
void assoc_mkiter(assoc_iter *i, assoc_table *t)
void *assoc_next(assoc_iter *i)
-#----- Double-ended arrays --------------------------------------------------
+###----- Double-ended arrays ------------------------------------------------
cdef extern from 'array.h':
void da_pysetup()
PyTypeObject da_pytype
PyTypeObject daiter_pytype
-#----- Line buffer ----------------------------------------------------------
+###----- Line buffer --------------------------------------------------------
cdef extern from 'mLib/lbuf.h':
cdef struct lbuf:
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 --------------------------------------------------------
+###----- Packet buffer ------------------------------------------------------
cdef extern from 'mLib/pkbuf.h':
ctypedef struct pkbuf:
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 ---------------------------------------------------------
-
-# --- Basics ---
+###----- Select stuff -------------------------------------------------------
+## Basics.
cdef extern from 'mLib/sel.h':
ctypedef struct sel_state:
pass
_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 *
-# --- Non-blocking connection ---
-
+### Non-blocking connection.
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 ---
-
+## Background name resolver.
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)
-# --- In-band signal handling ---
-
+## In-band signal handling.
cdef extern from 'mLib/sig.h':
ctypedef struct sig:
pass
void sig_remove(sig *s)
void sig_init(sel_state *s)
-# --- Line buffer ---
-
+## Line buffer.
cdef extern from 'mLib/selbuf.h':
ctypedef struct selbuf:
sel_file reader
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 ---
-
+## Packet buffer.
cdef extern from 'mLib/selpk.h':
ctypedef struct selpk:
sel_file reader
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 ---
-
+## Ident client.
cdef extern from 'mLib/ident.h':
ctypedef struct ident_request:
pass
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 ------------------------------------------------------
+###----- Error reporting ----------------------------------------------------
cdef extern from 'mLib/quis.h':
void _ego "ego"(char *prog)
cdef extern from 'mLib/report.h':
void _moan "moan"(char *f, char *msg)
-#----- File comparison ------------------------------------------------------
+###----- File comparison ----------------------------------------------------
cdef extern from 'mLib/fwatch.h':
ctypedef struct fwatch:
int fwatch_update(fwatch *f, char *name)
int fwatch_updatefd(fwatch *f, int fd)
-#----- File descriptor hacking ----------------------------------------------
+###----- File descriptor hacking --------------------------------------------
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 want
int _mdup "mdup"(mdup_fd *v, size_t n)
-#----- Daemon utilities -----------------------------------------------------
+###----- Daemon utilities ---------------------------------------------------
cdef extern from 'mLib/daemonize.h':
int _daemonize "daemonize"()
void _detachtty "detachtty"()
-#----- Internal utilities ---------------------------------------------------
+###----- Internal utilities -------------------------------------------------
cdef extern from 'grim.h':
int PSIZEOF(void *x)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Messing with file descriptors
-#
-# (c) 2007 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Messing with file descriptors
+###
+### (c) 2007 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.
def fdflags(file,
unsigned fbic = 0, unsigned fxor = 0,
_PyString_Resize(&obj, len)
return fd, <object>obj
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Watching files for changes
-#
-# (c) 2007 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Watching files for changes
+###
+### (c) 2007 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.
cdef class FWatch:
cdef fwatch fw
rc = fwatch_updatefd(&me.fw, _getfd(me.file))
return rc
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
/* -*-c-*-
- *
- * $Id$
*
* Grim hacks to support the Pyrex code
*
-# -*-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
elif i.type == IDENT_USERID:
id.user(i.u.userid.os, i.u.userid.user)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Line buffering
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Line buffering
+###
+### (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.
LBUF_CRLF = _LBUF_CRLF
LBUF_STRICTCRLF = _LBUF_STRICTCRLF
else:
sb.line(PyString_FromStringAndSize(s, n))
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Main driver for mLib module
-#
-# (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.
-
-#----- External stuff -------------------------------------------------------
+### -*-pyrex-*-
+###
+### Main driver for mLib module
+###
+### (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.
+
+###----- External stuff -----------------------------------------------------
include 'defs.pxi'
-#----- Various facilities ---------------------------------------------------
-
-# --- Internal utilities ---
+###----- Various facilities -------------------------------------------------
+## Internal utilities.
include 'utils.pyx'
-# --- Hashing ---
-
+## Hashing.
include 'crc32.pyx'
include 'unihash.pyx'
-# --- Data structures ---
-
+## Data structures.
include 'mapping.pyx'
include 'sym.pyx'
include 'atom.pyx'
include 'assoc.pyx'
-# --- String utilities ---
-
+## String utilities.
include 'str.pyx'
-# --- Encodings ---
-
+## Encodings.
include 'base64.pyx'
include 'base32.pyx'
include 'hex.pyx'
include 'url.pyx'
-# --- Error reporting ---
-
+## Error reporting.
include 'report.pyx'
-# --- File utilities ---
-
+## File utilities.
include 'fwatch.pyx'
include 'fdutils.pyx'
include 'mdup.pyx'
-# --- Other useful stuff ---
-
+## Other useful stuff.
include 'stuff.pyx'
-# --- Buffering ---
-
+## Buffering.
include 'lbuf.pyx'
include 'pkbuf.pyx'
-# --- Select stuff ---
-
+## Select stuff.
include 'sel-base.pyx'
include 'sel-file.pyx'
include 'sel-timer.pyx'
include 'selpk.pyx'
include 'ident.pyx'
-#----- Set-up stuff ---------------------------------------------------------
+###----- Set-up stuff -------------------------------------------------------
cdef object _tyobj(PyTypeObject *ty):
cdef PyObject *obj
atom_pysetup()
Atom = _tyobj(&atom_pytype)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Common mapping stuff
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Common mapping stuff
+###
+### (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.
cdef class Mapping
cdef object _map_item(Mapping m, void *e):
return m._key(e), m._value(e)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# File descriptor juggling
-#
-# (c) 2009 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### File descriptor juggling
+###
+### (c) 2009 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.
def mdup(v):
cdef mdup_fd *vv
_oserror()
return v
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Packet buffering
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Packet buffering
+###
+### (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.
cdef class PacketBuffer:
cdef pkbuf pk
memcpy(p + n - rn, rp, rn)
keep[0] = rn
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Error reporting and stuff
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Error reporting and stuff
+###
+### (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.
quis = '<UNNAMED>'
cdef char *_progstring
_moan('%s', msg)
raise SystemExit, rc
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Select basic stuff
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Select basic stuff
+###
+### (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.
cdef sel_state _sel
sel_init(&_sel)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# File selectors
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### File selectors
+###
+### (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.
SEL_READ = _SEL_READ
SEL_WRITE = _SEL_WRITE
sf = <SelFile>arg
sf.ready()
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Timer selectors
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Timer selectors
+###
+### (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.
cdef double _tvtofloat(timeval *tv):
return tv.tv_sec + (tv.tv_usec / 1000000)
st._dead()
st.timer(_tvtofloat(now))
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Selecting line-buffers
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Selecting line-buffers
+###
+### (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.
cdef class SelLineBuffer:
cdef selbuf b
else:
sb.line(PyString_FromStringAndSize(s, n))
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Selecting packet-buffer
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Selecting packet-buffer
+###
+### (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.
cdef class SelPacketBuffer:
cdef selpk p
memcpy(p + n - rn, rp, rn)
keep[0] = rn
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# In-band signals
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### In-band signals
+###
+### (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 signal
sig_init(&_sel)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# String utilities
-#
-# (c) 2006 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### String utilities
+###
+### (c) 2006 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.
def word(char *p, quotep = False):
cdef unsigned f
def versioncmp(char *va, char *vb):
return _versioncmp(va, vb)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Various small things
-#
-# (c) 2007 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Various small things
+###
+### (c) 2007 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.
def detachtty():
_detachtty()
if _daemonize():
_oserror()
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Symbol table, using universal hashing
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Symbol table, using universal hashing
+###
+### (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.
cdef struct _sym_entry:
sym_base _b
cdef void *_next(me):
return sym_next(&me.i)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Universal hashing interface
-#
-# (c) 2005 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Universal hashing interface
+###
+### (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.
def setglobalkey(uint32 k):
unihash_setkey(&unihash_global, k)
def done(me):
return _u32(me._a)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Form-urlencoding functions
-#
-# (c) 2006 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Form-urlencoding functions
+###
+### (c) 2006 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.
cdef class URLEncode:
cdef url_ectx ctx
def __del__(me):
xfree(me.p)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Miscellaneous support gubbins
-#
-# (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.
+### -*-pyrex-*-
+###
+### Miscellaneous support gubbins
+###
+### (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.
cdef object _u32(uint32 x):
if x <= LONG_MAX:
return None
return f(*args)
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------