X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib-python/blobdiff_plain/20bce5e92b01cd928f26b61be78215117039c561..95920c4fcd363969a497f6fe1fe35e0b95ca082b:/report.pyx diff --git a/report.pyx b/report.pyx index e3749b4..cb368f6 100644 --- a/report.pyx +++ b/report.pyx @@ -25,24 +25,22 @@ # 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/quis.h': - void _ego "ego"(char *prog) - char *_quis "quis"() - -cdef extern from 'mLib/report.h': - void _moan "moan"(char *f, char *msg) - -import sys - quis = '' -def ego(prog): - _ego(prog) +cdef char *_progstring +_progstring = NULL + +def ego(char *prog): + global quis, _progstring + if _progstring: + xfree(_progstring) + _progstring = xstrdup(prog) + _ego(_progstring) quis = _quis() -def moan(msg): +def moan(char *msg): _moan('%s', msg) -def die(msg, rc = 1): +def die(char *msg, rc = 126): _moan('%s', msg) - sys.exit(rc) + raise SystemExit, rc #----- That's all, folks ----------------------------------------------------