Lines Matching refs:cc

405   DPSPrivContext cc, c = (DPSPrivContext) ctxt;
408 for (cc = ss->firstContext; cc != NIL; cc = cc->next)
409 if (cc == c) return true;
426 DPSPrivContext cc = (DPSPrivContext) ctxt;
431 if (cc == NIL) cc = (DPSPrivContext)dummyCtx;
432 if (cc == NIL) return;
435 DPSAssertWarn(buf == NIL, cc, "non-nil output buffer with 0 length");
436 cc->eofReceived = true;
437 if (cc->objBuf) {
439 free(cc->objBuf);
440 cc->objBuf = NIL;
441 cc->nObjBufChars = 0;
448 if (cc->objBuf) { /* we're buffering */
450 char *b = cc->objBuf + cc->nObjBufChars;
452 while (cc->nObjBufChars < DPS_SEQ_MIN) {
455 ++cc->nObjBufChars;
458 b = cc->objBuf;
460 if (cc->nObjBufChars < minSize) {
461 if (nch + cc->nObjBufChars < (unsigned) minSize) {
462 os_bcopy(buf, b + cc->nObjBufChars, nch);
463 cc->nObjBufChars += nch;
467 os_bcopy(buf, b + cc->nObjBufChars, minSize - cc->nObjBufChars);
468 buf += minSize - cc->nObjBufChars;
469 nch -= minSize - cc->nObjBufChars;
470 cc->nObjBufChars = minSize;
475 unsigned short *sizeP = (unsigned short *)(cc->objBuf+2);
479 unsigned long *extSizeP = (unsigned long *)(cc->objBuf+4);
483 /* here with m = BOS total length in bytes, b = cc->objBuf */
484 cc->objBuf = (char *)realloc(b, m);
486 if (nch + cc->nObjBufChars < m) {
487 os_bcopy(buf, cc->objBuf + cc->nObjBufChars, nch);
488 cc->nObjBufChars += nch;
492 os_bcopy(buf, cc->objBuf + cc->nObjBufChars, m - cc->nObjBufChars);
493 buf += m - cc->nObjBufChars;
494 nch -= m - cc->nObjBufChars;
495 cc->nObjBufChars = m;
497 /* we're here only if cc->objBuf contains a complete BOS */
500 buf = cc->objBuf;
501 nch = cc->nObjBufChars;
502 cc->objBuf = NIL;
503 cc->nObjBufChars = 0;
508 if (cc->contextFlags & DPS_FLAG_NO_BINARY_CONVERSION) n = nch;
513 if ((n > 0) && (cc->textProc != NIL)) {
514 (*cc->textProc)((DPSContext)cc, buf, n);
530 DPSAssertWarn(nch == 1 && !oldBuf, cc, "illegal binary output from context (oldBuf)");
531 cc->objBuf = (char *)DPScalloc(DPS_EXT_HEADER_SIZE, 1);
532 cc->nObjBufChars = nch;
533 *cc->objBuf = *buf;
542 DPSAssertWarn(!oldBuf && nch > 1, cc, "return values garbled (oldBuf||nch<DPS_SEQ_MIN");
544 cc->objBuf = (char *)DPScalloc(DPS_EXT_HEADER_SIZE, 1);
545 cc->nObjBufChars = DPS_SEQ_MIN;
546 os_bcopy(buf, cc->objBuf, cc->nObjBufChars);
558 DPSAssertWarn(!oldBuf, cc, "return values garbled (oldBuf)");
559 tb = cc->objBuf = (char *)DPScalloc(minSize, 1);
560 cc->nObjBufChars = nch;
577 DPSAssertWarn(!oldBuf, cc, "return values garbled (oldBuf&&nch<m");
578 cc->objBuf = (char *)DPScalloc(bos->length, 1);
579 cc->nObjBufChars = nch;
580 os_bcopy(buf, cc->objBuf, nch);
583 DPSAssertWarn(bos->nTopElements == 1, cc, "illegal binary output detected (bos->nTopElements!=1)");
590 cc->resultTable = NIL;
591 DPSSafeSetLastNameIndex((DPSContext)cc);
593 if (cc->errorProc != NIL)
594 (*cc->errorProc)((DPSContext)cc, dps_err_ps, (unsigned long)buf, m);
601 if (!cc->resultTable || t > cc->resultTableLength) {
602 if (cc->chainParent == NIL && cc->errorProc != NIL) {
603 DPSSafeSetLastNameIndex((DPSContext)cc);
604 (*cc->errorProc)((DPSContext)cc, dps_err_resultTagCheck, (unsigned long)buf, m);
607 else if (t == cc->resultTableLength) {
608 cc->resultTable = NIL;
611 StuffResultVal((DPSContext)cc, &cc->resultTable[t], t, firstObj);
619 DPSAssertWarn(nch == 0, cc, "some return values/data lost (nch)");
980 DPSPrivContext c = (DPSPrivContext)ctxt, cc, prev;
998 for (cc = ss->firstContext; (cc != NIL) && (cc != c); cc = cc->next)
999 prev = cc;
1000 DPSAssert(cc != NIL);
1001 DPSAssert(cc != prev);
1002 if (prev == NIL) ss->firstContext = cc->next;
1004 prev->next = cc->next;
1403 DPSPrivContext cc = (DPSPrivContext) ctxt;
1462 if (numFormat != cc->numFormat) {
1523 if (DPSDefaultByteOrder == dps_hiFirst && cc->numFormat == dps_ieee)
1525 else if (DPSDefaultByteOrder == dps_loFirst && cc->numFormat == dps_ieee)
1527 else if (DPSDefaultByteOrder == dps_hiFirst && cc->numFormat == dps_native)
1964 DPSPrivContext cc = (DPSPrivContext) ctxt;
1994 || cc->numFormat != DPSDefaultNumFormat) {
2056 DPSPrivContext cc = (DPSPrivContext)ctxt;
2061 if (cc->outBuf) { /* we're buffering */
2064 if (!IsBinaryToken(cc->outBuf[0]) && cc->nOutBufChars < DPS_SEQ_MIN) {
2065 char *tb = cc->outBuf + cc->nOutBufChars;
2066 integer nn = DPS_SEQ_MIN - cc->nOutBufChars;
2068 cc->nOutBufChars += nn;
2072 bst = GetHdrNBytes((unsigned char *) cc->outBuf);
2074 if (cc->nOutBufChars < bst) {
2075 char *b = cc->outBuf;
2076 if (nch + cc->nOutBufChars < (unsigned) bst) {
2077 os_bcopy(buf, cc->outBuf + cc->nOutBufChars, nch);
2078 cc->nOutBufChars += nch;
2081 os_bcopy(buf, b + cc->nOutBufChars, bst - cc->nOutBufChars);
2082 buf += bst - cc->nOutBufChars;
2083 nch -= bst - cc->nOutBufChars;
2084 cc->nOutBufChars = bst;
2085 m = GetNBytes((unsigned char *) cc->outBuf);
2086 cc->outBuf = (char *)DPScalloc(m, 1);
2087 os_bcopy(b, cc->outBuf, bst);
2090 else m = GetNBytes((unsigned char *) cc->outBuf);
2093 if (nch + cc->nOutBufChars < m) {
2094 os_bcopy(buf, cc->outBuf + cc->nOutBufChars, nch);
2095 cc->nOutBufChars += nch;
2098 os_bcopy(buf, cc->outBuf + cc->nOutBufChars, m - cc->nOutBufChars);
2099 buf += m - cc->nOutBufChars;
2100 nch -= m - cc->nOutBufChars;
2101 cc->nOutBufChars = m;
2104 buf = cc->outBuf;
2105 nch = cc->nOutBufChars;
2106 cc->outBuf = NIL;
2107 cc->nOutBufChars = 0;
2108 } /* if (cc->outBuf) */
2112 if (cc->contextFlags & DPS_FLAG_NO_BINARY_CONVERSION) n = nch;
2121 DPSWriteData((DPSContext)cc, buf, n);
2136 DPSAssertWarn(nch == 1 && !oldBuf, cc, "problem converting binary token/sequence (nch!=1||oldBuf)");
2137 cc->outBuf = (char *)DPScalloc(DPS_EXT_HEADER_SIZE, 1);
2138 cc->nOutBufChars = nch;
2139 cc->outBuf[0] = *buf;
2145 DPSAssertWarn(!oldBuf, cc, "problem converting binary token/sequence (oldBuf)");
2147 cc->outBuf = (char *)DPScalloc(bst, 1);
2150 cc->outBuf = (char *)DPScalloc(m, 1);
2152 cc->nOutBufChars = nch;
2153 os_bcopy(buf, cc->outBuf, nch);
2160 WriteEntireGoody(ctxt, (unsigned char *) buf, cc->numstringOffsets);
2163 DPSAssertWarn(nch == m, cc, "some converted PostScript language may be lost during error recovery (nch!=m)");
2170 DPSAssertWarn(nch == m, cc, "some converted PostScript language may be lost (nch!=m)");
2255 DPSPrivContext cc = (DPSPrivContext) ctxt;
2258 if (cc->contextFlags & DPS_FLAG_CONVERT_NUMSTRINGS) {
2259 if (cc->numstringOffsets == NULL) {
2260 cc->numstringOffsets = (int *) DPScalloc(sizeof(int),
2262 cc->numstringOffsets[0] = BUFFER_GROW + 2; /* Current size */
2263 cc->numstringOffsets[1] = 2; /* Next slot */
2264 } else if (cc->numstringOffsets[1] >= cc->numstringOffsets[0]) {
2265 cc->numstringOffsets[0] += BUFFER_GROW;
2266 cc->numstringOffsets =
2267 (int *) realloc(cc->numstringOffsets,
2268 sizeof(int)* cc->numstringOffsets[0]);
2272 cc->numstringOffsets[cc->numstringOffsets[1]] = cc->nOutBufChars - 4;
2273 cc->numstringOffsets[1] += 1;
2419 DPSPrivContext cc = (DPSPrivContext) ctxt;
2420 cc->resyncing = true;
2465 DPSPrivContext cc = (DPSPrivContext) c;
2466 if (cc != NULL && cc->resyncing) {
2467 cc->resyncing = false;
2687 DPSPrivContext cc = (DPSPrivContext) ctxt;
2688 char *tmp = cc->wh;
2689 cc->wh = newWh;
2702 DPSContext cc = child->chainChild;
2716 if (cc != NIL) {
2717 cc->chainParent = NIL;
2718 (void) DPSChainContext(child, cc);