コード例 #1
0
ファイル: cffwrite_t2cstr.c プロジェクト: VirgilMing/afdko
/* Initialize module. */
void cfwCstrNew(cfwCtx g) {
	cstrCtx h = cfwMemNew(g, sizeof(struct cstrCtx_));

	/* Link contexts */
	h->g = g;
	g->ctx.cstr = h;

	dnaINIT(g->ctx.dnaFail, h->cstr, 500, 5000);
	dnaINIT(g->ctx.dnaFail, h->masks, 30, 60);
	dnaINIT(g->ctx.dnaFail, h->hints, 10, 40);
	dnaINIT(g->ctx.dnaFail, h->cntrs, 1, 10);

	/* Open tmp stream */
	g->stm.tmp = g->cb.stm.open(&g->cb.stm, CFW_TMP_STREAM_ID, 0);
	if (g->stm.tmp == NULL) {
		cfwFatal(g, cfwErrTmpStream, NULL);
	}
	h->tmpoff = 0;

	/* Initialize warning accumulator */
	memset(h->warning, 0, sizeof(h->warning));

	/* Used as charstring separator for subroutinizer */
	h->unique = 0;
}
コード例 #2
0
ファイル: cffwrite_dict.c プロジェクト: blakejia/afdko
/* Initialize module. */
void cfwDictNew(cfwCtx g) {
	dictCtx h = cfwMemNew(g, sizeof(struct dictCtx_));

	/* Link contexts */
	h->g = g;
	g->ctx.dict = h;

	dnaINIT(g->ctx.dnaSafe, h->tmp, 30, 10);
}
コード例 #3
0
/* Initialize module. */
void cfwEncodingNew(cfwCtx g) {
    encodingCtx h = (encodingCtx)cfwMemNew(g, sizeof(struct encodingCtx_));

    /* Link contexts */
    h->g = g;
    g->ctx.encoding = h;

    dnaINIT(g->ctx.dnaSafe, h->encodings, 1, 10);
    h->encodings.func = initEncoding;
}