MCPcopy Create free account
hub / github.com/SimHacker/micropolis / tcpMainLoopCommand

Function tcpMainLoopCommand

micropolis-activity/src/tk/tktcp.c:891–920  ·  view source on GitHub ↗

ARGSUSED*/

(clientData, interp, argc, argv)

Source from the content-addressed store, hash-verified

889
890/*
891 * tcpMainLoopCommand:
892 *
893 * This procedure is invoked in a non-Tk environment when the server
894 * implementor wishes to use a main loop built into the library. It
895 * repeatedly polls ofr work to be done, returning only when the last server
896 * is closed.
897 *
898 * In a Tk environment, the procedure returns immediately.
899 */
900
901/*ARGSUSED*/
902static int
903tcpMainLoopCommand (clientData, interp, argc, argv)
904 ClientData clientData;
905 Tcl_Interp * interp;
906 int argc;
907 char * * argv;
908{
909
910 int status;
911
912 if (argc != 1) {
913 Tcl_AppendResult (interp, "wrong # args: should be \"", argv [-1],
914 " ", argv [0], "\"", (char *) NULL);
915 return TCL_ERROR;
916 }
917
918 errno = 0; status = -1;
919
920 /* In a non-Tk environment, errno has a Unix error or 0 for no clients
921 * or servers. In a Tk environment, errno is zero at this point.
922 */
923

Callers 1

Tk_TcpCmdFunction · 0.85

Calls 1

Tcl_AppendResultFunction · 0.85

Tested by

no test coverage detected