[Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.11,2.12
Jack Jansen
python-dev@python.org
Sat, 15 Jul 2000 15:31:47 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24642
Modified Files:
_localemodule.c
Log Message:
Implemented getdefaultlocale() for macintosh, after an idea by Fredrik.
Index: _localemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -r2.11 -r2.12
*** _localemodule.c 2000/07/08 20:07:24 2.11
--- _localemodule.c 2000/07/15 22:31:45 2.12
***************
*** 25,29 ****
#ifdef macintosh
! char *strdup(char *);
#endif
--- 25,29 ----
#ifdef macintosh
! #include "macglue.h"
#endif
***************
*** 381,384 ****
--- 381,392 ----
#endif
+ #if defined(macintosh)
+ static PyObject*
+ PyLocale_getdefaultlocale(PyObject* self, PyObject* args)
+ {
+ return Py_BuildValue("Os", Py_None, PyMac_getscript());
+ }
+ #endif
+
static struct PyMethodDef PyLocale_Methods[] = {
{"setlocale", (PyCFunction) PyLocale_setlocale, 1, setlocale__doc__},
***************
*** 386,390 ****
{"strcoll", (PyCFunction) PyLocale_strcoll, 1, strcoll__doc__},
{"strxfrm", (PyCFunction) PyLocale_strxfrm, 1, strxfrm__doc__},
! #if defined(MS_WIN32)
{"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 0},
#endif
--- 394,398 ----
{"strcoll", (PyCFunction) PyLocale_strcoll, 1, strcoll__doc__},
{"strxfrm", (PyCFunction) PyLocale_strxfrm, 1, strxfrm__doc__},
! #if defined(MS_WIN32) || defined(macintosh)
{"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 0},
#endif