summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/tctos.h
diff options
context:
space:
mode:
Diffstat (limited to 'dviware/beebe/src/tctos.h')
-rw-r--r--dviware/beebe/src/tctos.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/dviware/beebe/src/tctos.h b/dviware/beebe/src/tctos.h
new file mode 100644
index 0000000000..2febd42c69
--- /dev/null
+++ b/dviware/beebe/src/tctos.h
@@ -0,0 +1,21 @@
+/* -*-C-*- tctos.h */
+/*-->tctos*/
+/**********************************************************************/
+/**************************** tctos *********************************/
+/**********************************************************************/
+
+char *
+tctos() /* return pointer to (static) TeX page counter string */
+{ /* (trailing zero counters are not printed) */
+ register INT16 k; /* loop index */
+ register INT16 n; /* number of counters to print */
+ static char s[111]; /* 10 32-bit counters n.n.n... */
+
+ for (n = 9; (n > 0) && (tex_counter[n] == 0); --n)
+ /* NO-OP */;
+ s[0] = '\0';
+ for (k = 0; k <= n; ++k)
+ (void)sprintf(strrchr(s,'\0'),"%ld%s",
+ tex_counter[k],(k < n) ? "." : "");
+ return ((char *)&s[0]);
+}