/[pdpsoft]/trunk/grid-mw-security/cgul/realpath/realpath.h
ViewVC logotype

Annotation of /trunk/grid-mw-security/cgul/realpath/realpath.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1890 - (hide annotations) (download) (as text)
Fri Aug 20 14:19:35 2010 UTC (11 years, 9 months ago) by msalle
File MIME type: text/x-csrc
File size: 2187 byte(s)
Make sure we don't get error on missing POSIX define
Fix typo (missing ;)

1 msalle 1884 /**
2     * Copyright (c) Members of the EGEE Collaboration. 2010.
3     * See http://www.eu-egee.org/partners/ for details on the copyright
4     * holders.
5     *
6     * Licensed under the Apache License, Version 2.0 (the "License");
7     * you may not use this file except in compliance with the License.
8     * You may obtain a copy of the License at
9     *
10     * http://www.apache.org/licenses/LICENSE-2.0
11     *
12     * Unless required by applicable law or agreed to in writing, software
13     * distributed under the License is distributed on an "AS IS" BASIS,
14     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15     * See the License for the specific language governing permissions and
16     * limitations under the License.
17     *
18     * Authors: Oscar Koeroo, Mischa Sall\'e, Aram Verstegen
19     * NIKHEF Amsterdam, the Netherlands
20     * <grid-mw-security@nikhef.nl>
21     */
22    
23 msalle 1888 #ifndef _REALPATH_H_
24     #define _REALPATH_H_
25    
26     #include <sys/stat.h> /* Needed for definition of struct stat */
27    
28 msalle 1884 /*!
29     * Returns the fully canonicalized and absolute path for a diretory or NULL on
30     * error. Memory for the return string is malloced and should be freed by the
31     * caller. Any path cannot be longer than PATH_MAX. Note that it is necessary
32     * that we can chdir to dir.
33     * NOTE: This function is not thread-safe
34     * \param dir non-absolute and/or non-canonical directory
35     * \return canonical absolute directory
36     */
37     char *cgul_realdir(const char *dir);
38    
39     /*!
40     * Returns the fully canonicalized and absolute path for any path or NULL on
41     * error. Note that this function substitutes the unsafe realpath() or the
42     * GNU-only canonicalize_file_name().
43     * Memory for the return string is malloced and should be freed by the
44     * caller. Any path cannot be longer than PATH_MAX. Any directory has to be
45     * accessible, including if it's the last element.
46     * NOTE: This function is not thread-safe
47     * \param inpath non-absolute and/or non-canonical path
48     * \param instat optional stat information on the input (for performance, if
49     * already available). When NULL it will be determined locally
50     * when needed.
51     * \return canonical absolute path
52     */
53 msalle 1890 char *cgul_realpath(const char *inpath, struct stat *instat);
54 msalle 1888
55     #endif

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28