void ICP::DcGS(void) const { // Go search NoParameters(); if (IsGameOver()) ReportGameOver(); else { Move move; FindMove(move); PrintFSL(fsLbMove); move.Print(stateptr->FetchSearchFEnv()); PrintNL(); }; }
void ICP::DcTB(void) const { // Take back move NoParameters(); if (stateptr->GetUnDoCount() == 0) PrintFS(fsUdNoTakeBackAvail); else { const Move move = stateptr->FetchLastMove(); stateptr->Unplay(); PrintFSL(fsLbUnplayedMove); move.Print(stateptr->FetchSearchFEnv()); PrintNL(); CondShowBoard(); }; }
VOID share_display_share(TCHAR * netname) { USHORT err; /* API return status */ TCHAR FAR * pBuffer; USHORT2ULONG num_read; /* num entries read by API */ USHORT maxLen; /* max msg length */ USHORT len; /* message length formater */ struct share_info_2 FAR * share_entry; struct connection_info_1 FAR * conn_entry; USHORT2ULONG i; USHORT more_data = FALSE; TCHAR txt_UNKNOWN[APE2_GEN_MAX_MSG_LEN]; LUI_GetMsg(txt_UNKNOWN, APE2_GEN_MAX_MSG_LEN, APE2_GEN_UNKNOWN); // // On NT, the redir doesn't have to be running to use the server // start_autostart(txt_SERVICE_FILE_SRV); if (err = MNetShareGetInfo(NULL, netname, 2, (LPBYTE*)&share_entry)) ErrorExit(err); GetMessageList(NUM_SHARE_MSGS, ShareMsgList, &maxLen); len = maxLen + (USHORT) 5; share_entry->shi2_type &= ~STYPE_SPECIAL; if (share_entry->shi2_type == STYPE_PRINTQ) get_print_devices(share_entry->shi2_netname); else _tcscpy(Buffer, share_entry->shi2_path); WriteToCon(fmtPSZ, 0, len, PaddedString(len,ShareMsgList[SHARE_MSG_NAME].msg_text,NULL), share_entry->shi2_netname); WriteToCon(fmtNPSZ, 0, len, PaddedString(len,ShareMsgList[SHARE_MSG_PATH].msg_text,NULL), Buffer); WriteToCon(fmtPSZ, 0, len, PaddedString(len,ShareMsgList[SHARE_MSG_REMARK].msg_text,NULL), share_entry->shi2_remark); if (share_entry->shi2_max_uses == SHI_USES_UNLIMITED) WriteToCon(fmtNPSZ, 0, len, PaddedString(len,ShareMsgList[SHARE_MSG_MAX_USERS].msg_text,NULL), ShareMsgList[SHARE_MSG_ULIMIT].msg_text); else WriteToCon(fmtULONG, 0, len, PaddedString(len,ShareMsgList[SHARE_MSG_MAX_USERS].msg_text,NULL), share_entry->shi2_max_uses); NetApiBufferFree((TCHAR FAR *) share_entry); if( (err = MNetConnectionEnum( NULL, netname, 1, (LPBYTE*)&pBuffer, &num_read)) == ERROR_MORE_DATA) more_data = TRUE; else if (err) ErrorExit( err ); WriteToCon(TEXT("%-*.*ws"),0,len, PaddedString(len,ShareMsgList[SHARE_MSG_USERS].msg_text,NULL)); for (i = 0, conn_entry = (struct connection_info_1 FAR *) pBuffer; i < num_read; i++, conn_entry++) { if ((i != 0) && ((i % 3) == 0)) WriteToCon(TEXT("%-*.*ws"),len,len, NULL_STRING); WriteToCon(TEXT("%Fws"), PaddedString(21,(conn_entry->coni1_username == NULL) ? (TCHAR FAR *)txt_UNKNOWN : conn_entry->coni1_username, NULL)); if (((i + 1) % 3) == 0) PrintNL(); } if ((i == 0) || ((i % 3) != 0)) PrintNL(); if (num_read) { NetApiBufferFree(pBuffer); } if( more_data ) InfoPrint(APE_MoreData); else InfoSuccess(); }
/*** * share_display_all() * Display info about one share or all shares * * Args: * netname - the share to display of NULL for all * * Returns: * nothing - success * exit(2) - command failed */ VOID share_display_all(VOID) { USHORT err; /* API return status */ TCHAR FAR * pBuffer; USHORT2ULONG num_read; /* num entries read by API */ USHORT maxLen; /* max msg length */ USHORT2ULONG i; struct share_info_2 FAR * share_entry; // // On NT, the redir doesn't have to be running to use the server // #if !defined(NTENV) start_autostart(txt_SERVICE_REDIR); #endif start_autostart(txt_SERVICE_FILE_SRV); if (err = MNetShareEnum( NULL, 2, (LPBYTE*)&pBuffer, &num_read)) ErrorExit(err); if (num_read == 0) EmptyExit(); NetISort(pBuffer, num_read, sizeof(struct share_info_2), CmpShrInfo2); GetMessageList(NUM_SHARE_MSGS, ShareMsgList, &maxLen); PrintNL(); InfoPrint(APE2_SHARE_MSG_HDR); PrintLine(); for (i = 0, share_entry = (struct share_info_2 FAR *) pBuffer; i < num_read; i++, share_entry++) { if (SizeOfHalfWidthString(share_entry->shi2_netname) <= 12) WriteToCon(TEXT("%Fws "),PaddedString(12,share_entry->shi2_netname,NULL)); else { WriteToCon(TEXT("%Fws"), share_entry->shi2_netname); PrintNL(); WriteToCon(TEXT("%-12.12Fws "), TEXT("")); } share_entry->shi2_type &= ~STYPE_SPECIAL; if (share_entry->shi2_type == STYPE_PRINTQ) { get_print_devices(share_entry->shi2_netname); WriteToCon(TEXT("%ws "),PaddedString(-22, Buffer, NULL)); WriteToCon(TEXT("%ws "),PaddedString( 8, ShareMsgList[SHARE_MSG_SPOOLED].msg_text, NULL)); } else { WriteToCon(TEXT("%Fws "),PaddedString(-31,share_entry->shi2_path,NULL)); } WriteToCon(TEXT("%Fws"),PaddedString(-34,share_entry->shi2_remark,NULL)); PrintNL(); } InfoSuccess(); NetApiBufferFree(pBuffer); }