xref: /original-bsd/lib/libplot/hp2648/linemod.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1980, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)linemod.c	8.1 (Berkeley) 06/04/93";
10 #endif /* not lint */
11 
12 #include "hp2648.h"
13 
14 linemod( line )
15 char	*line;
16 {
17 	putchar('Z');
18 	handshake();
19 	putchar(ESC);
20 	putchar(GRAPHIC);
21 	putchar(MODE);
22 	if ( *(line) == 's' ) {
23 		if ( *(++line) == 'o' ) {
24 			/*
25 			 * solid mode 1
26 			 */
27 			putchar( '1' );
28 			putchar( 'b' );
29 			goto done;
30 		}
31 		else if ( *(line) == 'h' ) {
32 			/*
33 			 * shortdashed mode 4
34 			 */
35 			putchar( '6' );
36 			putchar( 'b' );
37 			goto done;
38 		}
39 	}
40 	else if ( *(line) == 'd' ) {
41 		if ( *(++line) == 'o' && *(++line) == 't' ) {
42 			if ( *(++line) == 't' ) {
43 				/*
44 				 * dotted mode 2
45 				 */
46 				putchar( '7' );
47 				putchar( 'b' );
48 				goto done;
49 			}
50 			else if ( *(line) == 'd' ) {
51 				/*
52 				 * dotdashed mode 3
53 				 */
54 				putchar( '8' );
55 				putchar( 'b' );
56 				goto done;
57 			}
58 		}
59 	}
60 	else if ( *(line) == 'l' ) {
61 		/*
62 		 * longdashed mode 5
63 		 */
64 		putchar( '5' );
65 		putchar( 'b' );
66 		goto done;
67 	}
68 	putchar( '1' );				/* default to solid */
69 	putchar( 'b' );				/* default to solid */
70 done:
71 	putchar( 'Z' );
72 	handshake();
73 	putchar(ESC);
74 	putchar(GRAPHIC);
75 	putchar(PLOT);
76 	putchar(BINARY);
77 	buffcount = 4;
78 	return;
79 }
80