Ignore:
Timestamp:
Oct 20, 2000, 1:46:48 PM (25 years ago)
Author:
sandervl
Message:

basic support for VIO console command line apps added + FormatMessage addition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/conin.cpp

    r4407 r4502  
    1 /* $Id: conin.cpp,v 1.12 2000-10-03 17:28:28 sandervl Exp $ */
     1/* $Id: conin.cpp,v 1.13 2000-10-20 11:46:45 sandervl Exp $ */
    22
    33/*
     
    3232#define  INCL_VIO
    3333#define  INCL_AVIO
    34 #include <os2wrap.h>    //Odin32 OS/2 api wrappers
     34#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    3535
    3636#include <win32api.h>
     
    4545#include <heapstring.h>
    4646
    47 #define DBG_LOCALLOG    DBG_conin
     47#define DBG_LOCALLOG    DBG_conin
    4848#include "dbglocal.h"
    4949
     
    128128  for (;fLoop;)                       /* until we got some characters */
    129129  {
    130     if (iConsoleInputQueryEvents() == 0)      /* if queue is currently empty */
    131     {
    132       rc = DosWaitEventSem(pConsoleInput->hevInputQueue,    /* wait for input */
    133                            SEM_INDEFINITE_WAIT);
    134       DosResetEventSem(pConsoleInput->hevInputQueue,       /* reset semaphore */
    135                        &ulPostCounter);            /* post counter - ignored */
    136     }
     130    iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_WAIT);      /* if queue is currently empty */
    137131
    138132    do
     
    158152            // @@@PH 2000/08/10 changed behaviour to return ALL input events
    159153            // recorded in the console.
    160             fLoop = (iConsoleInputQueryEvents() != 0);
     154            fLoop = (iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_PEEK) != 0);
    161155
    162156          // record key stroke
     
    170164                // key events, etc.
    171165                break;
    172              
     166
    173167              case 0x03: // ctrl-c is filtered!
    174168                // @@@PH we're supposed to call a ctrl-c break handler here!
    175169                break;
    176              
     170
    177171              case 0x0d: // CR
    178172                // CR is automatically expanded to CRLF if in line input mode!
     
    188182                    ulCounter++;
    189183                  }
    190                  
     184
    191185                  if (pConsoleInput->dwConsoleMode & ENABLE_ECHO_INPUT)
    192186                    HMWriteFile(pConsoleGlobals->hConsoleBuffer,
     
    195189                        &ulPostCounter,                      /* dummy result */
    196190                        NULL);
    197                  
     191
    198192                }
    199              
     193
    200194                break;
    201195
     
    443437#endif
    444438
     439  //get all pending events
     440  iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_PEEK);
     441
    445442  pConsoleInput->ulIndexFree  = 0;
    446443  pConsoleInput->ulIndexEvent = 0;
     
    507504#endif
    508505
    509   *lpNumberOfEvents = pConsoleInput->ulEvents;     /* return number of events */
     506  //get all pending events and return number of events
     507  *lpNumberOfEvents = iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_PEEK);
    510508
    511509  return (TRUE);
     
    548546#endif
    549547
    550   if (iConsoleInputQueryEvents() == 0)        /* if queue is currently empty */
     548  if (iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_PEEK) == 0)        /* if queue is currently empty */
    551549  {
    552550    *lpcRead = 0;                               /* no events read from queue */
     
    620618#endif
    621619
    622   if (iConsoleInputQueryEvents() == 0)        /* if queue is currently empty */
     620  if (iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_PEEK) == 0)        /* if queue is currently empty */
    623621  {
    624622    *lpcRead = 0;                               /* no events read from queue */
     
    786784#endif
    787785
    788   if (iConsoleInputQueryEvents() == 0)        /* if queue is currently empty */
    789   {
    790     rc = DosWaitEventSem(pConsoleInput->hevInputQueue,     /* wait for input */
    791                          SEM_INDEFINITE_WAIT);
    792     DosResetEventSem(pConsoleInput->hevInputQueue,        /* reset semaphore */
    793                      &ulPostCounter);              /* post counter - ignored */
    794   }
    795 
     786  iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_WAIT);
    796787
    797788  /* now read events into target buffer */
     
    842833#endif
    843834
    844   if (iConsoleInputQueryEvents() == 0)        /* if queue is currently empty */
    845   {
    846     rc = DosWaitEventSem(pConsoleInput->hevInputQueue,      /* wait for input */
    847                          SEM_INDEFINITE_WAIT);
    848     DosResetEventSem(pConsoleInput->hevInputQueue,         /* reset semaphore */
    849                      &ulPostCounter);              /* post counter - ignored */
    850   }
    851 
     835  iConsoleInputQueryEvents(pConsoleInput, QUERY_EVENT_WAIT);
    852836
    853837  /* now read events into target buffer */
Note: See TracChangeset for help on using the changeset viewer.