diff options
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/string/strftime.c | 7 | ||||
-rw-r--r-- | lib/string/strftime.h | 19 |
3 files changed, 28 insertions, 0 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 58d9c142..0aa9d5ec 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -149,6 +149,8 @@ libshadow_la_SOURCES = \ string/stpecpy.h \ string/stpeprintf.c \ string/stpeprintf.h \ + string/strftime.c \ + string/strftime.h \ string/strncpy.h \ string/strtcpy.c \ string/strtcpy.h \ diff --git a/lib/string/strftime.c b/lib/string/strftime.c new file mode 100644 index 00000000..ea1deb3f --- /dev/null +++ b/lib/string/strftime.c @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org> +// SPDX-License-Identifier: BSD-3-Clause + + +#include <config.h> + +#include "strftime.h" diff --git a/lib/string/strftime.h b/lib/string/strftime.h new file mode 100644 index 00000000..bebb31a4 --- /dev/null +++ b/lib/string/strftime.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org> +// SPDX-License-Identifier: BSD-3-Clause + + +#ifndef SHADOW_INCLUDE_LIB_STRFTIME_H_ +#define SHADOW_INCLUDE_LIB_STRFTIME_H_ + + +#include <config.h> + +#include <time.h> + +#include "sizeof.h" + + +#define STRFTIME(dst, fmt, ...) strftime(dst, NITEMS(dst), fmt, __VA_ARGS__) + + +#endif // include guard |