X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Frelocatable.h;h=131809f6ad8189632e629344bb16b78a0e53d660;hb=23eecb48e39afd0d267d64d40ba6bf97aa865e13;hp=5970be7a27456a26835552d257b9099966da28e6;hpb=1146b210ba48607a5a29ea516a5cda3d5afa6542;p=gnulib.git diff --git a/lib/relocatable.h b/lib/relocatable.h index 5970be7a2..131809f6a 100644 --- a/lib/relocatable.h +++ b/lib/relocatable.h @@ -1,21 +1,19 @@ /* Provide relocatable packages. - Copyright (C) 2003, 2005, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2008-2013 Free Software Foundation, Inc. Written by Bruno Haible , 2003. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H @@ -46,15 +44,18 @@ extern "C" { instead of "/"). */ extern RELOCATABLE_DLL_EXPORTED void set_relocation_prefix (const char *orig_prefix, - const char *curr_prefix); + const char *curr_prefix); /* Returns the pathname, relocated according to the current installation - directory. */ + directory. + The returned string is either PATHNAME unmodified or a freshly allocated + string that you can free with free() after casting it to 'char *'. */ extern const char * relocate (const char *pathname); -/* Memory management: relocate() leaks memory, because it has to construct - a fresh pathname. If this is a problem because your program calls - relocate() frequently, think about caching the result. */ +/* Memory management: relocate() potentially allocates memory, because it has + to construct a fresh pathname. If this is a problem because your program + calls relocate() frequently, think about caching the result. Or free the + return value if it was different from the argument pathname. */ /* Convenience function: Computes the current installation prefix, based on the original @@ -62,8 +63,8 @@ extern const char * relocate (const char *pathname); file, and the current pathname of this file. Returns it, freshly allocated. Returns NULL upon failure. */ extern char * compute_curr_prefix (const char *orig_installprefix, - const char *orig_installdir, - const char *curr_pathname); + const char *orig_installdir, + const char *curr_pathname); #else