[Python-checkins] python/dist/src/Modules socketmodule.c, 1.278, 1.279

loewis at users.sourceforge.net loewis at users.sourceforge.net
Thu Nov 27 14:40:24 EST 2003


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv3034/Modules

Modified Files:
	socketmodule.c 
Log Message:
Patch #849595: Add socket.shutdown() constants.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.278
retrieving revision 1.279
diff -C2 -d -r1.278 -r1.279
*** socketmodule.c	19 Nov 2003 22:52:23 -0000	1.278
--- socketmodule.c	27 Nov 2003 19:40:22 -0000	1.279
***************
*** 2098,2103 ****
  "shutdown(flag)\n\
  \n\
! Shut down the reading side of the socket (flag == 0), the writing side\n\
! of the socket (flag == 1), or both ends (flag == 2).");
  
  
--- 2098,2103 ----
  "shutdown(flag)\n\
  \n\
! Shut down the reading side of the socket (flag == SHUT_RD), the writing side\n\
! of the socket (flag == SHUT_WR), or both ends (flag == SHUT_RDWR).");
  
  
***************
*** 4100,4103 ****
--- 4100,4126 ----
  #ifdef NI_DGRAM
  	PyModule_AddIntConstant(m, "NI_DGRAM", NI_DGRAM);
+ #endif
+ 
+ 	/* shutdown() parameters */
+ #ifdef SHUT_RD
+ 	PyModule_AddIntConstant(m, "SHUT_RD", SHUT_RD);
+ #elif defined(SD_RECEIVE)
+ 	PyModule_AddIntConstant(m, "SHUT_RD", SD_RECEIVE);
+ #else
+ 	PyModule_AddIntConstant(m, "SHUT_RD", 0);
+ #endif
+ #ifdef SHUT_WR
+ 	PyModule_AddIntConstant(m, "SHUT_WR", SHUT_WR);
+ #elif defined(SD_SEND)
+ 	PyModule_AddIntConstant(m, "SHUT_WR", SD_SEND);
+ #else
+ 	PyModule_AddIntConstant(m, "SHUT_WR", 1);
+ #endif
+ #ifdef SHUT_RDWR
+ 	PyModule_AddIntConstant(m, "SHUT_RDWR", SHUT_RDWR);
+ #elif defined(SD_BOTH)
+ 	PyModule_AddIntConstant(m, "SHUT_RDWR", SD_BOTH);
+ #else
+ 	PyModule_AddIntConstant(m, "SHUT_RDWR", 2);
  #endif
  





More information about the Python-checkins mailing list