exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / concat-filename.h
blob328b0e27bf93198a0734fea0826691886a34bda0
1 /* Construct a full filename from a directory and a relative filename.
2 Copyright (C) 2001-2004, 2007-2024 Free Software Foundation, Inc.
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) any later version.
9 This file is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _CONCAT_FILENAME_H
18 #define _CONCAT_FILENAME_H
20 /* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */
21 #if !_GL_CONFIG_H_INCLUDED
22 #error "Please include config.h first."
23 #endif
25 #include <stdlib.h>
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
32 /* Concatenate a directory filename, a relative filename and an optional
33 suffix. Return a freshly allocated filename. Return NULL and set errno
34 upon memory allocation failure. */
35 extern char *concatenated_filename (const char *directory,
36 const char *filename, const char *suffix)
37 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
39 /* Concatenate a directory filename, a relative filename and an optional
40 suffix. Return a freshly allocated filename. */
41 extern char *xconcatenated_filename (const char *directory,
42 const char *filename, const char *suffix)
43 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
44 _GL_ATTRIBUTE_RETURNS_NONNULL;
47 #ifdef __cplusplus
49 #endif
51 #endif /* _CONCAT_FILENAME_H */