]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/drivers/libc_backend.h
Inital import
[l4.git] / kernel / fiasco / src / drivers / libc_backend.h
1 /* */
2
3
4
5 /* This file defines the backend interface */
6 /* of the kernel c-library. */
7
8 #ifndef __LIBC_BACKEND_H__
9 #define __LIBC_BACKEND_H__
10
11 #include <stddef.h>
12 #include <cdefs.h>
13
14 __BEGIN_DECLS
15
16 /** 
17  * The text output backend. 
18  * 
19  * This function must be provided to the c-library for
20  * text output. It must simply send len characters of s
21  * to an output device.
22  *
23  * @param s the string to send (not zero terminated).
24  * @param len the number of characters.
25  * @return 1 on success, 0 else.
26  */
27 int __libc_backend_outs( const char *s, size_t len );
28
29
30 /**
31  * The text input backend.
32  *
33  * This function must be provided to the c-library for 
34  * text input. It has to block til len characters are
35  * read or a newline is reached. The retrurn value gives 
36  * the number of characters virtually read.
37  *
38  * @param s a poiznter to the buffer for the read text.
39  * @param len the size of the buffer.
40  * @return the number of characters virtually read.
41  */
42 int __libc_backend_ins( char *s, size_t len );
43
44 unsigned long __libc_backend_printf_lock(void);
45 void __libc_backend_printf_unlock(unsigned long);
46
47 __END_DECLS
48
49
50 #endif //__LIBC_BACKEND_H__