string: implement nstrdup
This commit is contained in:
parent
66032c95f2
commit
0f3c11110c
2 changed files with 23 additions and 0 deletions
src/string
22
src/string/nstrdup.c
Normal file
22
src/string/nstrdup.c
Normal 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.
|
||||
*/
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue