1
1

- Multiple functions, that allocate and return new

strings, aka should have __opal_attribute_malloc__
   update comment of opal_path_access -- new string returned.

This commit was SVN r21227.
Этот коммит содержится в:
Rainer Keller 2009-05-14 00:20:07 +00:00
родитель 73fd329cbd
Коммит 3f7f2b6f0f
3 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -132,7 +132,7 @@ OPAL_DECLSPEC void opal_argv_free(char **argv);
* argument (i.e., it can be freed after calling this function
* without invalidating the output argv).
*/
OPAL_DECLSPEC char **opal_argv_split(const char *src_string, int delimiter) __opal_attribute_warn_unused_result__;
OPAL_DECLSPEC char **opal_argv_split(const char *src_string, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Split a string into a NULL-terminated argv array. Include empty
@ -149,7 +149,7 @@ OPAL_DECLSPEC char **opal_argv_split(const char *src_string, int delimiter) __o
* argument (i.e., it can be freed after calling this function
* without invalidating the output argv).
*/
OPAL_DECLSPEC char **opal_argv_split_with_empty(const char *src_string, int delimiter) __opal_attribute_warn_unused_result__;
OPAL_DECLSPEC char **opal_argv_split_with_empty(const char *src_string, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Return the length of a NULL-terminated argv array.
@ -181,7 +181,7 @@ OPAL_DECLSPEC int opal_argv_count(char **argv);
*/
OPAL_DECLSPEC char *opal_argv_join(char **argv, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
OPAL_DECLSPEC char *opal_argv_join_range(char **argv, size_t start, size_t end, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
OPAL_DECLSPEC char *opal_argv_join_range(char **argv, size_t start, size_t end, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Return the number of bytes consumed by an argv array.

Просмотреть файл

@ -63,8 +63,10 @@ BEGIN_C_DECLS
* F: returns "F:"
*
* G:\ returns "G:"
*
* The caller is responsible for freeing the returned string.
*/
OPAL_DECLSPEC char *opal_basename(const char* filename);
OPAL_DECLSPEC char *opal_basename(const char* filename) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Return the dirname of a filename.
@ -100,8 +102,10 @@ OPAL_DECLSPEC char *opal_basename(const char* filename);
* F: returns ""
*
* G:\ returns ""
*
* The caller is responsible for freeing the returned string.
*/
OPAL_DECLSPEC char *opal_dirname(const char* filename);
OPAL_DECLSPEC char *opal_dirname(const char* filename) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
END_C_DECLS

Просмотреть файл

@ -45,7 +45,7 @@ BEGIN_C_DECLS
* The caller is responsible for freeing the returned string.
*/
OPAL_DECLSPEC char *opal_path_find(char *fname, char **pathv, int mode,
char **envv);
char **envv) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Locates a file with certain permissions from a list of search
@ -66,7 +66,7 @@ OPAL_DECLSPEC char *opal_path_find(char *fname, char **pathv, int mode,
* The caller is responsible for freeing the returned string.
*/
OPAL_DECLSPEC char *opal_path_findv(char *fname, int mode,
char **envv, char *wrkdir);
char **envv, char *wrkdir) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Detect if the requested path is absolute or relative.
*
@ -98,7 +98,7 @@ OPAL_DECLSPEC bool opal_path_is_absolute( const char *path );
* function will return NULL. Otherwise, an newly allocated string
* will be returned.
*/
OPAL_DECLSPEC char* opal_find_absolute_path( char* app_name );
OPAL_DECLSPEC char* opal_find_absolute_path( char* app_name ) __opal_attribute_warn_unused_result__;
/**
* Forms a complete pathname and checks it for existance and
@ -110,8 +110,10 @@ OPAL_DECLSPEC char* opal_find_absolute_path( char* app_name );
*
* @retval NULL Failure
* @retval Full pathname of the located file on Success
*
* The caller is responsible for freeing the returned string.
*/
OPAL_DECLSPEC char *opal_path_access(char *fname, char *path, int mode);
OPAL_DECLSPEC char *opal_path_access(char *fname, char *path, int mode) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
END_C_DECLS
#endif /* OPAL_PATH_H */