Changeset 46c20c8 in mainline for uspace/lib/c/include
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45df59a
- Parents:
- fb150d78 (diff), ffdd2b9 (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. - Location:
- uspace/lib/c/include
- Files:
-
- 43 added
- 85 moved
-
adt/char_map.h (added)
-
adt/dynamic_fifo.h (added)
-
adt/fifo.h (moved) (moved from uspace/lib/libc/include/adt/fifo.h )
-
adt/gcdlcm.h (moved) (moved from uspace/lib/libc/include/adt/gcdlcm.h )
-
adt/generic_char_map.h (added)
-
adt/generic_field.h (added)
-
adt/hash_table.h (moved) (moved from uspace/lib/libc/include/adt/hash_table.h )
-
adt/int_map.h (added)
-
adt/list.h (moved) (moved from uspace/lib/libc/include/adt/list.h )
-
adt/measured_strings.h (added)
-
align.h (moved) (moved from uspace/lib/libc/include/align.h )
-
arg_parse.h (added)
-
as.h (moved) (moved from uspace/lib/libc/include/as.h )
-
assert.h (moved) (moved from uspace/lib/libc/include/assert.h ) (1 diff)
-
async.h (moved) (moved from uspace/lib/libc/include/async.h ) (1 diff)
-
async_priv.h (moved) (moved from uspace/lib/libc/include/async_priv.h )
-
async_rel.h (moved) (moved from uspace/lib/libc/generic/sysinfo.c ) (2 diffs)
-
atomic.h (moved) (moved from uspace/lib/libc/include/atomic.h )
-
atomicdflt.h (moved) (moved from uspace/lib/libc/include/atomicdflt.h ) (1 diff)
-
bitops.h (moved) (moved from uspace/lib/libc/include/bitops.h )
-
bool.h (moved) (moved from uspace/lib/libc/include/bool.h ) (1 diff)
-
byteorder.h (moved) (moved from uspace/lib/libc/include/byteorder.h ) (1 diff)
-
cap.h (moved) (moved from uspace/lib/libc/include/cap.h )
-
clipboard.h (moved) (moved from uspace/lib/libc/include/clipboard.h )
-
ctype.h (moved) (moved from uspace/lib/libc/include/ctype.h )
-
ddi.h (moved) (moved from uspace/lib/libc/include/ddi.h ) (1 diff)
-
device/char.h (moved) (moved from boot/generic/printf.h ) (3 diffs)
-
device/hw_res.h (added)
-
devman.h (added)
-
devmap.h (moved) (moved from uspace/lib/libc/include/devmap.h ) (2 diffs)
-
dirent.h (moved) (moved from uspace/lib/libc/include/dirent.h )
-
err.h (moved) (moved from uspace/lib/libc/include/err.h ) (1 diff)
-
errno.h (added)
-
event.h (moved) (moved from uspace/lib/libc/include/event.h )
-
fcntl.h (moved) (moved from uspace/lib/libc/include/fcntl.h )
-
fibril.h (moved) (moved from uspace/lib/libc/include/fibril.h ) (2 diffs)
-
fibril_synch.h (moved) (moved from uspace/lib/libc/include/fibril_synch.h ) (5 diffs)
-
futex.h (moved) (moved from uspace/lib/libc/include/futex.h ) (1 diff)
-
getopt.h (moved) (moved from uspace/lib/libc/include/getopt.h )
-
inttypes.h (moved) (moved from uspace/lib/libc/include/inttypes.h )
-
io/color.h (moved) (moved from uspace/lib/libc/include/io/color.h ) (2 diffs)
-
io/console.h (moved) (moved from uspace/lib/libc/include/io/console.h ) (2 diffs)
-
io/keycode.h (moved) (moved from uspace/lib/libc/include/io/keycode.h ) (2 diffs)
-
io/klog.h (moved) (moved from uspace/lib/libc/include/io/klog.h ) (1 diff)
-
io/printf_core.h (moved) (moved from uspace/lib/libc/include/io/printf_core.h ) (2 diffs)
-
io/screenbuffer.h (moved) (moved from uspace/srv/hid/console/screenbuffer.h ) (6 diffs)
-
io/style.h (moved) (moved from uspace/lib/libc/include/io/style.h ) (1 diff)
-
ipc/adb.h (moved) (moved from uspace/lib/libc/include/ipc/adb.h )
-
ipc/arp.h (added)
-
ipc/bd.h (moved) (moved from uspace/lib/libc/include/ipc/bd.h )
-
ipc/bus.h (moved) (moved from uspace/lib/libc/include/ipc/bus.h )
-
ipc/char.h (moved) (moved from uspace/lib/libc/include/ipc/char.h )
-
ipc/clipboard.h (moved) (moved from uspace/lib/libc/include/ipc/clipboard.h )
-
ipc/console.h (moved) (moved from uspace/lib/libc/include/ipc/console.h )
-
ipc/dev_iface.h (added)
-
ipc/devman.h (added)
-
ipc/devmap.h (moved) (moved from uspace/lib/libc/include/ipc/devmap.h ) (2 diffs)
-
ipc/driver.h (added)
-
ipc/fb.h (moved) (moved from uspace/lib/libc/include/ipc/fb.h )
-
ipc/icmp.h (added)
-
ipc/il.h (added)
-
ipc/ip.h (added)
-
ipc/ipc.h (moved) (moved from uspace/lib/libc/include/ipc/ipc.h )
-
ipc/kbd.h (moved) (moved from uspace/lib/libc/include/ipc/kbd.h )
-
ipc/loader.h (moved) (moved from uspace/lib/libc/include/ipc/loader.h )
-
ipc/mouse.h (moved) (moved from uspace/lib/libc/include/ipc/mouse.h )
-
ipc/net.h (added)
-
ipc/net_net.h (moved) (moved from uspace/lib/libc/include/errno.h ) (2 diffs)
-
ipc/netif.h (added)
-
ipc/nil.h (added)
-
ipc/ns.h (moved) (moved from uspace/lib/libc/include/ipc/ns.h )
-
ipc/packet.h (moved) (moved from kernel/generic/include/synch/rwlock.h ) (2 diffs)
-
ipc/serial_ctl.h (added)
-
ipc/services.h (moved) (moved from uspace/lib/libc/include/ipc/services.h ) (2 diffs)
-
ipc/socket.h (added)
-
ipc/tl.h (added)
-
ipc/vfs.h (moved) (moved from uspace/lib/libc/include/ipc/vfs.h )
-
libc.h (moved) (moved from uspace/lib/libc/include/libc.h )
-
limits.h (moved) (moved from uspace/lib/libc/include/limits.h )
-
loader/loader.h (moved) (moved from uspace/lib/libc/include/loader/loader.h ) (1 diff)
-
loader/pcb.h (moved) (moved from uspace/lib/libc/include/loader/pcb.h )
-
macros.h (moved) (moved from uspace/lib/libc/include/macros.h ) (1 diff)
-
malloc.h (moved) (moved from uspace/lib/libc/include/malloc.h ) (1 diff)
-
mem.h (moved) (moved from uspace/lib/libc/include/mem.h )
-
net/device.h (added)
-
net/icmp_api.h (added)
-
net/icmp_codes.h (added)
-
net/icmp_common.h (added)
-
net/in.h (added)
-
net/in6.h (added)
-
net/inet.h (moved) (moved from uspace/lib/libc/arch/ia32/include/istate.h ) (2 diffs)
-
net/ip_codes.h (added)
-
net/ip_protocols.h (added)
-
net/modules.h (added)
-
net/packet.h (added)
-
net/packet_header.h (added)
-
net/socket.h (added)
-
net/socket_codes.h (added)
-
net/socket_parse.h (added)
-
rwlock.h (moved) (moved from uspace/lib/libc/include/rwlock.h )
-
setjmp.h (moved) (moved from uspace/lib/libc/include/setjmp.h )
-
smc.h (moved) (moved from uspace/lib/libc/include/smc.h )
-
sort.h (added)
-
stacktrace.h (moved) (moved from uspace/lib/libc/include/stacktrace.h ) (1 diff)
-
stats.h (added)
-
stdarg.h (moved) (moved from uspace/lib/libc/include/stdarg.h )
-
stddef.h (moved) (moved from uspace/lib/libc/include/stddef.h )
-
stdint.h (added)
-
stdio.h (moved) (moved from uspace/lib/libc/include/stdio.h ) (7 diffs)
-
stdlib.h (moved) (moved from uspace/lib/libc/include/stdlib.h )
-
str.h (moved) (moved from uspace/lib/libc/include/string.h ) (2 diffs)
-
str_error.h (added)
-
sys/mman.h (moved) (moved from uspace/lib/libc/include/sys/mman.h ) (2 diffs)
-
sys/stat.h (moved) (moved from uspace/lib/libc/include/sys/stat.h ) (2 diffs)
-
sys/time.h (moved) (moved from uspace/lib/libc/include/sys/time.h ) (2 diffs)
-
sys/typefmt.h (added)
-
sys/types.h (moved) (moved from uspace/lib/libc/include/sys/types.h ) (1 diff)
-
syscall.h (moved) (moved from uspace/lib/libc/include/syscall.h )
-
sysinfo.h (moved) (moved from uspace/lib/libc/include/sysinfo.h ) (2 diffs)
-
task.h (moved) (moved from uspace/lib/libc/include/task.h ) (1 diff)
-
thread.h (moved) (moved from uspace/lib/libc/include/thread.h ) (1 diff)
-
time.h (moved) (moved from uspace/lib/libc/include/time.h )
-
tls.h (moved) (moved from uspace/lib/libc/include/tls.h )
-
trace.h (added)
-
udebug.h (moved) (moved from uspace/lib/libc/include/udebug.h )
-
unistd.h (moved) (moved from uspace/lib/libc/include/unistd.h ) (4 diffs)
-
vfs/canonify.h (moved) (moved from uspace/lib/libc/include/vfs/canonify.h )
-
vfs/vfs.h (moved) (moved from uspace/lib/libc/include/vfs/vfs.h ) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/assert.h
rfb150d78 r46c20c8 51 51 52 52 #ifndef NDEBUG 53 # define assert(expr) \ 54 do { \ 55 if (!(expr)) { \ 56 printf("Assertion failed (%s) at file '%s', " \ 57 "line %d.\n", #expr, __FILE__, __LINE__); \ 58 abort(); \ 59 } \ 60 } while (0) 61 #else 62 # define assert(expr) 63 #endif 53 54 #define assert(expr) \ 55 do { \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 61 } while (0) 62 63 #else /* NDEBUG */ 64 65 #define assert(expr) 66 67 #endif /* NDEBUG */ 64 68 65 69 #endif -
uspace/lib/c/include/async.h
rfb150d78 r46c20c8 259 259 } 260 260 261 extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t); 262 extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t); 263 261 264 /* 262 265 * User-friendly wrappers for async_share_in_start(). -
uspace/lib/c/include/async_rel.h
rfb150d78 r46c20c8 1 1 /* 2 * Copyright (c) 20 06Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 #include <libc.h> 36 #include <sysinfo.h> 37 #include <string.h> 35 #ifndef LIBC_ASYNC_REL_H_ 36 #define LIBC_ASYNC_REL_H_ 38 37 39 sysarg_t sysinfo_value(char *name) 40 { 41 return __SYSCALL2(SYS_SYSINFO_VALUE, (sysarg_t ) name, 42 (sysarg_t) str_size(name)); 43 } 38 extern int async_rel_init(void); 39 extern int async_relation_create(int); 40 extern void async_relation_destroy(int, int); 41 42 #endif 44 43 45 44 /** @} -
uspace/lib/c/include/atomicdflt.h
rfb150d78 r46c20c8 37 37 38 38 #ifndef LIBC_ARCH_ATOMIC_H_ 39 #error This file cannot be included directly, include atomic.h instead.39 #error This file cannot be included directly, include atomic.h instead. 40 40 #endif 41 41 42 #include <stdint.h> 42 43 #include <bool.h> 43 44 44 45 typedef struct atomic { 45 volatile longcount;46 volatile atomic_count_t count; 46 47 } atomic_t; 47 48 48 static inline void atomic_set(atomic_t *val, longi)49 static inline void atomic_set(atomic_t *val, atomic_count_t i) 49 50 { 50 val->count = i;51 val->count = i; 51 52 } 52 53 53 static inline longatomic_get(atomic_t *val)54 static inline atomic_count_t atomic_get(atomic_t *val) 54 55 { 55 return val->count;56 return val->count; 56 57 } 57 58 58 #ifndef CAS 59 static inline bool cas(atomic_t *val, long ov, longnv)59 #ifndef CAS 60 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv) 60 61 { 61 62 return __sync_bool_compare_and_swap(&val->count, ov, nv); -
uspace/lib/c/include/bool.h
rfb150d78 r46c20c8 36 36 #define LIBC_BOOL_H_ 37 37 38 #define false 0 39 #define true 1 38 #include <libarch/types.h> 40 39 41 typedef short bool; 40 #define false 0 41 #define true 1 42 43 typedef uint8_t bool; 42 44 43 45 #endif -
uspace/lib/c/include/byteorder.h
rfb150d78 r46c20c8 80 80 #endif 81 81 82 #define htons(n) host2uint16_t_be((n)) 83 #define htonl(n) host2uint32_t_be((n)) 84 #define ntohs(n) uint16_t_be2host((n)) 85 #define ntohl(n) uint32_t_be2host((n)) 86 82 87 static inline uint64_t uint64_t_byteorder_swap(uint64_t n) 83 88 { -
uspace/lib/c/include/ddi.h
rfb150d78 r46c20c8 41 41 extern int physmem_map(void *, void *, unsigned long, int); 42 42 extern int iospace_enable(task_id_t, void *, unsigned long); 43 extern int preemption_control(int);44 43 extern int pio_enable(void *, size_t, void **); 44 extern int interrupt_enable(int); 45 extern int interrupt_disable(int); 45 46 46 47 #endif -
uspace/lib/c/include/device/char.h
rfb150d78 r46c20c8 1 1 /* 2 * Copyright (c) 20 06 Martin Decky2 * Copyright (c) 2010 Lenka Trochtova 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup generic29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef BOOT_PRINTF_H_36 #define BOOT_PRINTF_H_35 #ifndef LIBC_DEVICE_HW_RES_H_ 36 #define LIBC_DEVICE_HW_RES_H_ 37 37 38 #define INT8 1 39 #define INT16 2 40 #define INT32 4 41 #define INT64 8 38 typedef enum { 39 CHAR_READ_DEV = 0, 40 CHAR_WRITE_DEV 41 } hw_res_funcs_t; 42 42 43 extern void puts(const char *str); 44 extern void printf(const char *fmt, ...); 45 46 extern void write(const char *str, const int len); 43 ssize_t read_dev(int dev_phone, void *buf, size_t len); 44 ssize_t write_dev(int dev_phone, void *buf, size_t len); 47 45 48 46 #endif -
uspace/lib/c/include/devmap.h
rfb150d78 r46c20c8 44 44 45 45 extern int devmap_driver_register(const char *, async_client_conn_t); 46 extern int devmap_device_register(const char *, dev _handle_t *);46 extern int devmap_device_register(const char *, devmap_handle_t *); 47 47 48 extern int devmap_device_get_handle(const char *, dev _handle_t *, unsigned int);49 extern int devmap_namespace_get_handle(const char *, dev _handle_t *, unsigned int);50 extern devmap_handle_type_t devmap_handle_probe(dev _handle_t);48 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int); 49 extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int); 50 extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t); 51 51 52 extern int devmap_device_connect(dev _handle_t, unsigned int);52 extern int devmap_device_connect(devmap_handle_t, unsigned int); 53 53 54 54 extern int devmap_null_create(void); … … 56 56 57 57 extern size_t devmap_count_namespaces(void); 58 extern size_t devmap_count_devices(dev _handle_t);58 extern size_t devmap_count_devices(devmap_handle_t); 59 59 60 60 extern size_t devmap_get_namespaces(dev_desc_t **); 61 extern size_t devmap_get_devices(dev _handle_t, dev_desc_t **);61 extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **); 62 62 63 63 #endif -
uspace/lib/c/include/err.h
rfb150d78 r46c20c8 36 36 #define LIBC_ERR_H_ 37 37 38 #define errx(status, fmt, ...) { \ 39 printf((fmt), ##__VA_ARGS__); \ 40 _exit(status); \ 41 } 38 #include <stdio.h> 39 40 #define errx(status, fmt, ...) \ 41 { \ 42 printf((fmt), ##__VA_ARGS__); \ 43 _exit(status); \ 44 } 42 45 43 46 #endif -
uspace/lib/c/include/fibril.h
rfb150d78 r46c20c8 48 48 #define FIBRIL_WRITER 2 49 49 50 struct fibril; 51 52 typedef struct { 53 struct fibril *owned_by; 54 } fibril_owner_info_t; 55 50 56 typedef enum { 51 57 FIBRIL_PREEMPT, … … 68 74 int retval; 69 75 int flags; 76 77 fibril_owner_info_t *waits_for; 70 78 } fibril_t; 71 79 -
uspace/lib/c/include/fibril_synch.h
rfb150d78 r46c20c8 43 43 44 44 typedef struct { 45 fibril_owner_info_t oi; /* Keep this the first thing. */ 45 46 int counter; 46 47 link_t waiters; 47 48 } fibril_mutex_t; 48 49 49 #define FIBRIL_MUTEX_INITIALIZE(name) \ 50 fibril_mutex_t name = { \ 50 #define FIBRIL_MUTEX_INITIALIZER(name) \ 51 { \ 52 .oi = { \ 53 .owned_by = NULL \ 54 }, \ 51 55 .counter = 1, \ 52 56 .waiters = { \ … … 55 59 } \ 56 60 } 61 62 #define FIBRIL_MUTEX_INITIALIZE(name) \ 63 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) 57 64 58 65 typedef struct { 66 fibril_owner_info_t oi; /* Keep this the first thing. */ 59 67 unsigned writers; 60 68 unsigned readers; … … 62 70 } fibril_rwlock_t; 63 71 64 #define FIBRIL_RWLOCK_INITIALIZE(name) \ 65 fibril_rwlock_t name = { \ 72 #define FIBRIL_RWLOCK_INITIALIZER(name) \ 73 { \ 74 .oi = { \ 75 .owned_by = NULL \ 76 }, \ 66 77 .readers = 0, \ 67 78 .writers = 0, \ … … 72 83 } 73 84 85 #define FIBRIL_RWLOCK_INITIALIZE(name) \ 86 fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name) 87 74 88 typedef struct { 75 89 link_t waiters; 76 90 } fibril_condvar_t; 77 91 78 #define FIBRIL_CONDVAR_INITIALIZE (name) \79 fibril_condvar_t name ={ \92 #define FIBRIL_CONDVAR_INITIALIZER(name) \ 93 { \ 80 94 .waiters = { \ 81 95 .next = &name.waiters, \ … … 83 97 } \ 84 98 } 99 100 #define FIBRIL_CONDVAR_INITIALIZE(name) \ 101 fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) 85 102 86 103 extern void fibril_mutex_initialize(fibril_mutex_t *); -
uspace/lib/c/include/futex.h
rfb150d78 r46c20c8 39 39 #include <sys/types.h> 40 40 41 #define FUTEX_INITIALIZER {1}41 #define FUTEX_INITIALIZER {1} 42 42 43 43 typedef atomic_t futex_t; -
uspace/lib/c/include/io/color.h
rfb150d78 r46c20c8 36 36 #define LIBC_IO_COLOR_H_ 37 37 38 enum console_color{38 typedef enum { 39 39 COLOR_BLACK = 0, 40 40 COLOR_BLUE = 1, … … 48 48 CATTR_BRIGHT = 8, 49 49 CATTR_BLINK = 8 50 } ;50 } console_color_t; 51 51 52 52 #endif -
uspace/lib/c/include/io/console.h
rfb150d78 r46c20c8 44 44 } console_ev_type_t; 45 45 46 enum {46 typedef enum { 47 47 CONSOLE_CCAP_NONE = 0, 48 48 CONSOLE_CCAP_STYLE, 49 49 CONSOLE_CCAP_INDEXED, 50 50 CONSOLE_CCAP_RGB 51 } ;51 } console_caps_t; 52 52 53 53 /** Console event structure. */ … … 68 68 extern void console_clear(int phone); 69 69 70 extern int console_get_size(int phone, i nt *cols, int *rows);71 extern int console_get_pos(int phone, i nt *col, int *row);72 extern void console_ goto(int phone, int col, int row);70 extern int console_get_size(int phone, ipcarg_t *cols, ipcarg_t *rows); 71 extern int console_get_pos(int phone, ipcarg_t *col, ipcarg_t *row); 72 extern void console_set_pos(int phone, ipcarg_t col, ipcarg_t row); 73 73 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); 74 extern void console_set_style(int phone, uint8_t style); 75 extern void console_set_color(int phone, uint8_t fg_color, uint8_t bg_color, 76 uint8_t flags); 77 extern void console_set_rgb_color(int phone, uint32_t fg_color, uint32_t bg_color); 77 78 78 79 extern void console_cursor_visibility(int phone, bool show); 79 extern int console_get_color_cap(int phone, i nt *ccap);80 extern int console_get_color_cap(int phone, ipcarg_t *ccap); 80 81 extern void console_kcon_enable(int phone); 81 82 -
uspace/lib/c/include/io/keycode.h
rfb150d78 r46c20c8 51 51 * they really are organized here by position, rather than by label. 52 52 */ 53 enum keycode{53 typedef enum { 54 54 55 55 /* Main block row 1 */ … … 199 199 } keycode_t; 200 200 201 enum keymod{201 typedef enum { 202 202 KM_LSHIFT = 0x001, 203 203 KM_RSHIFT = 0x002, -
uspace/lib/c/include/io/klog.h
rfb150d78 r46c20c8 33 33 */ 34 34 35 #ifndef LIBC_ STREAM_H_36 #define LIBC_ STREAM_H_35 #ifndef LIBC_IO_KLOG_H_ 36 #define LIBC_IO_KLOG_H_ 37 37 38 38 #include <sys/types.h> 39 39 40 extern size_t klog_write(const void * buf, size_t size);40 extern size_t klog_write(const void *, size_t); 41 41 extern void klog_update(void); 42 42 -
uspace/lib/c/include/io/printf_core.h
rfb150d78 r46c20c8 40 40 41 41 /** Structure for specifying output methods for different printf clones. */ 42 typedef struct printf_spec{42 typedef struct { 43 43 /* String output function, returns number of printed characters or EOF */ 44 44 int (*str_write)(const char *, size_t, void *); … … 51 51 } printf_spec_t; 52 52 53 int printf_core(const char *fmt, printf_spec_t *ps, va_list ap);53 extern int printf_core(const char *, printf_spec_t *, va_list); 54 54 55 55 #endif -
uspace/lib/c/include/io/screenbuffer.h
rfb150d78 r46c20c8 33 33 */ 34 34 35 #ifndef SCREENBUFFER_H__36 #define SCREENBUFFER_H__35 #ifndef LIBC_SCREENBUFFER_H__ 36 #define LIBC_SCREENBUFFER_H__ 37 37 38 38 #include <stdint.h> 39 39 #include <sys/types.h> 40 #include <ipc/ipc.h> 40 41 #include <bool.h> 41 42 42 #define DEFAULT_FOREGROUND 0x0 /**< default console foreground color */ 43 #define DEFAULT_BACKGROUND 0xf0f0f0 /**< default console background color */ 43 typedef enum { 44 at_style, 45 at_idx, 46 at_rgb 47 } attr_type_t; 44 48 45 49 typedef struct { … … 58 62 } attr_rgb_t; 59 63 64 typedef union { 65 attr_style_t s; 66 attr_idx_t i; 67 attr_rgb_t r; 68 } attr_val_t; 69 60 70 typedef 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; 71 73 } attrs_t; 72 74 … … 82 84 keyfield_t *buffer; /**< Screen content - characters and 83 85 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 */ 86 88 87 89 /** 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; 90 92 91 93 attrs_t attrs; /**< Current attributes. */ … … 107 109 * 108 110 */ 109 static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y)111 static inline keyfield_t *get_field_at(screenbuffer_t *scr, ipcarg_t x, ipcarg_t y) 110 112 { 111 113 return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x; … … 120 122 * 121 123 */ 122 static inline intattrs_same(attrs_t a1, attrs_t a2)124 static inline bool attrs_same(attrs_t a1, attrs_t a2) 123 125 { 124 126 if (a1.t != a2.t) 125 return 0;127 return false; 126 128 127 129 switch (a1.t) { … … 137 139 } 138 140 139 return 0;141 return false; 140 142 } 141 143 144 extern void screenbuffer_putchar(screenbuffer_t *, wchar_t); 145 extern screenbuffer_t *screenbuffer_init(screenbuffer_t *, ipcarg_t, ipcarg_t); 142 146 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); 147 extern void screenbuffer_clear(screenbuffer_t *); 148 extern void screenbuffer_clear_line(screenbuffer_t *, ipcarg_t); 149 extern void screenbuffer_copy_buffer(screenbuffer_t *, keyfield_t *); 150 extern void screenbuffer_goto(screenbuffer_t *, ipcarg_t, ipcarg_t); 151 extern void screenbuffer_set_style(screenbuffer_t *, uint8_t); 152 extern void screenbuffer_set_color(screenbuffer_t *, uint8_t, uint8_t, uint8_t); 153 extern void screenbuffer_set_rgb_color(screenbuffer_t *, uint32_t, uint32_t); 155 154 156 155 #endif -
uspace/lib/c/include/io/style.h
rfb150d78 r46c20c8 36 36 #define LIBC_IO_STYLE_H_ 37 37 38 enum console_style{38 typedef enum { 39 39 STYLE_NORMAL = 0, 40 STYLE_EMPHASIS = 1 41 }; 40 STYLE_EMPHASIS = 1, 41 STYLE_INVERTED = 2, 42 STYLE_SELECTED = 3 43 } console_style_t; 42 44 43 45 #endif -
uspace/lib/c/include/ipc/devmap.h
rfb150d78 r46c20c8 40 40 #define DEVMAP_NAME_MAXLEN 255 41 41 42 typedef ipcarg_t dev _handle_t;42 typedef ipcarg_t devmap_handle_t; 43 43 44 44 typedef enum { … … 81 81 82 82 typedef struct { 83 dev _handle_t handle;83 devmap_handle_t handle; 84 84 char name[DEVMAP_NAME_MAXLEN + 1]; 85 85 } dev_desc_t; -
uspace/lib/c/include/ipc/net_net.h
rfb150d78 r46c20c8 1 1 /* 2 * Copyright (c) 200 6 Ondrej Palkovsky2 * Copyright (c) 2009 Lukas Mejdrech 3 3 * All rights reserved. 4 4 * … … 30 30 * @{ 31 31 */ 32 32 33 /** @file 34 * Networking subsystem central module messages. 35 * @see net_interface.h 33 36 */ 34 37 35 #ifndef LIBC_ ERRNO_H_36 #define LIBC_ ERRNO_H_38 #ifndef LIBC_NET_NET_MESSAGES_H_ 39 #define LIBC_NET_NET_MESSAGES_H_ 37 40 38 #include < kernel/errno.h>39 #include < fibril.h>41 #include <ipc/ipc.h> 42 #include <ipc/net.h> 40 43 41 extern int _errno; 42 43 #define errno _errno 44 45 #define EMFILE (-17) 46 #define ENAMETOOLONG (-256) 47 #define EISDIR (-257) 48 #define ENOTDIR (-258) 49 #define ENOSPC (-259) 50 #define EEXIST (-260) 51 #define ENOTEMPTY (-261) 52 #define EBADF (-262) 53 #define ERANGE (-263) 54 #define EXDEV (-264) 55 #define EIO (-265) 56 #define EMLINK (-266) 44 /** Networking subsystem central module messages. */ 45 typedef enum { 46 /** Returns the general configuration 47 * @see net_get_conf_req() 48 */ 49 NET_NET_GET_CONF = NET_FIRST, 50 /** Returns the device specific configuration 51 * @see net_get_device_conf_req() 52 */ 53 NET_NET_GET_DEVICE_CONF, 54 /** Starts the networking stack. */ 55 NET_NET_STARTUP, 56 } net_messages; 57 57 58 58 #endif -
uspace/lib/c/include/ipc/packet.h
rfb150d78 r46c20c8 1 1 /* 2 * Copyright (c) 200 1-2004 Jakub Jermar2 * Copyright (c) 2009 Lukas Mejdrech 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup sync 30 * @{ 31 */ 32 /** @file 29 /** @addtogroup libc 30 * @{ 33 31 */ 34 32 35 #ifndef KERN_RWLOCK_H_ 36 #define KERN_RWLOCK_H_ 33 /** @file 34 * Packet server module messages. 35 */ 37 36 38 #include <arch/types.h> 39 #include <synch/mutex.h> 40 #include <synch/synch.h> 41 #include <synch/spinlock.h> 37 #ifndef LIBC_PACKET_MESSAGES_ 38 #define LIBC_PACKET_MESSAGES_ 42 39 40 #include <ipc/ipc.h> 41 #include <ipc/net.h> 42 43 /** Packet server module messages. */ 43 44 typedef enum { 44 RWLOCK_NONE, 45 RWLOCK_READER, 46 RWLOCK_WRITER 47 } rwlock_type_t; 45 /** Create packet message with specified content length. 46 * @see packet_get_1() 47 */ 48 NET_PACKET_CREATE_1 = NET_PACKET_FIRST, 49 50 /** 51 * Create packet message with specified address length, prefix, content 52 * and suffix. 53 * @see packet_get_4() 54 */ 55 NET_PACKET_CREATE_4, 56 57 /** Get packet message. 58 * @see packet_return() */ 59 NET_PACKET_GET, 60 61 /** Get packet size message. 62 * @see packet_translate() 63 */ 64 NET_PACKET_GET_SIZE, 65 66 /** Release packet message. 67 * @see pq_release() 68 */ 69 NET_PACKET_RELEASE 70 } packet_messages; 48 71 49 typedef struct { 50 SPINLOCK_DECLARE(lock); 51 /** 52 * Mutex for writers, readers can bypass it if readers_in is positive. 53 */ 54 mutex_t exclusive; 55 /** Number of readers in critical section. */ 56 size_t readers_in; 57 } rwlock_t; 72 /** Returns the protocol service message parameter. */ 73 #define ARP_GET_PROTO(call) (services_t) IPC_GET_ARG2(*call) 58 74 59 #define rwlock_write_lock(rwl) \ 60 _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 61 #define rwlock_read_lock(rwl) \ 62 _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 63 #define rwlock_write_trylock(rwl) \ 64 _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \ 65 SYNCH_FLAGS_NON_BLOCKING) 66 #define rwlock_read_trylock(rwl) \ 67 _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \ 68 SYNCH_FLAGS_NON_BLOCKING) 69 #define rwlock_write_lock_timeout(rwl, usec) \ 70 _rwlock_write_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE) 71 #define rwlock_read_lock_timeout(rwl, usec) \ 72 _rwlock_read_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE) 75 /** Returns the packet identifier message parameter. */ 76 #define IPC_GET_ID(call) (packet_id_t) IPC_GET_ARG1(*call) 73 77 74 extern void rwlock_initialize(rwlock_t *rwl); 75 extern void rwlock_read_unlock(rwlock_t *rwl); 76 extern void rwlock_write_unlock(rwlock_t *rwl); 77 extern int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 78 extern int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 78 /** Returns the maximal content length message parameter. */ 79 #define IPC_GET_CONTENT(call) (size_t) IPC_GET_ARG1(*call) 80 81 /** Returns the maximal address length message parameter. */ 82 #define IPC_GET_ADDR_LEN(call) (size_t) IPC_GET_ARG2(*call) 83 84 /** Returns the maximal prefix length message parameter. */ 85 #define IPC_GET_PREFIX(call) (size_t) IPC_GET_ARG3(*call) 86 87 /** Returns the maximal suffix length message parameter. */ 88 #define IPC_GET_SUFFIX(call) (size_t) IPC_GET_ARG4(*call) 79 89 80 90 #endif -
uspace/lib/c/include/ipc/services.h
rfb150d78 r46c20c8 39 39 40 40 typedef enum { 41 SERVICE_LOAD = 1, 41 SERVICE_NONE = 0, 42 SERVICE_LOAD, 42 43 SERVICE_PCI, 43 44 SERVICE_VIDEO, … … 45 46 SERVICE_VFS, 46 47 SERVICE_DEVMAP, 48 SERVICE_DEVMAN, 47 49 SERVICE_FHC, 48 50 SERVICE_OBIO, 49 SERVICE_CLIPBOARD 51 SERVICE_CLIPBOARD, 52 SERVICE_NETWORKING, 53 SERVICE_LO, 54 SERVICE_DP8390, 55 SERVICE_ETHERNET, 56 SERVICE_NILDUMMY, 57 SERVICE_IP, 58 SERVICE_ARP, 59 SERVICE_RARP, 60 SERVICE_ICMP, 61 SERVICE_UDP, 62 SERVICE_TCP, 63 SERVICE_SOCKET 50 64 } services_t; 51 65 -
uspace/lib/c/include/loader/loader.h
rfb150d78 r46c20c8 51 51 extern int loader_set_cwd(loader_t *); 52 52 extern int loader_set_pathname(loader_t *, const char *); 53 extern int loader_set_args(loader_t *, c har *const[]);53 extern int loader_set_args(loader_t *, const char *const[]); 54 54 extern int loader_set_files(loader_t *, fdi_node_t *const[]); 55 55 extern int loader_load_program(loader_t *); -
uspace/lib/c/include/macros.h
rfb150d78 r46c20c8 48 48 #define STRING_ARG(arg) #arg 49 49 50 #define LOWER32(arg) (( arg) & 0xffffffff)51 #define UPPER32(arg) ((( arg) >> 32) & 0xffffffff)50 #define LOWER32(arg) (((uint64_t) (arg)) & 0xffffffff) 51 #define UPPER32(arg) (((((uint64_t) arg)) >> 32) & 0xffffffff) 52 52 53 53 #define MERGE_LOUP32(lo, up) \ -
uspace/lib/c/include/malloc.h
rfb150d78 r46c20c8 41 41 extern uintptr_t get_max_heap_addr(void); 42 42 43 extern void *malloc(const size_t size); 44 extern void *calloc(const size_t nmemb, const size_t size); 45 extern void *memalign(const size_t align, const size_t size); 43 extern void *malloc(const size_t size) 44 __attribute__((malloc)); 45 extern void *calloc(const size_t nmemb, const size_t size) 46 __attribute__((malloc)); 47 extern void *memalign(const size_t align, const size_t size) 48 __attribute__((malloc)); 46 49 extern void *realloc(const void *addr, const size_t size); 47 50 extern void free(const void *addr); -
uspace/lib/c/include/net/inet.h
rfb150d78 r46c20c8 1 1 /* 2 * Copyright (c) 20 10 Jiri Svoboda2 * Copyright (c) 2009 Lukas Mejdrech 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup debug 30 * @{ 31 */ 32 /** @file 29 /** @addtogroup libc 30 * @{ 33 31 */ 34 32 35 #ifndef LIBC_ia32__ISTATE_H_ 36 #define LIBC_ia32__ISTATE_H_ 33 /** @file 34 * Internet common definitions. 35 */ 36 37 #ifndef LIBC_INET_H_ 38 #define LIBC_INET_H_ 37 39 38 40 #include <sys/types.h> 41 #include <byteorder.h> 39 42 40 /** Interrupt context. 41 * 42 * This is a copy of the kernel definition with which it must be kept in sync. 43 /** Type definition of the socket address. 44 * @see sockaddr 43 45 */ 44 typedef struct istate { 45 uint32_t eax; 46 uint32_t ecx; 47 uint32_t edx; 48 uint32_t ebp; 46 typedef struct sockaddr sockaddr_t; 49 47 50 uint32_t gs; 51 uint32_t fs; 52 uint32_t es; 53 uint32_t ds;48 /** Type definition of the address information. 49 * @see addrinfo 50 */ 51 typedef struct addrinfo addrinfo_t; 54 52 55 uint32_t error_word; 56 uint32_t eip; 57 uint32_t cs; 58 uint32_t eflags; 59 uint32_t stack[]; 60 } istate_t; 53 /** Socket address. */ 54 struct sockaddr { 55 /** Address family. @see socket.h */ 56 uint16_t sa_family; 57 /** 14 byte protocol address. */ 58 uint8_t sa_data[14]; 59 }; 61 60 62 static inline uintptr_t istate_get_pc(istate_t *istate) 63 { 64 return istate->eip; 65 } 66 67 static inline uintptr_t istate_get_fp(istate_t *istate) 68 { 69 return istate->ebp; 70 } 61 extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t); 62 extern int inet_pton(uint16_t, const char *, uint8_t *); 71 63 72 64 #endif -
uspace/lib/c/include/stacktrace.h
rfb150d78 r46c20c8 57 57 extern void stacktrace_prepare(void); 58 58 extern uintptr_t stacktrace_fp_get(void); 59 extern uintptr_t stacktrace_pc_get( );59 extern uintptr_t stacktrace_pc_get(void); 60 60 61 61 #endif -
uspace/lib/c/include/stdio.h
rfb150d78 r46c20c8 38 38 #include <sys/types.h> 39 39 #include <stdarg.h> 40 #include <str ing.h>40 #include <str.h> 41 41 #include <adt/list.h> 42 43 #ifndef NVERIFY_PRINTF 44 45 #define PRINTF_ATTRIBUTE(start, end) \ 46 __attribute__((format(gnu_printf, start, end))) 47 48 #else /* NVERIFY_PRINTF */ 49 50 #define PRINTF_ATTRIBUTE(start, end) 51 52 #endif /* NVERIFY_PRINTF */ 42 53 43 54 #define EOF (-1) … … 56 67 #ifndef SEEK_SET 57 68 #define SEEK_SET 0 69 #endif 70 71 #ifndef SEEK_CUR 58 72 #define SEEK_CUR 1 73 #endif 74 75 #ifndef SEEK_END 59 76 #define SEEK_END 2 60 77 #endif … … 69 86 }; 70 87 88 enum _buffer_state { 89 /** Buffer is empty */ 90 _bs_empty, 91 92 /** Buffer contains data to be written */ 93 _bs_write, 94 95 /** Buffer contains prefetched data for reading */ 96 _bs_read 97 }; 98 71 99 typedef struct { 72 100 /** Linked list pointer. */ … … 88 116 int phone; 89 117 118 /** 119 * Non-zero if the stream needs sync on fflush(). XXX change 120 * console semantics so that sync is not needed. 121 */ 122 int need_sync; 123 90 124 /** Buffering type */ 91 125 enum _buffer_type btype; 126 92 127 /** Buffer */ 93 128 uint8_t *buf; 129 94 130 /** Buffer size */ 95 131 size_t buf_size; 132 133 /** Buffer state */ 134 enum _buffer_state buf_state; 135 96 136 /** Buffer I/O pointer */ 97 137 uint8_t *buf_head; 138 139 /** Points to end of occupied space when in read mode. */ 140 uint8_t *buf_tail; 98 141 } FILE; 99 142 … … 104 147 /* Character and string input functions */ 105 148 extern int fgetc(FILE *); 106 extern char *fgets(char *, size_t, FILE *);149 extern char *fgets(char *, int, FILE *); 107 150 108 151 extern int getchar(void); … … 117 160 118 161 /* Formatted string output functions */ 119 extern int fprintf(FILE *, const char*, ...); 162 extern int fprintf(FILE *, const char*, ...) 163 PRINTF_ATTRIBUTE(2, 3); 120 164 extern int vfprintf(FILE *, const char *, va_list); 121 165 122 extern int printf(const char *, ...); 166 extern int printf(const char *, ...) 167 PRINTF_ATTRIBUTE(1, 2); 123 168 extern int vprintf(const char *, va_list); 124 169 125 extern int snprintf(char *, size_t , const char *, ...); 126 extern int asprintf(char **, const char *, ...); 170 extern int snprintf(char *, size_t , const char *, ...) 171 PRINTF_ATTRIBUTE(3, 4); 172 extern int asprintf(char **, const char *, ...) 173 PRINTF_ATTRIBUTE(2, 3); 127 174 extern int vsnprintf(char *, size_t, const char *, va_list); 128 175 … … 135 182 extern size_t fwrite(const void *, size_t, size_t, FILE *); 136 183 137 extern int fseek(FILE *, long, int);184 extern int fseek(FILE *, off64_t, int); 138 185 extern void rewind(FILE *); 139 extern int ftell(FILE *);186 extern off64_t ftell(FILE *); 140 187 extern int feof(FILE *); 188 extern int fileno(FILE *); 141 189 142 190 extern int fflush(FILE *); -
uspace/lib/c/include/str.h
rfb150d78 r46c20c8 33 33 */ 34 34 35 #ifndef LIBC_STR ING_H_36 #define LIBC_STR ING_H_35 #ifndef LIBC_STR_H_ 36 #define LIBC_STR_H_ 37 37 38 38 #include <mem.h> … … 86 86 extern char *str_ndup(const char *, size_t max_size); 87 87 88 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *); 89 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); 90 91 extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix); 92 88 93 /* 89 94 * TODO: Get rid of this. -
uspace/lib/c/include/sys/mman.h
rfb150d78 r46c20c8 41 41 #define MAP_FAILED ((void *) -1) 42 42 43 #define MAP_SHARED (1 << 0)44 #define MAP_PRIVATE (1 << 1)45 #define MAP_FIXED (1 << 2)46 #define MAP_ANONYMOUS (1 << 3)43 #define MAP_SHARED (1 << 0) 44 #define MAP_PRIVATE (1 << 1) 45 #define MAP_FIXED (1 << 2) 46 #define MAP_ANONYMOUS (1 << 3) 47 47 48 48 #define PROTO_READ AS_AREA_READ … … 50 50 #define PROTO_EXEC AS_AREA_EXEC 51 51 52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd,53 off_t offset);52 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, 53 aoff64_t offset); 54 54 extern int munmap(void *start, size_t length); 55 55 -
uspace/lib/c/include/sys/stat.h
rfb150d78 r46c20c8 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_SYS_STAT_H_ … … 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 dev _handle_t dev_handle;45 devmap_handle_t devmap_handle; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; 48 48 bool is_file; 49 49 bool is_directory; 50 off_t size;51 dev _handle_t device;50 aoff64_t size; 51 devmap_handle_t device; 52 52 }; 53 53 -
uspace/lib/c/include/sys/time.h
rfb150d78 r46c20c8 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_SYS_TIME_H_ … … 43 43 typedef long suseconds_t; 44 44 45 typedef uint32_t useconds_t; 46 typedef uint32_t mseconds_t; 47 45 48 struct timeval { 46 time_t tv_sec; /* seconds */47 suseconds_t tv_usec; /* microseconds */49 time_t tv_sec; /* seconds */ 50 suseconds_t tv_usec; /* microseconds */ 48 51 }; 49 52 50 53 struct timezone { 51 int tz_minuteswest;/* minutes W of Greenwich */52 int tz_dsttime;/* type of dst correction */54 int tz_minuteswest; /* minutes W of Greenwich */ 55 int tz_dsttime; /* type of dst correction */ 53 56 }; 54 57 -
uspace/lib/c/include/sys/types.h
rfb150d78 r46c20c8 38 38 #include <libarch/types.h> 39 39 40 typedef long off_t; 41 typedef int mode_t; 42 typedef uint64_t bn_t; /**< Block number type. */ 40 typedef unsigned int mode_t; 43 41 44 typedef int32_t wchar_t; 42 /** Relative offset */ 43 typedef int64_t off64_t; 44 45 /** Absolute offset */ 46 typedef uint64_t aoff64_t; 45 47 46 48 typedef volatile uint8_t ioport8_t; -
uspace/lib/c/include/sysinfo.h
rfb150d78 r46c20c8 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_SYSINFO_H_ … … 37 37 38 38 #include <libc.h> 39 #include <sysinfo.h>40 #include <string.h>41 39 42 sysarg_t sysinfo_value(char *name); 40 /** Sysinfo value types 41 * 42 */ 43 typedef enum { 44 SYSINFO_VAL_UNDEFINED = 0, 45 SYSINFO_VAL_VAL = 1, 46 SYSINFO_VAL_DATA = 2 47 } sysinfo_item_tag_t; 48 49 extern sysinfo_item_tag_t sysinfo_get_tag(const char *); 50 extern int sysinfo_get_value(const char *, sysarg_t *); 51 extern void *sysinfo_get_data(const char *, size_t *); 43 52 44 53 #endif -
uspace/lib/c/include/task.h
rfb150d78 r46c20c8 46 46 47 47 extern 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, 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);48 extern int task_set_name(const char *); 49 extern task_id_t task_spawn(const char *, const char *const[], int *); 50 extern int task_spawnv(task_id_t *, const char *path, const char *const []); 51 extern int task_spawnl(task_id_t *, const char *path, ...); 52 52 53 extern int task_wait(task_id_t id, task_exit_t *, int *); 54 extern int task_retval(int); 53 55 54 56 #endif -
uspace/lib/c/include/thread.h
rfb150d78 r46c20c8 45 45 extern void __thread_main(uspace_arg_t *); 46 46 47 extern int thread_create(void (*)(void *), void *, c har *, thread_id_t *);47 extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *); 48 48 extern void thread_exit(int) __attribute__ ((noreturn)); 49 49 extern void thread_detach(thread_id_t); -
uspace/lib/c/include/unistd.h
rfb150d78 r46c20c8 37 37 38 38 #include <sys/types.h> 39 #include <time.h> 39 40 #include <libarch/config.h> 40 41 41 42 #ifndef NULL 42 #define NULL 043 #define NULL ((void *) 0) 43 44 #endif 44 45 … … 47 48 #ifndef SEEK_SET 48 49 #define SEEK_SET 0 50 #endif 51 52 #ifndef SEEK_CUR 49 53 #define SEEK_CUR 1 54 #endif 55 56 #ifndef SEEK_END 50 57 #define SEEK_END 2 51 58 #endif 52 53 typedef uint32_t useconds_t;54 59 55 60 extern int dup2(int oldfd, int newfd); … … 58 63 extern ssize_t read(int, void *, size_t); 59 64 60 extern off _t lseek(int, off_t, int);61 extern int ftruncate(int, off_t);65 extern off64_t lseek(int, off64_t, int); 66 extern int ftruncate(int, aoff64_t); 62 67 63 68 extern int close(int); … … 69 74 extern int chdir(const char *); 70 75 71 extern void _exit(int status) __attribute__((noreturn));72 extern int usleep(useconds_t uses);73 extern unsigned int sleep(unsigned int se);76 extern void _exit(int) __attribute__((noreturn)); 77 extern int usleep(useconds_t); 78 extern unsigned int sleep(unsigned int); 74 79 75 80 #endif -
uspace/lib/c/include/vfs/vfs.h
rfb150d78 r46c20c8 43 43 /** 44 44 * This type is a libc version of the VFS triplet. 45 * It uniquel ly identifies a file system node within a file system instance.45 * It uniquely identifies a file system node within a file system instance. 46 46 */ 47 47 typedef struct { 48 48 fs_handle_t fs_handle; 49 dev _handle_t dev_handle;49 devmap_handle_t devmap_handle; 50 50 fs_index_t index; 51 51 } fdi_node_t;
Note:
See TracChangeset
for help on using the changeset viewer.
