Changeset 2595dab in mainline for uspace/lib/libc/include
- Timestamp:
- 2009-06-03T19:26:28Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d00ae4c
- Parents:
- ca3ba3a
- Location:
- uspace/lib/libc/include
- Files:
-
- 1 deleted
- 7 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/dirent.h
rca3ba3a r2595dab 36 36 #define LIBC_DIRENT_H_ 37 37 38 #define NAME_MAX 25638 #define NAME_MAX 256 39 39 40 40 struct dirent { … … 47 47 } DIR; 48 48 49 50 49 extern DIR *opendir(const char *); 51 50 extern struct dirent *readdir(DIR *); -
uspace/lib/libc/include/fcntl.h
rca3ba3a r2595dab 36 36 #define LIBC_FCNTL_H_ 37 37 38 #define O_CREAT 39 #define O_EXCL 40 #define O_TRUNC 41 #define O_APPEND 42 #define O_RDONLY 43 #define O_RDWR 44 #define O_WRONLY 38 #define O_CREAT 1 39 #define O_EXCL 2 40 #define O_TRUNC 4 41 #define O_APPEND 8 42 #define O_RDONLY 16 43 #define O_RDWR 32 44 #define O_WRONLY 64 45 45 46 46 extern int open(const char *, int, ...); -
uspace/lib/libc/include/fibril.h
rca3ba3a r2595dab 41 41 42 42 #ifndef context_set 43 #define context_set(c, _pc, stack, size, ptls) 44 (c)->pc = (sysarg_t) (_pc); 45 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; 46 43 #define context_set(c, _pc, stack, size, ptls) \ 44 (c)->pc = (sysarg_t) (_pc); \ 45 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 46 (c)->tls = (sysarg_t) (ptls); 47 47 #endif /* context_set */ 48 48 49 #define FIBRIL_SERIALIZED 49 #define FIBRIL_SERIALIZED 1 50 50 51 51 typedef enum { -
uspace/lib/libc/include/io/color.h
rca3ba3a r2595dab 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 31 */ 32 32 /** @file 33 33 */ 34 34 35 #ifndef LIBC_ CONSOLE_COLOR_H_36 #define LIBC_ CONSOLE_COLOR_H_35 #ifndef LIBC_IO_COLOR_H_ 36 #define LIBC_IO_COLOR_H_ 37 37 38 38 enum console_color { 39 COLOR_BLACK 40 COLOR_BLUE 41 COLOR_GREEN 42 COLOR_CYAN 43 COLOR_RED 44 COLOR_MAGENTA 45 COLOR_YELLOW 46 COLOR_WHITE 47 48 CATTR_BRIGHT 49 CATTR_BLINK 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 50 50 }; 51 51 52 52 #endif 53 53 54 54 /** @} 55 55 */ -
uspace/lib/libc/include/io/console.h
rca3ba3a r2595dab 1 1 /* 2 * Copyright (c) 200 9Jiri Svoboda2 * Copyright (c) 2008 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 31 */ 32 32 /** @file 33 33 */ 34 34 35 #ifndef LIBC_ KBD_H_36 #define LIBC_ KBD_H_35 #ifndef LIBC_IO_CONSOLE_H_ 36 #define LIBC_IO_CONSOLE_H_ 37 37 38 #include <sys/types.h> 38 #include <ipc/ipc.h> 39 #include <bool.h> 39 40 40 typedef enum kbd_ev_type{41 KE _PRESS,42 KE _RELEASE43 } kbd_ev_type_t;41 typedef enum { 42 KEY_PRESS, 43 KEY_RELEASE 44 } console_ev_type_t; 44 45 45 /** Keyboardevent structure. */46 /** Console event structure. */ 46 47 typedef struct { 47 48 /** Press or release event. */ 48 kbd_ev_type_t type;49 49 console_ev_type_t type; 50 50 51 /** Keycode of the key that was pressed or released. */ 51 52 unsigned int key; 52 53 53 54 /** Bitmask of modifiers held. */ 54 55 unsigned int mods; 55 56 56 57 /** The character that was generated or '\0' for none. */ 57 58 wchar_t c; 58 } kbd_event_t;59 } console_event_t; 59 60 60 extern int kbd_get_event(kbd_event_t *); 61 extern void console_clear(int phone); 62 63 extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols); 64 extern void console_goto(int phone, ipcarg_t row, ipcarg_t col); 65 66 extern void console_set_style(int phone, int style); 67 extern void console_set_color(int phone, int fg_color, int bg_color, int flags); 68 extern void console_set_rgb_color(int phone, int fg_color, int bg_color); 69 70 extern void console_cursor_visibility(int phone, bool show); 71 extern void console_kcon_enable(int phone); 72 73 extern bool console_get_event(int phone, console_event_t *event); 61 74 62 75 #endif 63 76 64 77 /** @} 65 78 */ -
uspace/lib/libc/include/io/keycode.h
rca3ba3a r2595dab 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 31 */ 32 32 /** @file 33 33 */ 34 34 35 #ifndef LIBC_ KBD_KEYCODE_H_36 #define LIBC_ KBD_KEYCODE_H_35 #ifndef LIBC_IO_KEYCODE_H_ 36 #define LIBC_IO_KEYCODE_H_ 37 37 38 38 /** Keycode definitions. … … 200 200 201 201 enum keymod { 202 KM_LSHIFT 203 KM_RSHIFT 204 KM_LCTRL 205 KM_RCTRL 206 KM_LALT 207 KM_RALT 208 KM_CAPS_LOCK 209 KM_NUM_LOCK 210 KM_SCROLL_LOCK 211 212 KM_SHIFT 213 KM_CTRL 214 KM_ALT 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 215 215 } keymod_t; 216 216 217 217 #endif 218 218 219 219 /** @} 220 220 */ -
uspace/lib/libc/include/io/klog.h
rca3ba3a r2595dab 36 36 #define LIBC_STREAM_H_ 37 37 38 #include < libarch/types.h>38 #include <sys/types.h> 39 39 40 #define EMFILE -17 41 42 extern ssize_t read_stdin(void *, size_t); 43 extern int klog_puts(const char *); 40 extern size_t klog_write(const void *buf, size_t size); 44 41 extern void klog_update(void); 45 42 -
uspace/lib/libc/include/io/printf_core.h
rca3ba3a r2595dab 57 57 /** @} 58 58 */ 59 60 -
uspace/lib/libc/include/io/style.h
rca3ba3a r2595dab 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 31 */ 32 32 /** @file 33 33 */ 34 34 35 #ifndef LIBC_ CONSOLE_STYLE_H_36 #define LIBC_ CONSOLE_STYLE_H_35 #ifndef LIBC_IO_STYLE_H_ 36 #define LIBC_IO_STYLE_H_ 37 37 38 38 enum console_style { 39 STYLE_NORMAL 40 STYLE_EMPHASIS 39 STYLE_NORMAL = 0, 40 STYLE_EMPHASIS = 1 41 41 }; 42 42 43 43 #endif 44 44 45 45 /** @} 46 46 */ -
uspace/lib/libc/include/stdio.h
rca3ba3a r2595dab 39 39 #include <stdarg.h> 40 40 41 #define EOF (-1) 42 43 #include <string.h> 44 #include <io/stream.h> 41 #define EOF (-1) 45 42 46 43 #define DEBUG(fmt, ...) \ 47 44 { \ 48 45 char buf[256]; \ 49 int n; \ 50 n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \ 46 int n = snprintf(buf, sizeof(buf), fmt, ##__VA_ARGS__); \ 51 47 if (n > 0) \ 52 48 (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, str_size(buf)); \ 53 49 } 54 50 51 #ifndef SEEK_SET 52 #define SEEK_SET 0 53 #define SEEK_CUR 1 54 #define SEEK_END 2 55 #endif 56 55 57 typedef struct { 56 58 /** Underlying file descriptor. */ 57 59 int fd; 58 60 59 61 /** Error indicator. */ 60 62 int error; 61 63 62 64 /** End-of-file indicator. */ 63 65 int eof; 66 67 /** Klog indicator */ 68 int klog; 69 70 /** Phone to the file provider */ 71 int phone; 64 72 } FILE; 65 73 66 extern FILE *stdin, *stdout, *stderr; 74 extern FILE stdin_null; 75 extern FILE stdout_klog; 76 77 extern FILE *stdin; 78 extern FILE *stdout; 79 extern FILE *stderr; 80 81 /* Character and string input functions */ 82 extern int fgetc(FILE *); 83 extern char *fgets(char *, size_t, FILE *); 67 84 68 85 extern int getchar(void); 86 extern char *gets(char *, size_t); 69 87 88 /* Character and string output functions */ 89 extern int fputc(wchar_t, FILE *); 90 extern int fputs(const char *, FILE *); 91 92 extern int putchar(wchar_t); 70 93 extern int puts(const char *); 71 extern int putchar(int); 72 extern int fflush(FILE *); 94 95 /* Formatted string output functions */ 96 extern int fprintf(FILE *, const char*, ...); 97 extern int vfprintf(FILE *, const char *, va_list); 73 98 74 99 extern int printf(const char *, ...); 100 extern int vprintf(const char *, va_list); 101 102 extern int snprintf(char *, size_t , const char *, ...); 75 103 extern int asprintf(char **, const char *, ...); 76 extern int sprintf(char *, const char *, ...);77 extern int snprintf(char *, size_t , const char *, ...);78 79 extern int vprintf(const char *, va_list);80 extern int vsprintf(char *, const char *, va_list);81 104 extern int vsnprintf(char *, size_t, const char *, va_list); 82 105 83 extern int rename(const char *, const char *); 84 106 /* File stream functions */ 85 107 extern FILE *fopen(const char *, const char *); 86 108 extern int fclose(FILE *); 109 87 110 extern size_t fread(void *, size_t, size_t, FILE *); 88 111 extern size_t fwrite(const void *, size_t, size_t, FILE *); 112 113 extern int fseek(FILE *, long, int); 114 extern int ftell(FILE *); 89 115 extern int feof(FILE *); 116 117 extern int fflush(FILE *); 90 118 extern int ferror(FILE *); 91 119 extern void clearerr(FILE *); 92 120 93 extern int fgetc(FILE *); 94 extern int fputc(int, FILE *); 95 extern int fputs(const char *, FILE *); 96 97 extern int fprintf(FILE *, const char *, ...); 98 extern int vfprintf(FILE *, const char *, va_list); 99 100 #define getc fgetc 101 #define putc fputc 102 103 extern int fseek(FILE *, long, int); 104 105 #ifndef SEEK_SET 106 #define SEEK_SET 0 107 #define SEEK_CUR 1 108 #define SEEK_END 2 109 #endif 121 /* Misc file functions */ 122 extern int rename(const char *, const char *); 110 123 111 124 #endif -
uspace/lib/libc/include/unistd.h
rca3ba3a r2595dab 40 40 41 41 #ifndef NULL 42 #define NULL042 #define NULL 0 43 43 #endif 44 44 45 #define getpagesize() 45 #define getpagesize() (PAGE_SIZE) 46 46 47 47 #ifndef SEEK_SET 48 #define SEEK_SET 49 #define SEEK_CUR 50 #define SEEK_END 48 #define SEEK_SET 0 49 #define SEEK_CUR 1 50 #define SEEK_END 2 51 51 #endif 52 52 53 53 extern ssize_t write(int, const void *, size_t); 54 54 extern ssize_t read(int, void *, size_t); 55 55 56 extern off_t lseek(int, off_t, int); 56 57 extern int ftruncate(int, off_t); 58 57 59 extern int close(int); 60 extern int fsync(int); 58 61 extern int unlink(const char *); 62 63 extern char *getcwd(char *buf, size_t); 59 64 extern int rmdir(const char *); 60 65 extern int chdir(const char *); 61 extern char *getcwd(char *buf, size_t);62 66 63 67 extern void _exit(int status) __attribute__ ((noreturn)); -
uspace/lib/libc/include/vfs/vfs.h
rca3ba3a r2595dab 37 37 38 38 #include <sys/types.h> 39 #include <ipc/vfs.h> 40 #include <ipc/devmap.h> 41 #include <stdio.h> 42 43 typedef struct { 44 fs_handle_t fs_handle; 45 dev_handle_t dev_handle; 46 fs_index_t index; 47 } fs_node_t; 39 48 40 49 extern char *absolutize(const char *, size_t *); … … 43 52 unsigned int flags); 44 53 54 extern int open_node(fs_node_t *node, int oflag); 55 extern int fd_phone(int); 56 extern void fd_node(int, fs_node_t *); 57 58 extern FILE *fopen_node(fs_node_t *node, const char *); 59 extern int fphone(FILE *); 60 extern void fnode(FILE *stream, fs_node_t *node); 61 45 62 #endif 46 63
Note:
See TracChangeset
for help on using the changeset viewer.