summaryrefslogtreecommitdiffstats
path: root/Modules/structmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Keep Microsoft VC happy.Guido van Rossum1997-04-111-8/+8
|
* Changed the ``add/sub_offset'' hacks for dealing with C's unsignedGuido van Rossum1997-01-031-112/+14
| | | | | | | int/long types, and use the new PyLong_FromUnsignedLong() and PyLong_AsUnsignedLong() interfaces instead. Semantic change: the 'I' format will now always return a long int.
* Fill pad bytes with zeros (fixing a bug dating from the very first version!).Guido van Rossum1997-01-031-2/+5
|
* Scratch the ears of gcc -Wall.Barry Warsaw1997-01-031-1/+1
|
* Ok, ok, I've fixed gradual underflow on packing too.Guido van Rossum1997-01-021-45/+47
| | | | | | Still don't know what to do with Inf/NaN, so I raise an exception on pack(), and something random decided by ldexp() will happen on unpack().
* Oops -- unpack float/double didn't do the right thing if e==0.Guido van Rossum1997-01-021-4/+14
|
* Support float and double in non-native formats.Guido van Rossum1997-01-021-2/+365
| | | | | These use the ANSI/IEEE standard, which is also used by XDR; so the _xdr module may become obsolete.
* Added better handling of unsigned longs -- a Python long returned byGuido van Rossum1996-12-311-27/+163
| | | | unpack('L', ...) is now acceptable to pack('L', ...).
* Fix the first bugs... treatment of 0 count was wrong, and memchr()Guido van Rossum1996-12-311-6/+6
| | | | should be memset().
* Pretty much rewritten to fulfull several long-standing wishes:Guido van Rossum1996-12-311-226/+572
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- The whole implementation is now more table-driven. -- Unsigned integers. Format characters 'B', 'H', 'I' and 'L' mean unsigned byte, short, int and long. For 'I' and 'L', the return value is a Python long integer if a Python plain integer can't represent the required range (note: this is dependent on the size of the relevant C types only, not of the sign of the actual value). -- A new format character 's' packs/unpacks a string. When given a count prefix, this is the size of the string, not a repeat count like for the other format characters; e.g. '10s' means a single 10-byte string, while '10c' means 10 characters. For packing, the string is truncated or padded with null bytes as appropriate to make it fit. For unpacking, the resulting string always has exactly the specified number of bytes. As a special case, '0s' means a single, empty string (while '0c' means 0 characters). -- Various byte order options. The first character of the format string determines the byte order, size and alignment, as follows: First character Byte order size and alignment '@' native native '=' native standard '<' little-endian standard '>' big-endian standard '!' network (= big-endian) standard If the first character is not one of these, '@' is assumed. Native byte order is big-endian or little-endian, depending on the host system (e.g. Motorola and Sun are big-endian; Intel and DEC are little-endian). Native size and alignment are determined using the C compiler's sizeof expression. This is always combined with native byte order. Standard size and alignment are as follows: no alignment is required for any type (so you have to use pad bytes); short is 2 bytes; int and long are 4 bytes. In this mode, there is no support for float and double. Note the difference between '@' and '=': both use native byte order, but the size and alignment of the latter is standardized. The form '!' is available for those poor souls who can't remember whether network byte order is big-endian or little-endian. There is no way to indicate non-native byte order (i.e. force byte-swapping); use the appropriate choice of '<' or '>'.
* Renamed.Barry Warsaw1996-12-121-82/+88
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Quick hack so PowerPC macs can access system structuresJack Jansen1995-02-021-0/+14
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-4/+8
| | | | | Setup.in: clarified Tk comments somewhat. structmodule.c: use memcpy() instead of double precision assignment.
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-1/+1
|
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* unpack() now returns a tuple, not a listGuido van Rossum1992-08-191-1/+23
|
* struct: pack/unpack binary structs; fcntl: fcntl(), ioctl().Guido van Rossum1992-08-171-0/+447