Changeset f4f866c in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2010-04-23T21:42:26Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c39a907
Parents:
38aaacc2 (diff), 80badbe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
uspace/lib/c/include
Files:
3 added
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/bool.h

    r38aaacc2 rf4f866c  
    3636#define LIBC_BOOL_H_
    3737
    38 #define false 0
    39 #define true 1
     38#include <libarch/types.h>
    4039
    41 typedef short bool;
     40#define false  0
     41#define true   1
     42
     43typedef uint8_t bool;
    4244
    4345#endif
  • uspace/lib/c/include/errno.h

    r38aaacc2 rf4f866c  
    4343#define errno _errno
    4444
    45 #define EMFILE        (-17)
     45#define EMFILE        (-18)
    4646#define ENAMETOOLONG  (-256)
    4747#define EISDIR        (-257)
  • uspace/lib/c/include/futex.h

    r38aaacc2 rf4f866c  
    3939#include <sys/types.h>
    4040
    41 #define FUTEX_INITIALIZER     {1}
     41#define FUTEX_INITIALIZER  {1}
    4242
    4343typedef atomic_t futex_t;
  • uspace/lib/c/include/io/color.h

    r38aaacc2 rf4f866c  
    3636#define LIBC_IO_COLOR_H_
    3737
    38 enum console_color {
     38typedef enum {
    3939        COLOR_BLACK   = 0,
    4040        COLOR_BLUE    = 1,
     
    4848        CATTR_BRIGHT  = 8,
    4949        CATTR_BLINK   = 8
    50 };
     50} console_color_t;
    5151
    5252#endif
  • uspace/lib/c/include/io/console.h

    r38aaacc2 rf4f866c  
    4444} console_ev_type_t;
    4545
    46 enum {
     46typedef enum {
    4747        CONSOLE_CCAP_NONE = 0,
    4848        CONSOLE_CCAP_STYLE,
    4949        CONSOLE_CCAP_INDEXED,
    5050        CONSOLE_CCAP_RGB
    51 };
     51} console_caps_t;
    5252
    5353/** Console event structure. */
     
    6868extern void console_clear(int phone);
    6969
    70 extern int console_get_size(int phone, int *cols, int *rows);
    71 extern int console_get_pos(int phone, int *col, int *row);
    72 extern void console_goto(int phone, int col, int row);
     70extern int console_get_size(int phone, ipcarg_t *cols, ipcarg_t *rows);
     71extern int console_get_pos(int phone, ipcarg_t *col, ipcarg_t *row);
     72extern void console_set_pos(int phone, ipcarg_t col, ipcarg_t row);
    7373
    74 extern void console_set_style(int phone, int style);
    75 extern void console_set_color(int phone, int fg_color, int bg_color, int flags);
    76 extern void console_set_rgb_color(int phone, int fg_color, int bg_color);
     74extern void console_set_style(int phone, uint8_t style);
     75extern void console_set_color(int phone, uint8_t fg_color, uint8_t bg_color,
     76    uint8_t flags);
     77extern void console_set_rgb_color(int phone, uint32_t fg_color, uint32_t bg_color);
    7778
    7879extern void console_cursor_visibility(int phone, bool show);
    79 extern int console_get_color_cap(int phone, int *ccap);
     80extern int console_get_color_cap(int phone, ipcarg_t *ccap);
    8081extern void console_kcon_enable(int phone);
    8182
  • uspace/lib/c/include/io/keycode.h

    r38aaacc2 rf4f866c  
    5151 * they really are organized here by position, rather than by label.
    5252 */
    53 enum keycode {
     53typedef enum {
    5454
    5555        /* Main block row 1 */
     
    199199} keycode_t;
    200200
    201 enum keymod {
     201typedef enum {
    202202        KM_LSHIFT      = 0x001,
    203203        KM_RSHIFT      = 0x002,
  • uspace/lib/c/include/io/klog.h

    r38aaacc2 rf4f866c  
    3333 */
    3434
    35 #ifndef LIBC_STREAM_H_
    36 #define LIBC_STREAM_H_
     35#ifndef LIBC_IO_KLOG_H_
     36#define LIBC_IO_KLOG_H_
    3737
    3838#include <sys/types.h>
    3939
    40 extern size_t klog_write(const void *buf, size_t size);
     40extern size_t klog_write(const void *, size_t);
    4141extern void klog_update(void);
    4242
  • uspace/lib/c/include/io/printf_core.h

    r38aaacc2 rf4f866c  
    4040
    4141/** Structure for specifying output methods for different printf clones. */
    42 typedef struct printf_spec {
     42typedef struct {
    4343        /* String output function, returns number of printed characters or EOF */
    4444        int (*str_write)(const char *, size_t, void *);
     
    5151} printf_spec_t;
    5252
    53 int printf_core(const char *fmt, printf_spec_t *ps, va_list ap);
     53extern int printf_core(const char *, printf_spec_t *, va_list);
    5454
    5555#endif
  • uspace/lib/c/include/io/screenbuffer.h

    r38aaacc2 rf4f866c  
    3333 */
    3434
    35 #ifndef SCREENBUFFER_H__
    36 #define SCREENBUFFER_H__
     35#ifndef LIBC_SCREENBUFFER_H__
     36#define LIBC_SCREENBUFFER_H__
    3737
    3838#include <stdint.h>
    3939#include <sys/types.h>
     40#include <ipc/ipc.h>
    4041#include <bool.h>
    4142
    42 #define DEFAULT_FOREGROUND  0x0       /**< default console foreground color */
    43 #define DEFAULT_BACKGROUND  0xf0f0f0  /**< default console background color */
     43typedef enum {
     44        at_style,
     45        at_idx,
     46        at_rgb
     47} attr_type_t;
    4448
    4549typedef struct {
     
    5862} attr_rgb_t;
    5963
     64typedef union {
     65        attr_style_t s;
     66        attr_idx_t i;
     67        attr_rgb_t r;
     68} attr_val_t;
     69
    6070typedef struct {
    61         enum {
    62                 at_style,
    63                 at_idx,
    64                 at_rgb
    65         } t;
    66         union {
    67                 attr_style_t s;
    68                 attr_idx_t i;
    69                 attr_rgb_t r;
    70         } a;
     71        attr_type_t t;
     72        attr_val_t a;
    7173} attrs_t;
    7274
     
    8284        keyfield_t *buffer;      /**< Screen content - characters and
    8385                                      their attributes (used as a circular buffer) */
    84         size_t size_x;           /**< Number of columns  */
    85         size_t size_y;           /**< Number of rows */
     86        ipcarg_t size_x;         /**< Number of columns  */
     87        ipcarg_t size_y;         /**< Number of rows */
    8688       
    8789        /** Coordinates of last printed character for determining cursor position */
    88         size_t position_x;
    89         size_t position_y;
     90        ipcarg_t position_x;
     91        ipcarg_t position_y;
    9092       
    9193        attrs_t attrs;           /**< Current attributes. */
     
    107109 *
    108110 */
    109 static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y)
     111static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y)
    110112{
    111113        return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x;
     
    120122 *
    121123 */
    122 static inline int attrs_same(attrs_t a1, attrs_t a2)
     124static inline bool attrs_same(attrs_t a1, attrs_t a2)
    123125{
    124126        if (a1.t != a2.t)
    125                 return 0;
     127                return false;
    126128       
    127129        switch (a1.t) {
     
    137139        }
    138140       
    139         return 0;
     141        return false;
    140142}
    141143
     144extern void screenbuffer_putchar(screenbuffer_t *, wchar_t);
     145extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t);
    142146
    143 void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c);
    144 screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y);
    145 
    146 void screenbuffer_clear(screenbuffer_t *scr);
    147 void screenbuffer_clear_line(screenbuffer_t *scr, size_t line);
    148 void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest);
    149 void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y);
    150 void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style);
    151 void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color,
    152     uint8_t bg_color, uint8_t attr);
    153 void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color,
    154     uint32_t bg_color);
     147extern void screenbuffer_clear(screenbuffer_t *);
     148extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t);
     149extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *);
     150extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t);
     151extern void screenbuffer_set_style(screenbuffer_t *, uint8_t);
     152extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t);
     153extern void screenbuffer_set_rgb_color(screenbuffer_t *, uint32_t, uint32_t);
    155154
    156155#endif
  • uspace/lib/c/include/io/style.h

    r38aaacc2 rf4f866c  
    3636#define LIBC_IO_STYLE_H_
    3737
    38 enum console_style {
     38typedef enum {
    3939        STYLE_NORMAL   = 0,
    40         STYLE_EMPHASIS = 1
    41 };
     40        STYLE_EMPHASIS = 1,
     41        STYLE_INVERTED = 2,
     42        STYLE_SELECTED = 3
     43} console_style_t;
    4244
    4345#endif
  • uspace/lib/c/include/str.h

    r38aaacc2 rf4f866c  
    8686extern char *str_ndup(const char *, size_t max_size);
    8787
     88extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix);
     89
    8890/*
    8991 * TODO: Get rid of this.
  • uspace/lib/c/include/sysinfo.h

    r38aaacc2 rf4f866c  
    3131 */
    3232/** @file
    33  */ 
     33 */
    3434
    3535#ifndef LIBC_SYSINFO_H_
     
    3737
    3838#include <libc.h>
    39 #include <sysinfo.h>
    40 #include <str.h>
    4139
    42 sysarg_t sysinfo_value(const char *name);
     40/** Sysinfo value types
     41 *
     42 */
     43typedef enum {
     44        SYSINFO_VAL_UNDEFINED = 0,
     45        SYSINFO_VAL_VAL = 1,
     46        SYSINFO_VAL_DATA = 2
     47} sysinfo_item_tag_t;
     48
     49extern sysinfo_item_tag_t sysinfo_get_tag(const char *);
     50extern int sysinfo_get_value(const char *, sysarg_t *);
     51extern void *sysinfo_get_data(const char *, size_t *);
    4352
    4453#endif
  • uspace/lib/c/include/task.h

    r38aaacc2 rf4f866c  
    4646
    4747extern task_id_t task_get_id(void);
    48 extern int task_set_name(const char *name);
    49 extern task_id_t task_spawn(const char *path, const char *const argv[]);
    50 extern int task_wait(task_id_t id, task_exit_t *texit, int *retval);
    51 extern int task_retval(int val);
    52 
     48extern int task_set_name(const char *);
     49extern task_id_t task_spawn(const char *, const char *const[], int *);
     50extern int task_wait(task_id_t id, task_exit_t *, int *);
     51extern int task_retval(int);
    5352
    5453#endif
Note: See TracChangeset for help on using the changeset viewer.