summaryrefslogtreecommitdiff
path: root/pcl/pcmisc.c
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>1998-07-23 03:20:23 +0000
committerHenry Stiles <henry.stiles@artifex.com>1998-07-23 03:20:23 +0000
commit9ba7427ce3f94a9973994f26948c3304377af33e (patch)
tree74612253b5c386755f1d5d8f1c8524bf3e1ba80b /pcl/pcmisc.c
Initial revision
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@11 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl/pcmisc.c')
-rw-r--r--pcl/pcmisc.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/pcl/pcmisc.c b/pcl/pcmisc.c
new file mode 100644
index 000000000..1987ffe03
--- /dev/null
+++ b/pcl/pcmisc.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1996 Aladdin Enterprises. All rights reserved.
+ Unauthorized use, copying, and/or distribution prohibited.
+ */
+
+/* pcmisc.c */
+/* PCL5 miscellaneous and debugging commands */
+#include "std.h"
+#include "pcommand.h"
+#include "pcstate.h"
+
+private int /* ESC & s <bool> C */
+pcl_end_of_line_wrap(pcl_args_t *pargs, pcl_state_t *pcls)
+{ uint i = uint_arg(pargs);
+
+ if ( i > 1 )
+ return e_Range;
+ pcls->end_of_line_wrap = i == 0;
+ return 0;
+}
+
+private int /* ESC Y */
+pcl_enable_display_functions(pcl_args_t *pargs, pcl_state_t *pcls)
+{ pcls->display_functions = true;
+ return 0;
+}
+
+/* We export this procedure so we can detect the end of display fns mode. */
+int /* ESC Z */
+pcl_disable_display_functions(pcl_args_t *pargs, pcl_state_t *pcls)
+{ pcls->display_functions = false;
+ return 0;
+}
+
+/* Initialization */
+private int
+pcmisc_do_init(gs_memory_t *mem)
+{ /* Register commands */
+ DEFINE_CLASS_COMMAND_ARGS('&', 's', 'C', pcl_end_of_line_wrap, pca_neg_error|pca_big_error)
+ DEFINE_ESCAPE_ARGS('Y', pcl_enable_display_functions, pca_in_macro)
+ DEFINE_ESCAPE_ARGS('Z', pcl_disable_display_functions, pca_in_macro)
+ return 0;
+}
+private void
+pcmisc_do_reset(pcl_state_t *pcls, pcl_reset_type_t type)
+{ if ( type & (pcl_reset_initial | pcl_reset_printer) )
+ { pcls->end_of_line_wrap = false;
+ pcls->display_functions = false;
+ }
+}
+const pcl_init_t pcmisc_init = {
+ pcmisc_do_init, pcmisc_do_reset
+};