string: implement nstrdup

This commit is contained in:
anna 2021-07-16 14:43:26 +02:00
parent 66032c95f2
commit 0f3c11110c
Signed by: fef
GPG key ID: EC22E476DC2D3D84
2 changed files with 23 additions and 0 deletions

22
src/string/nstrdup.c Normal file
View file

@ -0,0 +1,22 @@
/** See the end of this file for copyright and license terms. */
#include "neo/_string.h"
#include "neo/_types.h"
string *nstrdup(const string *s, error *err)
{
return nstr(s->_data, err);
}
/*
* This file is part of libneo.
* Copyright (c) 2021 Fefie <owo@fef.moe>.
*
* libneo is non-violent software: you may only use, redistribute,
* and/or modify it under the terms of the CNPLv6+ as found in
* the LICENSE file in the source code root directory or at
* <https://git.pixie.town/thufie/CNPL>.
*
* libneo comes with ABSOLUTELY NO WARRANTY, to the extent
* permitted by applicable law. See the CNPLv6+ for details.
*/

View file

@ -2,6 +2,7 @@ target_sources(neo PRIVATE
./string/nstr.c
./string/nstrcat.c
./string/nstrcmp.c
./string/nstrdup.c
./string/nstrmul.c
./string/leftpad.c
./string/utf.c