コード例 #1
0
ファイル: gsfont.c プロジェクト: SynEmira/ruby-ghostscript
/* Font directory GC procedures */
static
ENUM_PTRS_WITH(font_dir_enum_ptrs, gs_font_dir *dir)
{
    /* Enumerate pointers from cached characters to f/m pairs, */
    /* and mark the cached character glyphs. */
    /* See gxfcache.h for why we do this here. */
    uint cci = index - st_font_dir_max_ptrs;
    uint offset, count;
    uint tmask = dir->ccache.table_mask;

    if (cci == 0)
        offset = 0, count = 1;
    else if (cci == dir->enum_index + 1)
        offset = dir->enum_offset + 1, count = 1;
    else
        offset = 0, count = cci;
    for (; offset <= tmask; ++offset) {
        cached_char *cc = dir->ccache.table[offset];

        if (cc != 0 && !--count) {
            (*dir->ccache.mark_glyph)
                (mem, cc->code, dir->ccache.mark_glyph_data);
            /****** HACK: break const.  We'll fix this someday. ******/
            ((gs_font_dir *)dir)->enum_index = cci;
            ((gs_font_dir *)dir)->enum_offset = offset;
            ENUM_RETURN(cc_pair(cc) - cc->pair_index);
        }
    }
}
コード例 #2
0
ファイル: gshtscr.c プロジェクト: sicsiksix/aaa_website
/* GC procedures */
static
ENUM_PTRS_WITH(screen_enum_enum_ptrs, gs_screen_enum *eptr)
{
    if (index < 1 + st_ht_order_max_ptrs) {
        gs_ptr_type_t ret =
            ENUM_USING(st_ht_order, &eptr->order, sizeof(eptr->order),
                       index - 1);

        if (ret == 0)           /* don't stop early */
            ENUM_RETURN(0);
        return ret;
    }
    return ENUM_USING(st_halftone, &eptr->halftone, sizeof(eptr->halftone),
                      index - (1 + st_ht_order_max_ptrs));
}