Changes in / [f3a605be:5c5117c] in mainline
- Location:
- uspace/lib/posix
- Files:
-
- 8 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/Makefile
rf3a605be r5c5117c 43 43 stdio.c \ 44 44 stdlib.c \ 45 stdlib/strtold.c \ 45 46 string.c \ 46 47 strings.c \ -
uspace/lib/posix/fcntl.c
rf3a605be r5c5117c 35 35 #define LIBPOSIX_INTERNAL 36 36 37 #include " common.h"37 #include "internal/common.h" 38 38 #include "fcntl.h" 39 39 -
uspace/lib/posix/fnmatch.c
rf3a605be r5c5117c 35 35 #define LIBPOSIX_INTERNAL 36 36 37 #include " common.h"37 #include "internal/common.h" 38 38 #include "fnmatch.h" 39 39 -
uspace/lib/posix/getopt.c
rf3a605be r5c5117c 35 35 #define LIBPOSIX_INTERNAL 36 36 37 #include " common.h"37 #include "internal/common.h" 38 38 #include "getopt.h" 39 39 -
uspace/lib/posix/stdio.c
rf3a605be r5c5117c 39 39 #include <errno.h> 40 40 41 #include " common.h"41 #include "internal/common.h" 42 42 #include "stdio.h" 43 43 #include "string.h" -
uspace/lib/posix/stdlib.c
rf3a605be r5c5117c 37 37 38 38 #include "stdlib.h" 39 #include " common.h"39 #include "internal/common.h" 40 40 41 41 /** … … 77 77 78 78 /** 79 * 79 * Converts a string representation of a floating-point number to 80 * its native representation. See posix_strtold(). 81 * 80 82 * @param nptr 81 83 * @param endptr … … 84 86 float posix_strtof(const char *restrict nptr, char **restrict endptr) 85 87 { 86 // TODO 87 not_implemented(); 88 return (float) posix_strtold(nptr, endptr); 88 89 } 89 90 90 91 /** 91 * 92 * Converts a string representation of a floating-point number to 93 * its native representation. See posix_strtold(). 94 * 92 95 * @param nptr 93 96 * @param endptr … … 96 99 double posix_strtod(const char *restrict nptr, char **restrict endptr) 97 100 { 98 // TODO 99 not_implemented(); 100 } 101 102 /** 103 * 104 * @param nptr 105 * @param endptr 106 * @return 107 */ 108 long double posix_strtold(const char *restrict nptr, char **restrict endptr) 109 { 110 // TODO 111 not_implemented(); 101 return (double) posix_strtold(nptr, endptr); 112 102 } 113 103 -
uspace/lib/posix/string.h
rf3a605be r5c5117c 102 102 extern size_t posix_strnlen(const char *s, size_t n); 103 103 104 /* Legacy declarations */ 105 extern int posix_ffs(int i); 106 104 107 #ifndef LIBPOSIX_INTERNAL 105 108 #define strcpy posix_strcpy … … 134 137 #define strlen posix_strlen 135 138 #define strnlen posix_strnlen 139 140 #define ffs posix_ffs 136 141 #endif 137 142 -
uspace/lib/posix/strings.c
rf3a605be r5c5117c 36 36 #define LIBPOSIX_INTERNAL 37 37 38 #include " common.h"38 #include "internal/common.h" 39 39 #include "strings.h" 40 40 #include "string.h" 41 #include "ctype.h" 41 42 42 43 /** … … 59 60 int posix_strcasecmp(const char *s1, const char *s2) 60 61 { 61 // TODO 62 not_implemented(); 62 return posix_strncasecmp(s1, s2, STR_NO_LIMIT); 63 63 } 64 64 … … 72 72 int posix_strncasecmp(const char *s1, const char *s2, size_t n) 73 73 { 74 // TODO 75 not_implemented(); 74 for (size_t i = 0; i < n; ++i) { 75 int cmp = tolower(s1[i]) - tolower(s2[i]); 76 if (cmp != 0) { 77 return cmp; 78 } 79 80 if (s1[i] == 0) { 81 return 0; 82 } 83 } 84 85 return 0; 76 86 } 77 87 -
uspace/lib/posix/sys/stat.c
rf3a605be r5c5117c 37 37 38 38 #include "stat.h" 39 #include "../ common.h"39 #include "../internal/common.h" 40 40 #include <mem.h> 41 41 -
uspace/lib/posix/sys/stat.h
rf3a605be r5c5117c 40 40 #include "types.h" 41 41 #include "../time.h" 42 #include <ipc/devmap.h> 43 #include <task.h> 44 45 typedef devmap_handle_t posix_dev_t; 46 typedef task_id_t posix_pid_t; 42 47 43 48 /* values are the same as on Linux */ … … 134 139 135 140 #ifndef LIBPOSIX_INTERNAL 141 #define dev_t posix_dev_t 142 #define pid_t posix_pid_t 136 143 #define fstat posix_fstat 137 144 #define lstat posix_lstat -
uspace/lib/posix/sys/types.h
rf3a605be r5c5117c 38 38 39 39 #include "../libc/sys/types.h" 40 #include <ipc/devmap.h>41 #include <task.h>42 40 43 typedef task_id_t posix_pid_t;44 typedef devmap_handle_t posix_dev_t;45 41 typedef unsigned int posix_ino_t; 46 42 typedef unsigned int posix_nlink_t; … … 52 48 53 49 #ifndef LIBPOSIX_INTERNAL 54 #define pid_t posix_pid_t 55 #define dev_t posix_dev_t 50 #define ino_t posix_ino_t 56 51 #define nlink_t posix_nlink_t 57 52 #define uid_t posix_uid_t -
uspace/lib/posix/time.c
rf3a605be r5c5117c 36 36 #define LIBPOSIX_INTERNAL 37 37 38 #include " common.h"38 #include "internal/common.h" 39 39 #include "time.h" 40 40 -
uspace/lib/posix/unistd.c
rf3a605be r5c5117c 36 36 #define LIBPOSIX_INTERNAL 37 37 38 #include " common.h"38 #include "internal/common.h" 39 39 #include "unistd.h" 40 41 /* Array of environment variable strings (NAME=VALUE). */ 42 char **environ = NULL; 40 43 41 44 /** -
uspace/lib/posix/unistd.h
rf3a605be r5c5117c 48 48 extern int getopt(int, char * const [], const char *); 49 49 50 /* Environmental Variables */ 51 extern char **posix_environ; 52 50 53 /* Identifying Terminals */ 51 54 extern int posix_isatty(int fd); … … 85 88 86 89 #ifndef LIBPOSIX_INTERNAL 90 #define environ posix_environ 91 87 92 #define isatty posix_isatty 88 93
Note:
See TracChangeset
for help on using the changeset viewer.