Commit 3a51b25b authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.4.0

parent a42b8e07
$Id: CHANGES,v 1.2 2004/02/18 23:05:05 cvs Exp $
version: 0.1
- Initial release.
......@@ -25,3 +22,15 @@ version: 0.3
- Encoded lines size now is 128 chars.
- using fread() instead of fgets in decode() function (much faster).
- SWIG isn't used anymore for wrapper generation.
version: 0.4
- change license to LGPL
- crc32 codes are now Python longs (returned from _yenc calls) in the range [2**0, 2**32 -1]
- crc32 formatting is fixed
- 'bytes' arguments named 'bytez' to avoid collision with 'bytes' type
- basic unit testing
- unescaped dots at the beginning of line caused ydecode to fail under some circumstances
dots at the beginning of line are now always escaped
- Encoder's and Decoder's output files (if any) are automatically flushed and closed upon deletion
- new method close() on Encoder and Decoder
This diff is collapsed.
CHANGES
COPYING
MANIFEST
MANIFEST.in
README
TODO
setup.cfg
setup.py
debian/changelog
debian/control
debian/rules
debian/DEBIAN/control
doc/yenc-draft.1.3.txt
examples/logo.ync
examples/ydecode.py
examples/ydecode_Decoder.py
examples/yencode.py
examples/yencode_Encoder.py
lib/yenc.py
src/_yenc.c
src/_yenc.h
test/test.py
Metadata-Version: 1.0
Name: yenc
Version: 0.3
Version: 0.3.1
Summary: yEnc Module for Python
Home-page: http://golug.cc.uniud.it/yenc.html
Home-page: http://www.golug.it/yenc.html
Author: Alessandro Duca
Author-email: dual@golug.cc.uniud.it
License: GPL
Author-email: alessandro.duca@gmail.com
License: LGPL
Description: UNKNOWN
Platform: UNKNOWN
$Id: README,v 1.2 2004/02/18 23:05:05 cvs Exp $
##=============================================================================
#
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
##=============================================================================
Description:
-----------
......@@ -14,30 +32,36 @@ input and output and use filenames instead of file objects as arguments
for encode() and decode() ). See CHANGES file for details.
Version 0.3 doesn't introduce anything new, just a bugfix a some internals
changes.
Version 0.4 introduces the close() method on Encoder and Decoder, fixes
crc32 formatting and adds escaping of '.' for compatibility with some ydecode
tools, strictly speaking this wasn't a bug and yenc specs reccomend this
behaviour only for clients that write directly on the tcp steam.
Version 0.4 is meant to be backward compatible with both 0.3 and 0.2.
Requirements:
------------
A C developement environment, Python>=2.1 and python developement libs (look for
A C developement environment, Python>=2.6 and python developement libs (look for
python-dev or something like that if you're using .rpm or .deb packages, if you
installed from sources you already have everything you need).
The module is known to work with Python2.1 and 2.2, maybe it will work also
with 1.5.2 (as long as you have distutils I think).
The module is known to work with Python2.6, testing with other version is needed.
Installation:
------------
To install:
tar xzfv yenc-0.3.tar.gz
cd yenc-0.3
tar xzfv yenc-0.4.tar.gz
cd yenc-0.4
python setup.py build
su
python setup.py install
To uninstall:
Simply remove _yenc.so, yenc.py and yenc.pyc from your PYTHONPATH.
On my Debian GNU/Linux 3.0:
/usr/local/lib/python2.2/site-packages/{_yenc.so,yenc.py,yenc.pyc}
On my Ubuntu:
/usr/local/lib/python2.6/site-packages/{_yenc.so,yenc.py,yenc.pyc}
Usage:
......@@ -77,7 +101,39 @@ output can't be written or calculated crc doesn't match the optional crc_in
argument (useful for writing decoding tools).
CRC32 sums are always represented as lowercase strings, whithout any
preceeding simbol ( like '0x').
preceeding simbol (like '0x').
Decoder and Encoder:
-------------------
Encoder and Decoder are facility classes meant for encoding data one chunk at time,
optionally writing the encoded/decoded data to an output file.
import yenc.Encoder
encoder = Encoder()
encoder.feed('some data')
encoder.feed('some other data')
encoder.terminate() # writes the \r\n terminator on file, further feed(..) will fail
encoded_data = encoder.getEncoded() # returns encoded data as string
crc32 = encoder.getCrc32() # returns crc32 of clear data
optionally you can write onto an output file:
encoder = Encoder(file('outputfile.ync', 'wb'))
encoder.feed('some data')
encoder.feed('some other data')
encoder.terminate()
encoder.flush() # writes the local buffer to the output file
encoder.close() # flushes and closes output_file, called automatically upon deletion
crc32 = encoder.getCrc32()
Decoder works basically the same way.
Performances:
......@@ -86,13 +142,13 @@ Fast enough.
Author:
------
Alessandro Duca <dual@golug.cc.uniud.it>
------:
Alessandro Duca <alessandro.duca AT gmail.com>
Thanks:
------
Michael Muller <mmuller@endunden.com> for code reviewing and fixing.
Michael Muller <mmuller AT endunden.com> for code reviewing and fixing.
Greets, Sandro.
......
$Id: TODO,v 1.2 2004/02/18 23:05:05 cvs Exp $
version 0.3:
version 0.4:
- Provide *real* documentation.
......
Package: python-yenc
Architecture: i386
Version: 0.4
Depends: python2.6
Maintainer: Alessandro Duca (DuAL) <alessandro.duca@gmail.com>
Section: news
Priority: optional
Standards-Version: 3.5.6.1
Description: yEnc encoding/decoding extension for Python
The yEnc module provide a simple API for doing raw encoding/decoding of
yencoded binaries, mainly for retrieving or posting to the usenet.
This implementation is really simple and intended mainly as an exercise
to the author but is also significatively faster than any possible pure
Python implementation and it's being actually used by some Python nntp
clients out there.
python-yenc (0.3) experimental; urgency=LOW
* Initial version
-- Alessandro Duca <alessandro.duca@gmail.com> Tue, 17 Feb 2004 11:16:54 +0100
Source: python-yenc
Maintainer: Alessandro Duca (DuAL) <alessandro.duca@gmail.com>
Section: news
Priority: optional
Build-Depends: python2.6-dev
Standards-Version: 3.5.6.1
Package: python-yenc
Architecture: i386
Depends: python2.6
Description: yEnc encoding/decoding extension for Python
The yEnc module provide a simple API for doing raw encoding/decoding of
yencoded binaries, mainly for retrieving or posting to the usenet.
This implementation is really simple and intended mainly as an exercise
to the author but is also significatively faster than any possible pure
Python implementation and it's being actually used by some Python nntp
clients out there.
#!/usr/bin/make -f
PYTHON='python2.6'
build: clean
/usr/bin/env $PYTHON setup.py build
/usr/bin/env $PYTHON setup.py install --root=debian/tmp
cp -av debian/DEBIAN debian/tmp/DEBIAN
binary: binary-arch binary-indep
binary-indep:
dpkg-gencontrol
dpkg --build debian/tmp ../python-yenc_0.4.deb
binary-arch:
clean:
rm -rf debian/tmp/*
rm -rf dist/*
rm -rf build/*
......@@ -127,6 +127,6 @@ Gv(
KrI<VCDBZ|wDV|Ȓ;"6+MZ-Cԫ,.4VP/[BYWL΍xH2+<6JlJ?6VPfkU=MKVY j=}
;ë\D*,^k>kU+(?M/WzmN"H7+\[Yi:P.-E.ٴ0K6.ImS]̙ +,k>>i ]_UOl]eDB]fb
%mmiB7*⸫@[.ʙlҫȬ2:*Bv=}rcYkN.XTtIUBl$Bz]llEm3b-7jyI,z17.,\qn8v@jo?kHj?2B)+
.RwԪxP򫄅FovBZKfPr?J\,7~!LouoB+B6m#lS܆MBP^Pe2>8ZfE8=}IJjCP߅AZWBkJJ+
]`Sx*BZS-:-$XyQ}`-+.JfV9M8R3.,\> `$]T]$<2:m32aJ.la5!`]V} !a1.*e
=nRwԪxP򫄅FovBZKfPr?J\,7~!LouoB+B6m#lS܆MBP^Pe2>8ZfE8=}IJjCP߅AZWBkJJ
+]`Sx*BZS-:-$XyQ}`-+.JfV9M8R3.,\> `$]T]$<2:m32aJ.la5!`]V} !a1.*e
=yend size=16335 crc32=547266c7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
# $Id: ydecode.py,v 1.2 2004/02/18 23:10:11 cvs Exp $
#
##=============================================================================
......@@ -36,7 +33,7 @@ CRC32_RE = re.compile(r"^.*? crc32=(\w+)")
def main():
if len(sys.argv) > 1:
file_in = open(sys.argv[1],"r")
file_in = open(sys.argv[1],"rb")
else:
file_in = sys.stdin
while 1:
......@@ -54,7 +51,7 @@ def main():
elif not line:
sys.stderr.write("err-critical: no valid =ybegin header found\n")
sys.exit(1)
file_out = open(name,"w")
file_out = open(name,"wb")
try:
dec, dec_crc = yenc.decode(file_in, file_out, size)
except yenc.Error, e:
......
#!/usr/bin/env python
## -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
# $Id: ydecode_Decoder.py,v 1.1 2004/02/18 11:33:08 cvs Exp $
#
##=============================================================================
import yenc
import os
import sys
import re
import yenc
NAME_RE = re.compile(r"^.*? name=(.+?)\r\n$")
LINE_RE = re.compile(r"^.*? line=(\d{3}) .*$")
SIZE_RE = re.compile(r"^.*? size=(\d+) .*$")
......@@ -38,7 +35,7 @@ CRC32_RE = re.compile(r"^.*? crc32=(\w+)")
def main():
head_crc = trail_crc = ""
if len(sys.argv) > 1:
file_in = open(sys.argv[1],"r")
file_in = open(sys.argv[1],"rb")
else:
file_in = sys.stdin
while 1:
......@@ -56,7 +53,7 @@ def main():
elif not line:
sys.stderr.write("err-critical: no valid =ybegin header found\n")
sys.exit(1)
file_out = open(name,"w")
file_out = open(name,"wb")
dec = yenc.Decoder(file_out)
trailer = ""
garbage = 0
......@@ -70,11 +67,10 @@ def main():
else:
dec.feed(data)
dec.flush()
#file_out.write(dec.getDecoded())
if trailer:
try:
size = int( SIZE_RE.match(line).group(1) )
m_obj = CRC32_RE.match(line)
size = int(SIZE_RE.match(trailer).group(1))
m_obj = CRC32_RE.search(trailer)
if m_obj:
trail_crc = m_obj.group(1)
except re.error, e:
......@@ -90,7 +86,7 @@ def main():
else:
sys.exit(0)
# print "comparing"
if cmp(tmp_crc,dec.getCrc32()):
if cmp(tmp_crc, dec.getCrc32()):
sys.stderr.write("err: header: %s dec: %s CRC32 mismatch\n" % (tmp_crc,dec.getCrc32()) )
sys.exit(1)
else:
......
##!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
# $Id: yencode.py,v 1.2 2004/02/18 23:10:11 cvs Exp $
#
##=============================================================================
......@@ -40,26 +37,26 @@ def main():
file_out = sys.stdout
for o,a in opts:
if o == '-o':
file_out = open(a,"w")
file_out = open(a,"wb")
if args:
filename = args[0]
if os.access( filename, os.F_OK | os.R_OK ):
file_in = open(filename,"r")
file_in = open(filename,"rb")
else:
print "couldn't access %s" % filename
sys.exit(2)
else:
usage()
crc = hex( crc32( open(filename,"r").read() ) )[2:]
crc = "%08x"%(0xFFFFFFFF & crc32(open(filename,"rb").read()))
name = os.path.split(filename)[1]
size = os.stat(filename)[ST_SIZE]
file_out.write("=ybegin line=128 size=%d crc32=%s name=%s\r\n" % (size, crc, name) )
try:
encoded, crc = yenc.encode(file_in, file_out, size)
encoded, crc_out = yenc.encode(file_in, file_out, size)
except Exception, e:
print e
sys.exit(3)
file_out.write("=yend size=%d crc32=%s\r\n" % (encoded, crc) )
file_out.write("=yend size=%d crc32=%s\r\n" % (encoded, crc_out))
def usage():
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
# $Id: yencode_Encoder.py,v 1.2 2004/02/18 23:09:30 cvs Exp $
#
##=============================================================================
import sys
import os
import os.path
......@@ -41,21 +37,21 @@ def main():
file_out = sys.stdout
for o,a in opts:
if o == '-o':
file_out = open(a,"w")
file_out = open(a,"wb")
if args:
filename = args[0]
if os.access( filename, os.F_OK | os.R_OK ):
file_in = open(filename,"r")
file_in = open(filename,"rb")
else:
print "couldn't access %s" % filename
sys.exit(2)
else:
usage()
crc = hex( crc32( open(filename,"r").read() ) )[2:]
crc = "%x"%(0xFFFFFFFF & crc32( open(filename,"rb").read()))
name = os.path.split(filename)[1]
size = os.stat(filename)[ST_SIZE]
file_out.write("=ybegin line=128 size=%d crc32=%s name=%s\r\n" % (size, crc, name) )
file_in = open(filename, "r")
file_in = open(filename, "rb")
encoder = yenc.Encoder(file_out)
while True:
data_in = file_in.read(1024)
......@@ -68,7 +64,7 @@ def main():
def usage():
print "Usage: yencode2.py <-o outfile> filename"
print "Usage: yencode_Encoder.py <-o outfile> filename"
sys.exit(1)
if __name__ == "__main__":
......
This diff is collapsed.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
# $Id: setup.py,v 1.2 2004/02/18 23:05:05 cvs Exp $
#
##=============================================================================
from distutils.core import setup, Extension
setup(
name = "yenc",
version = "0.3",
author = "Alessandro Duca",
author_email = "dual@golug.cc.uniud.it",
url = "http://golug.cc.uniud.it/yenc.html",
description = "yEnc Module for Python",
license = "GPL",
package_dir = { '': 'lib' },
py_modules = ["yenc"],
ext_modules = [Extension("_yenc",["src/_yenc.c"],extra_compile_args=["-O2","-g"])]
name = "yenc",
version = "0.4.0",
author = "Alessandro Duca",
author_email = "alessandro.duca@gmail.com",
url = "https://bitbucket.org/dual75/yenc",
license = "LGPL",
platforms = ["Unix"],
package_dir = { '': 'lib' },
py_modules = ["yenc"],
ext_modules = [Extension("_yenc",["src/_yenc.c"],extra_compile_args=["-O2","-g"])],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: C",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Operating System :: Unix",
"Development Status :: 4 - Beta",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Communications :: Usenet News"
],
description = "yEnc Module for Python",
long_description = """
yEnc Encoding/Decoding for Python
---------------------------------
This a fairly simple module, it provide only raw yEnc encoding/decoding with
builitin crc32 calculation. Header parsing, checkings and yenc formatting are
left to you (see examples directory for possible implementations).
Supports encoding and decoding directly to files or to memory buffers
with helper classes Encoder and Decoder.
"""
)
This diff is collapsed.
/*=============================================================================
/*=============================================================================
*
* Copyright (C) 2003, 2004 Alessandro Duca
* Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
*
* This program 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.
*
* This program is distributed in the hope that it will be useful,
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*=============================================================================
*
* $Id: _yenc.h,v 1.2 2004/02/18 23:06:14 cvs Exp $
*
*/
*/
#include <Python.h>
#include <stdio.h>
......@@ -53,6 +46,7 @@
#define ESC 0x3d
#define TAB 0x09
#define SPACE 0x20
#define DOT 0x2e
#define E_MODE 1
#define E_EOF 2
......@@ -61,9 +55,12 @@
#define E_MODE_MSG "Invalide mode for '*file' arguments"
#define E_IO_MSG "I/O Error"
#define _DDEBUG_
/* Customized types */
typedef unsigned long uLong;
typedef unsigned int uInt;
typedef unsigned char Byte;
typedef int Bool;
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##=============================================================================
#
# Copyright (C) 2003, 2004 Alessandro Duca
# Copyright (C) 2003, 2011 Alessandro Duca <alessandro.duca@gmail.com>
#
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public