mirror of
https://github.com/python/cpython.git
synced 2025-08-12 12:58:50 +00:00
Untabify C files. Will watch buildbots.
This commit is contained in:
parent
368ede83d9
commit
c83ea137d7
318 changed files with 198669 additions and 198669 deletions
|
@ -27,10 +27,10 @@
|
|||
/* use structure to pass command line to Python thread */
|
||||
typedef struct
|
||||
{
|
||||
int argc;
|
||||
char **argv;
|
||||
HWND Frame;
|
||||
int running;
|
||||
int argc;
|
||||
char **argv;
|
||||
HWND Frame;
|
||||
int running;
|
||||
} arglist;
|
||||
|
||||
/* make this a global to simplify access.
|
||||
|
@ -45,80 +45,80 @@ void PythonThread(void *);
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
ULONG FrameFlags = FCF_TITLEBAR |
|
||||
FCF_SYSMENU |
|
||||
FCF_SIZEBORDER |
|
||||
FCF_HIDEBUTTON |
|
||||
FCF_SHELLPOSITION |
|
||||
FCF_TASKLIST;
|
||||
HAB hab;
|
||||
HMQ hmq;
|
||||
HWND Client;
|
||||
QMSG qmsg;
|
||||
arglist args;
|
||||
int python_tid;
|
||||
ULONG FrameFlags = FCF_TITLEBAR |
|
||||
FCF_SYSMENU |
|
||||
FCF_SIZEBORDER |
|
||||
FCF_HIDEBUTTON |
|
||||
FCF_SHELLPOSITION |
|
||||
FCF_TASKLIST;
|
||||
HAB hab;
|
||||
HMQ hmq;
|
||||
HWND Client;
|
||||
QMSG qmsg;
|
||||
arglist args;
|
||||
int python_tid;
|
||||
|
||||
/* init PM and create message queue */
|
||||
hab = WinInitialize(0);
|
||||
hmq = WinCreateMsgQueue(hab, 0);
|
||||
/* init PM and create message queue */
|
||||
hab = WinInitialize(0);
|
||||
hmq = WinCreateMsgQueue(hab, 0);
|
||||
|
||||
/* create a (hidden) Window to house the window procedure */
|
||||
args.Frame = WinCreateStdWindow(HWND_DESKTOP,
|
||||
0,
|
||||
&FrameFlags,
|
||||
NULL,
|
||||
"PythonPM",
|
||||
0L,
|
||||
0,
|
||||
0,
|
||||
&Client);
|
||||
/* create a (hidden) Window to house the window procedure */
|
||||
args.Frame = WinCreateStdWindow(HWND_DESKTOP,
|
||||
0,
|
||||
&FrameFlags,
|
||||
NULL,
|
||||
"PythonPM",
|
||||
0L,
|
||||
0,
|
||||
0,
|
||||
&Client);
|
||||
|
||||
/* run Python interpreter in a thread */
|
||||
args.argc = argc;
|
||||
args.argv = argv;
|
||||
args.running = 0;
|
||||
if (-1 == (python_tid = _beginthread(PythonThread, NULL, 1024 * 1024, &args)))
|
||||
{
|
||||
/* couldn't start thread */
|
||||
WinAlarm(HWND_DESKTOP, WA_ERROR);
|
||||
PythonRC = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* process PM messages, until Python exits */
|
||||
while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0))
|
||||
WinDispatchMsg(hab, &qmsg);
|
||||
if (args.running > 0)
|
||||
DosKillThread(python_tid);
|
||||
}
|
||||
|
||||
/* destroy window, shutdown message queue and PM */
|
||||
WinDestroyWindow(args.Frame);
|
||||
WinDestroyMsgQueue(hmq);
|
||||
WinTerminate(hab);
|
||||
/* run Python interpreter in a thread */
|
||||
args.argc = argc;
|
||||
args.argv = argv;
|
||||
args.running = 0;
|
||||
if (-1 == (python_tid = _beginthread(PythonThread, NULL, 1024 * 1024, &args)))
|
||||
{
|
||||
/* couldn't start thread */
|
||||
WinAlarm(HWND_DESKTOP, WA_ERROR);
|
||||
PythonRC = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* process PM messages, until Python exits */
|
||||
while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0))
|
||||
WinDispatchMsg(hab, &qmsg);
|
||||
if (args.running > 0)
|
||||
DosKillThread(python_tid);
|
||||
}
|
||||
|
||||
return PythonRC;
|
||||
/* destroy window, shutdown message queue and PM */
|
||||
WinDestroyWindow(args.Frame);
|
||||
WinDestroyMsgQueue(hmq);
|
||||
WinTerminate(hab);
|
||||
|
||||
return PythonRC;
|
||||
}
|
||||
|
||||
void PythonThread(void *argl)
|
||||
{
|
||||
HAB hab;
|
||||
arglist *args;
|
||||
HAB hab;
|
||||
arglist *args;
|
||||
|
||||
/* PM initialisation */
|
||||
hab = WinInitialize(0);
|
||||
/* PM initialisation */
|
||||
hab = WinInitialize(0);
|
||||
|
||||
/* start Python */
|
||||
args = (arglist *)argl;
|
||||
args->running = 1;
|
||||
PythonRC = Py_Main(args->argc, args->argv);
|
||||
/* start Python */
|
||||
args = (arglist *)argl;
|
||||
args->running = 1;
|
||||
PythonRC = Py_Main(args->argc, args->argv);
|
||||
|
||||
/* enter a critical section and send the termination message */
|
||||
DosEnterCritSec();
|
||||
args->running = 0;
|
||||
WinPostMsg(args->Frame, WM_QUIT, NULL, NULL);
|
||||
/* enter a critical section and send the termination message */
|
||||
DosEnterCritSec();
|
||||
args->running = 0;
|
||||
WinPostMsg(args->Frame, WM_QUIT, NULL, NULL);
|
||||
|
||||
/* shutdown PM and terminate thread */
|
||||
WinTerminate(hab);
|
||||
_endthread();
|
||||
/* shutdown PM and terminate thread */
|
||||
WinTerminate(hab);
|
||||
_endthread();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue