Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3919571f
Commit
3919571f
authored
Jan 04, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap doc strings in PyDoc_STRVAR. Fix .string docstring. Provide default
macro definitions for older Python releases.
parent
4fede1a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
Modules/_tkinter.c
Modules/_tkinter.c
+21
-3
No files found.
Modules/_tkinter.c
View file @
3919571f
...
@@ -37,6 +37,15 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -37,6 +37,15 @@ Copyright (C) 1994 Steen Lumholt.
#define MAC_TCL
#define MAC_TCL
#endif
#endif
/* Allow using this code in Python 2.[12] */
#ifndef PyDoc_STRVAR
#define PyDoc_STRVAR(name,str) static char name[] = PyDoc_STR(str)
#endif
#ifndef PyMODINIT_FUNC
#define PyPyMODINIT_FUNC void
#endif
/* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
/* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
making _tkinter correct for this API means to break earlier
making _tkinter correct for this API means to break earlier
versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
...
@@ -723,6 +732,9 @@ PyTclObject_str(PyTclObject *self)
...
@@ -723,6 +732,9 @@ PyTclObject_str(PyTclObject *self)
}
}
/* Like _str, but create Unicode if necessary. */
/* Like _str, but create Unicode if necessary. */
PyDoc_STRVAR
(
PyTclObject_string__doc__
,
"the string representation of this object, either as string or Unicode"
);
static
PyObject
*
static
PyObject
*
PyTclObject_string
(
PyTclObject
*
self
,
void
*
ignored
)
PyTclObject_string
(
PyTclObject
*
self
,
void
*
ignored
)
{
{
...
@@ -755,6 +767,8 @@ PyTclObject_string(PyTclObject *self, void *ignored)
...
@@ -755,6 +767,8 @@ PyTclObject_string(PyTclObject *self, void *ignored)
}
}
#ifdef Py_USING_UNICODE
#ifdef Py_USING_UNICODE
PyDoc_STRVAR
(
PyTclObject_unicode__doc__
,
"convert argument to unicode"
);
static
PyObject
*
static
PyObject
*
PyTclObject_unicode
(
PyTclObject
*
self
,
void
*
ignored
)
PyTclObject_unicode
(
PyTclObject
*
self
,
void
*
ignored
)
{
{
...
@@ -779,21 +793,25 @@ PyTclObject_repr(PyTclObject *self)
...
@@ -779,21 +793,25 @@ PyTclObject_repr(PyTclObject *self)
return
PyString_FromString
(
buf
);
return
PyString_FromString
(
buf
);
}
}
PyDoc_STRVAR
(
get_typename__doc__
,
"name of the Tcl type"
);
static
PyObject
*
static
PyObject
*
get_typename
(
PyTclObject
*
obj
,
void
*
ignored
)
get_typename
(
PyTclObject
*
obj
,
void
*
ignored
)
{
{
return
PyString_FromString
(
obj
->
value
->
typePtr
->
name
);
return
PyString_FromString
(
obj
->
value
->
typePtr
->
name
);
}
}
static
PyGetSetDef
PyTclObject_getsetlist
[]
=
{
static
PyGetSetDef
PyTclObject_getsetlist
[]
=
{
{
"typename"
,
(
getter
)
get_typename
,
NULL
,
"name of the Tcl type"
},
{
"typename"
,
(
getter
)
get_typename
,
NULL
,
get_typename__doc__
},
{
"string"
,
(
getter
)
PyTclObject_string
,
NULL
,
"name of the Tcl type"
},
{
"string"
,
(
getter
)
PyTclObject_string
,
NULL
,
PyTclObject_string__doc__
},
{
0
},
{
0
},
};
};
static
PyMethodDef
PyTclObject_methods
[]
=
{
static
PyMethodDef
PyTclObject_methods
[]
=
{
{
"__unicode__"
,
(
PyCFunction
)
PyTclObject_unicode
,
METH_NOARGS
,
{
"__unicode__"
,
(
PyCFunction
)
PyTclObject_unicode
,
METH_NOARGS
,
"convert argument to unicode"
},
PyTclObject_unicode__doc__
},
{
0
}
{
0
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment