Changeset 2595dab in mainline for uspace/lib/libc/include/io


Ignore:
Timestamp:
2009-06-03T19:26:28Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d00ae4c
Parents:
ca3ba3a
Message:

I/O subsystem overhaul:

  • add more POSIX-like file and stream functions (with real functionality of stdin, stdout, stderr)
  • cleanup console access methods (now generic to any console-like device)
  • remove unsafe stream functions
  • add special open_node(), fd_node(), fd_phone() (file) and fopen_node(), fnode(), fphone() (stream) functions for HelenOS-specific I/O operations
Location:
uspace/lib/libc/include/io
Files:
1 edited
5 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/io/color.h

    rca3ba3a r2595dab  
    2828
    2929/** @addtogroup libc
    30  * @{ 
     30 * @{
    3131 */
    3232/** @file
    3333 */
    3434
    35 #ifndef LIBC_CONSOLE_COLOR_H_
    36 #define LIBC_CONSOLE_COLOR_H_
     35#ifndef LIBC_IO_COLOR_H_
     36#define LIBC_IO_COLOR_H_
    3737
    3838enum console_color {
    39         COLOR_BLACK     = 0,
    40         COLOR_BLUE      = 1,
    41         COLOR_GREEN     = 2,
    42         COLOR_CYAN      = 3,
    43         COLOR_RED       = 4,
    44         COLOR_MAGENTA   = 5,
    45         COLOR_YELLOW    = 6,
    46         COLOR_WHITE     = 7,
    47 
    48         CATTR_BRIGHT    = 8,
    49         CATTR_BLINK     = 8
     39        COLOR_BLACK   = 0,
     40        COLOR_BLUE    = 1,
     41        COLOR_GREEN   = 2,
     42        COLOR_CYAN    = 3,
     43        COLOR_RED     = 4,
     44        COLOR_MAGENTA = 5,
     45        COLOR_YELLOW  = 6,
     46        COLOR_WHITE   = 7,
     47       
     48        CATTR_BRIGHT  = 8,
     49        CATTR_BLINK   = 8
    5050};
    5151
    5252#endif
    53  
     53
    5454/** @}
    5555 */
  • uspace/lib/libc/include/io/console.h

    rca3ba3a r2595dab  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2008 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2828
    2929/** @addtogroup libc
    30  * @{ 
     30 * @{
    3131 */
    3232/** @file
    3333 */
    3434
    35 #ifndef LIBC_KBD_H_
    36 #define LIBC_KBD_H_
     35#ifndef LIBC_IO_CONSOLE_H_
     36#define LIBC_IO_CONSOLE_H_
    3737
    38 #include <sys/types.h>
     38#include <ipc/ipc.h>
     39#include <bool.h>
    3940
    40 typedef enum kbd_ev_type {
    41         KE_PRESS,
    42         KE_RELEASE
    43 } kbd_ev_type_t;
     41typedef enum {
     42        KEY_PRESS,
     43        KEY_RELEASE
     44} console_ev_type_t;
    4445
    45 /** Keyboard event structure. */
     46/** Console event structure. */
    4647typedef struct {
    4748        /** Press or release event. */
    48         kbd_ev_type_t type;
    49 
     49        console_ev_type_t type;
     50       
    5051        /** Keycode of the key that was pressed or released. */
    5152        unsigned int key;
    52 
     53       
    5354        /** Bitmask of modifiers held. */
    5455        unsigned int mods;
    55 
     56       
    5657        /** The character that was generated or '\0' for none. */
    5758        wchar_t c;
    58 } kbd_event_t;
     59} console_event_t;
    5960
    60 extern int kbd_get_event(kbd_event_t *);
     61extern void console_clear(int phone);
     62
     63extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols);
     64extern void console_goto(int phone, ipcarg_t row, ipcarg_t col);
     65
     66extern void console_set_style(int phone, int style);
     67extern void console_set_color(int phone, int fg_color, int bg_color, int flags);
     68extern void console_set_rgb_color(int phone, int fg_color, int bg_color);
     69
     70extern void console_cursor_visibility(int phone, bool show);
     71extern void console_kcon_enable(int phone);
     72
     73extern bool console_get_event(int phone, console_event_t *event);
    6174
    6275#endif
    63  
     76
    6477/** @}
    6578 */
  • uspace/lib/libc/include/io/keycode.h

    rca3ba3a r2595dab  
    2828
    2929/** @addtogroup libc
    30  * @{ 
     30 * @{
    3131 */
    3232/** @file
    3333 */
    3434
    35 #ifndef LIBC_KBD_KEYCODE_H_
    36 #define LIBC_KBD_KEYCODE_H_
     35#ifndef LIBC_IO_KEYCODE_H_
     36#define LIBC_IO_KEYCODE_H_
    3737
    3838/** Keycode definitions.
     
    200200
    201201enum keymod {
    202         KM_LSHIFT       = 0x001,
    203         KM_RSHIFT       = 0x002,
    204         KM_LCTRL        = 0x004,
    205         KM_RCTRL        = 0x008,
    206         KM_LALT         = 0x010,
    207         KM_RALT         = 0x020,
    208         KM_CAPS_LOCK    = 0x040,
    209         KM_NUM_LOCK     = 0x080,
    210         KM_SCROLL_LOCK  = 0x100,
    211 
    212         KM_SHIFT        = KM_LSHIFT | KM_RSHIFT,
    213         KM_CTRL         = KM_LCTRL | KM_RCTRL,
    214         KM_ALT          = KM_LALT | KM_RALT
     202        KM_LSHIFT      = 0x001,
     203        KM_RSHIFT      = 0x002,
     204        KM_LCTRL       = 0x004,
     205        KM_RCTRL       = 0x008,
     206        KM_LALT        = 0x010,
     207        KM_RALT        = 0x020,
     208        KM_CAPS_LOCK   = 0x040,
     209        KM_NUM_LOCK    = 0x080,
     210        KM_SCROLL_LOCK = 0x100,
     211       
     212        KM_SHIFT       = KM_LSHIFT | KM_RSHIFT,
     213        KM_CTRL        = KM_LCTRL | KM_RCTRL,
     214        KM_ALT         = KM_LALT | KM_RALT
    215215} keymod_t;
    216216
    217217#endif
    218  
     218
    219219/** @}
    220220 */
  • uspace/lib/libc/include/io/klog.h

    rca3ba3a r2595dab  
    3636#define LIBC_STREAM_H_
    3737
    38 #include <libarch/types.h>
     38#include <sys/types.h>
    3939
    40 #define EMFILE  -17
    41 
    42 extern ssize_t read_stdin(void *, size_t);
    43 extern int klog_puts(const char *);
     40extern size_t klog_write(const void *buf, size_t size);
    4441extern void klog_update(void);
    4542
  • uspace/lib/libc/include/io/printf_core.h

    rca3ba3a r2595dab  
    5757/** @}
    5858 */
    59  
    60  
  • uspace/lib/libc/include/io/style.h

    rca3ba3a r2595dab  
    2828
    2929/** @addtogroup libc
    30  * @{ 
     30 * @{
    3131 */
    3232/** @file
    3333 */
    3434
    35 #ifndef LIBC_CONSOLE_STYLE_H_
    36 #define LIBC_CONSOLE_STYLE_H_
     35#ifndef LIBC_IO_STYLE_H_
     36#define LIBC_IO_STYLE_H_
    3737
    3838enum console_style {
    39         STYLE_NORMAL    = 0,
    40         STYLE_EMPHASIS  = 1
     39        STYLE_NORMAL   = 0,
     40        STYLE_EMPHASIS = 1
    4141};
    4242
    4343#endif
    44  
     44
    4545/** @}
    4646 */
Note: See TracChangeset for help on using the changeset viewer.