/**
* hb_tag_from_string:
- * @str: (array length=len):
+ * @str: (array length=len) (element-type uint8_t):
* @len:
*
*
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_tag_t
hb_tag_from_string (const char *str, int len)
*
*
*
- * Since: 1.0
+ * Since: 0.9.5
**/
void
hb_tag_to_string (hb_tag_t tag, char *buf)
/**
* hb_direction_from_string:
- * @str: (array length=len):
+ * @str: (array length=len) (element-type uint8_t):
* @len:
*
*
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_direction_t
hb_direction_from_string (const char *str, int len)
*
* Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_direction_to_string (hb_direction_t direction)
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0
};
-static hb_bool_t
+static bool
lang_equal (hb_language_t v1,
const void *v2)
{
/**
* hb_language_from_string:
- * @str: (array length=len):
- * @len:
+ * @str: (array length=len) (element-type uint8_t): a string representing
+ * ISO 639 language code
+ * @len: length of the @str, or -1 if it is %NULL-terminated.
*
- *
+ * Converts @str representing an ISO 639 language code to the corresponding
+ * #hb_language_t.
*
- * Return value:
+ * Return value: (transfer none):
+ * The #hb_language_t corresponding to the ISO 639 language code.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_language_t
hb_language_from_string (const char *str, int len)
{
- char strbuf[64];
-
if (!str || !len || !*str)
return HB_LANGUAGE_INVALID;
+ hb_language_item_t *item = NULL;
if (len >= 0)
{
/* NUL-terminate it. */
+ char strbuf[64];
len = MIN (len, (int) sizeof (strbuf) - 1);
memcpy (strbuf, str, len);
strbuf[len] = '\0';
- str = strbuf;
+ item = lang_find_or_insert (strbuf);
}
-
- hb_language_item_t *item = lang_find_or_insert (str);
+ else
+ item = lang_find_or_insert (str);
return likely (item) ? item->lang : HB_LANGUAGE_INVALID;
}
/**
* hb_language_to_string:
- * @language:
+ * @language: an #hb_language_t to convert.
*
- *
+ * See hb_language_from_string().
*
- * Return value: (transfer none):
+ * Return value: (transfer none):
+ * A %NULL-terminated string representing the @language. Must not be freed by
+ * the caller.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_language_to_string (hb_language_t language)
*
*
*
- * Return value:
+ * Return value: (transfer none):
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_language_t
hb_language_get_default (void)
/**
* hb_script_from_iso15924_tag:
- * @tag:
+ * @tag: an #hb_tag_t representing an ISO 15924 tag.
*
- *
+ * Converts an ISO 15924 script tag to a corresponding #hb_script_t.
*
* Return value:
+ * An #hb_script_t corresponding to the ISO 15924 tag.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_script_t
hb_script_from_iso15924_tag (hb_tag_t tag)
/**
* hb_script_from_string:
- * @s: (array length=len):
- * @len:
+ * @str: (array length=len) (element-type uint8_t): a string representing an
+ * ISO 15924 tag.
+ * @len: length of the @str, or -1 if it is %NULL-terminated.
*
- *
+ * Converts a string @str representing an ISO 15924 script tag to a
+ * corresponding #hb_script_t. Shorthand for hb_tag_from_string() then
+ * hb_script_from_iso15924_tag().
*
* Return value:
+ * An #hb_script_t corresponding to the ISO 15924 tag.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_script_t
-hb_script_from_string (const char *s, int len)
+hb_script_from_string (const char *str, int len)
{
- return hb_script_from_iso15924_tag (hb_tag_from_string (s, len));
+ return hb_script_from_iso15924_tag (hb_tag_from_string (str, len));
}
/**
* hb_script_to_iso15924_tag:
- * @script:
+ * @script: an #hb_script_ to convert.
*
- *
+ * See hb_script_from_iso15924_tag().
*
- * Return value:
+ * Return value:
+ * An #hb_tag_t representing an ISO 15924 script tag.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_tag_t
hb_script_to_iso15924_tag (hb_script_t script)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.2
**/
hb_direction_t
hb_script_get_horizontal_direction (hb_script_t script)
case HB_SCRIPT_PALMYRENE:
case HB_SCRIPT_PSALTER_PAHLAVI:
+ /* Unicode-8.0 additions */
+ case HB_SCRIPT_OLD_HUNGARIAN:
+
return HB_DIRECTION_RTL;
}
}
}
hb_user_data_item_t item = {key, data, destroy};
- bool ret = !!items.replace_or_insert (item, lock, replace);
+ bool ret = !!items.replace_or_insert (item, lock, (bool) replace);
return ret;
}
void *
hb_user_data_array_t::get (hb_user_data_key_t *key)
{
- hb_user_data_item_t item = {NULL };
+ hb_user_data_item_t item = {NULL, NULL, NULL};
return items.find (key, &item, lock) ? item.data : NULL;
}
*
* Returns library version as three integer components.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
void
hb_version (unsigned int *major,
*
* Return value: library version string.
*
- * Since: 1.0
+ * Since: 0.9.2
**/
const char *
hb_version_string (void)
*
* Return value:
*
- * Since: 1.0
+ * Since: 0.9.30
**/
hb_bool_t
hb_version_atleast (unsigned int major,