Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

console.h File Reference

Virtual consoles header. More...

Go to the source code of this file.

Data Structures

struct  console
 Virtual console structure. More...


Defines

#define BLACK   0x00
 Black color.

#define BLUE   0x01
 Blue color.

#define GREEN   0x02
 Green color.

#define CYAN   0x03
 Cyan color.

#define RED   0x04
 Red color.

#define MAGENTA   0x05
 Magenta color.

#define BROWN   0x06
 Brown color.

#define LIGHT_GREY   0x07
 Light grey color.

#define GREY   0x08
 Grey color.

#define LIGHT_BLUE   0x09
 Light blue color.

#define LIGHT_GREEN   0x0A
 Light green color.

#define LIGHT_CYAN   0x0B
 Light cyan color.

#define LIGHT_RED   0x0C
 Light red color.

#define LIGHT_MAGENTA   0x0D
 Light magenta color.

#define YELLOW   0x0E
 Yellow color.

#define WHITE   0x0F
 White color.

#define DEFAULT_COLOR   0x07
 The default color for the text of the console.

#define KEYB_BUF_DIM   32
 Size of the console keyboard buffer.

#define K_TOT_VIR_CONS   10
 Number of virtual consoles (must be at least 1).


Typedefs

typedef console console_t
 Virtual console structure.


Functions

console_tget_console_addr (int c)
 Get the address of a console structure.
Parameters:
c  The console id.
Returns:
The address of the console structure.
Exceptions:
NULL  Console c does not exists.


int get_curr_console ()
 Get the current console id.
Returns:
The current console id.


bool set_curr_console (int c)
 Set the current console.
Parameters:
c  The console id to set as current console.
Returns:
  • TRUE if c is a valid console id.
  • FALSE if c is not a valid console id.


bool switch_to_console (int c)
 Change the current console and refresh the screen.
Parameters:
c  The console to switch to.
Returns:
  • TRUE if c is a valid console id.
  • FALSE if c is not a valid console id.


void clrscr ()
 Clear the screen.

byte get_color ()
 Get the current text color of the console.
Returns:
The value of the color.


void set_color (byte attrib)
 Set the text color for the current console.
Parameters:
attrib  The color value.


void scroll_up ()
 Scroll the console up.

void gotoxy (int x, int y)
 Place the cursor at the (x, y) coordinates.
Note:
If x or y get a value of -1 they does not change their value.


void kputchar (int c)
 Put a character on the current console.
Parameters:
c  The ASCII value of the character.


int kprintf (const char *fmt,...)
 Print a string to the current console.
Parameters:
message  The format of the message.
...  The variables to print.


void init_main_console ()
 Initialize the special console #0 as the video memory buffer.

void create_virtual_console ()
 Allocate and initialize memory space for virtual consoles.
Note:
Before you can run this procedure you have to initialize the virtual memory manager.



Detailed Description

Virtual consoles header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-01
Note:
Copyright (©) 2003 Andrea Righi

Definition in file console.h.


Define Documentation

#define BLACK   0x00
 

Black color.

Definition at line 12 of file console.h.

#define BLUE   0x01
 

Blue color.

Definition at line 13 of file console.h.

#define BROWN   0x06
 

Brown color.

Definition at line 18 of file console.h.

#define CYAN   0x03
 

Cyan color.

Definition at line 15 of file console.h.

#define DEFAULT_COLOR   0x07
 

The default color for the text of the console.

Definition at line 30 of file console.h.

#define GREEN   0x02
 

Green color.

Definition at line 14 of file console.h.

#define GREY   0x08
 

Grey color.

Definition at line 20 of file console.h.

#define K_TOT_VIR_CONS   10
 

Number of virtual consoles (must be at least 1).

Definition at line 36 of file console.h.

#define KEYB_BUF_DIM   32
 

Size of the console keyboard buffer.

Definition at line 33 of file console.h.

#define LIGHT_BLUE   0x09
 

Light blue color.

Definition at line 21 of file console.h.

#define LIGHT_CYAN   0x0B
 

Light cyan color.

Definition at line 23 of file console.h.

#define LIGHT_GREEN   0x0A
 

Light green color.

Definition at line 22 of file console.h.

#define LIGHT_GREY   0x07
 

Light grey color.

Definition at line 19 of file console.h.

#define LIGHT_MAGENTA   0x0D
 

Light magenta color.

Definition at line 25 of file console.h.

#define LIGHT_RED   0x0C
 

Light red color.

Definition at line 24 of file console.h.

#define MAGENTA   0x05
 

Magenta color.

Definition at line 17 of file console.h.

#define RED   0x04
 

Red color.

Definition at line 16 of file console.h.

#define WHITE   0x0F
 

White color.

Definition at line 27 of file console.h.

#define YELLOW   0x0E
 

Yellow color.

Definition at line 26 of file console.h.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18