ZenWINX Logo ZenWINX

Architecture - Reference Manual - Guides

Console

Functions

int __stdcall kb_read (PKEYBOARD_INPUT_DATA pKID, int msec_timeout)
 Checks the console for keyboard input.
void winx_print (char *string)
 Displays ANSI string on the screen.
int __cdecl winx_putch (int ch)
 putch() native equivalent.
int __cdecl winx_puts (const char *string)
 puts() native equivalent.
int __cdecl winx_printf (const char *format,...)
 printf() native equivalent.
int __cdecl winx_kbhit (int msec)
 Checks the console for keyboard input.
int __cdecl winx_breakhit (int msec)
 Checks the console for the 'Break' character on the keyboard input.
int __cdecl winx_getch (void)
 getch() native equivalent.
int __cdecl winx_getche (void)
 getche() native equivalent.
int __cdecl winx_gets (char *string, int n)
 gets() native equivalent with limited number of characters to read.
int __cdecl winx_prompt (char *prompt, char *string, int n)
 Displays prompt on the screen and waits for the user input. When user presses the return key fills the string pointed by the second parameter by characters read.

Function Documentation

int __stdcall kb_read ( PKEYBOARD_INPUT_DATA  pKID,
int  msec_timeout 
)

Checks the console for keyboard input.

Tries to read from all keyboard devices until specified time-out expires.

Parameters:
[out] pKID pointer to the structure receiving keyboard input.
[in] msec_timeout time-out interval in milliseconds.
Returns:
Zero if some key was pressed, negative value otherwise.
Note:
Internal use only.

Definition at line 116 of file keyboard.c.

References kb_read_internal().

Referenced by winx_breakhit(), winx_getch(), winx_kbhit(), and winx_prompt().

void winx_print ( char *  string  ) 

Displays ANSI string on the screen.

Parameters:
[in] string the string to be displayed.
Note:
Internal use only.

Definition at line 40 of file stdio.c.

References winx_putch().

Referenced by winx_printf().

int __cdecl winx_putch ( int  ch  ) 

putch() native equivalent.

Bug:
Does not recognize special characters such as 'backspace'.

Definition at line 65 of file stdio.c.

Referenced by winx_getche(), winx_gets(), winx_print(), and winx_prompt().

int __cdecl winx_puts ( const char *  string  ) 

puts() native equivalent.

Bug:
Does not recognize special characters such as 'backspace'.

Definition at line 82 of file stdio.c.

References winx_printf().

int __cdecl winx_printf ( const char *  format,
  ... 
)

printf() native equivalent.

Bug:
Does not recognize special characters such as 'backspace'.

Definition at line 93 of file stdio.c.

References winx_heap_alloc(), winx_heap_free(), and winx_print().

Referenced by kb_open(), kb_open_internal(), kb_read_internal(), winx_get_windows_boot_options(), winx_gets(), winx_prompt(), and winx_puts().

int __cdecl winx_kbhit ( int  msec  ) 

Checks the console for keyboard input.

Waits for an input during the specified time interval.

Parameters:
[in] msec the time interval, in milliseconds.
Returns:
If any key was pressed, the return value is the ascii character or zero for the control keys. Negative value indicates failure.
Note:
  • If an INFINITE time constant is passed, the time-out interval never elapses.
  • This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.

Definition at line 165 of file stdio.c.

References kb_read().

int __cdecl winx_breakhit ( int  msec  ) 

Checks the console for the 'Break' character on the keyboard input.

Waits for an input during the specified time interval.

Parameters:
[in] msec the time interval, in milliseconds.
Returns:
If the 'Break' key was pressed, the return value is zero. Otherwise it returns negative value.
Note:
  • If an INFINITE time constant is passed, the time-out interval never elapses.
  • This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.

Definition at line 192 of file stdio.c.

References kb_read().

int __cdecl winx_getch ( void   ) 

getch() native equivalent.

Note:
This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.

Definition at line 207 of file stdio.c.

References kb_read().

Referenced by winx_getche().

int __cdecl winx_getche ( void   ) 

getche() native equivalent.

Note:
This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.
Bug:
Does not recognize special characters such as 'backspace'.

Definition at line 226 of file stdio.c.

References winx_getch(), and winx_putch().

Referenced by winx_gets().

int __cdecl winx_gets ( char *  string,
int  n 
)

gets() native equivalent with limited number of characters to read.

Parameters:
[out] string the storage for the input string.
[in] n the maximum number of characters to read.
Returns:
Number of characters read including terminal zero. Negative value indicates failure.
Note:
This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.
Bug:
Does not recognize special characters such as 'backspace'.

Definition at line 248 of file stdio.c.

References winx_getche(), winx_printf(), and winx_putch().

int __cdecl winx_prompt ( char *  prompt,
char *  string,
int  n 
)

Displays prompt on the screen and waits for the user input. When user presses the return key fills the string pointed by the second parameter by characters read.

Parameters:
[in] prompt the string to be printed as prompt.
[out] string the storage for the input string.
[in] n the maximum number of characters to read.
Returns:
Number of characters read including terminal zero. Negative value indicates failure.
Note:
  • Recognizes properly both backslash and escape keys.
  • The sentence above works fine only when user input stands in a single line of the screen.
  • This call may terminate the program if NtCancelIoFile() fails for one of the existing keyboard devices.

Definition at line 299 of file stdio.c.

References kb_read(), winx_heap_alloc(), winx_heap_free(), winx_printf(), and winx_putch().


Generated on Sat May 29 23:06:45 2010 for ZenWINX by doxygen 1.6.2