[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.115,2.116

Fred L. Drake fdrake@weyr.cnri.reston.va.us
Thu, 9 Dec 1999 16:13:10 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Modules
In directory weyr:/home/fdrake/projects/python/Modules

Modified Files:
	posixmodule.c 
Log Message:

Added support for abort(), ctermid(), tmpfile(), tempnam(), tmpnam(),
and TMP_MAX.

Converted all functions that used PyArg_Parse() or PyArg_NoArgs() to
use PyArg_ParseTuple() and specified all function names using the
:name syntax in the format strings, to allow better error messages
when TypeError is raised for parameter type mismatches.


Index: posixmodule.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.115
retrieving revision 2.116
diff -u -C2 -r2.115 -r2.116
*** posixmodule.c	1999/10/19 13:29:23	2.115
--- posixmodule.c	1999/12/09 21:13:07	2.116
***************
*** 432,442 ****
  
  static PyObject *
! posix_int(args, func)
          PyObject *args;
  	int (*func) Py_FPROTO((int));
  {
  	int fd;
  	int res;
! 	if (!PyArg_Parse(args,  "i", &fd))
  		return NULL;
[...1720 lines suppressed...]
  #endif
+ #ifdef HAVE_TEMPNAM
+ 	{"tempnam",	posix_tempnam, METH_VARARGS, posix_tempnam__doc__},
+ #endif
+ #ifdef HAVE_TMPNAM
+ 	{"tmpnam",	posix_tmpnam, METH_VARARGS, posix_tmpnam__doc__},
+ #endif
+ 	{"abort",	posix_abort, METH_VARARGS, posix_abort__doc__},
  	{NULL,		NULL}		 /* Sentinel */
  };
***************
*** 3426,3429 ****
--- 3586,3592 ----
          if (ins(d, "X_OK", (long)X_OK)) return -1;
  #endif        
+ #ifdef TMP_MAX
+         if (ins(d, "TMP_MAX", (long)TMP_MAX)) return -1;
+ #endif
  #ifdef WNOHANG
          if (ins(d, "WNOHANG", (long)WNOHANG)) return -1;