2004-01-09 11:03:27 +03:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-09 11:03:27 +03:00
|
|
|
* $HEADER$
|
2005-02-09 20:13:54 +03:00
|
|
|
*
|
|
|
|
* @file
|
2004-01-09 11:03:27 +03:00
|
|
|
*/
|
|
|
|
|
2005-07-04 05:59:52 +04:00
|
|
|
#ifndef OPAL_PATH_H
|
|
|
|
#define OPAL_PATH_H
|
2004-01-09 11:03:27 +03:00
|
|
|
|
2004-10-22 20:06:05 +04:00
|
|
|
#include "ompi_config.h"
|
2005-02-09 20:13:54 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
2004-01-12 05:07:42 +03:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-02-09 20:13:54 +03:00
|
|
|
/**
|
|
|
|
* Locates a file with certain permissions
|
|
|
|
*
|
|
|
|
* @param fname File name
|
|
|
|
* @param pathv Array of search directories
|
2005-10-05 07:02:11 +04:00
|
|
|
* @param mode Permissions which must be satisfied (see access(2))
|
2005-02-09 20:13:54 +03:00
|
|
|
* @param envv Pointer to string containing environment
|
|
|
|
*
|
|
|
|
* @retval Full pathname of located file Success
|
|
|
|
* @retval NULL Failure
|
|
|
|
*
|
|
|
|
* Environment variables can appear in the form $variable at the
|
|
|
|
* start of a prefix path and will be replaced by the environment
|
|
|
|
* value if it is defined; otherwise the whole prefix is ignored.
|
|
|
|
* Environment variables must be followed by a path delimiter or
|
|
|
|
* end-of-string.
|
2005-10-05 07:02:11 +04:00
|
|
|
*
|
|
|
|
* The caller is responsible for freeing the returned string.
|
2005-02-09 20:13:54 +03:00
|
|
|
*/
|
2005-07-04 05:59:52 +04:00
|
|
|
OMPI_DECLSPEC char *opal_path_find(char *fname, char **pathv, int mode,
|
2005-02-09 20:13:54 +03:00
|
|
|
char **envv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Locates a file with certain permissions from a list of search
|
|
|
|
* paths
|
|
|
|
*
|
|
|
|
* @param fname File name
|
2005-10-05 07:02:11 +04:00
|
|
|
* @param mode Target permissions which must be satisfied (see access(2))
|
2005-02-09 20:13:54 +03:00
|
|
|
* @param envv Pointer to environment list
|
|
|
|
* @param wrkdir Working directory
|
|
|
|
*
|
|
|
|
* @retval Full pathname of located file Success
|
|
|
|
* @retval NULL Failure
|
|
|
|
*
|
|
|
|
* Locates a file with certain permissions from the list of paths
|
|
|
|
* given by the $PATH environment variable. Replaces "." in the
|
|
|
|
* path with the working dir.
|
2005-10-05 07:02:11 +04:00
|
|
|
*
|
|
|
|
* The caller is responsible for freeing the returned string.
|
2005-02-09 20:13:54 +03:00
|
|
|
*/
|
2005-07-04 05:59:52 +04:00
|
|
|
OMPI_DECLSPEC char *opal_path_findv(char *fname, int mode,
|
2005-02-09 20:13:54 +03:00
|
|
|
char **envv, char *wrkdir);
|
2004-01-09 11:03:27 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
2004-01-12 05:07:42 +03:00
|
|
|
}
|
|
|
|
#endif
|
2005-07-04 05:59:52 +04:00
|
|
|
#endif /* OPAL_PATH_H */
|