+2007-01-09 Kenichi Handa <handa@m17n.org>
+
+ * src/otf.h: Adjusted for C++. Adjusted many prototypes to
+ contain `const' qualifiers.
+
+ * src/otferror.h (otf__error): Add `const' qualifier.
+
+ * src/otferror.c (otf__error, OTF_perror): Add `const' qualifiers.
+
+ * src/otfdrive.c: Add many `const' qualifiers.
+
+ * src/otfopen.c: Add many `const' qualifiers.
+
2006-07-25 Kenichi Handa <handa@m17n.org>
* Version 0.9.5 released.
}
static OTF_LangSys *
-get_langsys (OTF_ScriptList *script_list, char *script, char *language)
+get_langsys (OTF_ScriptList *script_list,
+ const char *script, const char *language)
{
OTF_Tag script_tag = OTF_tag (script);
static int
setup_lookup_indices (OTF_LookupList *LookupList, OTF_FeatureList *FeatureList,
- char *features, int *lookup_indices)
+ const char *features, int *lookup_indices)
{
int i, j, n = 0;
OTF_Feature *feature;
static int
OTF_drive_gsub_internal (OTF *otf, OTF_GlyphString *gstring,
- char *script, char *language, char *features,
+ const char *script, const char *language,
+ const char *features,
int alternate_subst)
{
char *errfmt = "GSUB driving%s";
int
OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring,
- char *script, char *language, char *features)
+ const char *script, const char *language, const char *features)
{
return OTF_drive_gsub_internal (otf, gstring, script, language, features, 0);
}
int
OTF_drive_gpos (OTF *otf, OTF_GlyphString *gstring,
- char *script, char *language, char *features)
+ const char *script, const char *language, const char *features)
{
char *errfmt = "GPOS driving%s";
int errret = -1;
int
OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring,
- char *script, char *language,
- char *gsub_features, char *gpos_features)
+ const char *script, const char *language,
+ const char *gsub_features, const char *gpos_features)
{
if (OTF_drive_cmap (otf, gstring) < 0)
return -1;
int
OTF_drive_gsub_alternate (OTF *otf, OTF_GlyphString *gstring,
- char *script, char *language, char *features)
+ const char *script, const char *language,
+ const char *features)
{
return OTF_drive_gsub_internal (otf, gstring, script, language, features, 1);
}
};
int
-otf__error (int err, char *fmt, void *arg)
+otf__error (int err, const char *fmt, const void *arg)
{
sprintf (error_message, "OTF-Error (%s): ", error_string[err]);
sprintf (error_message + strlen (error_message), fmt, arg);
}
void
-OTF_perror (char *prefix)
+OTF_perror (const char *prefix)
{
if (OTF_error == 0)
sprintf (error_message, "%s", error_string[0]);
#define OTF_ERROR(err, arg) \
return (otf__error ((err), errfmt, (arg)), errret)
-extern int otf__error (int err, char *fmt, void *arg);
+extern int otf__error (int err, const char *fmt, const void *arg);
typedef struct
{
- char *name;
+ const char *name;
long pos;
long bufsize;
long allocated;
typedef long OTF_StreamState;
OTF_Stream *
-make_stream (char *name)
+make_stream (const char *name)
{
OTF_Stream *stream;
char *errfmt = "stream creation%s";
}
OTF_Stream *
-make_stream_from_ft_face (FT_Face face, char *name)
+make_stream_from_ft_face (FT_Face face, const char *name)
{
char *errfmt = "FT_Face stream creation for %s";
void *errret = NULL;
}
static OTF_TableInfo *
-get_table_info (OTF *otf, char *name)
+get_table_info (OTF *otf, const char *name)
{
char *errfmt = "OTF Table Read%s";
OTF_TableInfo *errret = NULL;
freeing memory previously allocated. */
OTF *
-OTF_open (char *otf_name)
+OTF_open (const char *otf_name)
{
FILE *fp;
char *errfmt = "opening otf (%s)";
/*** (2-3) OTF_get_table() */
int
-OTF_get_table (OTF *otf, char *name)
+OTF_get_table (OTF *otf, const char *name)
{
OTF_TableInfo *table_info = get_table_info (otf, name);
void *address;
/*** (2-4) OTF_check_table() */
int
-OTF_check_table (OTF *otf, char *name)
+OTF_check_table (OTF *otf, const char *name)
{
return (get_table_info (otf, name) ? 0 : -1);
}
int
OTF_check_features (OTF *otf, int gsubp,
- OTF_Tag script, OTF_Tag language, OTF_Tag *features,
+ OTF_Tag script, OTF_Tag language, const OTF_Tag *features,
int n_features)
{
OTF_ScriptList *script_list;
/*** (5) API miscellaneous ***/
OTF_Tag
-OTF_tag (char *name)
+OTF_tag (const char *name)
{
- unsigned char *p = (unsigned char *) name;
+ const unsigned char *p = (unsigned char *) name;
if (! name)
return (OTF_Tag) 0;