@@ -29,6 +29,8 @@ DEFINITION MODULE FOR "C" libc ;
FROM SYSTEM IMPORT ADDRESS, CSIZE_T, CSSIZE_T ;
EXPORT UNQUALIFIED time_t, timeb, tm, ptrToTM,
+ atof, atoi, atol, atoll,
+ strtod, strtof, strtold, strtol, strtoll, strtoul, strtoull,
write, read,
system, abort,
malloc, free,
@@ -75,6 +77,88 @@ TYPE
exitP = PROCEDURE () : INTEGER ;
+(*
+ double atof(const char *nptr)
+*)
+
+PROCEDURE atof (nptr: ADDRESS) : REAL ;
+
+
+(*
+ int atoi(const char *nptr)
+*)
+
+PROCEDURE atoi (nptr: ADDRESS) : INTEGER ;
+
+
+(*
+ long atol(const char *nptr);
+*)
+
+PROCEDURE atol (nptr: ADDRESS) : CSSIZE_T ;
+
+
+(*
+ long long atoll(const char *nptr);
+*)
+
+PROCEDURE atoll (nptr: ADDRESS) : LONGINT ;
+
+
+(*
+ double strtod(const char *restrict nptr, char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtod (nptr, endptr: ADDRESS) : REAL ;
+
+
+(*
+ float strtof(const char *restrict nptr, char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtof (nptr, endptr: ADDRESS) : SHORTREAL ;
+
+
+(*
+ long double strtold(const char *restrict nptr,
+ char **_Nullable restrict endptr)
+*)
+
+PROCEDURE strtold (nptr, endptr: ADDRESS) : LONGREAL ;
+
+
+(*
+ long strtol(const char *restrict nptr, char **_Nullable restrict endptr,
+ int base)
+*)
+
+PROCEDURE strtol (nptr, endptr: ADDRESS; base: INTEGER) : CSSIZE_T ;
+
+
+(*
+ long long strtoll(const char *restrict nptr,
+ char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoll (nptr, endptr: ADDRESS; base: INTEGER) : LONGINT ;
+
+
+(*
+ unsigned long strtoul(const char *restrict nptr,
+ char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoul (nptr, endptr: ADDRESS; base: INTEGER) : CSIZE_T ;
+
+
+(*
+ unsigned long long strtoull(const char *restrict nptr,
+ char **_Nullable restrict endptr, int base)
+*)
+
+PROCEDURE strtoull (nptr, endptr: ADDRESS; base: INTEGER) : LONGCARD ;
+
+
(*
ssize_t write (int d, void *buf, size_t nbytes)
*)
Export all string to integral and floating point number conversion functions (atof, atoi, atol, atoll, strtod, strtof, strtold, strtol, strtoll, strtoul, strtoull). gcc/gm2: * gm2-libs/libc.def: Export all string to number conversion functions. Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net> --- gcc/m2/gm2-libs/libc.def | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+)