static DataOffset getUnicodeGroupOffset (TextTableData *ttd, wchar_t character, int allocate) { unsigned int groupNumber = UNICODE_GROUP_NUMBER(character); DataOffset groupOffset = getTextTableHeader(ttd)->unicodeGroups[groupNumber]; if (!groupOffset && allocate) { if (!allocateDataItem(ttd->area, &groupOffset, sizeof(UnicodeGroupEntry), __alignof__(UnicodeGroupEntry))) return 0; getTextTableHeader(ttd)->unicodeGroups[groupNumber] = groupOffset; } return groupOffset; }
static inline const UnicodeGroupEntry * getUnicodeGroupEntry (TextTable *table, wchar_t character) { TextTableOffset offset = table->header.fields->unicodeGroups[UNICODE_GROUP_NUMBER(character)]; if (offset) return getTextTableItem(table, offset); return NULL; }