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
a3f36a64
Commit
a3f36a64
authored
Jun 02, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mac hack to make select() work again...
parent
e8df724a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
Modules/_tkinter.c
Modules/_tkinter.c
+61
-0
No files found.
Modules/_tkinter.c
View file @
a3f36a64
...
@@ -49,6 +49,7 @@ PERFORMANCE OF THIS SOFTWARE.
...
@@ -49,6 +49,7 @@ PERFORMANCE OF THIS SOFTWARE.
#ifdef macintosh
#ifdef macintosh
#define MAC_TCL
#define MAC_TCL
#include "myselect.h"
#endif
#endif
#include <tcl.h>
#include <tcl.h>
...
@@ -1590,6 +1591,66 @@ PyMacConvertEvent(eventPtr)
...
@@ -1590,6 +1591,66 @@ PyMacConvertEvent(eventPtr)
return
TkMacConvertEvent
(
eventPtr
);
return
TkMacConvertEvent
(
eventPtr
);
}
}
#ifdef USE_GUSI
/*
* For Python we have to override this routine (from TclMacNotify),
* since we use GUSI for our sockets, not Tcl streams. Hence, we have
* to use GUSI select to see whether our socket is ready. Note that
* createfilehandler (above) sets the type to TCL_UNIX_FD for our
* files and sockets.
*
* NOTE: this code was lifted from Tcl 7.6, it may need to be modified
* for other versions. */
int
Tcl_FileReady
(
file
,
mask
)
Tcl_File
file
;
/* File handle for a stream. */
int
mask
;
/* OR'ed combination of TCL_READABLE,
* TCL_WRITABLE, and TCL_EXCEPTION:
* indicates conditions caller cares about. */
{
int
type
;
int
fd
;
fd
=
(
int
)
Tcl_GetFileInfo
(
file
,
&
type
);
if
(
type
==
TCL_MAC_SOCKET
)
{
return
TclMacSocketReady
(
file
,
mask
);
}
else
if
(
type
==
TCL_MAC_FILE
)
{
/*
* Under the Macintosh, files are always ready, so we just
* return the mask that was passed in.
*/
return
mask
;
}
else
if
(
type
==
TCL_UNIX_FD
)
{
fd_set
readset
,
writeset
,
excset
;
struct
timeval
tv
;
FD_ZERO
(
&
readset
);
FD_ZERO
(
&
writeset
);
FD_ZERO
(
&
excset
);
if
(
mask
&
TCL_READABLE
)
FD_SET
(
fd
,
&
readset
);
if
(
mask
&
TCL_WRITABLE
)
FD_SET
(
fd
,
&
writeset
);
if
(
mask
&
TCL_EXCEPTION
)
FD_SET
(
fd
,
&
excset
);
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
if
(
select
(
fd
+
1
,
&
readset
,
&
writeset
,
&
excset
,
&
tv
)
<=
0
)
return
0
;
mask
=
0
;
if
(
FD_ISSET
(
fd
,
&
readset
)
)
mask
|=
TCL_READABLE
;
if
(
FD_ISSET
(
fd
,
&
writeset
)
)
mask
|=
TCL_WRITABLE
;
if
(
FD_ISSET
(
fd
,
&
excset
)
)
mask
|=
TCL_EXCEPTION
;
return
mask
;
}
return
0
;
}
#endif
/* USE_GUSI */
#if GENERATINGCFM
#if GENERATINGCFM
/*
/*
...
...
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