diff --git a/src/string/nstrdup.c b/src/string/nstrdup.c new file mode 100644 index 0000000..d634157 --- /dev/null +++ b/src/string/nstrdup.c @@ -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 . + * + * 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 + * . + * + * libneo comes with ABSOLUTELY NO WARRANTY, to the extent + * permitted by applicable law. See the CNPLv6+ for details. + */ diff --git a/src/string/string.cmake b/src/string/string.cmake index 31a854b..61c2468 100644 --- a/src/string/string.cmake +++ b/src/string/string.cmake @@ -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