summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-15 21:47:31 +0900
committerKeith Packard <keithp@keithp.com>2014-01-29 15:15:11 -0800
commit8ba53a78bfc443a4ee8228b9c47f7e94118d7153 (patch)
tree758a3ec886378632292af70795f71f936065c5fa
parent7f951a3b8ad71211e34a52878a030d5df823c49e (diff)
Allow paths and patterns to be const
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
-rw-r--r--font.h4
-rw-r--r--fontstruct.h16
2 files changed, 12 insertions, 8 deletions
diff --git a/font.h b/font.h
index b71046b..a834655 100644
--- a/font.h
+++ b/font.h
@@ -140,7 +140,7 @@ extern void EmptyFontPatternCache (
extern void CacheFontPattern (
FontPatternCachePtr /* cache */,
- char * /* pattern */,
+ const char * /* pattern */,
int /* patlen */,
FontPtr /* pFont */
);
@@ -150,7 +150,7 @@ extern FontResolutionPtr GetClientResolutions(
extern FontPtr FindCachedFontPattern (
FontPatternCachePtr /* cache */,
- char * /* pattern */,
+ const char * /* pattern */,
int /* patlen */
);
diff --git a/fontstruct.h b/fontstruct.h
index 44bed90..55c89da 100644
--- a/fontstruct.h
+++ b/fontstruct.h
@@ -143,23 +143,27 @@ typedef struct _FontNames {
char **names;
} FontNamesRec;
+
/* External view of font paths */
typedef struct _FontPathElement {
int name_length;
- char *name;
+#if FONT_PATH_ELEMENT_NAME_CONST
+ const
+#endif
+ char *name;
int type;
int refcount;
void *private;
} FontPathElementRec;
-typedef Bool (*NameCheckFunc) (char *name);
+typedef Bool (*NameCheckFunc) (const char *name);
typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
typedef int (*OpenFontFunc) ( void *client,
FontPathElementPtr fpe,
Mask flags,
- char* name,
+ const char* name,
int namelen,
fsBitmapFormat format,
fsBitmapFormatMask fmask,
@@ -170,14 +174,14 @@ typedef int (*OpenFontFunc) ( void *client,
typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
typedef int (*ListFontsFunc) (void *client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
FontNamesPtr names);
typedef int (*StartLfwiFunc) (void *client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
void ** privatep);
@@ -205,7 +209,7 @@ typedef int (*LoadGlyphsFunc) (void *client,
typedef int (*StartLaFunc) (void *client,
FontPathElementPtr fpe,
- char* pat,
+ const char* pat,
int len,
int max,
void ** privatep);