summaryrefslogtreecommitdiff
path: root/lib/canonicalize.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/canonicalize.h')
-rw-r--r--lib/canonicalize.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/canonicalize.h b/lib/canonicalize.h
index 950d117d5d..fed014855c 100644
--- a/lib/canonicalize.h
+++ b/lib/canonicalize.h
@@ -1,9 +1,9 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2007, 2009-2020 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -17,6 +17,11 @@
#ifndef CANONICALIZE_H_
# define CANONICALIZE_H_
+/* This file uses _GL_ATTRIBUTE_MALLOC. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#include <stdlib.h> /* for canonicalize_file_name */
#define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING)
@@ -46,8 +51,10 @@ typedef enum canonicalize_mode_t canonicalize_mode_t;
does not contain any `.', `..' components nor any repeated file name
separators ('/') or, depending on other CAN_MODE flags, symlinks.
Whether components must exist or not depends on canonicalize mode.
- The result is malloc'd. */
-char *canonicalize_filename_mode (const char *, canonicalize_mode_t);
+ The result is malloc'd.
+ Upon failure, return NULL with errno set. */
+char *canonicalize_filename_mode (const char *, canonicalize_mode_t)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
#ifdef __cplusplus
}

Return to:

Send suggestions and report system problems to the System administrator.