Main Page   File List  

Client Library for Text Output


Functions

L4_CV int contxt_init (long max_sbuf_size, int scrbuf_lines)
 Init of contxt library.
L4_CV int contxt_close (void)
 Close contxt library.
L4_CV int contxt_ihb_init (contxt_ihb_t *ihb, int count, int length)
 Initialize input history buffer.
L4_CV void contxt_ihb_add (contxt_ihb_t *ihb, const char *s)
 Add string to history buffer.
L4_CV void contxt_ihb_read (char *retstr, int maxlen, contxt_ihb_t *ihb)
 Reads a maximum amount of count of characters from keyboard.
L4_CV int getchar (void)
 Read a character from keyboarde.
L4_CV int contxt_getchar (void)
 Read a character.
L4_CV int putchar (int c)
 Write a character.
L4_CV int contxt_putchar (int c)
 Write a character.
L4_CV int puts (const char *s)
 Write a string +
.
L4_CV int contxt_puts (const char *s)
 Write a string +
.
L4_CV int contxt_set_graphmode (long gmode)
 set graphic mode
L4_CV int contxt_get_graphmode (void)
 get graphic mode
L4_CV void contxt_clrscr (void)
 clear screen

This function fills the screen with the current background color


Function Documentation

L4_CV int contxt_init ( long  max_sbuf_size,
int  scrbuf_lines 
)

Init of contxt library.

Parameters:
max_sbuf_size ... max IPC string buffer
scrbuf_lines ... number of additional screenbuffer lines
This is the init-function of libcontxt. It opens a console and allocates the screen history buffer using malloc(). This functions must be called before the other functions for text output may be used.

L4_CV int contxt_close ( void   ) 

Close contxt library.

Returns:
0 on success (close a console) PANIC otherwise
Close the libcontxt console.

L4_CV int contxt_ihb_init ( contxt_ihb_t ihb,
int  count,
int  length 
)

Initialize input history buffer.

Parameters:
ihb ... input history buffer structure
count ... number of lines
length ... number of characters per line
This is the init-function of the input history buffer. The history buffer has to be already allocated. See the run example of the loader.

L4_CV void contxt_ihb_add ( contxt_ihb_t ihb,
const char *  s 
)

Add string to history buffer.

Parameters:
ihb ... input history buffer structure
s ... string to add

L4_CV void contxt_ihb_read ( char *  retstr,
int  maxlen,
contxt_ihb_t ihb 
)

Reads a maximum amount of count of characters from keyboard.

Parameters:
maxlen ... size of return string buffer
Return values:
retstr ... return string buffer
ihb ... used input history buffer if 0, no input history buffer will be used
This function reads a number (maximum maxlen) of character.

L4_CV int getchar ( void   ) 

Read a character from keyboarde.

Returns:
a character
This function reads a character. (libc)

L4_CV int contxt_getchar ( void   ) 

Read a character.

Returns:
a character
This function reads a character.

L4_CV int putchar ( int  c  ) 

Write a character.

Parameters:
c ... character
Returns:
a character
This function writes a character. (libc)

L4_CV int contxt_putchar ( int  c  ) 

Write a character.

Parameters:
c ... character
Returns:
a character
This function writes a character.

L4_CV int puts ( const char *  s  ) 

Write a string +
.

Parameters:
s ... string
Returns:
>=0 ok, EOF else
This function writes a string +
. (libc)

L4_CV int contxt_puts ( const char *  s  ) 

Write a string +
.

Parameters:
s ... string
Returns:
>=0 ok, EOF else
This function writes a string to the virtual console.

L4_CV int contxt_set_graphmode ( long  gmode  ) 

set graphic mode

Parameters:
gmode ... coded graphic mode
Returns:
0 on success (set graphic mode)
Does nothing since the graphics mode is initialized at boot time.

L4_CV int contxt_get_graphmode ( void   ) 

get graphic mode

Returns:
gmode (graphic mode)
Does nothing since the graphics mode is initialized at boot time.


DROPS Console User Manual, part of DROPS  © 2000-2003