Changeset 11 for trunk/txlib/txcon.c

Show
Ignore:
Timestamp:
05/09/06 22:21:53 (3 years ago)
Author:
jvw
Message:

DFSee 8.01 level; fix crash on huge PATH; History-popup improved (4OS2 compatible)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/txlib/txcon.c

    r7 r11  
    5353#include <txtpriv.h>                            // private text   interface 
    5454 
    55 static  SCREEN_STATE   screen_act  = SCREEN_ON; 
     55static  DEVICE_STATE   screen_act  = DEVICE_ON; 
     56static  DEVICE_STATE   logfile_act = DEVICE_ON; 
    5657 
    5758#if defined (USEWINDOWING) 
     
    427428// Test and set TxScreenState 
    428429/*****************************************************************************/ 
    429 SCREEN_STATE TxScreenState                      // RET   screen active 
    430 ( 
    431    SCREEN_STATE        action                   // IN    screen action 
    432 ) 
    433 { 
    434    if (action != SCREEN_TEST) 
     430DEVICE_STATE TxScreenState                      // RET   screen active 
     431( 
     432   DEVICE_STATE        action                   // IN    screen action 
     433) 
     434{ 
     435   if (action != DEVICE_TEST) 
    435436   { 
    436437      screen_act = action; 
     
    438439   return (screen_act); 
    439440}                                               // end 'TxScreenState' 
     441/*---------------------------------------------------------------------------*/ 
     442 
     443 
     444/*****************************************************************************/ 
     445// Test and set TxLogfileState, logging when state = ON and file opened 
     446/*****************************************************************************/ 
     447DEVICE_STATE TxLogfileState                     // RET   logfile active 
     448( 
     449   DEVICE_STATE        action                   // IN    screen action 
     450) 
     451{ 
     452   if (action != DEVICE_TEST) 
     453   { 
     454      logfile_act = action; 
     455   } 
     456   return (logfile_act); 
     457}                                               // end 'TxLogfileState' 
    440458/*---------------------------------------------------------------------------*/ 
    441459 
     
    471489      } 
    472490 
    473       if ((screen_act    == SCREEN_ON) &&       // screen output ON 
     491      if ((screen_act    == DEVICE_ON) &&       // screen output ON 
    474492          (txh_raw       == NULL))              // and not redirected to a RAW 
    475493      {                                         // stream (like scrollbuffer) 
     
    484502      { 
    485503         if ((size < hinfo->size) && (hinfo->active) && 
    486              ((screen_act == SCREEN_ON) || 
     504             ((screen_act == DEVICE_ON) || 
    487505              (hinfo->follow_screen_toggle == FALSE))) 
    488506         { 
     
    497515         { 
    498516            if ((size < hinfo->size) && (hinfo->active) && 
    499                 ((screen_act == SCREEN_ON) || 
     517                ((screen_act == DEVICE_ON) || 
    500518                 (hinfo->follow_screen_toggle == FALSE))) 
    501519            { 
     
    504522            } 
    505523         } 
    506          if (log_handle != 0) 
     524         if ((log_handle != 0) && (logfile_act == DEVICE_ON)) 
    507525         { 
    508526            if (!txc_ascii7 && log7bit)         // 7-bit ASCII for log only ? 
     
    695713   int                 ll;                      // real max line length 
    696714   int                 lines;                   // nr of lines 
    697    SCREEN_STATE        sa = screen_act; 
     715   DEVICE_STATE        sa = screen_act; 
    698716 
    699717   if ((ll = TxScreenCols() -12) < 20)          // ScreenCols will be 0 if 
     
    703721   if ((txwa->desktop != NULL) && (!TxaExeSwitch('p'))) 
    704722   { 
    705       screen_act = SCREEN_OFF;                  // no regular text if windowed 
     723      screen_act = DEVICE_OFF;                  // no regular text if windowed 
    706724   }                                            // and not 'pedantic mode' 
    707725   else 
    708726   { 
    709       screen_act = SCREEN_ON;                   // force screen for confirm 
     727      screen_act = DEVICE_ON;                   // force screen for confirm 
    710728   } 
    711729   va_start(varargs, fmt); 
     
    717735   txFreeText( mText);                          // free the text memory 
    718736 
     737   screen_act = sa;                             // restore screen state 
     738                                                // to allow sbView output while 
     739                                                // MsgBox is up (other threads!) 
    719740   #if defined (USEWINDOWING) 
    720741   if (txwa->desktop != NULL)                   // there is a desktop 
     
    774795   TxPrint("%c\n", reply); 
    775796 
    776    screen_act = sa;                             // restore screen state 
    777797   return (cf); 
    778798}                                               // end 'TxConfirm' 
     
    797817   int                 ll;                      // real max line length 
    798818   int                 lines;                   // nr of lines 
    799    SCREEN_STATE        sa = screen_act; 
     819   DEVICE_STATE        sa = screen_act; 
    800820 
    801821   if ((ll = TxScreenCols() -4) < 20)           // ScreenCols will be 0 if 
     
    805825   if ((txwa->desktop != NULL) && (acknowledge) && (!TxaExeSwitch('p'))) 
    806826   { 
    807       screen_act = SCREEN_OFF;                  // no regular text if windowed 
     827      screen_act = DEVICE_OFF;                  // no regular text if windowed 
    808828   }                                            // and not 'pedantic mode' 
    809829   else if (acknowledge) 
    810830   { 
    811       screen_act = SCREEN_ON;                   // force screen on for confirm 
     831      screen_act = DEVICE_ON;                   // force screen on for confirm 
    812832   } 
    813833   va_start(varargs, fmt); 
     
    820840   TxPrint("\n"); 
    821841 
     842   screen_act = sa;                             // restore screen state 
     843                                                // to allow sbView output while 
     844                                                // MsgBox is up (other threads!) 
    822845   if (acknowledge) 
    823846   { 
     
    845868      } 
    846869   } 
    847    screen_act = sa;                             // restore screen state 
    848870   return (rc); 
    849871}                                               // end 'TxMessage'