Blame intl/relocatable.h

Packit Service 72eb06
/* Provide relocatable packages.
Packit Service 72eb06
   Copyright (C) 2003 Free Software Foundation, Inc.
Packit Service 72eb06
   Written by Bruno Haible <bruno@clisp.org>, 2003.
Packit Service 72eb06
Packit Service 72eb06
   This program is free software; you can redistribute it and/or modify it
Packit Service 72eb06
   under the terms of the GNU Library General Public License as published
Packit Service 72eb06
   by the Free Software Foundation; either version 2, or (at your option)
Packit Service 72eb06
   any later version.
Packit Service 72eb06
Packit Service 72eb06
   This program is distributed in the hope that it will be useful,
Packit Service 72eb06
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 72eb06
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 72eb06
   Library General Public License for more details.
Packit Service 72eb06
Packit Service 72eb06
   You should have received a copy of the GNU Library General Public
Packit Service 72eb06
   License along with this program; if not, write to the Free Software
Packit Service 72eb06
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
Packit Service 72eb06
   USA.  */
Packit Service 72eb06
Packit Service 72eb06
#ifndef _RELOCATABLE_H
Packit Service 72eb06
#define _RELOCATABLE_H
Packit Service 72eb06
Packit Service 72eb06
/* This can be enabled through the configure --enable-relocatable option.  */
Packit Service 72eb06
#if ENABLE_RELOCATABLE
Packit Service 72eb06
Packit Service 72eb06
/* When building a DLL, we must export some functions.  Note that because
Packit Service 72eb06
   this is a private .h file, we don't need to use __declspec(dllimport)
Packit Service 72eb06
   in any case.  */
Packit Service 72eb06
#if defined _MSC_VER && BUILDING_DLL
Packit Service 72eb06
# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
Packit Service 72eb06
#else
Packit Service 72eb06
# define RELOCATABLE_DLL_EXPORTED
Packit Service 72eb06
#endif
Packit Service 72eb06
Packit Service 72eb06
/* Sets the original and the current installation prefix of the package.
Packit Service 72eb06
   Relocation simply replaces a pathname starting with the original prefix
Packit Service 72eb06
   by the corresponding pathname with the current prefix instead.  Both
Packit Service 72eb06
   prefixes should be directory names without trailing slash (i.e. use ""
Packit Service 72eb06
   instead of "/").  */
Packit Service 72eb06
extern RELOCATABLE_DLL_EXPORTED void
Packit Service 72eb06
       set_relocation_prefix (const char *orig_prefix,
Packit Service 72eb06
			      const char *curr_prefix);
Packit Service 72eb06
Packit Service 72eb06
/* Returns the pathname, relocated according to the current installation
Packit Service 72eb06
   directory.  */
Packit Service 72eb06
extern const char * relocate (const char *pathname);
Packit Service 72eb06
Packit Service 72eb06
/* Memory management: relocate() leaks memory, because it has to construct
Packit Service 72eb06
   a fresh pathname.  If this is a problem because your program calls
Packit Service 72eb06
   relocate() frequently, think about caching the result.  */
Packit Service 72eb06
Packit Service 72eb06
/* Convenience function:
Packit Service 72eb06
   Computes the current installation prefix, based on the original
Packit Service 72eb06
   installation prefix, the original installation directory of a particular
Packit Service 72eb06
   file, and the current pathname of this file.  Returns NULL upon failure.  */
Packit Service 72eb06
extern const char * compute_curr_prefix (const char *orig_installprefix,
Packit Service 72eb06
					 const char *orig_installdir,
Packit Service 72eb06
					 const char *curr_pathname);
Packit Service 72eb06
Packit Service 72eb06
#else
Packit Service 72eb06
Packit Service 72eb06
/* By default, we use the hardwired pathnames.  */
Packit Service 72eb06
#define relocate(pathname) (pathname)
Packit Service 72eb06
Packit Service 72eb06
#endif
Packit Service 72eb06
Packit Service 72eb06
#endif /* _RELOCATABLE_H */