diff options
author | Peter Jones <pjones@redhat.com> | 2018-03-13 15:20:28 -0400 |
---|---|---|
committer | Nigel Croxon <ncroxon@redhat.com> | 2018-03-14 14:50:23 -0400 |
commit | 9485c65f6d28b71ff697849c1c8d47fd077ccd07 (patch) | |
tree | 553402707dc9ae523e81d69ce898f2d20bf5409e /lib/str.c | |
parent | 5abc3858a25fa6774c6e2d89cc5d1d14a9c9f7cb (diff) | |
download | gnu-efi-9485c65f6d28b71ff697849c1c8d47fd077ccd07.tar.gz |
gnu-efi: add some more common string functions.
This adds bounded string helper functions:
StrnLen()
StrnCpy()
StrnCat()
StpnCpy()
And the unbounded function StpCpy().
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Diffstat (limited to 'lib/str.c')
-rw-r--r-- | lib/str.c | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -114,6 +114,38 @@ StrCpy ( } VOID +StrnCpy ( + IN CHAR16 *Dest, + IN CONST CHAR16 *Src, + IN UINTN Len + ) +// copy strings +{ + RtStrnCpy (Dest, Src, Len); +} + +CHAR16 * +StpCpy ( + IN CHAR16 *Dest, + IN CONST CHAR16 *Src + ) +// copy strings +{ + return RtStpCpy (Dest, Src); +} + +CHAR16 * +StpnCpy ( + IN CHAR16 *Dest, + IN CONST CHAR16 *Src, + IN UINTN Len + ) +// copy strings +{ + return RtStpnCpy (Dest, Src, Len); +} + +VOID StrCat ( IN CHAR16 *Dest, IN CONST CHAR16 *Src @@ -122,6 +154,27 @@ StrCat ( RtStrCat(Dest, Src); } +VOID +StrnCat ( + IN CHAR16 *Dest, + IN CONST CHAR16 *Src, + IN UINTN Len + ) +{ + RtStrnCat(Dest, Src, Len); +} + + +UINTN +StrnLen ( + IN CONST CHAR16 *s1, + IN UINTN Len + ) +// string length +{ + return RtStrnLen(s1, Len); +} + UINTN StrLen ( IN CONST CHAR16 *s1 |