148508Sbostic /*- 2*61388Sbostic * Copyright (c) 1980, 1993 3*61388Sbostic * The Regents of the University of California. All rights reserved. 448508Sbostic * 548508Sbostic * %sccs.include.proprietary.c% 619974Sdist */ 719974Sdist 815492Sralph #ifndef lint 9*61388Sbostic static char sccsid[] = "@(#)linemod.c 8.1 (Berkeley) 06/04/93"; 1048508Sbostic #endif /* not lint */ 1115492Sralph 1215492Sralph #include "gigi.h" 1315492Sralph linemod(line)1415492Sralphlinemod( line ) 1515492Sralph char *line; 1615492Sralph { 1715492Sralph /* 1815492Sralph * Note that the bit patterns could be compacted using the 1915492Sralph * repeat field conventions. They aren't for clarity. 2015492Sralph * Examples of almost identical packed patterns are in the 2115492Sralph * comments. 2215492Sralph * If linemod is changed really often, a ~15% savings 2315492Sralph * could be achieved. 2415492Sralph */ 2515492Sralph if ( *(line) == 's' ) { 2615492Sralph if ( *(++line) == 'o' ) { 2715492Sralph /* 2815492Sralph * solid mode 1 2915492Sralph */ 3015492Sralph printf( "W(P1)" ); 3115492Sralph return; 3215492Sralph } 3315492Sralph else if ( *(line) == 'h' ) { 3415492Sralph /* 3515492Sralph * shortdashed mode 4 3615492Sralph * printf( "W(P000111)" ); 3715492Sralph */ 3815492Sralph printf( "W(P00011100)" ); 3915492Sralph return; 4015492Sralph } 4115492Sralph } 4215492Sralph else if ( *(line) == 'd' ) { 4315492Sralph if ( *(++line) == 'o' && *(++line) == 't' ) { 4415492Sralph if ( *(++line) == 't' ) { 4515492Sralph /* 4615492Sralph * dotted mode 2 4715492Sralph * printf( "W(P00001)" ); 4815492Sralph */ 4915492Sralph printf( "W(P10000000)" ); 5015492Sralph return; 5115492Sralph } 5215492Sralph else if ( *(line) == 'd' ) { 5315492Sralph /* 5415492Sralph * dotdashed mode 3 5515492Sralph * printf( "W(P0110010)" ); 5615492Sralph */ 5715492Sralph printf( "W(P10001100)" ); 5815492Sralph return; 5915492Sralph } 6015492Sralph } 6115492Sralph } 6215492Sralph else if ( *(line) == 'l' ) { 6315492Sralph /* 6415492Sralph * longdashed mode 5 6515492Sralph * printf( "W(P11100)" ); 6615492Sralph */ 6715492Sralph printf( "W(P11111100)" ); 6815492Sralph return; 6915492Sralph } 7015492Sralph printf( "W(P1)" ); /* default to solid */ 7115492Sralph return; 7215492Sralph } 73