Commit Graph

784 Commits

Author SHA1 Message Date
Guido van Rossum 74679b455f Support float and double in non-native formats.
These use the ANSI/IEEE standard, which is also used by XDR;
so the _xdr module may become obsolete.
1997-01-02 22:21:36 +00:00
Barry Warsaw 9e3fceb5b3 rotorobj_setkey(): A single string argument is now required (i.e. no
long optional with nearly-no-op missing).
1997-01-02 20:36:36 +00:00
Guido van Rossum 60c50614e1 Added better handling of unsigned longs -- a Python long returned by
unpack('L', ...) is now acceptable to pack('L', ...).
1996-12-31 16:29:52 +00:00
Guido van Rossum 3aa27fd315 Fix the first bugs... treatment of 0 count was wrong, and memchr()
should be memset().
1996-12-31 02:10:45 +00:00
Guido van Rossum f7e6b4b388 Pretty much rewritten to fulfull several long-standing wishes:
-- 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 '>'.
1996-12-31 01:41:25 +00:00
Roger E. Masse fbd1d74286 Renamed.
However: "cgensupport.h" is still present... otherwise I get
	maaaany type errors... not sure if this needs more attention.
1996-12-24 19:39:23 +00:00
Barry Warsaw aeb207c6b6 Reworked to check for memory problems (one potential found),
non-checked error return values, and where appropriate,
PyArg_ParseTuple() style argument parsing.

I also changed some function names and converted all malloc/free calls
to PyMem_NEW/PyMem_DEL.

Some stylistic changes and formatting standardization.
1996-12-23 23:36:24 +00:00
Roger E. Masse 7f33e403a4 Renamed. 1996-12-20 21:56:08 +00:00
Barry Warsaw c357325663 Several changes. Test program to follow.
- Where optional arguments were being used, converted to
  PyArg_ParseTuple() style instead of nested PyArg_Parse() style.

- Check for and handle many potential error conditions that were never
  being tested.

- internal reg_* functions renamed to regobj_* (makes it easier to
  figure out which are global regex functions and which are for regex
  objects).

- reg_group (now regobj_group) was quite extensively reworked.  it no
  longer recurses to do its job (by factoring core functionality into
  a separate function that knows about string and integer indexes).

- some minor formatting fixes.

- regex_set_syntax() now invalidates the cache.  Without this change
  (in the example below), the second search would produce different
  output depending on whether the first search were performed or not
  (since performing the first search would cache the compiled object
  with RE_SYNTAX_EMACS, causing the second test to unexpectedly fail).

  regex.search('(a+)|(b+)', 'cdb')
  prev = regex.set_syntax(RE_SYNTAX_AWK)
  regex.search('(a+)|(b+)', 'cdb')
