Lines Matching refs:ppst
644 static short pstReachesConsole(PerStreamTags *ppst){ in pstReachesConsole() argument
645 return (ppst->hx != INVALID_HANDLE_VALUE); in pstReachesConsole()
648 # define pstReachesConsole(ppst) 0 argument
652 static void restoreConsoleArb(PerStreamTags *ppst){ in restoreConsoleArb() argument
653 if( pstReachesConsole(ppst) ) SetConsoleMode(ppst->hx, ppst->consMode); in restoreConsoleArb()
656 # define restoreConsoleArb(ppst) argument
660 static short streamOfConsole(FILE *pf, /* out */ PerStreamTags *ppst){ in streamOfConsole() argument
665 ppst->pf = pf; in streamOfConsole()
669 ppst->hx = (rv)? fh : INVALID_HANDLE_VALUE; in streamOfConsole()
670 ppst->consMode = dwCM; in streamOfConsole()
673 ppst->pf = pf; in streamOfConsole()
674 ppst->reachesConsole = ( (short)isatty(fileno(pf)) ); in streamOfConsole()
675 return ppst->reachesConsole; in streamOfConsole()
698 static short isValidStreamInfo(PerStreamTags *ppst){ in isValidStreamInfo() argument
699 return (ppst->pf != SHELL_INVALID_FILE_PTR); in isValidStreamInfo()
711 static void maybeSetupAsConsole(PerStreamTags *ppst, short odir){ in maybeSetupAsConsole() argument
712 if( pstReachesConsole(ppst) ){ in maybeSetupAsConsole()
714 SetConsoleMode(ppst->hx, cm); in maybeSetupAsConsole()
718 # define maybeSetupAsConsole(ppst,odir) argument
725 PerStreamTags *ppst = (ix<3)? in consoleRenewSetup() local
727 maybeSetupAsConsole(ppst, (ix % 3)>0); in consoleRenewSetup()
739 PerStreamTags *ppst = &consoleInfo.pstSetup[ix]; in consoleClassifySetup() local
740 if( streamOfConsole(apf[ix], ppst) ){ in consoleClassifySetup()
743 consoleInfo.pstDesignated[ix] = *ppst; in consoleClassifySetup()
758 PerStreamTags *ppst = &pci->pstSetup[ix]; in consoleRestore() local
759 SetConsoleMode(ppst->hx, ppst->consMode); in consoleRestore()
808 PerStreamTags *ppst = isKnownWritable(pf); in designateEmitStream() local
809 if( ppst != 0 ){ in designateEmitStream()
810 PerStreamTags pst = *ppst; in designateEmitStream()
854 static int conZstrEmit(PerStreamTags *ppst, const char *z, int ncTake){ in conZstrEmit() argument
864 if( WriteConsoleW(ppst->hx, zw,nwc, 0, NULL) ){ in conZstrEmit()
876 static int conioVmPrintf(PerStreamTags *ppst, const char *zFormat, va_list ap){ in conioVmPrintf() argument
879 int rv = conZstrEmit(ppst, z, (int)strlen(z)); in conioVmPrintf()
888 PerStreamTags *ppst){ in getDesignatedEmitStream() argument
892 streamOfConsole(pf, ppst); in getDesignatedEmitStream()
893 return ppst; in getDesignatedEmitStream()
905 getEmitStreamInfo(unsigned chix, PerStreamTags *ppst, in getEmitStreamInfo() argument
913 pfEmit = ppst->pf; in getEmitStreamInfo()
917 ppstTry = ppst; in getEmitStreamInfo()
924 streamOfConsole(*ppf, ppst); in getEmitStreamInfo()
925 return ppst; in getEmitStreamInfo()
936 PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut); in oPrintfUtf8() local
943 if( pstReachesConsole(ppst) ){ in oPrintfUtf8()
944 rv = conioVmPrintf(ppst, zFormat, ap); in oPrintfUtf8()
961 PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr); in ePrintfUtf8() local
968 if( pstReachesConsole(ppst) ){ in ePrintfUtf8()
969 rv = conioVmPrintf(ppst, zFormat, ap); in ePrintfUtf8()
985 PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO); in fPrintfUtf8() local
992 if( pstReachesConsole(ppst) ){ in fPrintfUtf8()
993 maybeSetupAsConsole(ppst, 1); in fPrintfUtf8()
994 rv = conioVmPrintf(ppst, zFormat, ap); in fPrintfUtf8()
995 if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst); in fPrintfUtf8()
1009 PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO); in fPutsUtf8() local
1015 if( pstReachesConsole(ppst) ){ in fPutsUtf8()
1017 maybeSetupAsConsole(ppst, 1); in fPutsUtf8()
1018 rv = conZstrEmit(ppst, z, (int)strlen(z)); in fPutsUtf8()
1019 if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst); in fPutsUtf8()
1033 PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr); in ePutsUtf8() local
1039 if( pstReachesConsole(ppst) ) return conZstrEmit(ppst, z, (int)strlen(z)); in ePutsUtf8()
1052 PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut); in oPutsUtf8() local
1058 if( pstReachesConsole(ppst) ) return conZstrEmit(ppst, z, (int)strlen(z)); in oPutsUtf8()
1113 PerStreamTags *ppst = getEmitStreamInfo(0, &pst, &pfO); in fPutbUtf8() local
1114 if( pstReachesConsole(ppst) ){ in fPutbUtf8()
1116 maybeSetupAsConsole(ppst, 1); in fPutbUtf8()
1117 rv = conZstrEmit(ppst, cBuf, nAccept); in fPutbUtf8()
1118 if( 0 == isKnownWritable(ppst->pf) ) restoreConsoleArb(ppst); in fPutbUtf8()
1134 PerStreamTags *ppst = getEmitStreamInfo(1, &pst, &pfOut); in oPutbUtf8() local
1139 if( pstReachesConsole(ppst) ){ in oPutbUtf8()
1140 return conZstrEmit(ppst, cBuf, nAccept); in oPutbUtf8()
1154 PerStreamTags *ppst = getEmitStreamInfo(2, &pst, &pfErr); in ePutbUtf8() local
1156 if( pstReachesConsole(ppst) ){ in ePutbUtf8()
1157 return conZstrEmit(ppst, cBuf, nAccept); in ePutbUtf8()