Lines Matching defs:ctxt

147 void DPSSafeSetLastNameIndex(DPSContext ctxt)
152 if (ctxt != dummyCtx && ctxt->space != NIL)
153 ((DPSPrivContext)ctxt)->lastNameIndex = ((DPSPrivSpace)(ctxt->space))->lastNameIndex;
181 DPSContext ctxt,
195 DPSSafeSetLastNameIndex(ctxt);
196 if (ctxt->errorProc != NIL)
197 (*ctxt->errorProc)(ctxt, dps_err_resultTypeCheck, (long unsigned)obj, 0);
284 DPSSafeSetLastNameIndex(ctxt);
285 if (ctxt->errorProc != NIL)
286 (*ctxt->errorProc)(ctxt, dps_err_resultTypeCheck, (long unsigned)obj, 0);
317 DPSSafeSetLastNameIndex(ctxt);
318 if (ctxt->errorProc != NIL)
319 (*ctxt->errorProc)(ctxt, dps_err_resultTypeCheck, (long unsigned)obj, 0);
323 DPSSafeSetLastNameIndex(ctxt);
324 if (ctxt->errorProc != NIL)
325 (*ctxt->errorProc)(ctxt, dps_err_resultTypeCheck, (long unsigned)obj, 0);
403 boolean DPSKnownContext(DPSContext ctxt)
405 DPSPrivContext cc, c = (DPSPrivContext) ctxt;
422 DPSContext ctxt,
426 DPSPrivContext cc = (DPSPrivContext) ctxt;
633 static void procWaitContext(DPSContext ctxt)
654 if (DPSPrivateCheckWait(ctxt)) return;
656 ctxt->resultTable = &DPSR; /* must be non-null for handler to work */
657 ctxt->resultTableLength = 0; /* same value as termination tag */
658 DPSBinObjSeqWrite(ctxt, (char *) &dpsF,sizeof(DPSQ));
659 DPSAwaitReturnValues(ctxt);
662 static void procUpdateNameMap(DPSContext ctxt)
665 DPSPrivContext c = (DPSPrivContext) ctxt;
666 DPSPrivSpace s = (DPSPrivSpace) ctxt->space;
667 DPSContext children = ctxt->chainChild;
670 if (children != NIL) ctxt->chainChild = NIL;
673 DPSPrintf(ctxt, "%d /%s defineusername\n", i, userNames[i]);
675 if (children != NIL) ctxt->chainChild = children;
681 ctxt->chainChild = children;
682 DPSUpdateNameMap(ctxt->chainChild);
687 DPSContext ctxt,
692 DPSinnerProcWriteData(ctxt, buf, count);
693 if (ctxt->chainChild != NIL) DPSWriteData(ctxt->chainChild, buf, count);
697 DPSContext ctxt,
701 if (((DPSPrivContext)ctxt)->lastNameIndex < globLastNameIndex) DPSUpdateNameMap(ctxt);
702 DPSinnerProcWriteData(ctxt, buf, count);
703 if (ctxt->chainChild != NIL) DPSBinObjSeqWrite(ctxt->chainChild, buf, count);
707 DPSContext ctxt,
711 DPSinnerProcWriteData(ctxt, buf, count);
712 if (ctxt->chainChild != NIL) DPSWriteStringChars(ctxt->chainChild, buf, count);
716 DPSContext ctxt,
720 DPSinnerProcWriteData(ctxt, buf, count);
721 if (ctxt->chainChild != NIL) DPSWritePostScript(ctxt->chainChild, buf, count);
725 DPSContext ctxt,
764 (*writeProc)(ctxt, (char *)HNumHeader, 4);
769 (*writeProc)(ctxt, (char *) data, size * 4);
775 (*writeProc)(ctxt, (char *) ibuf,
783 (*writeProc)(ctxt, (char *) data, size * sizeof(int));
787 (*writeProc)(ctxt, (char *) data, size * sizeof(short));
791 (*writeProc)(ctxt, (char *) data, size * sizeof(float));
799 DPSContext ctxt,
805 innerProcWriteNumstring(ctxt, type, data, size, scale, DPSinnerProcWriteData);
806 if (ctxt->chainChild != NIL) DPSWriteNumString(ctxt->chainChild, type, data, size, scale);
810 DPSContext ctxt,
818 DPSPrivContext c = (DPSPrivContext)(ctxt);
870 DPSWritePostScript(ctxt, (char *) bboolObj, sizeof(DPSBinObjGeneric) * i);
882 DPSWritePostScript(ctxt, (char *) rrealObj, sizeof(DPSBinObjReal) * i);
894 DPSWritePostScript(ctxt, (char *) rrealObj, sizeof(DPSBinObjReal) * i);
906 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
918 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
930 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
942 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
954 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
966 DPSWritePostScript(ctxt, (char *) iintObj, sizeof(DPSBinObjGeneric) * i);
978 static void procDestroyContext(DPSContext ctxt)
980 DPSPrivContext c = (DPSPrivContext)ctxt, cc, prev;
994 DPSUnchainContext(ctxt);
1008 DPSPrivateDestroyContext(ctxt);
1035 static void procInterrupt(DPSContext ctxt)
1037 DPSPrivContext c = (DPSPrivContext)ctxt;
1039 if (ctxt->chainChild != NIL) DPSInterruptContext(ctxt->chainChild);
1082 DPSContext ctxt,
1094 DPSPrintf(ctxt, "[ ");
1103 DPSPrintf(ctxt, "%d ", n32.i);
1107 DPSPrintf(ctxt, "%g ", n32.f);
1118 DPSPrintf(ctxt, "%d ", n16.i);
1122 DPSPrintf(ctxt, "%g ", n32.f);
1136 DPSPrintf(ctxt, "%g ", n32.f);
1143 DPSPrintf(ctxt, "%g ", n32.f);
1146 DPSPrintf(ctxt, "\n] ");
1248 DPSContext ctxt,
1278 DPSPrintf(ctxt, "true ");
1280 DPSPrintf(ctxt, "false ");
1284 DPSPrintf(ctxt, "%d ", i);
1300 DPSPrintf(ctxt, "%g ", f);
1309 if (lit) DPSPrintf(ctxt, "/");
1313 if (!lit && (ctxt->contextFlags & DPS_FLAG_USE_ABBREVS)) {
1330 DPSWriteData(ctxt, p, length);
1331 DPSPrintf(ctxt, " ");
1335 DPSPrintf(ctxt, (lit ? "[ " : "{ "));
1337 ctxt,
1342 DPSPrintf(ctxt, (lit ? " ] " : " } "));
1346 DPSPrintf(ctxt, "/mark ");
1348 DPSPrintf(ctxt, "mark ");
1361 WriteHomogeneousArrayAsASCII(ctxt, (unsigned char *) p);
1365 DPSPrintf(ctxt, "(");
1367 WriteVMSStringBody(ctxt, p, length); /* write this */
1373 DPSPrintf(ctxt, "\\%c", c);
1375 DPSPrintf(ctxt, "\\n");
1377 DPSPrintf(ctxt, "\\%03.3o", (unsigned char) c);
1378 else DPSWriteData(ctxt, &c, 1);
1381 DPSPrintf(ctxt, ") ");
1390 DPSPrintf(ctxt, "\n ");
1394 DPSPrintf(ctxt, "\n");
1399 DPSContext ctxt,
1403 DPSPrivContext cc = (DPSPrivContext) ctxt;
1448 if (pass == 0 && ctxt->nameEncoding != dps_strings)
1493 if (ctxt->nameEncoding == dps_strings) {
1499 case 2: DPSWriteData(ctxt, p, strlen(p)); goto next_obj;
1510 DPSWriteData(ctxt, (char *) &newObj, sizeof(newObj));
1531 DPSWriteData(ctxt, (char *) &t, 1);
1536 DPSWriteData(ctxt, (char *) &c, 1);
1538 nBytes = (ctxt->nameEncoding == dps_strings) ? bos->length + len :
1540 DPSWriteData(ctxt, (char *)&nBytes, 2);
1545 DPSWriteData(ctxt, (char *)&bos->escape, 3);
1547 nBytes = (ctxt->nameEncoding == dps_strings) ? bos->length + len :
1549 DPSWriteData(ctxt, (char *)&nBytes, 4);
1555 DPSWriteData(ctxt, stringStart, (bos->length - headSize - firstCharOffset));
1614 DPSContext ctxt,
1628 #define PB(byte) c = (byte),DPSWriteData(ctxt, (char *) &c, 1)
1655 DPSWriteData(ctxt, (char *) n32.bytes, 4);
1660 DPSWriteData(ctxt, (char *) n16.bytes, 2);
1678 DPSWriteData(ctxt, (char *) &currObj->val.realVal, 4);
1701 if (ctxt->nameEncoding == dps_indexed && index < 256) {
1716 if (lit) DPSPrintf(ctxt, "/");
1717 DPSWriteData(ctxt, p, length);
1718 DPSPrintf(ctxt, " ");
1728 DPSWriteData(ctxt, (char *) &length, 2);
1733 DPSWriteData(ctxt, (char *) &aryObj->val.integerVal, 4);
1737 DPSWriteData(ctxt, (char *) n16.bytes, 2);
1741 DPSWriteData(ctxt, (char *) &aryObj->val.realVal, 4);
1749 DPSPrintf(ctxt, (lit ? "[ " : "{ "));
1750 WriteSeqAsTokens(ctxt, base, aryObj, length, tokenType,
1752 DPSPrintf(ctxt, (lit ? " ] " : " } "));
1757 DPSPrintf(ctxt, "/mark ");
1759 DPSPrintf(ctxt, "mark ");
1769 DPSWriteData(ctxt, p, length);
1780 DPSWriteData(ctxt, (char *) &length, 2);
1782 DPSWriteData(ctxt, p, length);
1791 DPSPrintf(ctxt, "\n ");
1795 DPSPrintf(ctxt, "\n");
1799 DPSContext ctxt,
1810 DPSPrintf(ctxt, "%d ", n32.i);
1815 DPSPrintf(ctxt, "%d ", n32.i);
1820 DPSPrintf(ctxt, "%d ", n16.i);
1825 DPSPrintf(ctxt, "%d ", n16.i);
1829 DPSPrintf(ctxt, "%d ", n32.i);
1841 DPSPrintf(ctxt, "%d ", n32.i);
1853 DPSPrintf(ctxt, "%d ", n16.i);
1865 DPSPrintf(ctxt, "%g ", n32.f);
1875 DPSPrintf(ctxt, "%g ", n32.f);
1884 DPSPrintf(ctxt, "%g ", n32.f);
1889 DPSPrintf(ctxt, "%g ", n32.f);
1893 DPSPrintf(ctxt, "true ");
1895 DPSPrintf(ctxt, "false ");
1898 DPSPrintf(ctxt, "(");
1904 DPSPrintf(ctxt, "(");
1910 DPSPrintf(ctxt, "(");
1914 WriteVMSStringBody(ctxt, buf, n16.u); /* write this */
1920 DPSPrintf(ctxt, "\\%c", c);
1922 DPSPrintf(ctxt, "\\n");
1924 DPSPrintf(ctxt, "\\%03.3o", c);
1925 else DPSWriteData(ctxt, (char *) &c, 1);
1928 DPSPrintf(ctxt, ") ");
1931 DPSPrintf(ctxt, "/%s ", DPSSysNames[*buf]);
1934 DPSPrintf(ctxt, "%s ", DPSSysNames[*buf]);
1937 DPSPrintf(ctxt, "/%s ", DPSNameFromIndex(*buf));
1940 DPSPrintf(ctxt, "%s ", DPSNameFromIndex(*buf));
1943 WriteHomogeneousArrayAsASCII(ctxt, buf);
1952 sequence as specified by ctxt's encoding parameters. Write the
1956 DPSContext ctxt,
1964 DPSPrivContext cc = (DPSPrivContext) ctxt;
1968 WriteTokenAsAscii(ctxt, buf);
1985 switch (ctxt->programEncoding) {
1987 if (ctxt->nameEncoding == dps_strings) {
1989 ConvertAndWriteSeqAsData(ctxt, (char *) buf, 0);
1990 ConvertAndWriteSeqAsData(ctxt, (char *) buf, 1);
1991 ConvertAndWriteSeqAsData(ctxt, (char *) buf, 2);
1996 ConvertAndWriteSeqAsData(ctxt, (char *) buf, 0);
1998 ConvertAndWriteSeqAsData(ctxt, (char *) buf, 1);
2000 else DPSWriteData(ctxt, (char *) buf, bos->length);
2005 if (ctxt->programEncoding == dps_ascii)
2008 ctxt, (char *)currObj, currObj, bos->nTopElements,
2013 ctxt, (char *)currObj, currObj, bos->nTopElements,
2015 DPSWriteData(ctxt, "\n", 1);
2028 static void textWriteData(DPSContext ctxt, char *buf, unsigned int nch)
2030 (*ctxt->textProc)(ctxt, buf, nch);
2031 if (ctxt->chainChild != NIL) DPSWriteData(ctxt->chainChild, buf, nch);
2034 static void textFlushContext(DPSContext ctxt)
2036 if (ctxt->chainChild != NIL) DPSFlushContext(ctxt->chainChild);
2039 static void textInterruptContext(DPSContext ctxt)
2041 if (ctxt->chainChild != NIL) DPSInterruptContext(ctxt->chainChild);
2044 static void textDestroyContext(DPSContext ctxt)
2046 DPSPrivContext c = (DPSPrivContext)ctxt;
2048 DPSUnchainContext(ctxt);
2054 DPSContext ctxt, char *buf, unsigned int nch)
2056 DPSPrivContext cc = (DPSPrivContext)ctxt;
2160 WriteEntireGoody(ctxt, (unsigned char *) buf, cc->numstringOffsets);
2185 DPSContext ctxt, char *buf, unsigned int nch)
2187 DPSContext children = ctxt->chainChild;
2190 if (children != NIL) ctxt->chainChild = NIL;
2192 textInnerWritePostScript(ctxt, buf, nch);
2194 if (children != NIL) ctxt->chainChild = children;
2198 ctxt->chainChild = children;
2199 DPSWritePostScript(ctxt->chainChild, buf, nch);
2204 DPSContext ctxt, char *buf, unsigned int nch)
2206 DPSContext children = ctxt->chainChild;
2208 if (DPSCheckShared((DPSPrivContext)ctxt)) return;
2211 if (children != NIL) ctxt->chainChild = NIL;
2213 textInnerWritePostScript(ctxt, buf, nch);
2215 if (children != NIL) ctxt->chainChild = children;
2219 ctxt->chainChild = children;
2220 DPSWriteStringChars(ctxt->chainChild, buf, nch);
2225 DPSContext ctxt, char *buf, unsigned int nch)
2227 DPSContext children = ctxt->chainChild;
2228 DPSPrivContext c = (DPSPrivContext) ctxt;
2232 DPSUpdateNameMap(ctxt);
2235 if (children != NIL) ctxt->chainChild = NIL;
2237 textInnerWritePostScript(ctxt, buf, nch);
2239 if (children != NIL) ctxt->chainChild = children;
2243 ctxt->chainChild = children;
2244 DPSBinObjSeqWrite(ctxt->chainChild, buf, nch);
2249 DPSContext ctxt,
2255 DPSPrivContext cc = (DPSPrivContext) ctxt;
2276 innerProcWriteNumstring(ctxt, type, data, size, scale, textInnerWritePostScript);
2296 DPSContext ctxt,
2325 DPSSafeSetLastNameIndex(ctxt);
2326 (*ctxt->errorProc)(ctxt, dps_err_nameTooLong, (unsigned long) n, strlen(n));
2334 if (((DPSPrivContext)ctxt)->lastNameIndex < j)
2335 DPSUpdateNameMap(ctxt);
2340 if (((DPSPrivContext)ctxt)->lastNameIndex < globLastNameIndex)
2341 DPSUpdateNameMap(ctxt);
2356 DPSPrintf(ctxt, "%d /%s defineusername\n", globLastNameIndex, n);
2357 for (c = ctxt; c != NIL; c = c->chainChild)
2367 DPSContext ctxt,
2394 DPSHandleBogusError(ctxt, prefix, suffix);
2408 (*textProc)(ctxt, prefix, strlen(prefix));
2409 (*textProc)(ctxt, errorName, errorNameCount);
2410 (*textProc)(ctxt, infix, strlen(infix));
2411 (*textProc)(ctxt, error, errorCount);
2412 (*textProc)(ctxt, suffix, strlen(suffix));
2414 if (resyncFlg && (ctxt != dummyCtx) && (ctxt != NULL)) {
2416 RAISE(dps_err_ps, (char *) ctxt);
2419 DPSPrivContext cc = (DPSPrivContext) ctxt;
2428 (*textProc)(ctxt, prefix, strlen(prefix));
2429 (*textProc)(ctxt, nameinfix, strlen(nameinfix));
2430 (*textProc)(ctxt, buf, arg2);
2431 (*textProc)(ctxt, suffix, strlen(suffix));
2438 (*textProc)(ctxt, m, strlen(m));
2446 (*textProc)(ctxt, m, strlen(m));
2454 (*textProc)(ctxt, m, strlen(m));
2458 DPSDefaultPrivateHandler(ctxt, errorCode, arg1, arg2, prefix, suffix);
2478 static void textAwaitReturnValues(DPSContext ctxt)
2480 (*ctxt->errorProc)(ctxt, dps_err_invalidAccess, 0, 0);
2588 static void NoteInitFailure(DPSContext ctxt, char *buf, long unsigned length)
2684 DPSContext ctxt,
2687 DPSPrivContext cc = (DPSPrivContext) ctxt;
2723 void DPSUnchainContext(DPSContext ctxt)
2725 DPSContext p = ctxt->chainParent;
2726 DPSContext c = ctxt->chainChild;
2728 if (p != NIL) { /* remove ctxt from parent's chain */
2729 DPSAssertWarn(p->chainChild == ctxt, (DPSPrivContext)p, "attempting to unchain context from wrong chain (parent)");
2731 ctxt->chainParent = NIL;
2733 if (c != NIL) { /* remove ctxt's child (if any) from ctxt's chain */
2734 DPSAssertWarn(c->chainParent == ctxt, (DPSPrivContext)c, "attempting to unchain context from wrong chain (child)");
2736 ctxt->chainChild = NIL;
2743 void DPSAwaitReturnValues(DPSContext ctxt)
2745 (*(ctxt)->procs->AwaitReturnValues)((ctxt));
2748 void DPSDestroyContext(DPSContext ctxt)
2750 (*(ctxt)->procs->DestroyContext)((ctxt));
2758 void DPSFlushContext(DPSContext ctxt)
2760 (*(ctxt)->procs->FlushContext)((ctxt));
2765 void DPSInterruptContext(DPSContext ctxt)
2767 (*(ctxt)->procs->Interrupt)((ctxt));
2772 void DPSResetContext(DPSContext ctxt)
2774 (*(ctxt)->procs->ResetContext)((ctxt));
2778 register DPSContext ctxt,
2782 (ctxt)->resultTable = (tbl);
2783 (ctxt)->resultTableLength = (len);
2787 DPSContext ctxt)
2789 DPSGlobalContext = ctxt;
2793 DPSContext ctxt)
2795 (*(ctxt)->procs->UpdateNameMap)((ctxt));
2799 DPSContext ctxt)
2801 (*(ctxt)->procs->WaitContext)(ctxt);
2805 DPSContext ctxt,
2809 (*(ctxt)->procs->BinObjSeqWrite)((ctxt), (buf), (count));
2813 DPSContext ctxt,
2817 (*(ctxt)->procs->WriteData)((ctxt), (buf), (count));
2821 DPSContext ctxt,
2825 (*(ctxt)->procs->WritePostScript)((ctxt), (buf), (count));
2829 DPSContext ctxt,
2833 (*(ctxt)->procs->WriteStringChars)((ctxt), (buf), (count));
2836 void DPSWriteNumString(ctxt, type, data, size, scale)
2837 DPSContext ctxt;
2843 (*(ctxt)->procs->WriteNumString)((ctxt), (type), (data), (size), (scale));
2846 void DPSWriteTypedObjectArray(ctxt, type, array, length)
2847 DPSContext ctxt;
2851 (*(ctxt)->procs->WriteTypedObjectArray)((ctxt), (type), (array), (length));
2890 void DPSSetNumStringConversion(ctxt, flag)
2891 DPSContext ctxt;
2894 if (flag) ctxt->contextFlags |= DPS_FLAG_CONVERT_NUMSTRINGS;
2895 else ctxt->contextFlags &= ~DPS_FLAG_CONVERT_NUMSTRINGS;
2898 void DPSSetWrapSynchronization(ctxt, flag)
2899 DPSContext ctxt;
2902 if (flag) ctxt->contextFlags |= DPS_FLAG_SYNC;
2903 else ctxt->contextFlags &= ~DPS_FLAG_SYNC;
2906 void DPSSuppressBinaryConversion(ctxt, flag)
2907 DPSContext ctxt;
2910 if (flag) ctxt->contextFlags |= DPS_FLAG_NO_BINARY_CONVERSION;
2911 else ctxt->contextFlags &= ~DPS_FLAG_NO_BINARY_CONVERSION;
2914 void DPSSetAbbrevMode(ctxt, flag)
2915 DPSContext ctxt;
2918 if (flag) ctxt->contextFlags |= DPS_FLAG_USE_ABBREVS;
2919 else ctxt->contextFlags &= ~DPS_FLAG_USE_ABBREVS;
2922 DPSContextExtensionRec *DPSGetContextExtensionRec(ctxt, extensionId)
2923 DPSContext ctxt;
2926 DPSContextExtensionRec *r = ctxt->extension;
2932 void DPSAddContextExtensionRec(ctxt, rec)
2933 DPSContext ctxt;
2936 rec->next = ctxt->extension;
2937 ctxt->extension = rec;
2940 DPSContextExtensionRec *DPSRemoveContextExtensionRec(ctxt, extensionId)
2941 DPSContext ctxt;
2944 DPSContextExtensionRec *rret, **r = &ctxt->extension;
2962 DPSContextType DPSGetContextType(ctxt)
2963 DPSContext ctxt;
2965 DPSPrivContext c = (DPSPrivContext) ctxt;