1996-12-20 21:56:07 +00:00
Roger E. Masse a141f8a31a Renamed. 1996-12-20 20:50:39 +00:00
Barry Warsaw 4a34209468 1. Export open(2) flag constants for every defined constant
2. Reworked error checking in initposix() and initnt().
1996-12-19 23:50:02 +00:00
Barry Warsaw bab218e420 Minor formatting changes. 1996-12-19 22:22:32 +00:00
Barry Warsaw 43d68b8fb0 Minor formatting changes. 1996-12-19 22:10:44 +00:00
Guido van Rossum 25405c786b Added the new getprotobyname() call to the module overview at the top. 1996-12-19 16:42:52 +00:00
Guido van Rossum 3901d85277 Added getprotobyname() interface. 1996-12-19 16:35:04 +00:00
Roger E. Masse 20c6381856 Removed references to getdoublearg and get2doublearg rename macros and
substituted the appropriate PyArg_Parse calls.  Retested.  All appears well.
1996-12-18 21:59:01 +00:00
Roger E. Masse ec0b4af3d4 Eradicated all references to getintarg and getstrarg and substituded the
proper functions as defined in rename2.h.  Thanks Barry!
1996-12-18 20:07:39 +00:00
Roger E. Masse cfe3b61c02 Opps, left out two defines needed for argument parsing. 1996-12-18 19:56:48 +00:00
Barry Warsaw 19f61ae196 Tabification changes only; the module was already newly named. 1996-12-18 19:50:00 +00:00
Roger E. Masse b2b44e5b8a Renamed. 1996-12-18 19:37:32 +00:00
Guido van Rossum 2e6313930e Added Jeremy's resource module. 1996-12-18 18:37:27 +00:00
Guido van Rossum 4a4880966b Correct *another* mistake (initmath() always fell through to fatal error).
Watch it, Barry! :-)
1996-12-18 14:14:33 +00:00
Guido van Rossum 4c4cbf397b Correct 1-char typo / syntax error. 1996-12-18 14:12:22 +00:00
Guido van Rossum c88c9cb23f Corrected two errors introduced by the renaming (and the subsequent
style corrections, I presume), found by Jack.  Added warning that this
has not been tested (Jack could only compile and link it).
1996-12-17 20:43:55 +00:00
Roger E. Masse b15bef85a7 Renamed in a grand-ee-ous way! 1996-12-17 19:55:33 +00:00
Roger E. Masse 4ca4b07516 Opps, left in a /*#include "modsupport.h"*/ 1996-12-17 17:46:28 +00:00
Roger E. Masse 919213a098 Grandly renamed. 1996-12-17 17:42:22 +00:00
Guido van Rossum 4004e21484 Another fix for Split() -- don't refuse {"} but turn it into ".
This is needed because if a configure option has " as its value,
it will be rendered as {"}; after stripping one level of quoting it's
just ", on which splitlist will barf.
1996-12-17 01:25:36 +00:00
Guido van Rossum 0f868375ff Check errors returned by recursive call to Split(). 1996-12-17 01:02:18 +00:00
Barry Warsaw fc93f75da7 Better error checking in initmath(). 1996-12-17 00:47:03 +00:00
Barry Warsaw d0c1042ff2 Renamed. 1996-12-17 00:05:22 +00:00
Barry Warsaw 10f124c951 Updated to standard Python C coding style, and fixed a few error
checking nits.
1996-12-17 00:01:40 +00:00
Barry Warsaw 14ed5fb1ec initsignal(): Added SIGXCPU and SIGXFSZ. Left in the definitions for
SIGCPU and SIGFSZ but we're (Jeremy and I) are actually unsure whether
these were typos or if there are systems that use these alternate
names.  We've checked Solaris, SunOS, and IRIX; they contain only the
SIGX* names.
1996-12-16 20:24:22 +00:00
Barry Warsaw 529fcfe31f list2set(): correct return value (an int, not a PyObject*). 1996-12-16 18:15:34 +00:00
Roger E. Masse 81a6fe9b98 Removed a #inlclude <errno.h> since it's implied with "Python.h" 1996-12-13 23:29:09 +00:00
Barry Warsaw 24c4b3d4e8 list2set(): PyList_GetItem could fail. 1996-12-13 23:22:42 +00:00
Roger E. Masse 0e12032748 Renamed. 1996-12-13 20:33:44 +00:00
Guido van Rossum 4e7f62229e Get rid of it -- use bsddb! 1996-12-13 16:24:06 +00:00
Roger E. Masse bd4b961a0d Opps, fixed a couple of newly introduced wrapping problems. 1996-12-13 15:59:22 +00:00
Roger E. Masse e7ee8c3753 Reindented via GvR recomendation ala Bwarsaw cppy-style.el 1996-12-13 15:55:22 +00:00
Guido van Rossum fbcfd52a9a Added the example "thin ice" from the extensions manual. 1996-12-13 02:57:25 +00:00
Barry Warsaw f630f6b93d Renamed, and scrutinized for missed potential error conditions.
Alas, I don't have an Indigo, so I could not even compile this.
1996-12-13 01:24:29 +00:00
Barry Warsaw 8496d39478 Renamed, however there is no test case. I did test some of the module
out manually, and it does compile, but I'm not sure how to write a
useful portable test case.  Maybe later...
1996-12-13 00:11:04 +00:00
Barry Warsaw 30695fa3cd Renamed. 1996-12-12 23:32:31 +00:00
Barry Warsaw c2feec3378 Renamed, but *not* tested or compiled. I don't even have the STDWIN
library.
1996-12-12 22:48:20 +00:00
Barry Warsaw c1cb360683 Reworked to eliminate all potential memory problems, including
deletion of object from list argument during callout to fileno().
1996-12-12 22:16:21 +00:00
Barry Warsaw e4ac0aa618 Several changes... Guido *please* take a look!
1. Renamed

2. Several coding styles were being used here, owing to the multiple
   contributors.  I tried to convert everything to standard "python"
   coding style for indentation, paren and brace placement, etc.

3. There were several potential error conditions that were never being
   checked, and where I saw them, I added checks of return values,
   etc.  I'm pretty sure I got them all.

4. There were some old-style (pre PyArg_ParseTuple) argument
   extraction and these were converted to use PyArg_ParseTuple.

All changes compile and run with the new test_select.py module, at
least on my Solaris/Sparc box.
1996-12-12 00:04:35 +00:00
Barry Warsaw 7bd9fbdea2 Grandly renamed.
Note that since I have no idea how to test this, I didn't write a test
case.  It does seem to at least compile on my system though.
1996-12-11 21:33:16 +00:00
Barry Warsaw 50c5cf132a Renamed. 1996-12-11 16:54:40 +00:00
Barry Warsaw 1abda0fb12 cat and puste errors 1996-12-11 01:00:46 +00:00
Barry Warsaw 3696c524a4 nis_maplist(): Use check of yp_get_default_domain() return value
that's used in other parts of this module.

nis_maps(): use PyArg_NoArgs().
1996-12-11 00:29:14 +00:00
Barry Warsaw adbf4e66df Renamed, and bug fixed:
Two interesting problems in nis_maplist().  First, it is possible that
clnt_create() will return NULL.  This was being caught, but no Python
error was being set.  I use clnt_spcreateerror() to generate the value
of the exception.

But why would clnt_create() fail?  It's because no server was being
found.  And why was this?  It was because nis_maplist() tried only to
get the NIS master for the first map in the aliases list, which is
passwd.byname, and guess what?  That's the one NIS map CNRI does *not*
export!  So the yp_master() call was failing to return a valid
server.  I now cycle through all the map aliases until I find a valid
master.  If not, a different exception is set.

I'm not sure this is the completely correct way to do all this, but
short of rewriting the entire nismodule.c (to expose the proper API to
Python), it should do the trick.
1996-12-11 00:15:58 +00:00
Barry Warsaw 53699e9ec1 Renamed.
Note that there is no test suite for this module, and I don't plan to
write one just now.
1996-12-10 23:23:01 +00:00
Barry Warsaw a6b7c7146c Renamed. 1996-12-10 16:25:56 +00:00
Guido van Rossum caf783793d Added remaining declarations needed/used in glmodule.c; keeps gcc -Wall happy. 1996-12-10 15:41:19 +00:00
Guido van Rossum 36dd0d27c4 Fix operator priority bug found thanks to gcc -Wall. 1996-12-10 15:23:00 +00:00
Guido van Rossum e29ed8fa7c Make gcc -Wall happy; remove dummy variable (can't see where it's needed). 1996-12-10 15:21:30 +00:00
Guido van Rossum fb4130d1f1 Added extern decl for gethostname() to keep gcc -Wall happy. 1996-12-10 15:17:08 +00:00
Guido van Rossum 55db515a51 Great renaming.
Also got rid of the dummy variable, which was last needed in IRIX 4.x.
1996-12-10 00:32:31 +00:00
Guido van Rossum 09f99dfdba Removed redundant inclusion of <errno.h> (sorry, Roj!). 1996-12-10 00:12:14 +00:00
Roger E. Masse b0dfe969d9 renamed in a grand fashion. 1996-12-10 00:07:00 +00:00
Barry Warsaw abb7efeb7c Renamed a few symbols that were found in comments. 1996-12-09 23:22:35 +00:00
Barry Warsaw 3bdf746c5c Renamed, ungrandly. We don't have the GNU MP library here so we can't
really test this module, or even compile it without a lot of work.

I'll make a note of it that this has not been tested!
1996-12-09 23:16:31 +00:00
Roger E. Masse 56c345b235 renamed grandly. 1996-12-09 23:14:26 +00:00
Roger E. Masse 24070ca391 Renamed Grandly 1996-12-09 22:59:53 +00:00
Barry Warsaw 8b43b19ec9 Renamed 1996-12-09 22:32:36 +00:00
Roger E. Masse 5817f8f717 Removed some unneeded header files and reedited with a fixed-width font
from emacs as per recomendation from GvR
1996-12-09 22:24:19 +00:00
Roger E. Masse 2919eaaf08 Renamed Grandly (I think). 1996-12-09 20:10:36 +00:00
Guido van Rossum ece35bc22f Changes to keep gcc -Wall happy. 1996-12-09 18:52:11 +00:00
Guido van Rossum 7ce52be627 Added `void' to declaration of initgl(), to keep gcc -Wall happy. 1996-12-09 18:51:51 +00:00
Guido van Rossum 665f9198fe Added a bunch of extern void decls, to keep gcc -Wall happy. 1996-12-09 18:49:42 +00:00
Guido van Rossum 3d65fa3488 Include <sys/ioctl.h>, to keep gcc -Wall happy. 1996-12-09 18:49:14 +00:00
Guido van Rossum cd165cc092 Make dummy int public (with _Py_ prefix), to keep gcc -Wall happy. 1996-12-09 18:48:32 +00:00
Guido van Rossum 37273177be Add ``extern void bzero();'' for SGI, to keep gcc -Wall happy. 1996-12-09 18:47:43 +00:00
Guido van Rossum 66a7013c5c Include unistd.h to keep gcc -Wall happy. 1996-12-09 18:46:58 +00:00
Guido van Rossum 259552dbd9 Added ``extern int get_default_domain();'' for SGI, to keep gcc -Wall happy. 1996-12-09 18:46:28 +00:00
Guido van Rossum 52174577eb Added #ifdef around ``extern int ftime();'' for MS WINDOWS (which has
a conflicting definition somewhere).
Resolved line wrap for error message in ins().
1996-12-09 18:38:52 +00:00
Barry Warsaw f52560197f Greatly renamed. 1996-12-09 18:35:56 +00:00
Barry Warsaw ec775c52a2 ins(): missed a renaming in a string: dictinsert =>
PyDict_SetItemString.

GvR: note the long line > 80 chars.  Wrapping suggestions?
1996-12-09 18:24:35 +00:00
Barry Warsaw 9a2a8a8d31 Greatly renamed. 1996-12-06 23:32:14 +00:00
Guido van Rossum 1bb126fa13 Add extern decl of ftime() to make gcc -Wall happy. 1996-12-06 20:17:44 +00:00
Guido van Rossum a376cc5cc8 Keep gcc -Wall happy. 1996-12-05 23:43:35 +00:00
Guido van Rossum 60fca2c90f Add case for 'R' and a little bit of cleanup. Andrew Kuchling. 1996-12-05 23:41:26 +00:00
Guido van Rossum 049cd90b93 Jim F's brainchild 1996-12-05 23:30:48 +00:00
Guido van Rossum 81b24c0221 Fix bad format char in error msg (%s should be %d).
Keep gcc -Wall happy.
1996-12-05 23:30:16 +00:00
Guido van Rossum 36a484fb52 Correct typo -- repeat implements *, not +. 1996-12-05 19:01:16 +00:00
Guido van Rossum b916faf66a Upgraded new.function() contributed by Tommy. Also got rid of #if 0'ed code. 1996-11-21 16:02:12 +00:00
Guido van Rossum 0b1ff66920 Should compare errno to 0, not NULL 1996-11-02 17:31:22 +00:00
Guido van Rossum d266eb460e New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
Guido van Rossum 0cbaff440d Fix case where you start a new group immediately after a label.
Thanks to Ka-Ping Yee.
1996-10-23 17:53:06 +00:00
Guido van Rossum 1d6fddb776 Changed _Py_EllipsesObject -> _Py_EllipsisObject. 1996-10-21 15:11:12 +00:00
Guido van Rossum a1b1cdbab2 Major upgrade by Vladimir Marangozov. 1996-10-21 15:10:39 +00:00
Guido van Rossum 084814624d Don't close an already closed socket. 1996-10-12 14:07:22 +00:00
Guido van Rossum 6e8583dcb3 Check for NULL pointer returned from localtime()/gmtime(). 1996-10-08 14:19:52 +00:00
Guido van Rossum c196202e3d Speedup of makeresult() by keeping a filler of (-1, -1) around. 1996-10-08 14:18:42 +00:00
Guido van Rossum a0ca4c402d Replace all uses of strncmp (in split, find, rfind) with memcmp, so
embedded \0 in the delimiter is handled properly.  Thanks to Sjoerd
for suggesting this.
1996-10-04 13:39:37 +00:00
Guido van Rossum 07886d0e01 Rationalize MS #ifdefs 1996-09-11 23:31:42 +00:00
Guido van Rossum f156f503cd Correct typo: return -1 for error, not 0 1996-09-11 23:31:23 +00:00
Guido van Rossum 3863abb921 Correct typo: return -1 for error, not NULL 1996-09-11 23:31:07 +00:00
Guido van Rossum c35f933c44 Add text of argument to errors for atoi(), atol(), atof(). 1996-09-11 23:30:42 +00:00