diff --git a/lithos_c/inc/Lth_stdlib.h b/lithos_c/inc/Lth_stdlib.h index eb8edc5..7cbf702 100644 --- a/lithos_c/inc/Lth_stdlib.h +++ b/lithos_c/inc/Lth_stdlib.h @@ -19,6 +19,7 @@ // char *Lth_strdup(char const *s); +__str Lth_strdup_str(char const *s); void Lth_PrintString(char const *s); #endif//lithos3__Lth_stdlib_h diff --git a/lithos_c/src/stdlib.c b/lithos_c/src/stdlib.c index 742b69e..1f16103 100644 --- a/lithos_c/src/stdlib.c +++ b/lithos_c/src/stdlib.c @@ -35,6 +35,20 @@ char *Lth_strdup(char const *s) return ret; } +// +// Lth_strdup_str +// +// Duplicates a string into a new string entity. +// +__str Lth_strdup_str(char const *s) +{ + Lth_assert(s != NULL); + size_t len = strlen(s); + ACS_BeginPrint(); + Lth_PrintString(s); + return ACS_EndStrParam(); +} + // // Lth_PrintString //