Export FcConfig{G,S}etRescanInverval from .so, mark as deprecated.

These two names are typos of the correct names. Instead of simply changing
them, the correct thing to do is leave them in the library, add the correct
functions and mark them as deprecated so any source packages will be updated.

This requires bumping the minor version of the library (for adding APIs)
instead of bumping the major version of the library (for removing APIs).
This commit is contained in:
Keith Packard 2007-11-04 12:20:45 -08:00
parent 69d3eb9cb8
commit de1faa42d1
6 changed files with 72 additions and 5 deletions

View File

@ -33,7 +33,7 @@ dnl This is the package version number, not the shared library
dnl version. This same version number must appear in fontconfig/fontconfig.h
dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's
dnl not possible to extract the version number here from fontconfig.h
AM_INIT_AUTOMAKE(fontconfig, 2.4.91)
AM_INIT_AUTOMAKE(fontconfig, 2.4.92)
AM_MAINTAINER_MODE
dnl libtool versioning
@ -41,11 +41,11 @@ dnl libtool versioning
dnl bump revision when fixing bugs
dnl bump current and age, reset revision to zero when adding APIs
dnl bump current, leave age, reset revision to zero when changing/removing APIS
LT_CURRENT=3
LT_CURRENT=4
LT_REVISION=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
LT_AGE=2
LT_AGE=3
LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
AC_SUBST(LT_VERSION_INFO)

View File

@ -919,4 +919,17 @@ _FCFUNCPROTOEND
#undef FC_ATTRIBUTE_SENTINEL
#ifndef _FCINT_H_
/*
* Deprecated functions are placed here to help users fix their code without
* digging through documentation
*/
#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
#endif
#endif /* _FONTCONFIG_H_ */

View File

@ -79,7 +79,7 @@ INCLUDES = \
EXTRA_DIST = makealias
noinst_HEADERS=fcint.h
noinst_HEADERS=fcint.h fcdeprecate.h
ALIAS_FILES = fcalias.h fcaliastail.h
@ -124,7 +124,8 @@ uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
PUBLIC_FILES = \
$(top_srcdir)/fontconfig/fontconfig.h \
$(top_srcdir)/fontconfig/fcfreetype.h
$(top_srcdir)/fontconfig/fcfreetype.h \
$(top_srcdir)/src/fcdeprecate.h
fcaliastail.h: fcalias.h

View File

@ -535,6 +535,22 @@ FcConfigSetRescanInterval (FcConfig *config, int rescanInterval)
return FcTrue;
}
/*
* A couple of typos escaped into the library
*/
int
FcConfigGetRescanInverval (FcConfig *config)
{
return FcConfigGetRescanInterval (config);
}
FcBool
FcConfigSetRescanInverval (FcConfig *config, int rescanInterval)
{
return FcConfigSetRescanInterval (config, rescanInterval);
}
FcBool
FcConfigAddEdit (FcConfig *config,
FcTest *test,

36
src/fcdeprecate.h Normal file
View File

@ -0,0 +1,36 @@
/*
* Copyright © 2007 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* These APIs are deprecated; still exported by the library, but not
* declared in the public header file
*/
#ifndef _FCDEPRECATE_H_
#define _FCDEPRECATE_H_
FcPublic int
FcConfigGetRescanInverval (FcConfig *config);
FcPublic FcBool
FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
#endif /* _FCDEPRECATE_H_ */

View File

@ -47,6 +47,7 @@
#include <time.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
#include "fcdeprecate.h"
#ifndef FC_CONFIG_PATH
#define FC_CONFIG_PATH "fonts.conf"