void pdc_putc(unsigned char c) { unsigned int n; unsigned long flags; switch (c) { case '\n': iodc_dbuf[0] = '\r'; iodc_dbuf[1] = '\n'; n = 2; posx = 0; break; case '\t': pdc_putc(' '); while (posx & 7) /* expand TAB */ pdc_putc(' '); return; /* return since IODC can't handle this */ case '\b': posx-=2; /* BS */ default: iodc_dbuf[0] = c; n = 1; posx++; break; } { real32_call(PAGE0->mem_cons.iodc_io, (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT, PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), __pa(iodc_retbuf), 0, __pa(iodc_dbuf), n, 0); } }
void pdc_put_pdfstring(pdc_output *out, const char *text, int len) { const unsigned char *goal, *s; pdc_putc(out, PDF_PARENLEFT); goal = (const unsigned char *) text + len; for (s = (const unsigned char *) text; s < goal; s++) { switch (*s) { case PDF_RETURN: pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, PDF_r); break; case PDF_NEWLINE: pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, PDF_n); break; default: if (*s == PDF_PARENLEFT || *s == PDF_PARENRIGHT || *s == PDF_BACKSLASH) pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, (char) *s); } } pdc_putc(out, PDF_PARENRIGHT); }
void pdc_put_pdfname(pdc_output *out, const char *text, size_t len) { const unsigned char *goal, *s; static const char BinToHex[] = PDF_STRING_0123456789ABCDEF; goal = (const unsigned char *) text + len; pdc_putc(out, PDF_SLASH); for (s = (const unsigned char *) text; s < goal; s++) { if (PDF_NEEDS_QUOTE(*s)) { pdc_putc(out, PDF_HASH); pdc_putc(out, BinToHex[*s >> 4]); /* first nibble */ pdc_putc(out, BinToHex[*s & 0x0F]); /* second nibble */ } else
void pdc_put_pdfstring(pdc_output *out, const char *text, int len) { const unsigned char *goal, *s; if (!len) len = (int) strlen(text); if (out->pdc->compatibility <= PDC_1_5 && len > PDF_MAXSTRINGSIZE) pdc_error(out->pdc, PDC_E_INT_TOOLONG_TEXTSTR, pdc_errprintf(out->pdc, "%d", PDF_MAXSTRINGSIZE), 0, 0, 0); pdc_putc(out, PDF_PARENLEFT); goal = (const unsigned char *) text + len; for (s = (const unsigned char *) text; s < goal; s++) { switch (*s) { case PDF_RETURN: pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, PDF_r); break; case PDF_NEWLINE: pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, PDF_n); break; default: if (*s == PDF_PARENLEFT || *s == PDF_PARENRIGHT || *s == PDF_BACKSLASH) pdc_putc(out, PDF_BACKSLASH); pdc_putc(out, (char) *s); } } pdc_putc(out, PDF_PARENRIGHT); }
static void pdc_console_write(struct console *co, const char *s, unsigned count) { while(count--) pdc_putc(*s++); }