From b3127a2dc25ac63cae8e33e6f3dbd3580644fe52 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 4 Aug 2025 15:38:06 -0400 Subject: libutil++: New library containing C++ utility classes for use in base - freebsd::FILE_up is a wrapper class for std::unique_ptr<> for FILE objects which uses a custom deleter that calls fclose(). - freebsd::malloc_up is a wrapper class for std::unique_ptr<> which uses a custom deleter that calls free(). It is useful for pointers allocated by malloc() such as strdup(). - The freebsd::stringf() functions return a std::string constructed using a printf format string. The current implementation of freebsd::stringf() uses fwopen() where the write function appends to a std::string. Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794 --- lib/libutil++/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/libutil++/Makefile (limited to 'lib/libutil++/Makefile') diff --git a/lib/libutil++/Makefile b/lib/libutil++/Makefile new file mode 100644 index 000000000000..ec83a9ad35f9 --- /dev/null +++ b/lib/libutil++/Makefile @@ -0,0 +1,16 @@ +PACKAGE= lib${LIB} +LIB_CXX= util++ +INTERNALLIB= true +SHLIB_MAJOR= 1 +SRCS= stringf.cc + +MAN+= freebsd::FILE_up.3 \ + freebsd::malloc_up.3 \ + freebsd::stringf.3 + +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + +.include -- cgit v1.3