Changes in / [af5037d:52acfab] in mainline
- Files:
-
- 2 added
- 78 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/_bits/errno.h
raf5037d r52acfab 41 41 #define _BITS_ERRNO_H_ 42 42 43 #include <_bits/native.h> 44 #include <_bits/decls.h> 45 43 46 #ifdef __OPAQUE_ERRNO__ 44 47 #include <_bits/__opaque_handle.h> 45 48 49 __HELENOS_DECLS_BEGIN; 46 50 __opaque_handle(errno_t); 47 51 typedef errno_t sys_errno_t; 52 __HELENOS_DECLS_END; 53 48 54 #define __errno_t(val) ((errno_t) val) 49 55 50 56 #else 51 57 52 #include <_bits/native.h> 58 __HELENOS_DECLS_BEGIN; 53 59 54 60 /** … … 65 71 typedef sysarg_t sys_errno_t; 66 72 73 __HELENOS_DECLS_END; 74 67 75 /** 68 76 * A C++-style "cast" to `errno_t`. -
abi/include/_bits/native.h
raf5037d r52acfab 47 47 48 48 #include <inttypes.h> 49 #include <_bits/decls.h> 50 51 __HELENOS_DECLS_BEGIN; 49 52 50 53 typedef uintptr_t pfn_t; … … 53 56 typedef intptr_t native_t; 54 57 55 #define PRIdn PRIdPTR /**< Format for native_t. */ 56 #define PRIun PRIuPTR /**< Format for sysarg_t. */ 57 #define PRIxn PRIxPTR /**< Format for hexadecimal sysarg_t. */ 58 __HELENOS_DECLS_END; 58 59 59 60 #endif -
abi/include/_bits/ssize_t.h
raf5037d r52acfab 42 42 43 43 #include <stdint.h> 44 #include <_bits/decls.h> 44 45 46 __C_DECLS_BEGIN; 45 47 typedef intptr_t ssize_t; 46 47 #define SSIZE_MIN INTPTR_MIN 48 #define SSIZE_MAX INTPTR_MAX 48 __C_DECLS_END; 49 49 50 50 #endif -
abi/include/inttypes.h
raf5037d r52acfab 43 43 #include <stdint.h> 44 44 #include <_bits/wchar_t.h> 45 #include <_bits/decls.h> 45 46 46 47 /* … … 311 312 #endif 312 313 313 #ifdef _HELENOS_SOURCE314 #define UINT8_MIN 0315 #define UINT16_MIN 0316 #define UINT32_MIN 0317 #define UINT64_MIN 0318 #endif319 320 314 #define PRIdMAX "lld" 321 315 #define PRIiMAX "lli" … … 330 324 #define SCNxMAX "llx" 331 325 332 #ifdef __cplusplus 333 extern "C" { 326 #if defined(_HELENOS_SOURCE) && !defined(__cplusplus) 327 #define PRIdn PRIdPTR /**< Format for native_t. */ 328 #define PRIun PRIuPTR /**< Format for sysarg_t. */ 329 #define PRIxn PRIxPTR /**< Format for hexadecimal sysarg_t. */ 334 330 #endif 331 332 __C_DECLS_BEGIN; 335 333 336 334 typedef struct { … … 343 341 intmax_t strtoimax(const char *__restrict__, char **__restrict__, int); 344 342 uintmax_t strtoumax(const char *__restrict__, char **__restrict__, int); 345 346 #ifdef __cplusplus 347 } 343 intmax_t wcstoimax(const wchar_t *__restrict__, wchar_t **__restrict__, int); 344 uintmax_t wcstoumax(const wchar_t *__restrict__, wchar_t **__restrict__, int); 345 346 __C_DECLS_END; 347 348 348 #endif 349 349 350 #endif351 352 350 /** @} 353 351 */ -
abi/include/limits.h
raf5037d r52acfab 84 84 #define MB_LEN_MAX 4 85 85 86 #ifdef _HELENOS_SOURCE 86 87 #define UCHAR_MIN 0 87 88 #define USHRT_MIN 0 … … 89 90 #define ULONG_MIN (0ul) 90 91 #define ULLONG_MIN (0ull) 92 #define SSIZE_MIN INTPTR_MIN 93 #define UINT8_MIN 0 94 #define UINT16_MIN 0 95 #define UINT32_MIN 0 96 #define UINT64_MIN 0 97 #endif 98 99 #if defined(_HELENOS_SOURCE) || defined(_POSIX_SOURCE) || \ 100 defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ 101 defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 102 103 #define SSIZE_MAX INTPTR_MAX 104 #define NAME_MAX 255 105 106 #endif 91 107 92 108 /* GCC's <limits.h> doesn't define these for C++11, even though it should. */ -
kernel/Makefile
raf5037d r52acfab 87 87 INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES)) 88 88 89 DEFS = -D KERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__89 DEFS = -D_HELENOS_SOURCE -DKERNEL -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 90 90 91 91 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ -
uspace/lib/c/generic/dirent.c
raf5037d r52acfab 39 39 #include <errno.h> 40 40 #include <assert.h> 41 #include <string.h> 41 42 42 43 struct __dirstream { … … 92 93 ssize_t len = 0; 93 94 94 rc = vfs_read_short(dirp->fd, dirp->pos, &dirp->res.d_name[0],95 NAME_MAX + 1, &len);95 rc = vfs_read_short(dirp->fd, dirp->pos, dirp->res.d_name, 96 sizeof(dirp->res.d_name), &len); 96 97 if (rc != EOK) { 97 98 errno = rc; 98 99 return NULL; 99 100 } 101 102 assert(strnlen(dirp->res.d_name, sizeof(dirp->res.d_name)) < sizeof(dirp->res.d_name)); 100 103 101 104 dirp->pos += len; -
uspace/lib/c/generic/private/stdio.h
raf5037d r52acfab 40 40 #include <async.h> 41 41 #include <stddef.h> 42 #include <offset.h> 42 43 43 44 /** Maximum characters that can be pushed back by ungetc() */ … … 54 55 int (*flush)(FILE *stream); 55 56 } __stream_ops_t; 57 58 enum __buffer_state { 59 /** Buffer is empty */ 60 _bs_empty, 61 62 /** Buffer contains data to be written */ 63 _bs_write, 64 65 /** Buffer contains prefetched data for reading */ 66 _bs_read 67 }; 56 68 57 69 struct _IO_FILE { … … 87 99 88 100 /** Buffering type */ 89 enum _ buffer_type btype;101 enum __buffer_type btype; 90 102 91 103 /** Buffer */ … … 96 108 97 109 /** Buffer state */ 98 enum _ buffer_state buf_state;110 enum __buffer_state buf_state; 99 111 100 112 /** Buffer I/O pointer */ -
uspace/lib/c/include/adt/list.h
raf5037d r52acfab 42 42 #include <stdint.h> 43 43 #include <trace.h> 44 45 /** Doubly linked list link. */ 46 typedef struct link { 47 struct link *prev; /**< Pointer to the previous item in the list. */ 48 struct link *next; /**< Pointer to the next item in the list. */ 49 } link_t; 50 51 /** Doubly linked list. */ 52 typedef struct list { 53 link_t head; /**< List head. Does not have any data. */ 54 } list_t; 55 56 extern bool list_member(const link_t *, const list_t *); 57 extern void list_splice(list_t *, link_t *); 58 extern unsigned long list_count(const list_t *); 44 #include <_bits/decls.h> 45 46 #ifndef __cplusplus 47 48 /** 49 * We don't define the macros in C++ to avoid polluting headers with 50 * namespaceless names. We don't actually need them, so this is fine. 51 * We still allow including the rest of the file (in `helenos` namespace) 52 * so that we can expose publicly visible types that have list_t members. 53 */ 59 54 60 55 /** Declare and initialize statically allocated list. … … 138 133 assert(!link_used(link)) 139 134 135 #define list_pop(list, type, member) \ 136 ((type *) list_pop_internal(list, \ 137 (list_link_to_void(&(((type *) NULL)->member)) - NULL))) 138 139 #endif /* !__cplusplus */ 140 141 __HELENOS_DECLS_BEGIN; 142 143 /** Doubly linked list link. */ 144 typedef struct __adt_list_link { 145 struct __adt_list_link *prev; /**< Pointer to the previous item in the list. */ 146 struct __adt_list_link *next; /**< Pointer to the next item in the list. */ 147 } link_t; 148 149 /** Doubly linked list. */ 150 typedef struct { 151 link_t head; /**< List head. Does not have any data. */ 152 } list_t; 153 154 extern bool list_member(const link_t *, const list_t *); 155 extern void list_splice(list_t *, link_t *); 156 extern unsigned long list_count(const list_t *); 157 140 158 /** Returns true if the link is definitely part of a list. False if not sure. */ 141 159 static inline bool link_in_use(const link_t *link) … … 425 443 } 426 444 427 #define list_pop(list, type, member) \ 428 ((type *) list_pop_internal(list, \ 429 (list_link_to_void(&(((type *) NULL)->member)) - NULL))) 445 __HELENOS_DECLS_END; 430 446 431 447 #endif -
uspace/lib/c/include/assert.h
raf5037d r52acfab 41 41 #define _LIBC_ASSERT_H_ 42 42 43 #include <_bits/decls.h> 44 43 45 #ifndef __cplusplus 44 46 #define static_assert _Static_assert 45 47 #endif 48 49 __C_DECLS_BEGIN; 46 50 47 51 extern void __helenos_assert_abort(const char *, const char *, unsigned int) … … 50 54 extern void __helenos_assert_quick_abort(const char *, const char *, unsigned int) 51 55 __attribute__((noreturn)); 56 57 __C_DECLS_END; 52 58 53 59 #endif -
uspace/lib/c/include/bsearch.h
raf5037d r52acfab 37 37 38 38 #include <stddef.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 extern void *bsearch(const void *, const void *, size_t, size_t, 41 44 int (*)(const void *, const void *)); 45 46 __C_DECLS_END; 42 47 43 48 #endif -
uspace/lib/c/include/ctype.h
raf5037d r52acfab 30 30 #define _LIBC_CTYPE_H_ 31 31 32 #include <_bits/decls.h> 33 34 __C_DECLS_BEGIN; 32 35 int islower(int); 33 36 int isupper(int); … … 44 47 int tolower(int); 45 48 int toupper(int); 49 __C_DECLS_END; 46 50 47 51 #endif -
uspace/lib/c/include/dirent.h
raf5037d r52acfab 36 36 #define _LIBC_DIRENT_H_ 37 37 38 #define NAME_MAX 256 38 #include <_bits/decls.h> 39 40 __C_DECLS_BEGIN; 39 41 40 42 struct dirent { 41 char d_name[ NAME_MAX + 1];43 char d_name[256]; 42 44 }; 43 45 … … 49 51 extern int closedir(DIR *); 50 52 53 __C_DECLS_END; 54 51 55 #endif 52 56 -
uspace/lib/c/include/dlfcn.h
raf5037d r52acfab 37 37 #define _LIBC_DLFCN_H_ 38 38 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 42 39 43 void *dlopen(const char *, int); 40 44 void *dlsym(void *, const char *); 45 46 __C_DECLS_END; 41 47 42 48 #endif -
uspace/lib/c/include/errno.h
raf5037d r52acfab 38 38 #include <_bits/errno.h> 39 39 #include <abi/errno.h> 40 #include <_bits/decls.h> 40 41 41 #define errno (*(__errno())) 42 __HELENOS_DECLS_BEGIN; 42 43 43 44 extern errno_t *__errno(void) __attribute__((const)); 45 46 __HELENOS_DECLS_END; 47 48 #ifdef __cplusplus 49 #define errno (*(::helenos::__errno())) 50 #else 51 #define errno (*(__errno())) 52 #endif 44 53 45 54 #endif -
uspace/lib/c/include/fibril.h
raf5037d r52acfab 36 36 #define _LIBC_FIBRIL_H_ 37 37 38 #include <types/common.h>39 38 #include <time.h> 39 #include <_bits/errno.h> 40 40 #include <_bits/__noreturn.h> 41 #include <_bits/decls.h> 42 43 __HELENOS_DECLS_BEGIN; 41 44 42 45 typedef struct fibril fibril_t; … … 71 74 extern __noreturn void fibril_exit(long); 72 75 76 __HELENOS_DECLS_END; 77 73 78 #endif 74 79 -
uspace/lib/c/include/fibril_synch.h
raf5037d r52acfab 40 40 #include <time.h> 41 41 #include <stdbool.h> 42 43 typedef struct { 44 fibril_owner_info_t oi; /**< Keep this the first thing. */ 45 int counter; 46 list_t waiters; 47 } fibril_mutex_t; 42 #include <_bits/decls.h> 43 44 #ifndef __cplusplus 48 45 49 46 #define FIBRIL_MUTEX_INITIALIZER(name) \ … … 58 55 #define FIBRIL_MUTEX_INITIALIZE(name) \ 59 56 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) 60 61 typedef struct {62 fibril_owner_info_t oi; /**< Keep this the first thing. */63 unsigned int writers;64 unsigned int readers;65 list_t waiters;66 } fibril_rwlock_t;67 57 68 58 #define FIBRIL_RWLOCK_INITIALIZER(name) \ … … 79 69 fibril_rwlock_t name = FIBRIL_RWLOCK_INITIALIZER(name) 80 70 81 typedef struct {82 list_t waiters;83 } fibril_condvar_t;84 85 71 #define FIBRIL_CONDVAR_INITIALIZER(name) \ 86 72 { \ … … 90 76 #define FIBRIL_CONDVAR_INITIALIZE(name) \ 91 77 fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) 78 79 #define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \ 80 { \ 81 .count = (cnt), \ 82 .waiters = LIST_INITIALIZER((name).waiters), \ 83 } 84 85 #define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \ 86 fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) 87 88 #endif 89 90 __HELENOS_DECLS_BEGIN; 91 92 typedef struct { 93 fibril_owner_info_t oi; /**< Keep this the first thing. */ 94 int counter; 95 list_t waiters; 96 } fibril_mutex_t; 97 98 typedef struct { 99 fibril_owner_info_t oi; /**< Keep this the first thing. */ 100 unsigned int writers; 101 unsigned int readers; 102 list_t waiters; 103 } fibril_rwlock_t; 104 105 typedef struct { 106 list_t waiters; 107 } fibril_condvar_t; 92 108 93 109 typedef void (*fibril_timer_fun_t)(void *); … … 134 150 } fibril_semaphore_t; 135 151 136 #define FIBRIL_SEMAPHORE_INITIALIZER(name, cnt) \137 { \138 .count = (cnt), \139 .waiters = LIST_INITIALIZER((name).waiters), \140 }141 142 #define FIBRIL_SEMAPHORE_INITIALIZE(name, cnt) \143 fibril_semaphore_t name = FIBRIL_SEMAPHORE_INITIALIZER(name, cnt)144 145 152 extern void __fibril_synch_init(void); 146 153 extern void __fibril_synch_fini(void); … … 190 197 extern void mpsc_close(mpsc_t *); 191 198 199 __HELENOS_DECLS_END; 200 192 201 #endif 193 202 -
uspace/lib/c/include/malloc.h
raf5037d r52acfab 37 37 38 38 #include <stddef.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 extern void *malloc(size_t size) … … 42 45 extern void *calloc(size_t nmemb, size_t size) 43 46 __attribute__((malloc)); 44 extern void *memalign(size_t align, size_t size)45 __attribute__((malloc));46 47 extern void *realloc(void *addr, size_t size) 47 48 __attribute__((warn_unused_result)); 48 49 extern void free(void *addr); 50 51 __C_DECLS_END; 52 53 #ifdef _HELENOS_SOURCE 54 __HELENOS_DECLS_BEGIN; 55 56 extern void *memalign(size_t align, size_t size) 57 __attribute__((malloc)); 49 58 extern void *heap_check(void); 59 60 __HELENOS_DECLS_END; 61 #endif 50 62 51 63 #endif -
uspace/lib/c/include/mem.h
raf5037d r52acfab 38 38 39 39 #include <stddef.h> 40 #include <_bits/decls.h> 41 42 __C_DECLS_BEGIN; 40 43 41 44 extern void *memset(void *, int, size_t) … … 50 53 __attribute__((nonnull(1))); 51 54 55 __C_DECLS_END; 56 52 57 #endif 53 58 -
uspace/lib/c/include/offset.h
raf5037d r52acfab 36 36 #define _LIBC_OFFSET_H_ 37 37 38 #ifndef _HELENOS_SOURCE 39 #error This file should only be included from HelenOS sources 40 #endif 41 38 42 #include <stdint.h> 43 #include <_bits/decls.h> 44 #include <_bits/off64_t.h> 39 45 40 46 /* off64_t */ … … 52 58 #define PRIXOFF64 PRIX64 53 59 54 /** Relative offset */ 55 typedef int64_t off64_t; 60 __HELENOS_DECLS_BEGIN; 56 61 57 62 /** Absolute offset */ 58 63 typedef uint64_t aoff64_t; 64 65 __HELENOS_DECLS_END; 59 66 60 67 #endif -
uspace/lib/c/include/qsort.h
raf5037d r52acfab 37 37 38 38 #include <stddef.h> 39 #include <_bits/decls.h> 39 40 41 __C_DECLS_BEGIN; 40 42 extern void qsort(void *, size_t, size_t, int (*)(const void *, 41 43 const void *)); 44 __C_DECLS_END; 45 46 #ifdef _HELENOS_SOURCE 47 __HELENOS_DECLS_BEGIN; 42 48 extern void qsort_r(void *, size_t, size_t, int (*)(const void *, 43 49 const void *, void *), void *); 50 __HELENOS_DECLS_END; 51 #endif 44 52 45 53 #endif -
uspace/lib/c/include/setjmp.h
raf5037d r52acfab 34 34 #define _LIBC_SETJMP_H_ 35 35 36 #ifdef __cplusplus37 extern "C" {38 #endif39 40 36 #include <libarch/fibril_context.h> 41 37 #include <_bits/__noreturn.h> 38 #include <_bits/decls.h> 39 40 __C_DECLS_BEGIN; 42 41 43 42 typedef __context_t jmp_buf[1]; … … 46 45 extern __noreturn void __context_restore(__context_t *, int); 47 46 48 #define setjmp __context_save49 47 extern __noreturn void longjmp(jmp_buf, int); 50 48 51 #ifdef __cplusplus 52 } 53 # endif49 __C_DECLS_END; 50 51 #define setjmp __context_save 54 52 55 53 #endif -
uspace/lib/c/include/stdio.h
raf5037d r52acfab 37 37 #define _LIBC_STDIO_H_ 38 38 39 #ifdef __cplusplus40 extern "C" {41 #endif42 43 #include <offset.h>44 39 #include <stdarg.h> 45 40 #include <io/verify.h> … … 48 43 #include <_bits/wchar_t.h> 49 44 #include <_bits/wint_t.h> 50 51 /** Forward declaration */ 52 struct _IO_FILE; 53 typedef struct _IO_FILE FILE; 54 55 /** File position */ 56 typedef struct { 57 off64_t pos; 58 } fpos_t; 45 #include <_bits/decls.h> 59 46 60 47 #ifndef _HELENOS_SOURCE … … 70 57 71 58 /** Max number of files that is guaranteed to be able to open at the same time */ 72 #define FOPEN_MAX VFS_MAX_OPEN_FILES59 #define FOPEN_MAX 16 73 60 74 61 /** Recommended size of fixed-size array for holding file names. */ … … 92 79 /** Minimum number of unique temporary file names */ 93 80 #define TMP_MAX 1000000 81 82 __C_DECLS_BEGIN; 83 84 /** Forward declaration */ 85 struct _IO_FILE; 86 typedef struct _IO_FILE FILE; 87 88 /** File position */ 89 typedef struct { 90 long long pos; 91 } fpos_t; 94 92 95 93 extern FILE *stdin; … … 98 96 99 97 /* Character and string input functions */ 100 #define getc fgetc101 98 extern int fgetc(FILE *); 102 99 extern char *fgets(char *, int, FILE *); 103 100 extern char *gets(char *, size_t) __attribute__((deprecated)); 104 101 102 static inline int getc(FILE *f) 103 { 104 return fgetc(f); 105 } 106 105 107 extern int getchar(void); 106 108 107 109 /* Character and string output functions */ 108 #define putc fputc109 110 extern int fputc(int, FILE *); 110 111 extern int fputs(const char *, FILE *); 112 113 static inline int putc(int i, FILE *f) 114 { 115 return fputc(i, f); 116 } 111 117 112 118 extern int putchar(int); … … 180 186 extern char *tmpnam(char *s); 181 187 188 __C_DECLS_END; 189 182 190 #ifdef _HELENOS_SOURCE 183 191 192 #include <_bits/off64_t.h> 193 194 __HELENOS_DECLS_BEGIN; 195 184 196 /* Nonstandard extensions. */ 185 197 186 enum _ buffer_type {198 enum __buffer_type { 187 199 /** No buffering */ 188 200 _IONBF, … … 193 205 }; 194 206 195 enum _buffer_state {196 /** Buffer is empty */197 _bs_empty,198 199 /** Buffer contains data to be written */200 _bs_write,201 202 /** Buffer contains prefetched data for reading */203 _bs_read204 };205 206 207 extern int vprintf_length(const char *, va_list); 207 208 extern int printf_length(const char *, ...) … … 210 211 extern int fileno(FILE *); 211 212 212 #include <offset.h>213 214 213 extern int fseek64(FILE *, off64_t, int); 215 214 extern off64_t ftell64(FILE *); 216 215 217 #endif 218 219 #ifdef __cplusplus 220 } 216 __HELENOS_DECLS_END; 221 217 #endif 222 218 -
uspace/lib/c/include/stdlib.h
raf5037d r52acfab 36 36 #define _LIBC_STDLIB_H_ 37 37 38 #ifdef __cplusplus39 extern "C" {40 #endif41 42 38 #include <_bits/size_t.h> 43 39 #include <_bits/wchar_t.h> 40 #include <_bits/decls.h> 44 41 #include <bsearch.h> 45 42 #include <malloc.h> 46 43 #include <qsort.h> 44 45 #define EXIT_SUCCESS 0 46 #define EXIT_FAILURE 1 47 48 #define RAND_MAX 714025 49 50 #define MB_CUR_MAX 4 51 52 __C_DECLS_BEGIN; 47 53 48 54 /** Type returned by the div function */ … … 69 75 long long rem; 70 76 } lldiv_t; 71 72 #define EXIT_FAILURE 173 #define EXIT_SUCCESS 074 75 #define RAND_MAX 71402576 77 #define MB_CUR_MAX 478 77 79 78 extern long double strtold(const char *, char **); … … 109 108 extern lldiv_t lldiv(long long, long long); 110 109 111 #ifdef __cplusplus 112 } 113 #endif 110 __C_DECLS_END; 114 111 115 112 #endif -
uspace/lib/c/include/str.h
raf5037d r52acfab 38 38 #define _LIBC_STR_H_ 39 39 40 #ifdef __cplusplus41 extern "C" {42 #endif43 44 40 #include <errno.h> 45 41 #include <stdbool.h> … … 48 44 49 45 #include <mem.h> 46 #include <_bits/decls.h> 47 48 #ifndef __cplusplus 50 49 51 50 /* Common Unicode characters */ … … 63 62 */ 64 63 #define SPASCII_STR_BUFSIZE(spa_size) ((spa_size) + 1) 64 65 #endif 66 67 __HELENOS_DECLS_BEGIN; 65 68 66 69 extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); … … 147 150 extern unsigned long strtoul(const char *, char **, int); 148 151 149 #ifdef __cplusplus 150 } 151 #endif 152 __HELENOS_DECLS_END; 152 153 153 154 #endif -
uspace/lib/c/include/string.h
raf5037d r52acfab 41 41 #endif 42 42 43 #include <_bits/decls.h> 43 44 #include <_bits/size_t.h> 44 45 #include <_bits/NULL.h> 45 46 #include <mem.h> 47 48 __C_DECLS_BEGIN; 46 49 47 50 extern char *strcpy(char *, const char *); … … 70 73 #endif 71 74 75 __C_DECLS_END; 76 72 77 #endif 73 78 -
uspace/lib/c/include/time.h
raf5037d r52acfab 36 36 #define _LIBC_TIME_H_ 37 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 38 #include <_bits/decls.h> 41 39 42 40 /* ISO/IEC 9899:2011 7.27.1 (2) */ … … 51 49 52 50 #include <_bits/size_t.h> 51 52 __C_DECLS_BEGIN; 53 53 54 54 /* ISO/IEC 9899:2011 7.27.1 (3), (4) */ … … 106 106 const struct tm *__restrict__); 107 107 108 __C_DECLS_END; 109 108 110 #ifdef _HELENOS_SOURCE 109 111 … … 114 116 #include <stdbool.h> 115 117 #include <_bits/errno.h> 118 119 __HELENOS_DECLS_BEGIN; 116 120 117 121 typedef long long sec_t; … … 155 159 extern void udelay(sysarg_t); 156 160 161 __HELENOS_DECLS_END; 162 157 163 #endif /* _HELENOS_SOURCE */ 158 159 #ifdef __cplusplus160 }161 #endif162 164 163 165 #endif -
uspace/lib/c/include/vfs/vfs.h
raf5037d r52acfab 44 44 #include <async.h> 45 45 #include <offset.h> 46 47 #define VFS_MAX_OPEN_FILES 12848 46 49 47 enum vfs_change_state_type { -
uspace/lib/cpp/include/__bits/chrono.hpp
raf5037d r52acfab 611 611 static time_point now() 612 612 { 613 hel::timespec ts{};614 hel::getrealtime(&ts);613 ::std::timespec ts{}; 614 ::helenos::getrealtime(&ts); 615 615 616 616 rep time = NSEC2USEC(ts.tv_nsec); … … 654 654 static time_point now() 655 655 { 656 hel::timespec ts{};657 hel::getuptime(&ts);656 ::std::timespec ts{}; 657 ::helenos::getuptime(&ts); 658 658 659 659 rep time = NSEC2USEC(ts.tv_nsec); -
uspace/lib/cpp/include/__bits/io/ios.hpp
raf5037d r52acfab 41 41 { 42 42 using streamoff = long long; 43 using streamsize = hel::ssize_t;43 using streamsize = ::ssize_t; 44 44 45 45 /** -
uspace/lib/cpp/include/__bits/limits.hpp
raf5037d r52acfab 528 528 static constexpr unsigned short min() 529 529 { 530 return USHRT_MIN;530 return 0; 531 531 } 532 532 … … 552 552 static constexpr unsigned int min() 553 553 { 554 return UINT_MIN;554 return 0; 555 555 } 556 556 … … 576 576 static constexpr unsigned long min() 577 577 { 578 return ULONG_MIN;578 return 0; 579 579 } 580 580 … … 600 600 static constexpr unsigned long long min() 601 601 { 602 return ULLONG_MIN;602 return 0; 603 603 } 604 604 -
uspace/lib/cpp/include/__bits/locale/num_get.hpp
raf5037d r52acfab 301 301 if (size > 0) 302 302 { 303 int ret{}; 303 int olderrno{errno}; 304 errno = EOK; 305 char *endptr = NULL; 306 304 307 if constexpr (is_signed<BaseType>::value) 305 ret = std::hel::str_int64_t(base.buffer_, nullptr, num_base, false, &res); 306 else 307 ret = std::hel::str_uint64_t(base.buffer_, nullptr, num_base, false, &res); 308 309 if (ret != EOK) 310 { 308 res = ::strtoll(base.buffer_, &endptr, num_base); 309 else 310 res = ::strtoull(base.buffer_, &endptr, num_base); 311 312 if (errno != EOK || endptr == base.buffer_) 311 313 err |= ios_base::failbit; 312 v = 0; 313 } 314 else if (res > static_cast<BaseType>(numeric_limits<T>::max())) 314 315 errno = olderrno; 316 317 if (res > static_cast<BaseType>(numeric_limits<T>::max())) 315 318 { 316 319 err |= ios_base::failbit; -
uspace/lib/cpp/include/__bits/random.hpp
raf5037d r52acfab 1030 1030 * something better. 1031 1031 */ 1032 hel::srand(hel::time(nullptr));1032 ::srand(::time(nullptr)); 1033 1033 } 1034 1034 1035 1035 result_type operator()() 1036 1036 { 1037 return hel::rand();1037 return ::rand(); 1038 1038 } 1039 1039 -
uspace/lib/cpp/include/__bits/string/string.hpp
raf5037d r52acfab 82 82 static int compare(const char_type* s1, const char_type* s2, size_t n) 83 83 { 84 return hel::str_lcmp(s1, s2, n);84 return ::strncmp(s1, s2, n); 85 85 } 86 86 87 87 static size_t length(const char_type* s) 88 88 { 89 return hel::str_size(s);89 return ::strlen(s); 90 90 } 91 91 … … 367 367 // TODO: This function does not exits... 368 368 __unimplemented(); 369 //return hel::wstr_lcmp(s1, s2, n);370 369 return 0; 371 370 } … … 373 372 static size_t length(const char_type* s) 374 373 { 375 return hel::wstr_size(s); 374 size_t i = 0; 375 while (s[i] != 0) 376 i++; 377 return i; 376 378 } 377 379 -
uspace/lib/cpp/include/__bits/thread/condition_variable.hpp
raf5037d r52acfab 35 35 namespace std 36 36 { 37 extern "C" {38 #include <fibril.h>39 #include <fibril_synch.h>40 }41 42 37 enum class cv_status 43 38 { -
uspace/lib/cpp/include/__bits/thread/threading.hpp
raf5037d r52acfab 30 30 #define LIBCPP_BITS_THREAD_THREADING 31 31 32 namespace std::hel33 {34 extern "C" {35 #include <fibril.h>36 #include <fibril_synch.h>37 }38 }39 40 32 #include <chrono> 33 34 #include <fibril.h> 35 #include <fibril_synch.h> 41 36 42 37 namespace std::aux … … 54 49 struct threading_policy<fibril_tag> 55 50 { 56 using mutex_type = hel::fibril_mutex_t;57 using thread_type = hel::fid_t;58 using condvar_type = hel::fibril_condvar_t;59 using time_unit = hel::usec_t;60 using shared_mutex_type = hel::fibril_rwlock_t;51 using mutex_type = ::helenos::fibril_mutex_t; 52 using thread_type = ::helenos::fid_t; 53 using condvar_type = ::helenos::fibril_condvar_t; 54 using time_unit = ::helenos::usec_t; 55 using shared_mutex_type = ::helenos::fibril_rwlock_t; 61 56 62 57 struct thread … … 65 60 static thread_type create(Callable clbl, Payload& pld) 66 61 { 67 return hel::fibril_create(clbl, (void*)&pld);62 return ::helenos::fibril_create(clbl, (void*)&pld); 68 63 } 69 64 70 65 static void start(thread_type thr) 71 66 { 72 hel::fibril_add_ready(thr);67 ::helenos::fibril_add_ready(thr); 73 68 } 74 69 75 70 static thread_type this_thread() 76 71 { 77 return hel::fibril_get_id();72 return ::helenos::fibril_get_id(); 78 73 } 79 74 80 75 static void yield() 81 76 { 82 hel::fibril_yield();77 ::helenos::fibril_yield(); 83 78 } 84 79 … … 94 89 static void init(mutex_type& mtx) 95 90 { 96 hel::fibril_mutex_initialize(&mtx);91 ::helenos::fibril_mutex_initialize(&mtx); 97 92 } 98 93 99 94 static void lock(mutex_type& mtx) 100 95 { 101 hel::fibril_mutex_lock(&mtx);96 ::helenos::fibril_mutex_lock(&mtx); 102 97 } 103 98 104 99 static void unlock(mutex_type& mtx) 105 100 { 106 hel::fibril_mutex_unlock(&mtx);101 ::helenos::fibril_mutex_unlock(&mtx); 107 102 } 108 103 109 104 static bool try_lock(mutex_type& mtx) 110 105 { 111 return hel::fibril_mutex_trylock(&mtx);106 return ::helenos::fibril_mutex_trylock(&mtx); 112 107 } 113 108 … … 123 118 static void init(condvar_type& cv) 124 119 { 125 hel::fibril_condvar_initialize(&cv);120 ::helenos::fibril_condvar_initialize(&cv); 126 121 } 127 122 128 123 static void wait(condvar_type& cv, mutex_type& mtx) 129 124 { 130 hel::fibril_condvar_wait(&cv, &mtx);125 ::helenos::fibril_condvar_wait(&cv, &mtx); 131 126 } 132 127 133 128 static int wait_for(condvar_type& cv, mutex_type& mtx, time_unit timeout) 134 129 { 135 return hel::fibril_condvar_wait_timeout(&cv, &mtx, timeout);130 return ::helenos::fibril_condvar_wait_timeout(&cv, &mtx, timeout); 136 131 } 137 132 138 133 static void signal(condvar_type& cv) 139 134 { 140 hel::fibril_condvar_signal(&cv);135 ::helenos::fibril_condvar_signal(&cv); 141 136 } 142 137 143 138 static void broadcast(condvar_type& cv) 144 139 { 145 hel::fibril_condvar_broadcast(&cv);140 ::helenos::fibril_condvar_broadcast(&cv); 146 141 } 147 142 }; … … 157 152 static void sleep(time_unit time) 158 153 { 159 hel::fibril_usleep(time);154 ::helenos::fibril_usleep(time); 160 155 } 161 156 }; … … 165 160 static void init(shared_mutex_type& mtx) 166 161 { 167 hel::fibril_rwlock_initialize(&mtx);162 ::helenos::fibril_rwlock_initialize(&mtx); 168 163 } 169 164 170 165 static void lock(shared_mutex_type& mtx) 171 166 { 172 hel::fibril_rwlock_write_lock(&mtx);167 ::helenos::fibril_rwlock_write_lock(&mtx); 173 168 } 174 169 175 170 static void unlock(shared_mutex_type& mtx) 176 171 { 177 hel::fibril_rwlock_write_unlock(&mtx);172 ::helenos::fibril_rwlock_write_unlock(&mtx); 178 173 } 179 174 180 175 static void lock_shared(shared_mutex_type& mtx) 181 176 { 182 hel::fibril_rwlock_read_lock(&mtx);177 ::helenos::fibril_rwlock_read_lock(&mtx); 183 178 } 184 179 185 180 static void unlock_shared(shared_mutex_type& mtx) 186 181 { 187 hel::fibril_rwlock_read_unlock(&mtx);182 ::helenos::fibril_rwlock_read_unlock(&mtx); 188 183 } 189 184 -
uspace/lib/cpp/include/cassert
raf5037d r52acfab 30 30 #define LIBCPP_CASSERT 31 31 32 33 extern "C" { 34 #include <assert.h> 35 } 36 37 // TODO: For some reason, this function isn't visible (maybe the 38 // noreturn attribute?), adding a redeclaration here for the 39 // time being. 40 41 extern void __helenos_assert_abort(const char *, const char *, unsigned int); 32 #include <assert.h> 42 33 43 34 #define __unimplemented() assert(!"Not implemented!") -
uspace/lib/cpp/include/cctype
raf5037d r52acfab 30 30 #define LIBCPP_CCTYPE 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <ctype.h> 37 } 38 } 32 #include <ctype.h> 39 33 40 34 namespace std 41 35 { 42 using std::hel::isalnum;43 using std::hel::isalpha;44 using std::hel::islower;45 using std::hel::isupper;46 using std::hel::isdigit;47 /* using std::hel::isxdigit; */48 /* using std::hel::iscntrl; */49 /* using std::hel::isgraph; */50 using std::hel::isspace;51 /* using std::hel::isblank; */52 /* using std::hel::isprint; */53 /* using std::hel::ispunct; */54 using std::hel::tolower;55 using std::hel::toupper;36 using ::isalnum; 37 using ::isalpha; 38 using ::islower; 39 using ::isupper; 40 using ::isdigit; 41 using ::isxdigit; 42 using ::iscntrl; 43 using ::isgraph; 44 using ::isspace; 45 using ::isblank; 46 using ::isprint; 47 using ::ispunct; 48 using ::tolower; 49 using ::toupper; 56 50 } 57 51 -
uspace/lib/cpp/include/cerrno
raf5037d r52acfab 30 30 #define LIBCPP_CERRNO 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <errno.h> 37 } 38 } 39 40 namespace std 41 { 42 // Note: Only macros are imported here. 43 } 32 #include <errno.h> 44 33 45 34 #endif -
uspace/lib/cpp/include/cinttypes
raf5037d r52acfab 30 30 #define LIBCPP_CINTTYPES 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <inttypes.h> 37 } 38 } 32 #include <cstdint> 33 #include <inttypes.h> 39 34 40 35 namespace std 41 36 { 42 using std::hel::imaxdiv_t; 43 /* using std::hel::abs; */ 44 /* using std::hel::div; */ 45 /* using std::hel::imaxabs; */ 46 /* using std::hel::imaxdiv; */ 47 /* using std::hel::strtoimax; */ 48 /* using std::hel::strtoumax; */ 49 /* using std::hel::wcstoimax; */ 50 /* using std::hel::wcstoumax; */ 37 using ::imaxdiv_t; 38 using ::imaxabs; 39 using ::imaxdiv; 40 using ::strtoimax; 41 using ::strtoumax; 42 using ::wcstoimax; 43 using ::wcstoumax; 51 44 } 52 45 53 using std::hel::imaxdiv_t;54 /* using std::hel::abs; */55 /* using std::hel::div; */56 /* using std::hel::imaxabs; */57 /* using std::hel::imaxdiv; */58 /* using std::hel::strtoimax; */59 /* using std::hel::strtoumax; */60 /* using std::hel::wcstoimax; */61 /* using std::hel::wcstoumax; */62 63 #include <cstdint>64 65 46 #endif -
uspace/lib/cpp/include/climits
raf5037d r52acfab 30 30 #define LIBCPP_CLIMITS 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <limits.h> 37 } 38 } 39 40 namespace std 41 { 42 // Note: Only macros imported here. 43 } 32 #include <limits.h> 44 33 45 34 #endif -
uspace/lib/cpp/include/csetjmp
raf5037d r52acfab 30 30 #define LIBCPP_CSETJMP 31 31 32 33 /** 34 * TODO: Currently the <setjmp.h> header uses 35 * _Noreturn, which is not available in C++. 36 */ 37 38 namespace std::hel 39 { 40 extern "C" { 41 //#include <setjmp.h> 42 } 43 } 32 #include <setjmp.h> 44 33 45 34 namespace std 46 35 { 47 /* using std::hel::jmp_buf; */48 /* using std::hel::longjmp; */36 using ::jmp_buf; 37 using ::longjmp; 49 38 } 50 39 51 /* using std::hel::jmp_buf; */52 /* using std::hel::longjmp; */53 54 40 #endif -
uspace/lib/cpp/include/cstdarg
raf5037d r52acfab 30 30 #define LIBCPP_CSTDARG 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <stdarg.h> 37 } 38 } 32 #include <stdarg.h> 39 33 40 34 namespace std 41 35 { 42 using std::hel::va_list;36 using ::va_list; 43 37 } 44 38 45 using std::hel::va_list;46 47 39 #endif -
uspace/lib/cpp/include/cstddef
raf5037d r52acfab 30 30 #define LIBCPP_CSTDDEF 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <stddef.h> 37 } 38 } 39 32 #include <stddef.h> 40 33 41 34 namespace std 42 35 { 43 using nullptr_t = decltype(nullptr); 44 45 using std::hel::size_t; 46 using std::hel::ptrdiff_t; 47 /* using std::hel::max_align_t; */ 36 using ::nullptr_t; 37 using ::size_t; 38 using ::ptrdiff_t; 39 using ::max_align_t; 48 40 } 49 41 50 using std::nullptr_t;51 using std::hel::size_t;52 using std::hel::ptrdiff_t;53 /* using std::hel::max_align_t; */54 55 42 #endif -
uspace/lib/cpp/include/cstdint
raf5037d r52acfab 30 30 #define LIBCPP_CSTDINT 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <stdint.h> 37 } 38 } 32 #include <stdint.h> 39 33 40 34 namespace std 41 35 { 42 using int8_t = std::hel::int8_t;43 using int16_t = std::hel::int16_t;44 using int32_t = std::hel::int32_t;45 using int64_t = std::hel::int64_t;36 using ::int8_t; 37 using ::int16_t; 38 using ::int32_t; 39 using ::int64_t; 46 40 47 using intmax_t = std::hel::intmax_t;48 using intptr_t = std::hel::intptr_t;41 using ::intmax_t; 42 using ::intptr_t; 49 43 50 using int_fast8_t = std::hel::int_fast8_t;51 using int_fast16_t = std::hel::int_fast16_t;52 using int_fast32_t = std::hel::int_fast32_t;53 using int_fast64_t = std::hel::int_fast64_t;44 using ::int_fast8_t; 45 using ::int_fast16_t; 46 using ::int_fast32_t; 47 using ::int_fast64_t; 54 48 55 using int_least8_t = std::hel::int_least8_t;56 using int_least16_t = std::hel::int_least16_t;57 using int_least32_t = std::hel::int_least32_t;58 using int_least64_t = std::hel::int_least64_t;49 using ::int_least8_t; 50 using ::int_least16_t; 51 using ::int_least32_t; 52 using ::int_least64_t; 59 53 60 using uint8_t = std::hel::uint8_t;61 using uint16_t = std::hel::uint16_t;62 using uint32_t = std::hel::uint32_t;63 using uint64_t = std::hel::uint64_t;54 using ::uint8_t; 55 using ::uint16_t; 56 using ::uint32_t; 57 using ::uint64_t; 64 58 65 using uintmax_t = std::hel::uintmax_t;66 using uintptr_t = std::hel::uintptr_t;59 using ::uintmax_t; 60 using ::uintptr_t; 67 61 68 using uint_fast8_t = std::hel::uint_fast8_t;69 using uint_fast16_t = std::hel::uint_fast16_t;70 using uint_fast32_t = std::hel::uint_fast32_t;71 using uint_fast64_t = std::hel::uint_fast64_t;62 using ::uint_fast8_t; 63 using ::uint_fast16_t; 64 using ::uint_fast32_t; 65 using ::uint_fast64_t; 72 66 73 using uint_least8_t = std::hel::uint_least8_t;74 using uint_least16_t = std::hel::uint_least16_t;75 using uint_least32_t = std::hel::uint_least32_t;76 using uint_least64_t = std::hel::uint_least64_t;67 using ::uint_least8_t; 68 using ::uint_least16_t; 69 using ::uint_least32_t; 70 using ::uint_least64_t; 77 71 } 78 72 79 using int8_t = std::hel::int8_t;80 using int16_t = std::hel::int16_t;81 using int32_t = std::hel::int32_t;82 using int64_t = std::hel::int64_t;83 84 using intmax_t = std::hel::intmax_t;85 using intptr_t = std::hel::intptr_t;86 87 using int_fast8_t = std::hel::int_fast8_t;88 using int_fast16_t = std::hel::int_fast16_t;89 using int_fast32_t = std::hel::int_fast32_t;90 using int_fast64_t = std::hel::int_fast64_t;91 92 using int_least8_t = std::hel::int_least8_t;93 using int_least16_t = std::hel::int_least16_t;94 using int_least32_t = std::hel::int_least32_t;95 using int_least64_t = std::hel::int_least64_t;96 97 using uint8_t = std::hel::uint8_t;98 using uint16_t = std::hel::uint16_t;99 using uint32_t = std::hel::uint32_t;100 using uint64_t = std::hel::uint64_t;101 102 using uintmax_t = std::hel::uintmax_t;103 using uintptr_t = std::hel::uintptr_t;104 105 using uint_fast8_t = std::hel::uint_fast8_t;106 using uint_fast16_t = std::hel::uint_fast16_t;107 using uint_fast32_t = std::hel::uint_fast32_t;108 using uint_fast64_t = std::hel::uint_fast64_t;109 110 using uint_least8_t = std::hel::uint_least8_t;111 using uint_least16_t = std::hel::uint_least16_t;112 using uint_least32_t = std::hel::uint_least32_t;113 using uint_least64_t = std::hel::uint_least64_t;114 115 73 #endif -
uspace/lib/cpp/include/cstdio
raf5037d r52acfab 30 30 #define LIBCPP_CSTDIO 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <stdio.h> 37 } 38 } 32 #include <stdio.h> 39 33 40 34 namespace std 41 35 { 42 using std::hel::FILE;43 using std::hel::stdin;44 using std::hel::stdout;45 using std::hel::stderr;46 /* using std::hel::fpos_t */47 using std::hel::size_t;36 using ::FILE; 37 using ::stdin; 38 using ::stdout; 39 using ::stderr; 40 using ::fpos_t; 41 using ::size_t; 48 42 49 using std::hel::clearerr;50 using std::hel::fclose;51 using std::hel::feof;52 using std::hel::ferror;53 using std::hel::fflush;54 using std::hel::fgetc;55 /* using std::hel::fgetpos; */56 using std::hel::fgets;57 using std::hel::fopen;58 using std::hel::fprintf;59 using std::hel::fputc;60 using std::hel::fputs;61 using std::hel::fread;62 using std::hel::freopen;63 /* using std::hel::fscanf; */64 using std::hel::fseek;65 /* using std::hel::fsetpos; */66 using std::hel::ftell;67 using std::hel::fwrite;68 /* using std::hel::getc; */69 using std::hel::getchar;70 /* using std::hel::perror; */71 using std::hel::printf;72 /* using std::hel::putc; */73 using std::hel::putchar;74 using std::hel::puts;75 using std::hel::remove;76 using std::hel::rename;77 using std::hel::rewind;78 /* using std::hel::scanf; */79 using std::hel::setbuf;80 using std::hel::setvbuf;81 using std::hel::snprintf;82 /* using std::hel::sprintf; */83 /* using std::hel::sscanf; */84 /* using std::hel::tmpfile; */85 /* using std::hel::tmpnam; */86 using std::hel::ungetc;87 using std::hel::vfprintf;88 using std::hel::vprintf;89 /* using std::hel::vscanf; */90 using std::hel::vsnprintf;91 /* using std::hel::vsprintf; */92 /* using std::hel::vsscanf; */43 using ::clearerr; 44 using ::fclose; 45 using ::feof; 46 using ::ferror; 47 using ::fflush; 48 using ::fgetc; 49 using ::fgetpos; 50 using ::fgets; 51 using ::fopen; 52 using ::fprintf; 53 using ::fputc; 54 using ::fputs; 55 using ::fread; 56 using ::freopen; 57 using ::fscanf; 58 using ::fseek; 59 using ::fsetpos; 60 using ::ftell; 61 using ::fwrite; 62 using ::getc; 63 using ::getchar; 64 using ::perror; 65 using ::printf; 66 using ::putc; 67 using ::putchar; 68 using ::puts; 69 using ::remove; 70 using ::rename; 71 using ::rewind; 72 using ::scanf; 73 using ::setbuf; 74 using ::setvbuf; 75 using ::snprintf; 76 /* using ::sprintf; */ 77 /* using ::sscanf; */ 78 /* using ::tmpfile; */ 79 /* using ::tmpnam; */ 80 using ::ungetc; 81 using ::vfprintf; 82 using ::vprintf; 83 /* using ::vscanf; */ 84 using ::vsnprintf; 85 /* using ::vsprintf; */ 86 /* using ::vsscanf; */ 93 87 } 94 88 95 using std::hel::FILE;96 /* using std::hel::fpos_t */97 using std::hel::size_t;98 99 using std::hel::clearerr;100 using std::hel::fclose;101 using std::hel::feof;102 using std::hel::ferror;103 using std::hel::fflush;104 using std::hel::fgetc;105 /* using std::hel::fgetpos; */106 using std::hel::fgets;107 using std::hel::fopen;108 using std::hel::fprintf;109 using std::hel::fputc;110 using std::hel::fputs;111 using std::hel::fread;112 using std::hel::freopen;113 /* using std::hel::fscanf; */114 using std::hel::fseek;115 /* using std::hel::fsetpos; */116 using std::hel::ftell;117 using std::hel::fwrite;118 /* using std::hel::getc; */119 using std::hel::getchar;120 /* using std::hel::perror; */121 using std::hel::printf;122 /* using std::hel::putc; */123 using std::hel::putchar;124 using std::hel::puts;125 using std::hel::remove;126 using std::hel::rename;127 using std::hel::rewind;128 /* using std::hel::scanf; */129 using std::hel::setbuf;130 using std::hel::setvbuf;131 using std::hel::snprintf;132 /* using std::hel::sprintf; */133 /* using std::hel::sscanf; */134 /* using std::hel::tmpfile; */135 /* using std::hel::tmpnam; */136 using std::hel::ungetc;137 using std::hel::vfprintf;138 using std::hel::vprintf;139 /* using std::hel::vscanf; */140 using std::hel::vsnprintf;141 /* using std::hel::vsprintf; */142 /* using std::hel::vsscanf; */143 144 89 #endif -
uspace/lib/cpp/include/cstdlib
raf5037d r52acfab 30 30 #define LIBCPP_CSTDLIB 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <stdlib.h> 37 #include <_bits/ssize_t.h> 38 } 39 } 32 #include <stdlib.h> 33 #include <_bits/ssize_t.h> 40 34 41 35 namespace std 42 36 { 43 /* using std::hel::div_t; */44 /* using std::hel::ldiv_t; */45 /* using std::hel::lldiv_t; */46 using std::hel::size_t;37 /* using ::div_t; */ 38 /* using ::ldiv_t; */ 39 /* using ::lldiv_t; */ 40 using ::size_t; 47 41 48 using std::hel::abort;49 using std::hel::exit;50 /* using std::hel::quick_exit; */51 /* using std::hel::_Exit; */52 using std::hel::atexit;53 /* using std::hel::at_quick_exit; */54 /* using std::hel::system; */55 /* using std::hel::getenv; */42 using ::abort; 43 using ::exit; 44 /* using ::quick_exit; */ 45 /* using ::_Exit; */ 46 using ::atexit; 47 /* using ::at_quick_exit; */ 48 /* using ::system; */ 49 /* using ::getenv; */ 56 50 57 using std::hel::malloc;58 using std::hel::calloc;59 using std::hel::realloc;60 using std::hel::free;51 using ::malloc; 52 using ::calloc; 53 using ::realloc; 54 using ::free; 61 55 62 /* using std::hel::atof; */63 /* using std::hel::atoi; */64 /* using std::hel::atol; */65 /* using std::hel::atoll; */66 /* using std::hel::strtol; */67 /* using std::hel::strtoll; */68 /* using std::hel::strtoul; */69 /* using std::hel::strtoull; */70 /* using std::hel::strtof; */71 /* using std::hel::strtod; */72 /* using std::hel::strtold; */56 /* using ::atof; */ 57 /* using ::atoi; */ 58 /* using ::atol; */ 59 /* using ::atoll; */ 60 /* using ::strtol; */ 61 /* using ::strtoll; */ 62 /* using ::strtoul; */ 63 /* using ::strtoull; */ 64 /* using ::strtof; */ 65 /* using ::strtod; */ 66 /* using ::strtold; */ 73 67 74 /* using std::hel::mblen; */75 /* using std::hel::mbtowc; */76 /* using std::hel::wctomb; */77 /* using std::hel::mbstowcs; */78 /* using std::hel::wcstombs; */68 /* using ::mblen; */ 69 /* using ::mbtowc; */ 70 /* using ::wctomb; */ 71 /* using ::mbstowcs; */ 72 /* using ::wcstombs; */ 79 73 80 using std::hel::rand;81 using std::hel::srand;82 using std::hel::qsort;83 /* using std::hel::bsearch; */84 /* using std::hel::abs; */85 /* using std::hel::labs; */86 /* using std::hel::llabs; */87 /* using std::hel::div; */88 /* using std::hel::ldiv; */89 /* using std::hel::lldiv; */74 using ::rand; 75 using ::srand; 76 using ::qsort; 77 /* using ::bsearch; */ 78 /* using ::abs; */ 79 /* using ::labs; */ 80 /* using ::llabs; */ 81 /* using ::div; */ 82 /* using ::ldiv; */ 83 /* using ::lldiv; */ 90 84 } 91 85 92 /* using std::hel::div_t; */93 /* using std::hel::ldiv_t; */94 /* using std::hel::lldiv_t; */95 using std::hel::size_t;96 97 using std::hel::abort;98 using std::hel::exit;99 /* using std::hel::quick_exit; */100 /* using std::hel::_Exit; */101 using std::hel::atexit;102 /* using std::hel::at_quick_exit; */103 /* using std::hel::system; */104 /* using std::hel::getenv; */105 106 using std::hel::malloc;107 using std::hel::calloc;108 using std::hel::realloc;109 using std::hel::free;110 111 /* using std::hel::atof; */112 /* using std::hel::atoi; */113 /* using std::hel::atol; */114 /* using std::hel::atoll; */115 /* using std::hel::strtol; */116 /* using std::hel::strtoll; */117 /* using std::hel::strtoul; */118 /* using std::hel::strtoull; */119 /* using std::hel::strtof; */120 /* using std::hel::strtod; */121 /* using std::hel::strtold; */122 123 /* using std::hel::mblen; */124 /* using std::hel::mbtowc; */125 /* using std::hel::wctomb; */126 /* using std::hel::mbstowcs; */127 /* using std::hel::wcstombs; */128 129 using std::hel::rand;130 using std::hel::srand;131 using std::hel::qsort;132 /* using std::hel::bsearch; */133 /* using std::hel::abs; */134 /* using std::hel::labs; */135 /* using std::hel::llabs; */136 /* using std::hel::div; */137 /* using std::hel::ldiv; */138 /* using std::hel::lldiv; */139 140 86 #endif -
uspace/lib/cpp/include/cstring
raf5037d r52acfab 30 30 #define LIBCPP_CSTRING 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <str.h> 37 } 38 } 32 #define _REALLY_WANT_STRING_H 33 #include <string.h> 39 34 40 35 namespace std 41 36 { 42 using std::hel::size_t;37 using ::size_t; 43 38 44 /* using std::hel::strcpy; */45 /* using std::hel::strncpy; */46 /* using std::hel::strcat; */47 /* using std::hel::strncat; */48 /* using std::hel::strxfrm; */39 using ::strcpy; 40 using ::strncpy; 41 using ::strcat; 42 using ::strncat; 43 using ::strxfrm; 49 44 50 /* using std::hel::strlen; */51 /* using std::hel::strcmp; */52 /* using std::hel::strncmp; */53 /* using std::hel::strcoll; */54 /* using std::hel::strchr; */55 /* using std::hel::strrchr; */56 /* using std::hel::strspn; */57 /* using std::hel::strcspn; */58 /* using std::hel::strpbrk; */59 /* using std::hel::strstr; */60 /* using std::hel::strok; */45 using ::strlen; 46 using ::strcmp; 47 using ::strncmp; 48 using ::strcoll; 49 using ::strchr; 50 using ::strrchr; 51 using ::strspn; 52 using ::strcspn; 53 using ::strpbrk; 54 using ::strstr; 55 using ::strtok; 61 56 62 /* using std::hel::memchr; */63 using std::hel::memcmp;64 using std::hel::memset;65 using std::hel::memcpy;66 using std::hel::memmove;57 using ::memchr; 58 using ::memcmp; 59 using ::memset; 60 using ::memcpy; 61 using ::memmove; 67 62 68 /* using std::hel::strerror; */63 using ::strerror; 69 64 } 70 65 71 using std::hel::size_t;72 73 /* using std::hel::strcpy; */74 /* using std::hel::strncpy; */75 /* using std::hel::strcat; */76 /* using std::hel::strncat; */77 /* using std::hel::strxfrm; */78 79 /* using std::hel::strlen; */80 /* using std::hel::strcmp; */81 /* using std::hel::strncmp; */82 /* using std::hel::strcoll; */83 /* using std::hel::strchr; */84 /* using std::hel::strrchr; */85 /* using std::hel::strspn; */86 /* using std::hel::strcspn; */87 /* using std::hel::strpbrk; */88 /* using std::hel::strstr; */89 /* using std::hel::strok; */90 91 /* using std::hel::memchr; */92 using std::hel::memcmp;93 using std::hel::memset;94 using std::hel::memcpy;95 using std::hel::memmove;96 97 /* using std::hel::strerror; */98 99 66 #endif -
uspace/lib/cpp/include/ctime
raf5037d r52acfab 30 30 #define LIBCPP_CTIME 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <time.h> 37 } 38 } 32 #include <time.h> 39 33 40 34 namespace std 41 35 { 42 /* using std::hel::clock_t; */43 using std::hel::size_t;44 using std::hel::time_t;45 using std::hel::tm;46 /* using std::hel::timespec; */36 using ::clock_t; 37 using ::size_t; 38 using ::time_t; 39 using ::tm; 40 using ::timespec; 47 41 48 /* using std::hel::clock; */49 using std::hel::time;50 using std::hel::difftime;42 using ::clock; 43 using ::time; 44 using ::difftime; 51 45 52 /* using std::hel::ctime; */53 /* using std::hel::asctime; */54 using std::hel::strftime;55 /* using std::hel::wcsftime; */56 /* using std::hel::gmtime; */57 /* using std::hel::localtime; */58 using std::hel::mktime;46 using ::ctime; 47 using ::asctime; 48 using ::strftime; 49 /* using ::wcsftime; */ 50 /* using ::gmtime; */ 51 /* using ::localtime; */ 52 using ::mktime; 59 53 } 60 54 61 /* using std::hel::clock_t; */62 using std::hel::size_t;63 using std::hel::time_t;64 using std::hel::tm;65 /* using std::hel::timespec; */66 67 /* using std::hel::clock; */68 using std::hel::time;69 using std::hel::difftime;70 71 /* using std::hel::ctime; */72 /* using std::hel::asctime; */73 using std::hel::strftime;74 /* using std::hel::wcsftime; */75 /* using std::hel::gmtime; */76 /* using std::hel::localtime; */77 using std::hel::mktime;78 79 55 #endif -
uspace/lib/cpp/include/cwchar
raf5037d r52acfab 30 30 #define LIBCPP_WCHAR 31 31 32 33 namespace std::hel 34 { 35 extern "C" { 36 #include <wchar.h> 37 #include <time.h> 38 } 39 } 32 #include <wchar.h> 33 #include <time.h> 40 34 41 35 namespace std 42 36 { 43 /* using std::hel::mbstate_t; */44 using std::hel::size_t;45 using std::hel::wint_t;46 using std::hel::tm;37 /* using ::mbstate_t; */ 38 using ::size_t; 39 using ::wint_t; 40 using ::tm; 47 41 48 /* using std::hel::wcscpy; */49 /* using std::hel::wcsncpy; */50 /* using std::hel::wcscat; */51 /* using std::hel::wcsncat; */52 /* using std::hel::wcsnxfrm; */42 /* using ::wcscpy; */ 43 /* using ::wcsncpy; */ 44 /* using ::wcscat; */ 45 /* using ::wcsncat; */ 46 /* using ::wcsnxfrm; */ 53 47 54 /* using std::hel::wcslen; */55 /* using std::hel::wcscmp; */56 /* using std::hel::wcsncmp; */57 /* using std::hel::wcscoll; */58 /* using std::hel::wcschr; */59 /* using std::hel::wcsrchr; */60 /* using std::hel::wcsspn; */61 /* using std::hel::wcscspn; */62 /* using std::hel::wcspbrk; */63 /* using std::hel::wcsstr; */64 /* using std::hel::wcstok; */48 /* using ::wcslen; */ 49 /* using ::wcscmp; */ 50 /* using ::wcsncmp; */ 51 /* using ::wcscoll; */ 52 /* using ::wcschr; */ 53 /* using ::wcsrchr; */ 54 /* using ::wcsspn; */ 55 /* using ::wcscspn; */ 56 /* using ::wcspbrk; */ 57 /* using ::wcsstr; */ 58 /* using ::wcstok; */ 65 59 66 /* using std::hel::wmemcpy; */67 /* using std::hel::wmemmove; */68 /* using std::hel::wmemcmp; */69 /* using std::hel::wmemchr; */70 /* using std::hel::wmemset; */60 /* using ::wmemcpy; */ 61 /* using ::wmemmove; */ 62 /* using ::wmemcmp; */ 63 /* using ::wmemchr; */ 64 /* using ::wmemset; */ 71 65 72 /* using std::hel::msbinit; */73 /* using std::hel::btowc; */74 /* using std::hel::wctob; */75 /* using std::hel::mbrlen; */76 /* using std::hel::mbrtowc; */77 /* using std::hel::wctomb; */78 /* using std::hel::mbsrtowcs; */79 /* using std::hel::wcsrtombs; */66 /* using ::msbinit; */ 67 /* using ::btowc; */ 68 /* using ::wctob; */ 69 /* using ::mbrlen; */ 70 /* using ::mbrtowc; */ 71 /* using ::wctomb; */ 72 /* using ::mbsrtowcs; */ 73 /* using ::wcsrtombs; */ 80 74 81 /* using std::hel::fgetwc; */82 /* using std::hel::getwc; */83 /* using std::hel::fgetws; */84 /* using std::hel::fputwc; */85 /* using std::hel::putwc; */86 /* using std::hel::fputws; */87 /* using std::hel::getwchar; */88 /* using std::hel::putwchar; */89 /* using std::hel::ungetwc; */90 /* using std::hel::fwide; */91 /* using std::hel::wscanf; */92 /* using std::hel::fwscanf; */93 /* using std::hel::swscanf; */94 /* using std::hel::vwscanf; */95 /* using std::hel::vfwscanf; */96 /* using std::hel::vswscanf; */97 /* using std::hel::wprintf; */98 /* using std::hel::fwprintf; */99 /* using std::hel::swprintf; */75 /* using ::fgetwc; */ 76 /* using ::getwc; */ 77 /* using ::fgetws; */ 78 /* using ::fputwc; */ 79 /* using ::putwc; */ 80 /* using ::fputws; */ 81 /* using ::getwchar; */ 82 /* using ::putwchar; */ 83 /* using ::ungetwc; */ 84 /* using ::fwide; */ 85 /* using ::wscanf; */ 86 /* using ::fwscanf; */ 87 /* using ::swscanf; */ 88 /* using ::vwscanf; */ 89 /* using ::vfwscanf; */ 90 /* using ::vswscanf; */ 91 /* using ::wprintf; */ 92 /* using ::fwprintf; */ 93 /* using ::swprintf; */ 100 94 101 /* using std::hel::wcsftime; */102 /* using std::hel::wcstol; */103 /* using std::hel::wcstoll; */104 /* using std::hel::wcstoul; */105 /* using std::hel::wcstoull; */106 /* using std::hel::wcstof; */107 /* using std::hel::wcstod; */108 /* using std::hel::wcstold; */95 /* using ::wcsftime; */ 96 /* using ::wcstol; */ 97 /* using ::wcstoll; */ 98 /* using ::wcstoul; */ 99 /* using ::wcstoull; */ 100 /* using ::wcstof; */ 101 /* using ::wcstod; */ 102 /* using ::wcstold; */ 109 103 } 110 104 111 /* using std::hel::mbstate_t; */112 using std::hel::size_t;113 using std::hel::wint_t;114 using std::hel::tm;115 116 /* using std::hel::wcscpy; */117 /* using std::hel::wcsncpy; */118 /* using std::hel::wcscat; */119 /* using std::hel::wcsncat; */120 /* using std::hel::wcsnxfrm; */121 122 /* using std::hel::wcslen; */123 /* using std::hel::wcscmp; */124 /* using std::hel::wcsncmp; */125 /* using std::hel::wcscoll; */126 /* using std::hel::wcschr; */127 /* using std::hel::wcsrchr; */128 /* using std::hel::wcsspn; */129 /* using std::hel::wcscspn; */130 /* using std::hel::wcspbrk; */131 /* using std::hel::wcsstr; */132 /* using std::hel::wcstok; */133 134 /* using std::hel::wmemcpy; */135 /* using std::hel::wmemmove; */136 /* using std::hel::wmemcmp; */137 /* using std::hel::wmemchr; */138 /* using std::hel::wmemset; */139 140 /* using std::hel::msbinit; */141 /* using std::hel::btowc; */142 /* using std::hel::wctob; */143 /* using std::hel::mbrlen; */144 /* using std::hel::mbrtowc; */145 /* using std::hel::wctomb; */146 /* using std::hel::mbsrtowcs; */147 /* using std::hel::wcsrtombs; */148 149 /* using std::hel::fgetwc; */150 /* using std::hel::getwc; */151 /* using std::hel::fgetws; */152 /* using std::hel::fputwc; */153 /* using std::hel::putwc; */154 /* using std::hel::fputws; */155 /* using std::hel::getwchar; */156 /* using std::hel::putwchar; */157 /* using std::hel::ungetwc; */158 /* using std::hel::fwide; */159 /* using std::hel::wscanf; */160 /* using std::hel::fwscanf; */161 /* using std::hel::swscanf; */162 /* using std::hel::vwscanf; */163 /* using std::hel::vfwscanf; */164 /* using std::hel::vswscanf; */165 /* using std::hel::wprintf; */166 /* using std::hel::fwprintf; */167 /* using std::hel::swprintf; */168 169 /* using std::hel::wcsftime; */170 /* using std::hel::wcstol; */171 /* using std::hel::wcstoll; */172 /* using std::hel::wcstoul; */173 /* using std::hel::wcstoull; */174 /* using std::hel::wcstof; */175 /* using std::hel::wcstod; */176 /* using std::hel::wcstold; */177 178 105 #endif -
uspace/lib/cpp/src/stdexcept.cpp
raf5037d r52acfab 31 31 #include <stdexcept> 32 32 #include <string> 33 #include <str.h> 33 34 34 35 namespace std 35 36 { 36 37 logic_error::logic_error(const string& what) 37 : what_{ hel::str_dup(what.c_str())}38 : what_{::helenos::str_dup(what.c_str())} 38 39 { /* DUMMY BODY */ } 39 40 40 41 logic_error::logic_error(const char* what) 41 : what_{ hel::str_dup(what)}42 : what_{::helenos::str_dup(what)} 42 43 { /* DUMMY BODY */ } 43 44 44 45 logic_error::logic_error(const logic_error& other) noexcept 45 : exception{other}, what_{ hel::str_dup(other.what_)}46 : exception{other}, what_{::helenos::str_dup(other.what_)} 46 47 { /* DUMMY BODY */ } 47 48 … … 50 51 if (what_) 51 52 free(what_); 52 what_ = hel::str_dup(other.what_);53 what_ = ::helenos::str_dup(other.what_); 53 54 54 55 return *this; … … 114 115 115 116 runtime_error::runtime_error(const string& what) 116 : what_{ hel::str_dup(what.c_str())}117 : what_{::helenos::str_dup(what.c_str())} 117 118 { /* DUMMY BODY */ } 118 119 119 120 runtime_error::runtime_error(const char* what) 120 : what_{ hel::str_dup(what)}121 : what_{::helenos::str_dup(what)} 121 122 { /* DUMMY BODY */ } 122 123 123 124 runtime_error::runtime_error(const runtime_error& other) noexcept 124 : exception{other}, what_{ hel::str_dup(other.what_)}125 : exception{other}, what_{::helenos::str_dup(other.what_)} 125 126 { /* DUMMY BODY */ } 126 127 … … 129 130 if (what_) 130 131 free(what_); 131 what_ = hel::str_dup(other.what_);132 what_ = ::helenos::str_dup(other.what_); 132 133 133 134 return *this; -
uspace/lib/cpp/src/string.cpp
raf5037d r52acfab 42 42 { 43 43 char* end; 44 long result = hel::strtol(str.c_str(), &end, base);44 long result = ::strtol(str.c_str(), &end, base); 45 45 46 46 if (end != str.c_str()) … … 58 58 { 59 59 char* end; 60 unsigned long result = hel::strtoul(str.c_str(), &end, base);60 unsigned long result = ::strtoul(str.c_str(), &end, base); 61 61 62 62 if (end != str.c_str()) … … 106 106 } 107 107 108 namespace hel109 {110 extern "C" int asprintf(char**, const char*, ...);111 }112 113 108 string to_string(int val) 114 109 { 115 110 char* tmp; 116 hel::asprintf(&tmp, "%d", val);111 ::asprintf(&tmp, "%d", val); 117 112 118 113 std::string res{tmp}; … … 125 120 { 126 121 char* tmp; 127 hel::asprintf(&tmp, "%u", val);122 ::asprintf(&tmp, "%u", val); 128 123 129 124 std::string res{tmp}; … … 136 131 { 137 132 char* tmp; 138 hel::asprintf(&tmp, "%ld", val);133 ::asprintf(&tmp, "%ld", val); 139 134 140 135 std::string res{tmp}; … … 147 142 { 148 143 char* tmp; 149 hel::asprintf(&tmp, "%lu", val);144 ::asprintf(&tmp, "%lu", val); 150 145 151 146 std::string res{tmp}; … … 158 153 { 159 154 char* tmp; 160 hel::asprintf(&tmp, "%lld", val);155 ::asprintf(&tmp, "%lld", val); 161 156 162 157 std::string res{tmp}; … … 169 164 { 170 165 char* tmp; 171 hel::asprintf(&tmp, "%llu", val);166 ::asprintf(&tmp, "%llu", val); 172 167 173 168 std::string res{tmp}; … … 180 175 { 181 176 char* tmp; 182 hel::asprintf(&tmp, "%f", val);177 ::asprintf(&tmp, "%f", val); 183 178 184 179 std::string res{tmp}; … … 191 186 { 192 187 char* tmp; 193 hel::asprintf(&tmp, "%f", val);188 ::asprintf(&tmp, "%f", val); 194 189 195 190 std::string res{tmp}; … … 202 197 { 203 198 char* tmp; 204 hel::asprintf(&tmp, "%Lf", val);199 ::asprintf(&tmp, "%Lf", val); 205 200 206 201 std::string res{tmp}; -
uspace/lib/cpp/src/typeinfo.cpp
raf5037d r52acfab 38 38 bool type_info::operator==(const type_info& other) const noexcept 39 39 { 40 return (this == &other) || 41 std::hel::str_cmp(name(), other.name()); 40 return (this == &other) || ::strcmp(name(), other.name()) == 0; 42 41 } 43 42 -
uspace/lib/pcm/src/format.c
raf5037d r52acfab 40 40 #include <stdio.h> 41 41 #include <inttypes.h> 42 #include <limits.h> 42 43 43 44 #include "format.h" -
uspace/lib/posix/Makefile
raf5037d r52acfab 41 41 ../hound/libhound.a \ 42 42 ../pcm/libpcm.a \ 43 ../cpp/libcpp.a \ 43 44 $(LIBC_PREFIX)/libc.a \ 44 45 $(LIBC_PREFIX)/crt0.o \ … … 96 97 $(COMMON_CFLAGS) 97 98 99 EXPORT_CXXFLAGS = \ 100 $(COMMON_CXXFLAGS) 101 98 102 include $(USPACE_PREFIX)/Makefile.common 99 103 … … 109 113 echo 'HELENOS_CPPFLAGS="$(EXPORT_CPPFLAGS)"' >> $@.new 110 114 echo 'HELENOS_CFLAGS="$(EXPORT_CFLAGS)"' >> $@.new 111 echo 'HELENOS_CXXFLAGS="$(EXPORT_C FLAGS)"' >> $@.new115 echo 'HELENOS_CXXFLAGS="$(EXPORT_CXXFLAGS)"' >> $@.new 112 116 echo 'HELENOS_LDFLAGS="$(EXPORT_LDFLAGS)"' >> $@.new 113 117 echo 'HELENOS_LDLIBS="$(EXPORT_LDLIBS)"' >> $@.new … … 146 150 mkdir -p $(EXPORT_DIR)/include.new/libpcm 147 151 cp -r -L -t $(EXPORT_DIR)/include.new/libpcm ../pcm/include/* 152 mkdir -p $(EXPORT_DIR)/include.new/libcpp 153 cp -r -L -t $(EXPORT_DIR)/include.new/libcpp ../cpp/include/* 148 154 mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include -
uspace/lib/posix/include/posix/ctype.h
raf5037d r52acfab 39 39 #include <libc/ctype.h> 40 40 41 __C_DECLS_BEGIN; 42 41 43 /* Obsolete Functions and Macros */ 42 44 extern int isascii(int c); … … 46 48 #define _toupper(c) ((c) - 'a' + 'A') 47 49 50 __C_DECLS_END; 51 48 52 #endif /* POSIX_CTYPE_H_ */ 49 53 -
uspace/lib/posix/include/posix/dlfcn.h
raf5037d r52acfab 41 41 #define RTLD_LOCAL 0 42 42 43 __C_DECLS_BEGIN; 44 43 45 extern void *dlopen(const char *, int); 44 46 extern void *dlsym(void *, const char *); 45 47 extern int dlclose(void *); 46 48 extern char *dlerror(void); 49 50 __C_DECLS_END; 47 51 48 52 #endif -
uspace/lib/posix/include/posix/fcntl.h
raf5037d r52acfab 38 38 #include <sys/types.h> 39 39 40 #undef O_CREAT41 #undef O_EXCL42 #undef O_TRUNC43 #undef O_APPEND44 #undef O_RDONLY45 #undef O_RDWR46 #undef O_WRONLY47 40 #define O_CREAT 1 48 41 #define O_EXCL 2 … … 54 47 55 48 /* Mask for file access modes. */ 56 #undef O_ACCMODE57 49 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) 58 50 59 51 /* Dummy compatibility flag */ 60 #undef O_NOCTTY61 52 #define O_NOCTTY 0 62 53 63 54 /* fcntl commands */ 64 #undef F_DUPFD65 #undef F_DUPFD_CLOEXEC66 #undef F_GETFD67 #undef F_SETFD68 #undef F_GETFL69 #undef F_SETFL70 #undef F_GETOWN71 #undef F_SETOWN72 #undef F_GETLK73 #undef F_SETLK74 #undef F_SETLKW75 55 #define F_DUPFD 0 /* Duplicate file descriptor. */ 76 56 #define F_DUPFD_CLOEXEC 1 /* Same as F_DUPFD but with FD_CLOEXEC flag set. */ … … 86 66 87 67 /* File descriptor flags used with F_GETFD and F_SETFD. */ 88 #undef FD_CLOEXEC89 68 #define FD_CLOEXEC 1 /* Close on exec. */ 69 70 __C_DECLS_BEGIN; 90 71 91 72 extern int open(const char *pathname, int flags, ...); 92 73 extern int fcntl(int fd, int cmd, ...); 74 75 __C_DECLS_END; 93 76 94 77 #endif /* POSIX_FCNTL_H_ */ -
uspace/lib/posix/include/posix/fnmatch.h
raf5037d r52acfab 36 36 #define POSIX_FNMATCH_H_ 37 37 38 #include <_bits/decls.h> 39 38 40 /* Error Values */ 39 #undef FNM_NOMATCH40 41 #define FNM_NOMATCH 1 41 42 42 43 /* Flags */ 43 #undef FNM_PATHNAME44 #undef FNM_PERIOD45 #undef FNM_NOESCAPE46 44 #define FNM_PATHNAME 1 47 45 #define FNM_PERIOD 2 … … 49 47 50 48 /* GNU Extensions */ 51 #undef FNM_FILE_NAME52 #undef FNM_LEADING_DIR53 #undef FNM_CASEFOLD54 49 #define FNM_FILE_NAME FNM_PATHNAME 55 50 #define FNM_LEADING_DIR 8 56 51 #define FNM_CASEFOLD 16 57 52 53 __C_DECLS_BEGIN; 54 58 55 extern int fnmatch(const char *pattern, const char *string, int flags); 56 57 __C_DECLS_END; 59 58 60 59 #endif /* POSIX_FNMATCH_H_ */ -
uspace/lib/posix/include/posix/locale.h
raf5037d r52acfab 37 37 38 38 #include <stddef.h> 39 #include <_bits/decls.h> 39 40 40 #ifndef __locale_t_defined41 #define __locale_t_defined42 typedef struct __posix_locale *locale_t;43 #endif44 45 #undef LC_ALL46 #undef LC_COLLATE47 #undef LC_CTYPE48 #undef LC_MESSAGES49 #undef LC_MONETARY50 #undef LC_NUMERIC51 #undef LC_TIME52 41 #define LC_ALL 0 53 42 #define LC_COLLATE 1 … … 58 47 #define LC_TIME 6 59 48 60 #undef LC_COLLATE_MASK61 #undef LC_CTYPE_MASK62 #undef LC_MESSAGES_MASK63 #undef LC_MONETARY_MASK64 #undef LC_NUMERIC_MASK65 #undef LC_TIME_MASK66 #undef LC_ALL_MASK67 49 #define LC_COLLATE_MASK (1 << 0) 68 50 #define LC_CTYPE_MASK (1 << 1) … … 74 56 LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) 75 57 76 #undef LC_GLOBAL_LOCALE77 58 #define LC_GLOBAL_LOCALE NULL 59 60 __C_DECLS_BEGIN; 61 62 #ifndef __locale_t_defined 63 #define __locale_t_defined 64 typedef struct __posix_locale *locale_t; 65 #endif 78 66 79 67 struct lconv { … … 114 102 extern locale_t uselocale(locale_t newloc); 115 103 104 __C_DECLS_END; 105 116 106 #endif /* POSIX_LOCALE_H_ */ 117 107 -
uspace/lib/posix/include/posix/pthread.h
raf5037d r52acfab 34 34 35 35 #include <time.h> 36 #include <_bits/decls.h> 37 38 #define PTHREAD_MUTEX_RECURSIVE 1 39 40 #define PTHREAD_MUTEX_INITIALIZER { 0 } 41 42 #define PTHREAD_COND_INITIALIZER { 0 } 43 44 __C_DECLS_BEGIN; 36 45 37 46 typedef void *pthread_t; … … 43 52 typedef int pthread_key_t; 44 53 45 #define PTHREAD_MUTEX_RECURSIVE 146 47 54 typedef struct pthread_mutex { 48 55 int dummy; 49 56 } pthread_mutex_t; 50 51 #define PTHREAD_MUTEX_INITIALIZER { 0 }52 57 53 58 typedef struct { … … 62 67 int dummy; 63 68 } pthread_cond_t; 64 65 #define PTHREAD_COND_INITIALIZER { 0 }66 69 67 70 extern pthread_t pthread_self(void); … … 106 109 extern int pthread_key_create(pthread_key_t *, void (*)(void *)); 107 110 111 __C_DECLS_END; 112 108 113 #endif 109 114 -
uspace/lib/posix/include/posix/pwd.h
raf5037d r52acfab 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 struct passwd { … … 58 61 char *buffer, size_t bufsize, struct passwd **result); 59 62 63 __C_DECLS_END; 64 60 65 #endif /* POSIX_PWD_H_ */ 61 66 -
uspace/lib/posix/include/posix/signal.h
raf5037d r52acfab 39 39 #include <ucontext.h> 40 40 41 extern void __posix_default_signal_handler(int signo);42 extern void __posix_hold_signal_handler(int signo);43 extern void __posix_ignore_signal_handler(int signo);44 45 #undef SIG_DFL46 41 #define SIG_DFL ((void (*)(int)) __posix_default_signal_handler) 47 #undef SIG_ERR48 42 #define SIG_ERR ((void (*)(int)) NULL) 49 #undef SIG_HOLD50 43 #define SIG_HOLD ((void (*)(int)) __posix_hold_signal_handler) 51 #undef SIG_IGN52 44 #define SIG_IGN ((void (*)(int)) __posix_ignore_signal_handler) 53 45 54 typedef struct {55 int si_signo;56 int si_code;57 58 int si_errno;59 60 pid_t si_pid;61 uid_t si_uid;62 void *si_addr;63 int si_status;64 65 long si_band;66 67 union sigval si_value;68 } siginfo_t;69 70 struct sigaction {71 void (*sa_handler)(int);72 sigset_t sa_mask;73 int sa_flags;74 void (*sa_sigaction)(int, siginfo_t *, void *);75 };76 77 46 /* Values of sigevent::sigev_notify */ 78 #undef SIGEV_NONE79 #undef SIGEV_SIGNAL80 #undef SIGEV_THREAD81 47 #define SIGEV_NONE 0 82 48 #define SIGEV_SIGNAL 0 83 49 #define SIGEV_THREAD 0 84 50 85 #undef SIGRT_MIN86 #undef SIGRT_MAX87 51 #define SIGRT_MIN 0 88 52 #define SIGRT_MAX 0 89 53 90 #undef SIG_BLOCK91 #undef SIG_UNBLOCK92 #undef SIG_SETMASK93 54 #define SIG_BLOCK 0 94 55 #define SIG_UNBLOCK 1 95 56 #define SIG_SETMASK 2 96 57 97 #undef SA_NOCLDSTOP98 #undef SA_ONSTACK99 #undef SA_RESETHAND100 #undef SA_RESTART101 #undef SA_SIGINFO102 #undef SA_NOCLDWAIT103 #undef SA_NODEFER104 58 #define SA_NOCLDSTOP (1 << 0) 105 59 #define SA_ONSTACK (1 << 1) … … 110 64 #define SA_NODEFER (1 << 6) 111 65 112 #undef SS_ONSTACK113 #undef SS_DISABLE114 66 #define SS_ONSTACK 0 115 67 #define SS_DISABLE 0 116 68 117 #undef MINSIGSTKSZ118 #undef SIGSTKSZ119 69 #define MINSIGSTKSZ 0 120 70 #define SIGSTKSZ 0 71 72 __C_DECLS_BEGIN; 73 74 extern void __posix_default_signal_handler(int signo); 75 extern void __posix_hold_signal_handler(int signo); 76 extern void __posix_ignore_signal_handler(int signo); 77 78 typedef struct { 79 int si_signo; 80 int si_code; 81 82 int si_errno; 83 84 pid_t si_pid; 85 uid_t si_uid; 86 void *si_addr; 87 int si_status; 88 89 long si_band; 90 91 union sigval si_value; 92 } siginfo_t; 93 94 struct sigaction { 95 void (*sa_handler)(int); 96 sigset_t sa_mask; 97 int sa_flags; 98 void (*sa_sigaction)(int, siginfo_t *, void *); 99 }; 121 100 122 101 /* Full POSIX set */ … … 245 224 sigset_t *__restrict__ oset); 246 225 226 __C_DECLS_END; 227 247 228 #endif /* POSIX_SIGNAL_H_ */ 248 229 -
uspace/lib/posix/include/posix/stdio.h
raf5037d r52acfab 45 45 #include <limits.h> 46 46 47 #define P_tmpdir "/tmp" 48 49 #define L_ctermid PATH_MAX 50 51 __C_DECLS_BEGIN; 52 47 53 extern FILE *fdopen(int, const char *); 48 54 extern int fileno(FILE *); 49 55 50 #define P_tmpdir "/tmp"51 52 56 /* Identifying the Terminal */ 53 #undef L_ctermid54 #define L_ctermid PATH_MAX55 57 extern char *ctermid(char *s); 56 58 … … 98 100 extern char *tempnam(const char *dir, const char *pfx); 99 101 102 __C_DECLS_END; 103 100 104 #endif /* POSIX_STDIO_H_ */ 101 105 -
uspace/lib/posix/include/posix/stdlib.h
raf5037d r52acfab 42 42 #include <stddef.h> 43 43 44 __C_DECLS_BEGIN; 45 44 46 /* Environment Access */ 45 47 extern int putenv(char *string); … … 60 62 extern int bsd_getloadavg(double loadavg[], int nelem); 61 63 64 __C_DECLS_END; 65 62 66 #endif // POSIX_STDLIB_H_ 63 67 -
uspace/lib/posix/include/posix/string.h
raf5037d r52acfab 47 47 48 48 #include <libc/mem.h> 49 #ifdef _HELENOS_SOURCE 50 # undef _HELENOS_SOURCE49 50 #define _REALLY_WANT_STRING_H 51 51 #include <libc/string.h> 52 #define _HELENOS_SOURCE 53 #else 54 #include <libc/string.h> 55 #endif 52 53 __C_DECLS_BEGIN; 56 54 57 55 /* Copying and Concatenation */ … … 73 71 74 72 /* Legacy Declarations */ 75 #ifndef POSIX_STRINGS_H_76 73 extern int ffs(int i); 77 74 extern int strcasecmp(const char *s1, const char *s2); 78 75 extern int strncasecmp(const char *s1, const char *s2, size_t n); 79 #endif 76 77 __C_DECLS_END; 80 78 81 79 #endif // POSIX_STRING_H_ -
uspace/lib/posix/include/posix/strings.h
raf5037d r52acfab 39 39 #include <types/common.h> 40 40 41 __C_DECLS_BEGIN; 42 41 43 /* Search Functions */ 42 #ifndef POSIX_STRING_H_43 44 extern int ffs(int i); 44 #endif45 45 46 46 /* String/Array Comparison */ 47 #ifndef POSIX_STRING_H_48 47 extern int strcasecmp(const char *s1, const char *s2); 49 48 extern int strncasecmp(const char *s1, const char *s2, size_t n); 50 #endif51 49 52 50 /* … … 64 62 extern char *rindex(const char *s, int c); 65 63 64 __C_DECLS_END; 65 66 66 #endif // POSIX_STRINGS_H_ 67 67 -
uspace/lib/posix/include/posix/sys/mman.h
raf5037d r52acfab 37 37 38 38 #include <sys/types.h> 39 #include < abi/mm/as.h>39 #include <_bits/decls.h> 40 40 41 #define MAP_FAILED ((void *) -1)41 #define MAP_FAILED ((void *) -1) 42 42 43 43 #define MAP_SHARED (1 << 0) … … 45 45 #define MAP_FIXED (1 << 2) 46 46 #define MAP_ANONYMOUS (1 << 3) 47 #define MAP_ANON MAP_ANONYMOUS47 #define MAP_ANON MAP_ANONYMOUS 48 48 49 #undef PROT_NONE 50 #undef PROT_READ 51 #undef PROT_WRITE 52 #undef PROT_EXEC 53 #define PROT_NONE 0 54 #define PROT_READ AS_AREA_READ 55 #define PROT_WRITE AS_AREA_WRITE 56 #define PROT_EXEC AS_AREA_EXEC 49 #define PROT_NONE 0 50 #define PROT_READ 1 51 #define PROT_WRITE 2 52 #define PROT_EXEC 4 53 54 __C_DECLS_BEGIN; 57 55 58 56 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, … … 60 58 extern int munmap(void *start, size_t length); 61 59 60 __C_DECLS_END; 61 62 62 #endif /* POSIX_SYS_MMAN_H_ */ 63 63 -
uspace/lib/posix/include/posix/sys/stat.h
raf5037d r52acfab 39 39 #include <sys/types.h> 40 40 #include <time.h> 41 #include <_bits/decls.h> 41 42 42 43 /* values are the same as on Linux */ 43 44 44 #undef S_IFMT45 #undef S_IFSOCK46 #undef S_IFLNK47 #undef S_IFREG48 #undef S_IFBLK49 #undef S_IFDIR50 #undef S_IFCHR51 #undef S_IFIFO52 45 #define S_IFMT 0170000 /* all file types */ 53 46 #define S_IFSOCK 0140000 /* socket */ … … 59 52 #define S_IFIFO 0010000 /* FIFO */ 60 53 61 #undef S_ISUID62 #undef S_ISGID63 #undef S_ISVTX64 54 #define S_ISUID 0004000 /* SUID */ 65 55 #define S_ISGID 0002000 /* SGID */ 66 56 #define S_ISVTX 0001000 /* sticky */ 67 57 68 #undef S_IRWXU69 #undef S_IRUSR70 #undef S_IWUSR71 #undef S_IXUSR72 58 #define S_IRWXU 00700 /* owner permissions */ 73 59 #define S_IRUSR 00400 … … 75 61 #define S_IXUSR 00100 76 62 77 #undef S_IRWXG78 #undef S_IRGRP79 #undef S_IWGRP80 #undef S_IXGRP81 63 #define S_IRWXG 00070 /* group permissions */ 82 64 #define S_IRGRP 00040 … … 84 66 #define S_IXGRP 00010 85 67 86 #undef S_IRWXO87 #undef S_IROTH88 #undef S_IWOTH89 #undef S_IXOTH90 68 #define S_IRWXO 00007 /* other permissions */ 91 69 #define S_IROTH 00004 … … 93 71 #define S_IXOTH 00001 94 72 95 #undef S_ISREG96 #undef S_ISDIR97 #undef S_ISCHR98 #undef S_ISBLK99 #undef S_ISFIFO100 #undef S_ISLNK101 #undef S_ISSOCK102 73 #define S_ISREG(m) ((m & S_IFREG) != 0) 103 74 #define S_ISDIR(m) ((m & S_IFDIR) != 0) … … 107 78 #define S_ISLNK(m) ((m & S_IFLNK) != 0) /* symbolic link? (Not in POSIX.1-1996.) */ 108 79 #define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */ 80 81 __C_DECLS_BEGIN; 109 82 110 83 struct stat { … … 131 104 extern int mkdir(const char *path, mode_t mode); 132 105 106 __C_DECLS_END; 107 133 108 #endif /* POSIX_SYS_STAT_H */ 134 109 -
uspace/lib/posix/include/posix/sys/time.h
raf5037d r52acfab 35 35 36 36 #include <time.h> 37 #include <_bits/decls.h> 38 39 __C_DECLS_BEGIN; 37 40 38 41 struct timeval { … … 43 46 extern int gettimeofday(struct timeval *, void *); 44 47 48 __C_DECLS_END; 49 45 50 #endif 46 51 -
uspace/lib/posix/include/posix/sys/types.h
raf5037d r52acfab 37 37 #define POSIX_SYS_TYPES_H_ 38 38 39 #include <types/common.h> 39 #include <stddef.h> 40 #include <stdint.h> 41 #include <_bits/ssize_t.h> 42 #include <_bits/decls.h> 43 44 __C_DECLS_BEGIN; 40 45 41 46 typedef unsigned int ino_t; … … 46 51 typedef long blkcnt_t; 47 52 typedef int pid_t; 48 typedef sysarg_tdev_t;53 typedef unsigned long dev_t; 49 54 typedef unsigned int mode_t; 50 55 … … 67 72 typedef long suseconds_t; 68 73 74 __C_DECLS_END; 75 69 76 #endif /* POSIX_SYS_TYPES_H_ */ 70 77 -
uspace/lib/posix/include/posix/sys/wait.h
raf5037d r52acfab 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 39 40 40 #undef WIFEXITED41 #undef WEXITSTATUS42 #undef WIFSIGNALED43 #undef WTERMSIG44 41 #define WIFEXITED(status) __posix_wifexited(status) 45 42 #define WEXITSTATUS(status) __posix_wexitstatus(status) 46 43 #define WIFSIGNALED(status) __posix_wifsignaled(status) 47 44 #define WTERMSIG(status) __posix_wtermsig(status) 45 46 __C_DECLS_BEGIN; 48 47 49 48 extern int __posix_wifexited(int status); … … 55 54 extern pid_t waitpid(pid_t pid, int *stat_ptr, int options); 56 55 56 __C_DECLS_END; 57 57 58 #endif /* POSIX_SYS_WAIT_H_ */ 58 59 -
uspace/lib/posix/include/posix/time.h
raf5037d r52acfab 41 41 #include <libc/time.h> 42 42 43 #define CLOCK_REALTIME ((clockid_t) 0) 44 45 #define ASCTIME_BUF_LEN 26 46 47 __C_DECLS_BEGIN; 48 43 49 #ifndef __locale_t_defined 44 50 #define __locale_t_defined … … 46 52 #endif 47 53 48 #ifndef POSIX_SIGNAL_H_49 54 struct sigevent; 50 #endif51 52 #undef CLOCK_REALTIME53 #define CLOCK_REALTIME ((clockid_t) 0)54 55 #define ASCTIME_BUF_LEN 2656 55 57 56 struct itimerspec { … … 97 96 const struct timespec *rqtp, struct timespec *rmtp); 98 97 98 __C_DECLS_END; 99 99 100 #endif // POSIX_TIME_H_ 100 101 -
uspace/lib/posix/include/posix/ucontext.h
raf5037d r52acfab 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 typedef int sig_atomic_t; … … 71 74 } ucontext_t; 72 75 76 __C_DECLS_END; 77 73 78 #endif 74 79 -
uspace/lib/posix/include/posix/unistd.h
raf5037d r52acfab 46 46 /* Process Termination */ 47 47 #define _exit exit 48 49 /* Standard Streams */ 50 #define STDIN_FILENO (fileno(stdin)) 51 #define STDOUT_FILENO (fileno(stdout)) 52 #define STDERR_FILENO (fileno(stderr)) 53 54 #define F_OK 0 /* Test for existence. */ 55 #define X_OK 1 /* Test for execute permission. */ 56 #define W_OK 2 /* Test for write permission. */ 57 #define R_OK 4 /* Test for read permission. */ 58 59 __C_DECLS_BEGIN; 48 60 49 61 extern char *optarg; … … 106 118 #endif 107 119 108 /* Standard Streams */109 #undef STDIN_FILENO110 #define STDIN_FILENO (fileno(stdin))111 #undef STDOUT_FILENO112 #define STDOUT_FILENO (fileno(stdout))113 #undef STDERR_FILENO114 #define STDERR_FILENO (fileno(stderr))115 116 120 /* File Accessibility */ 117 #undef F_OK118 #undef X_OK119 #undef W_OK120 #undef R_OK121 #define F_OK 0 /* Test for existence. */122 #define X_OK 1 /* Test for execute permission. */123 #define W_OK 2 /* Test for write permission. */124 #define R_OK 4 /* Test for read permission. */125 121 extern int access(const char *path, int amode); 126 122 … … 171 167 extern unsigned int alarm(unsigned int); 172 168 169 __C_DECLS_END; 170 173 171 #endif /* POSIX_UNISTD_H_ */ 174 172 -
uspace/lib/posix/src/internal/common.h
raf5037d r52acfab 67 67 } 68 68 69 // TODO: Remove this arbitrary limit. 70 #define VFS_MAX_OPEN_FILES 128 71 69 72 extern aoff64_t posix_pos[VFS_MAX_OPEN_FILES]; 70 73 -
uspace/lib/posix/src/sys/mman.c
raf5037d r52acfab 39 39 #include <unistd.h> 40 40 41 static int _prot_to_as(int prot) 42 { 43 int ret = 0; 44 45 if (prot & PROT_READ) 46 ret |= AS_AREA_READ; 47 48 if (prot & PROT_WRITE) 49 ret |= AS_AREA_WRITE; 50 51 if (prot & PROT_EXEC) 52 ret |= AS_AREA_EXEC; 53 54 return ret; 55 } 56 41 57 void *mmap(void *start, size_t length, int prot, int flags, int fd, 42 58 off_t offset) … … 53 69 return MAP_FAILED; 54 70 55 return as_area_create(start, length, prot, AS_AREA_UNPAGED);71 return as_area_create(start, length, _prot_to_as(prot), AS_AREA_UNPAGED); 56 72 } 57 73 -
uspace/srv/vfs/vfs.h
raf5037d r52acfab 49 49 #define dprintf(...) 50 50 #endif 51 52 // TODO: Remove this arbitrary limit. 53 /** Maximum number of open files per client. */ 54 #define VFS_MAX_OPEN_FILES 128 51 55 52 56 /**
Note:
See TracChangeset
for help on using the changeset viewer.