예제 #1
0
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;
}
예제 #2
0
static void
setTextTableDots (TextTableData *ttd, wchar_t character, unsigned char dots) {
  TextTableHeader *header = getTextTableHeader(ttd);

  if (!BITMASK_TEST(header->dotsCharacterDefined, dots)) {
    header->dotsToCharacter[dots] = character;
    BITMASK_SET(header->dotsCharacterDefined, dots);
  }
}
예제 #3
0
static void
resetTextTableDots (TextTableData *ttd, unsigned char dots, wchar_t character) {
  TextTableHeader *header = getTextTableHeader(ttd);

  if (BITMASK_TEST(header->dotsCharacterDefined, dots)) {
    if (header->dotsToCharacter[dots] == character) {
      header->dotsToCharacter[dots] = 0;
      BITMASK_CLEAR(header->dotsCharacterDefined, dots);
    }
  }
}
예제 #4
0
TextTable *
makeTextTable (TextTableData *ttd) {
  TextTable *table = malloc(sizeof(*table));

  if (table) {
    table->header.fields = getTextTableHeader(ttd);
    table->size = getDataSize(ttd->area);
    resetDataArea(ttd->area);
  }

  return table;
}
예제 #5
0
파일: ttb_compile.c 프로젝트: mlang/brltty
TextTable *
makeTextTable (TextTableData *ttd) {
  TextTable *table = malloc(sizeof(*table));

  if (table) {
    memset(table, 0, sizeof(*table));

    table->header.fields = getTextTableHeader(ttd);
    table->size = getDataSize(ttd->area);

    table->options.tryBaseCharacter = 1;

    resetDataArea(ttd->area);
  }

  return table;
}
예제 #6
0
파일: ttb_compile.c 프로젝트: mlang/brltty
static int
finishTextTableData (TextTableData *ttd) {
  qsort(ttd->alias.array, ttd->alias.count, sizeof(*ttd->alias.array), sortTextTableAliasArray);

  {
    DataOffset offset;

    if (!saveDataItem(ttd->area, &offset, ttd->alias.array,
                      ARRAY_SIZE(ttd->alias.array, ttd->alias.count),
                      __alignof__(*ttd->alias.array))) {
      return 0;
    }

    {
      TextTableHeader *header = getTextTableHeader(ttd);

      header->aliasArray = offset;
      header->aliasCount = ttd->alias.count;
    }
  }

  return 1;
}