[Python-checkins] CVS: python/dist/src/Demo/pysvr pysvr.c,1.8,1.9

Thomas Wouters python-dev@python.org
Fri, 3 Nov 2000 00:18:40 -0800


Update of /cvsroot/python/python/dist/src/Demo/pysvr
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27629/Demo/pysvr

Modified Files:
	pysvr.c 
Log Message:

Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.



Index: pysvr.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/pysvr/pysvr.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** pysvr.c	2000/07/22 19:25:51	1.8
--- pysvr.c	2000/11/03 08:18:37	1.9
***************
*** 20,23 ****
--- 20,24 ----
  
  #include <pthread.h>
+ #include <getopt.h>
  
  /* XXX Umpfh.
***************
*** 32,39 ****
  #define PORT 4000
  #endif
- 
- extern int optind;
- extern char *optarg;
- extern int getopt(int, char **, char *);
  
  struct workorder {
--- 33,36 ----