Changeset 2b3dd78 in mainline for uspace/lib/c/include
- Timestamp:
- 2018-01-31T12:02:00Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5595841
- Parents:
- a0a9cc2 (diff), 14d789c (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:
-
- 21 edited
-
adt/hash_table.h (modified) (2 diffs)
-
async.h (modified) (1 diff)
-
ctype.h (modified) (2 diffs)
-
getopt.h (modified) (1 diff)
-
gsort.h (modified) (1 diff)
-
inttypes.h (modified) (1 diff)
-
io/kio.h (modified) (2 diffs)
-
io/log.h (modified) (1 diff)
-
io/verify.h (modified) (1 diff)
-
ipc/devman.h (modified) (1 diff)
-
ipc/ipc.h (modified) (1 diff)
-
ipc/logger.h (modified) (1 diff)
-
malloc.h (modified) (1 diff)
-
rtld/rtld_debug.h (modified) (1 diff)
-
stdio.h (modified) (3 diffs)
-
stdlib.h (modified) (1 diff)
-
syscall.h (modified) (1 diff)
-
time.h (modified) (1 diff)
-
udebug.h (modified) (1 diff)
-
vfs/inbox.h (modified) (1 diff)
-
vfs/vfs.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
ra0a9cc2 r2b3dd78 84 84 member_to_inst((item), type, member) 85 85 86 extern bool hash_table_create(hash_table_t *, size_t, size_t, 87 hash_table_ops_t *);86 extern bool hash_table_create(hash_table_t *, size_t, size_t, 87 hash_table_ops_t *); 88 88 extern void hash_table_destroy(hash_table_t *); 89 89 … … 98 98 extern size_t hash_table_remove(hash_table_t *, void *); 99 99 extern void hash_table_remove_item(hash_table_t *, ht_link_t *); 100 extern void hash_table_apply(hash_table_t *, bool (*)(ht_link_t *, void *), 101 void *);100 extern void hash_table_apply(hash_table_t *, bool (*)(ht_link_t *, void *), 101 void *); 102 102 103 103 -
uspace/lib/c/include/async.h
ra0a9cc2 r2b3dd78 34 34 35 35 #if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_))) 36 #error Do not intermix low-level IPC interface and async framework36 #error Do not intermix low-level IPC interface and async framework 37 37 #endif 38 38 -
uspace/lib/c/include/ctype.h
ra0a9cc2 r2b3dd78 61 61 } 62 62 63 static inline int isblank(int c) 64 { 65 return c == ' ' || c == '\t'; 66 } 67 68 static inline int iscntrl(int c) 69 { 70 return (c >= 0 && c < 0x20) || c == 0x7E; 71 } 72 73 static inline int isprint(int c) 74 { 75 return c >= 0 && c < 0x80 && !iscntrl(c); 76 } 77 78 static inline int isgraph(int c) 79 { 80 return isprint(c) && c != ' '; 81 } 82 63 83 static inline int isspace(int c) 64 84 { … … 75 95 return 0; 76 96 } 97 } 98 99 static inline int ispunct(int c) 100 { 101 return !isspace(c) && !isalnum(c) && isprint(c); 102 } 103 104 static inline int isxdigit(int c) 105 { 106 return isdigit(c) || 107 (c >= 'a' && c <= 'f') || 108 (c >= 'A' && c <= 'F'); 77 109 } 78 110 -
uspace/lib/c/include/getopt.h
ra0a9cc2 r2b3dd78 57 57 58 58 /* HelenOS Port - These need to be exposed for legacy getopt() */ 59 extern c onst char *optarg;59 extern char *optarg; 60 60 extern int optind, opterr, optopt; 61 61 extern int optreset; -
uspace/lib/c/include/gsort.h
ra0a9cc2 r2b3dd78 39 39 #include <stdbool.h> 40 40 41 typedef int (* sort_cmp_t)(void *, void *, void *);41 typedef int (*sort_cmp_t)(void *, void *, void *); 42 42 43 43 extern bool gsort(void *, size_t, size_t, sort_cmp_t, void *); -
uspace/lib/c/include/inttypes.h
ra0a9cc2 r2b3dd78 38 38 #include <_bits/inttypes.h> 39 39 40 #ifndef __HELENOS_DISABLE_INTMAX__ 41 intmax_t strtoimax(const char *__restrict__ nptr, 42 char **__restrict__ endptr, int base); 43 uintmax_t strtoumax(const char *__restrict__ nptr, 44 char **__restrict__ endptr, int base); 45 #endif 46 40 47 #endif 41 48 -
uspace/lib/c/include/io/kio.h
ra0a9cc2 r2b3dd78 39 39 #include <stdarg.h> 40 40 #include <io/verify.h> 41 #include <_bits/errno.h> 42 #include <_bits/size_t.h> 41 43 42 44 extern errno_t kio_write(const void *, size_t, size_t *); … … 44 46 extern void kio_command(const void *, size_t); 45 47 extern int kio_printf(const char *, ...) 46 PRINTF_ATTRIBUTE(1, 2);48 _HELENOS_PRINTF_ATTRIBUTE(1, 2); 47 49 extern int kio_vprintf(const char *, va_list); 48 50 -
uspace/lib/c/include/io/log.h
ra0a9cc2 r2b3dd78 60 60 61 61 extern void log_msg(log_t, log_level_t, const char *, ...) 62 PRINTF_ATTRIBUTE(3, 4);62 _HELENOS_PRINTF_ATTRIBUTE(3, 4); 63 63 extern void log_msgv(log_t, log_level_t, const char *, va_list); 64 64 -
uspace/lib/c/include/io/verify.h
ra0a9cc2 r2b3dd78 36 36 #define LIBC_IO_VERIFY_H_ 37 37 38 #ifndef NVERIFY_PRINTF38 #ifndef _HELENOS_NVERIFY_PRINTF 39 39 40 40 #ifdef __clang__ 41 #define PRINTF_ATTRIBUTE(start, end) \41 #define _HELENOS_PRINTF_ATTRIBUTE(start, end) \ 42 42 __attribute__((format(__printf__, start, end))) 43 43 #else 44 #define PRINTF_ATTRIBUTE(start, end) \44 #define _HELENOS_PRINTF_ATTRIBUTE(start, end) \ 45 45 __attribute__((format(gnu_printf, start, end))) 46 46 #endif 47 47 48 #else /* NVERIFY_PRINTF */48 #else /* _HELENOS_NVERIFY_PRINTF */ 49 49 50 #define PRINTF_ATTRIBUTE(start, end)50 #define _HELENOS_PRINTF_ATTRIBUTE(start, end) 51 51 52 #endif /* NVERIFY_PRINTF */52 #endif /* _HELENOS_NVERIFY_PRINTF */ 53 53 54 54 #endif -
uspace/lib/c/include/ipc/devman.h
ra0a9cc2 r2b3dd78 74 74 /** Id of device model. 75 75 */ 76 c onst char *id;76 char *id; 77 77 /** Relevancy of device-to-driver match. 78 78 * The higher is the product of scores specified for the device by the bus driver and by the leaf driver, -
uspace/lib/c/include/ipc/ipc.h
ra0a9cc2 r2b3dd78 34 34 35 35 #if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_))) 36 #error Do not intermix low-level IPC interface and async framework36 #error Do not intermix low-level IPC interface and async framework 37 37 #endif 38 38 -
uspace/lib/c/include/ipc/logger.h
ra0a9cc2 r2b3dd78 54 54 * Returns: error code 55 55 * Followed by: vfs_pass_handle() request. 56 */ 56 */ 57 57 LOGGER_CONTROL_SET_ROOT 58 58 } logger_control_request_t; -
uspace/lib/c/include/malloc.h
ra0a9cc2 r2b3dd78 38 38 #include <stddef.h> 39 39 40 extern void *malloc( constsize_t size)40 extern void *malloc(size_t size) 41 41 __attribute__((malloc)); 42 extern void *calloc( const size_t nmemb, constsize_t size)42 extern void *calloc(size_t nmemb, size_t size) 43 43 __attribute__((malloc)); 44 extern void *memalign( const size_t align, constsize_t size)44 extern void *memalign(size_t align, size_t size) 45 45 __attribute__((malloc)); 46 extern void *realloc( const void *addr, constsize_t size)46 extern void *realloc(void *addr, size_t size) 47 47 __attribute__((warn_unused_result)); 48 extern void free( constvoid *addr);48 extern void free(void *addr); 49 49 extern void *heap_check(void); 50 50 -
uspace/lib/c/include/rtld/rtld_debug.h
ra0a9cc2 r2b3dd78 42 42 43 43 #ifdef RTLD_DEBUG 44 #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__)44 #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__) 45 45 #else 46 #define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__)46 #define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__) 47 47 #endif 48 48 -
uspace/lib/c/include/stdio.h
ra0a9cc2 r2b3dd78 37 37 38 38 #include <stdarg.h> 39 #include <str.h>40 39 #include <io/verify.h> 41 #include <abi/kio.h> 40 #include <_bits/size_t.h> 41 #include <_bits/wchar_t.h> 42 42 43 43 #define EOF (-1) … … 58 58 #define BUFSIZ 4096 59 59 60 #define DEBUG(fmt, ...) \ 61 { \ 62 char _buf[256]; \ 63 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 64 if (_n > 0) \ 65 (void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \ 66 } 60 /** Forward declaration */ 61 struct _IO_FILE; 62 typedef struct _IO_FILE FILE; 63 64 extern FILE *stdin; 65 extern FILE *stdout; 66 extern FILE *stderr; 67 68 /* Character and string input functions */ 69 extern int fgetc(FILE *); 70 extern char *fgets(char *, int, FILE *); 71 72 extern int getchar(void); 73 74 /* Character and string output functions */ 75 extern int fputc(wchar_t, FILE *); 76 extern int fputs(const char *, FILE *); 77 78 extern int putchar(wchar_t); 79 extern int puts(const char *); 80 81 extern int ungetc(int, FILE *); 82 83 /* Formatted string output functions */ 84 extern int fprintf(FILE *, const char*, ...) 85 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 86 extern int vfprintf(FILE *, const char *, va_list); 87 88 extern int printf(const char *, ...) 89 _HELENOS_PRINTF_ATTRIBUTE(1, 2); 90 extern int vprintf(const char *, va_list); 91 92 extern int snprintf(char *, size_t , const char *, ...) 93 _HELENOS_PRINTF_ATTRIBUTE(3, 4); 94 extern int vasprintf(char **, const char *, va_list); 95 extern int asprintf(char **, const char *, ...) 96 _HELENOS_PRINTF_ATTRIBUTE(2, 3); 97 extern int vsnprintf(char *, size_t, const char *, va_list); 98 99 /* File stream functions */ 100 extern FILE *fopen(const char *, const char *); 101 extern FILE *freopen(const char *, const char *, FILE *); 102 extern int fclose(FILE *); 103 104 extern size_t fread(void *, size_t, size_t, FILE *); 105 extern size_t fwrite(const void *, size_t, size_t, FILE *); 106 107 extern int fseek(FILE *, long, int); 108 extern void rewind(FILE *); 109 extern long ftell(FILE *); 110 extern int feof(FILE *); 111 112 extern int fflush(FILE *); 113 extern int ferror(FILE *); 114 extern void clearerr(FILE *); 115 116 extern void setvbuf(FILE *, void *, int, size_t); 117 extern void setbuf(FILE *, void *); 118 119 /* Misc file functions */ 120 extern int rename(const char *, const char *); 121 extern int remove(const char *); 122 123 #ifndef _HELENOS_SOURCE 124 #define _IONBF 0 125 #define _IOLBF 1 126 #define _IOFBF 2 127 #endif 128 129 #ifdef _HELENOS_SOURCE 130 131 /* Nonstandard extensions. */ 67 132 68 133 enum _buffer_type { … … 86 151 }; 87 152 88 /** Forward declaration */ 89 struct _IO_FILE; 90 typedef struct _IO_FILE FILE; 91 92 extern FILE *stdin; 93 extern FILE *stdout; 94 extern FILE *stderr; 95 96 /* Character and string input functions */ 97 extern int fgetc(FILE *); 98 extern char *fgets(char *, int, FILE *); 99 100 extern int getchar(void); 153 extern int vprintf_size(const char *, va_list); 154 extern int printf_size(const char *, ...) 155 _HELENOS_PRINTF_ATTRIBUTE(1, 2); 156 extern FILE *fdopen(int, const char *); 157 extern int fileno(FILE *); 101 158 extern char *gets(char *, size_t); 102 159 103 /* Character and string output functions */ 104 extern int fputc(wchar_t, FILE *); 105 extern int fputs(const char *, FILE *); 160 #include <offset.h> 106 161 107 extern int putchar(wchar_t);108 extern int puts(const char*);162 extern int fseek64(FILE *, off64_t, int); 163 extern off64_t ftell64(FILE *); 109 164 110 extern int ungetc(int, FILE *); 165 #endif 111 166 112 /* Formatted string output functions */113 extern int fprintf(FILE *, const char*, ...)114 PRINTF_ATTRIBUTE(2, 3);115 extern int vfprintf(FILE *, const char *, va_list);116 117 extern int printf(const char *, ...)118 PRINTF_ATTRIBUTE(1, 2);119 extern int vprintf(const char *, va_list);120 121 extern int snprintf(char *, size_t , const char *, ...)122 PRINTF_ATTRIBUTE(3, 4);123 extern int vasprintf(char **, const char *, va_list);124 extern int asprintf(char **, const char *, ...)125 PRINTF_ATTRIBUTE(2, 3);126 extern int vsnprintf(char *, size_t, const char *, va_list);127 128 extern int printf_size(const char *, ...)129 PRINTF_ATTRIBUTE(1, 2);130 extern int vprintf_size(const char *, va_list);131 132 /* File stream functions */133 extern FILE *fopen(const char *, const char *);134 extern FILE *fdopen(int, const char *);135 extern FILE *freopen(const char *, const char *, FILE *);136 extern int fclose(FILE *);137 138 extern size_t fread(void *, size_t, size_t, FILE *);139 extern size_t fwrite(const void *, size_t, size_t, FILE *);140 141 extern int fseek(FILE *, long, int);142 extern void rewind(FILE *);143 extern long ftell(FILE *);144 extern int feof(FILE *);145 extern int fileno(FILE *);146 147 extern int fflush(FILE *);148 extern int ferror(FILE *);149 extern void clearerr(FILE *);150 151 extern void setvbuf(FILE *, void *, int, size_t);152 extern void setbuf(FILE *, void *);153 154 /* Misc file functions */155 extern int rename(const char *, const char *);156 extern int remove(const char *);157 167 158 168 #endif -
uspace/lib/c/include/stdlib.h
ra0a9cc2 r2b3dd78 42 42 #define RAND_MAX 714025 43 43 44 #define rand() random() 45 #define srand(seed) srandom(seed) 46 47 extern long int random(void); 48 extern void srandom(unsigned int seed); 44 extern int rand(void); 45 extern void srand(unsigned int seed); 49 46 50 47 extern void abort(void) __attribute__((noreturn)); 51 48 extern void exit(int) __attribute__((noreturn)); 49 50 extern int atoi(const char *); 51 extern long atol(const char *); 52 extern long long atoll(const char *); 53 54 extern long strtol(const char *__restrict__, char **__restrict__, int); 55 extern long long strtoll(const char *__restrict__, char **__restrict__, int); 56 extern unsigned long strtoul(const char *__restrict__, char **__restrict__, int); 57 extern unsigned long long strtoull(const char *__restrict__, char **__restrict__, int); 52 58 53 59 #endif -
uspace/lib/c/include/syscall.h
ra0a9cc2 r2b3dd78 41 41 42 42 #ifndef LIBARCH_SYSCALL_GENERIC 43 #error You cannot include this file directly43 #error You cannot include this file directly 44 44 #endif 45 45 -
uspace/lib/c/include/time.h
ra0a9cc2 r2b3dd78 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #ifndef LIBC_TIME_H_ -
uspace/lib/c/include/udebug.h
ra0a9cc2 r2b3dd78 46 46 extern errno_t udebug_end(async_sess_t *); 47 47 extern errno_t udebug_set_evmask(async_sess_t *, udebug_evmask_t); 48 extern errno_t udebug_thread_read(async_sess_t *, void *, size_t , size_t *,48 extern errno_t udebug_thread_read(async_sess_t *, void *, size_t, size_t *, 49 49 size_t *); 50 50 extern errno_t udebug_name_read(async_sess_t *, void *, size_t, size_t *, -
uspace/lib/c/include/vfs/inbox.h
ra0a9cc2 r2b3dd78 29 29 /** @addtogroup libc 30 30 * @{ 31 */ 31 */ 32 32 33 33 /** -
uspace/lib/c/include/vfs/vfs.h
ra0a9cc2 r2b3dd78 57 57 58 58 59 struct stat {59 typedef struct { 60 60 fs_handle_t fs_handle; 61 61 service_id_t service_id; … … 66 66 aoff64_t size; 67 67 service_id_t service; 68 } ;68 } vfs_stat_t; 69 69 70 struct statfs { 70 typedef struct { 71 71 char fs_name[FS_NAME_MAXLEN + 1]; 72 72 uint32_t f_bsize; /* fundamental file system block size */ 73 73 uint64_t f_blocks; /* total data blocks in file system */ 74 74 uint64_t f_bfree; /* free blocks in fs */ 75 } ;75 } vfs_statfs_t; 76 76 77 77 /** List of file system types */ … … 111 111 extern int vfs_root(void); 112 112 extern errno_t vfs_root_set(int); 113 extern errno_t vfs_stat(int, struct stat *);114 extern errno_t vfs_stat_path(const char *, struct stat *);115 extern errno_t vfs_statfs(int, struct statfs*);116 extern errno_t vfs_statfs_path(const char *, struct statfs*);113 extern errno_t vfs_stat(int, vfs_stat_t *); 114 extern errno_t vfs_stat_path(const char *, vfs_stat_t *); 115 extern errno_t vfs_statfs(int, vfs_statfs_t *); 116 extern errno_t vfs_statfs_path(const char *, vfs_statfs_t *); 117 117 extern errno_t vfs_sync(int); 118 118 extern errno_t vfs_unlink(int, const char *, int);
Note:
See TracChangeset
for help on using the changeset viewer.
