mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add _iconv_codec to Setup.dist. Use PyModule_ functions.
This commit is contained in:
parent
692d292c63
commit
727fe66f27
2 changed files with 6 additions and 8 deletions
|
@ -474,6 +474,9 @@ GLHACK=-Dclear=__GLclear
|
||||||
#EXPAT_DIR=/usr/local/src/expat-1.95.2
|
#EXPAT_DIR=/usr/local/src/expat-1.95.2
|
||||||
#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
|
#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
|
||||||
|
|
||||||
|
# Wrapper for iconv(3). This requires either GNU iconv, or a native
|
||||||
|
# iconv implementation (only Linux, Solaris, and BSD are known to work)
|
||||||
|
#_iconv_codec _iconv_codec -I$(prefix)/include -L$(exec_prefix)/lib -liconv
|
||||||
|
|
||||||
# Example -- included for reference only:
|
# Example -- included for reference only:
|
||||||
# xx xxmodule.c
|
# xx xxmodule.c
|
||||||
|
|
|
@ -603,17 +603,12 @@ static struct PyMethodDef _iconv_codec_methods[] = {
|
||||||
void
|
void
|
||||||
init_iconv_codec(void)
|
init_iconv_codec(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d, *t;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule("_iconv_codec", _iconv_codec_methods);
|
m = Py_InitModule("_iconv_codec", _iconv_codec_methods);
|
||||||
|
|
||||||
d = PyModule_GetDict(m);
|
PyModule_AddStringConstant(m, "__version__", (char*)__version__);
|
||||||
|
PyModule_AddObject(m, "iconvcodec", (PyObject *)(&iconvcodec_Type));
|
||||||
t = PyString_FromString(__version__);
|
|
||||||
PyDict_SetItemString(d, "__version__", t);
|
|
||||||
Py_DECREF(t);
|
|
||||||
|
|
||||||
PyDict_SetItemString(d, "iconvcodec", (PyObject *)(&iconvcodec_Type));
|
|
||||||
PyModule_AddStringConstant(m, "internal_encoding", UNICODE_ENCODING);
|
PyModule_AddStringConstant(m, "internal_encoding", UNICODE_ENCODING);
|
||||||
|
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue