io.h File Reference

Header file for input.c and output.c. More...

#include "typedefs.h"
#include "sys.h"
#include "debug.h"
#include "keyboard.h"
#include "printer.h"

Go to the source code of this file.

Functions

int gets (char *str, const size_t len)
 Read at most len-1 characters from keyboard, reading is terminated by '
' character.
int getc_try (void)
 Check for character in the keyboard buffer availible.
int getc (void)
 Reads char from keyboard buffer, else blocks calling thread and waits for keypress.
unsigned int putc (const char chr)
 Put one char to console.
unsigned int puts (const char *str)
 Put null terminated string to console.
unsigned int printk (const char *format,...)
 Put formated string to the console.
unsigned int printk_unwind (const char *format, void *arguments)
 Put formated string to the console.

Variables

mutex_t keyboard_mtx
cond_t keyboard_cnd


Detailed Description

Header file for input.c and output.c.


Function Documentation

int getc ( void   ) 

Reads char from keyboard buffer, else blocks calling thread and waits for keypress.

Returns:
character from keyboard buffer

int getc_try ( void   ) 

Check for character in the keyboard buffer availible.

Returns:
EWOULDBLOCK on empty keyboard buffer, EOK else

int gets ( char *  str,
const size_t  len 
)

Read at most len-1 characters from keyboard, reading is terminated by '
' character.

Parameters:
str - null terminated returned string
len - maximum length of str buffer
Returns:
EINVAL for len equal to 0, else str length (without trailing zero)

unsigned int printk ( const char *  format,
  ... 
)

Put formated string to the console.

Parameters:
format - format null terminated format string
... - arguments c for characters, s for strings, d, u, i for integers, x for integers in hexadecimal format, p pointers without modifier for aligning and valid digits.
Returns:
number of written characters

unsigned int printk_unwind ( const char *  format,
void *  arguments 
)

Put formated string to the console.

Parameters:
format - formated null terminated format string
arguments - void pointer to arguments stored in the memory "in the line"
Returns:
number of written characters
!note! this function is used e.g. in debug.c, see function panic

unsigned int putc ( const char  chr  ) 

Put one char to console.

Parameters:
chr - char to put
Returns:
number of written characters

unsigned int puts ( const char *  str  ) 

Put null terminated string to console.

Parameters:
str - pointer to null terminatted string
Returns:
number of written characters


Variable Documentation

cond_t keyboard_cnd

keyboard pool

mutex_t keyboard_mtx

keyboard lock


Generated on Wed Nov 15 17:25:43 2006 for Kalisto by  doxygen 1.4.7