Jspice3
mfbio.c
Go to the documentation of this file.
1 /**********
2 Copyright 1990 Regents of the University of California. All rights reserved.
3 Author: -C- 1982 Giles C. Billingsley
4 **********/
5 /*
6  * mfbio.c
7  *
8  * sccsid "@(#)mfbio.c 1.9 9/3/83"
9  *
10  * MFB is a graphics package that was developed by the integrated
11  * circuits group of the Electronics Research Laboratory and the
12  * Department of Electrical Engineering and Computer Sciences at
13  * the University of California, Berkeley, California. The programs
14  * in MFB are available free of charge to any interested party.
15  * The sale, resale, or use of these program for profit without the
16  * express written consent of the Department of Electrical Engineering
17  * and Computer Sciences, University of California, Berkeley, California,
18  * is forbidden.
19  */
20 
21 
22 #include "spice.h"
23 #include "mfb.h"
24 #include <stdio.h>
25 #include <string.h>
26 #include <ctype.h>
27 
28 #ifdef HAVE_TERMIOS_H
29 
30 #define iflush(FD) (0)
31 #define ioset(FD, TTYB_P) (0)
32 #define iosetl(FD, BITS) (0)
33 #define ioget(FD, TTYB_P) (0)
34 #define iogetl(FD, BITS) (0)
35 #define iolitout(FD, CODE) (0)
36 #define iosetraw(TTYB) (0)
37 #define iosetmfb_flags(TTYB) (0)
38 #undef HAVE_TERMIO_H
39 #undef HAVE_SGTTY_H
40 
41 #else
42 
43 #ifdef HAVE_TERMIO_H
44 #define iflush(FD) (ioctl(FD, TCFLSH, 0))
45 #define ioset(FD, TTYB_P) (ioctl(FD, TCSETA, (char *) TTYB_P))
46 #define iosetl(FD, BITS) (0)
47 #define ioget(FD, TTYB_P) (ioctl(FD, TCGETA, (char *) TTYB_P))
48 #define iogetl(FD, BITS) (0)
49 #define iolitout(FD, TTYB) (TTYB.c_oflag &= ~OPOST, 0)
50 #define iosetraw(TTYB) (TTYB.c_lflag &= ~(ICANON | ECHO), \
51  TTYB.c_cc[VMIN] = 1, \
52  TTYB.c_cc[VTIME] = 0, 0)
53 #define iosetmfb_flags(TTYB) (0)
54 #undef HAVE_SGTTY_H
55 
56 #else
57 
58 #ifdef HAVE_SGTTY_H
59 #include <sys/file.h>
60 #define iflush(FD) (ioctl(FD, TIOCFLUSH, 0))
61 #define ioset(FD, TTYB_P) (ioctl(FD, TIOCSETN, (char *) TTYB_P))
62 #define iosetl(FD, BITS) (ioctl(FD, TIOCLSET, (char *) BITS))
63 #define ioget(FD, TTYB_P) (ioctl(FD, TIOCGETP, (char *) TTYB_P))
64 #define iogetl(FD, BITS) (ioctl(FD, TIOCLGET, (char *) BITS))
65 #define iolitout(FD, CODE) (ioctl(FD,TIOCLBIS,(char *) LLITOUT))
66 #define iosetraw(TTYB) (TTYB.sg_flags |= RAW, 0)
67 #define iosetmfb_flags(TTYB) ( TTYB.sg_flags &= (ALLDELAY & ~XTABS), \
68  TTYB.sg_flags |= ODDP | EVENP | CBREAK)
69 
70 #endif
71 #endif
72 #endif
73 
74 /* Library routines */
75 
76 static int MFBsaveflg = 0; /* used for kludgy ungetc */
77 static int Oldsaveflg = 0; /* ungetc for displays without keyboards */
78 
79 #define MFBFORMAT MFBCurrent->strings
80 
81 struct err errors[] = {
82  MFBBADENT, "Unknown terminal type",
83  MFBMCELNG, "MFBCAP entry too long",
84  MFBBADMCF, "Can't open or close mfbcap file",
85  MFBBADMCE, "Bad mfbcap entry",
86  MFBINFMCE, "Infinite mfbcap entry",
87  MFBBADTTY, "stdout not in /dev",
88  MFBBADLST, "Illegal line style",
89  MFBBADFST, "Illegal fill style",
90  MFBBADCST, "Illegal color style",
91  MFBBADTM1, "No destructive text",
92  MFBBADTM2, "No overstriking text",
93  MFBNODFLP, "No defineable line styles",
94  MFBNODFFP, "No defineable fill styles",
95  MFBNODFCO, "No defineable colors",
96  MFBNOBLNK, "No blinkers",
97  MFBTMBLNK, "Too many blinkers",
98  MFBNOMASK, "No defineable read or write masks",
99  MFBBADDEV, "Can't open or close output device",
100  MFBBADOPT, "Can't access or set device status",
101  MFBBADWRT, "Error in write",
102  MFBPNTERR, "Error in pointing device",
103  MFBNOPTFT, "No format specified for pointing device",
104  MFBNOPNT, "No pointing device",
105  MFBNORBND, "No Rubberbanding of pointing device",
106  MFBBADALU, "Cannot set ALU mode",
107  0
108  };
109 
110 #define NUMERRORS (sizeof(errors)/sizeof(struct err))
111 
112 
113 
114 
115 /*****************************************************************************
116  *
117  * BASIC I/O ROUTINES
118  *
119  *****************************************************************************/
120 
122 char c;
123  /*
124  * Notes:
125  * Place a character in the output buffer and check for overflow.
126  */
127 {
130  MFBUpdate();
131  return( (int) c );
132 }
133 
134 
136 char *c;
137 int n;
138  /*
139  * Notes:
140  * Place a string of n characters in the output buffer and check
141  * for overflow.
142  */
143 {
144  int i;
145  i = n;
146  /* Putchar tests for overflow after insertion, Putstr tests before */
147  if((MFBCurrent->numTtyBuffer + n + 1) >= TTYBUFSIZE){
148  MFBUpdate();
150  }
151  while(i--)
153  return( n );
154 }
155 
156 
157 int
159 {
160  static char c;
161  char ibuffer[2];
162 
163  if( MFBsaveflg != 0 )
164  MFBsaveflg = 0;
165  else{
166 #ifdef vms
167  c = dev_getc(MFBCurrent->fileDesc);
168 #else
169  if(MFBCurrent->fileDesc == 1)
170  c = getchar();
171  else{
172  if((c = (char)read(MFBCurrent->fileDesc,ibuffer,1)) > 0)
173  c = ibuffer[0];
174  }
175 #endif
176  }
177  return( c );
178 }
179 
180 
181 int
183 {
184  MFBsaveflg++;
185 }
186 
187 
188 int
190 {
191  /*
192  * Notes:
193  * If the graphics display does not have a keyboard, mfb
194  * will use the standard getchar routine to acquire input
195  * from the user's terminal.
196  */
197  static char c;
198  if( Oldsaveflg != 0 )
199  Oldsaveflg = 0;
200  else{
201 #ifdef vms
202  c = dev_getchar();
203 #else
204  c = getchar();
205 #endif
206  }
207  return( c );
208 }
209 
210 
211 int
213 {
214  Oldsaveflg++;
215 }
216 
217 
218 int
220 {
221  /*
222  * Notes:
223  * Flush the output buffer to the graphics display.
224  */
225  int value;
226 #ifdef vms
227  if((value = MFBCurrent->numTtyBuffer) > 0)
228  dev_write(MFBCurrent->fileDesc,
230 #else
231  value =
233 #endif
235  return(value);
236 }
237 
238 
239 int
241 {
242 #if defined(HAVE_SGTTY_H) || defined(HAVE_TERMIO_H)
243  /*
244  * In the UNIX file system, all pending input is flushed whenever
245  * ioctl is called with the TIOCSETP option.
246  */
247 
248  /* the isatty() is necessary because user may be piping output */
249  if(isatty(MFBCurrent->fileDesc)){
250  if (iflush(MFBCurrent->fileDesc) < 0)
251  return(MFBBADOPT);
252  }
253 
254  if(MFBCurrent->fileDesc != 1 && isatty(1)){
255  if(iflush(1) < 0)
256  return(MFBBADOPT);
257  }
258 #endif
259  return(MFBOK);
260 }
261 
262 
263 
264 void
266 {
267  /*
268  * Notes:
269  * Rings the Bell.
270  */
271  if(MFBFORMAT.audio == NULL || *MFBFORMAT.audio == 0) {
272  /* cntrl-g by default */
273  if(MFBCurrent->fileDesc == 1)
274  MFBPutchar( '\07' );
275  else
276  (void) putchar( '\07' );
277  }
278  else{
279  MFBGenCode(MFBFORMAT.audio);
280  }
281 }
282 
283 
284 
285 
286 
287 /*****************************************************************************
288  *
289  * INITIALIZATION
290  *
291  *****************************************************************************/
292 
293 MFB
294 *MFBOpen(TerminalName,DeviceName,errorcode)
295 char *TerminalName;
296 char *DeviceName;
297 int *errorcode;
298  /*
299  * Notes:
300  * Called to initialize a graphics terminal. The character
301  * function MFBError(errnum) returns a pointer to a string
302  * describing the error.
303  *
304  * TerminalName is the name used in the MFBCAP file.
305  *
306  * DeviceName is a pointer to a string which specifies the name
307  * of the output device. If DeviceName is a null string,the
308  * current device is assumed (i.e. filedesc = 1, for UNIX).
309  * To avoid output to a tty through stdio, use DeviceName ==
310  * ttyname(fileno(stdout))
311  *
312  * errorcode returns an integer specifying the type of error,if
313  * any,which occurs during mfb initialization.
314  *
315  */
316 {
317  char *MFBGetStr();
318  char *getenv();
319 #ifndef vms
320  char *ttyname();
321 #endif
322  char *mfbcapFile;
323  char *bufPtr;
324  char buf[256], *s, *r;
325  char *cp_tildexpand(), *copy();
326  MFB *mfb;
327  int i;
328  FILE *fp;
329 
330  if((mfbcapFile = getenv("MFBCAP")) == NULL)
331  mfbcapFile = Default_MFB_Cap;
332  mfbcapFile = cp_tildexpand(mfbcapFile);
333 
334  if (!(mfb = (MFB *)malloc(sizeof(MFB))))
335  return (NULL);
336  mfb->terminalName = TerminalName;
337  SetCurrentMFB(mfb);
338 
339  if((*errorcode = MFBGetEnt(gEntBuf,TerminalName,mfbcapFile)) <= 0) {
340  /* Don't free the MFB because User may use it for Terminal Name. */
341  return(NULL);
342  }
343 
344  bufPtr = mfb->strBuf;
345 
346  if(MFBGetFlag("TTY")) {
347  mfb->deviceType = TTY;
348  if(DeviceName == NULL || *DeviceName == 0) {
349 #ifdef vms
350  dev_open(DeviceName,&mfb->fileDesc);
351  mfb->name = getenv("TERM");
352 #else
353  mfb->fileDesc = 1;
354  mfb->name = ttyname(2); /* stdout */
355 #endif
356  }
357  else{
358 #ifdef vms
359  dev_open(DeviceName,&mfb->fileDesc);
360 #else
361  /* try to create the file if does not exist */
362  if(close(creat(DeviceName,0644)) < 0){
363  *errorcode = MFBBADDEV;
364  return(NULL);
365  }
366 
367  if((mfb->fileDesc = open(DeviceName,2)) < 0){
368  *errorcode = MFBBADDEV;
369  return(NULL);
370  }
371 #endif
372  mfb->name = DeviceName;
373  }
374 
375 #ifdef DEBUG
376  MFBZeroCounters();
377 #endif
378 
379  /*
380  * Fill up mfb structure from mfbcap entry
381  */
382  mfb->litout = (Bool)MFBGetFlag("8BB");
383  mfb->raw = (Bool)MFBGetFlag("RAW");
384  mfb->strings.startSequence = MFBGetStr("GIS",&bufPtr);
385  mfb->strings.endSequence = MFBGetStr("GFS",&bufPtr);
386 
387  mfb->maxX = MFBGetNum("MXC");
388  mfb->maxY = MFBGetNum("MYC");
389  mfb->strings.initLineStyles = MFBGetStr("ILS",&bufPtr);
390  mfb->strings.initColorStyles = MFBGetStr("ICS",&bufPtr);
391  mfb->strings.initFillPatterns = MFBGetStr("IFP",&bufPtr);
392 
393  /*
394  * graphics text info
395  */
396  mfb->textPositionableBool = (Bool)MFBGetFlag("APT");
397  mfb->textRotateBool = (Bool)MFBGetFlag("ROT");
398  mfb->strings.rotateTextSequence = MFBGetStr("RTS",&bufPtr);
399  mfb->fontHeight = MFBGetNum("GCH");
400  mfb->fontWidth = MFBGetNum("GCW");
401  mfb->fontXOffset = MFBGetNum("GTW");
402  mfb->fontYOffset = MFBGetNum("GTH");
403  mfb->strings.graphicsTextStart = MFBGetStr("GTS",&bufPtr);
404  mfb->strings.graphicsTextEnd = MFBGetStr("GTE",&bufPtr);
405  mfb->replaceTextBool = (Bool)MFBGetFlag("GTR");
406  mfb->strings.replaceON = MFBGetStr("RMO",&bufPtr);
407  mfb->overstrikeTextBool = (Bool)MFBGetFlag("GTO");
408  mfb->strings.overstrikeON = MFBGetStr("OMO",&bufPtr);
409  mfb->strings.writePixel = MFBGetStr("WPX",&bufPtr);
410 
411  /*
412  * raster operations
413  */
414  mfb->minOffScreenX = MFBGetNum("OFFMX");
415  mfb->minOffScreenY = MFBGetNum("OFFMY");
416  mfb->offScreenDX = MFBGetNum("OFFDX");
417  mfb->offScreenDY = MFBGetNum("OFFDY");
418  mfb->rastRSCSFBool = (Bool)MFBGetFlag("RSCSF");
419  mfb->strings.rastCopyStart = MFBGetStr("RSCPS",&bufPtr);
420  mfb->strings.rastCopyEnd = MFBGetStr("RSCPE",&bufPtr);
421  mfb->strings.rastCopySource = MFBGetStr("RSSRC",&bufPtr);
422  mfb->strings.rastCopyDest = MFBGetStr("RSDST",&bufPtr);
423  if(mfb->strings.rastCopyStart == NULL ||
424  *mfb->strings.rastCopyStart == 0)
425  mfb->rastCopyBool = false;
426  else
427  mfb->rastCopyBool = true;
428 
429  /*
430  * display color (intensity) control
431  */
432  mfb->maxColors = MFBGetNum("MCL");
433  mfb->strings.screenFlood = MFBGetStr("GCS",&bufPtr);
434  mfb->maxIntensity = MFBGetNum("VTI");
435  mfb->vltBool = (Bool)MFBGetFlag("VLT");
436  mfb->vltUseHLSBool = (Bool)MFBGetFlag("HLS");
437  if(mfb->vltBool) {
438  mfb->lengthOfVLT = MFBGetNum("VTL");
439  mfb->strings.vltEntry = MFBGetStr("VTE",&bufPtr);
440  }
441  mfb->strings.setForegroundColor = MFBGetStr("SCS",&bufPtr);
442  mfb->strings.channelMaskSet = MFBGetStr("VWM",&bufPtr);
443  if(mfb->strings.channelMaskSet == NULL ||
444  *mfb->strings.channelMaskSet == 0)
445  mfb->channelMaskBool = false;
446  else
447  mfb->channelMaskBool = true;
448  mfb->strings.readMaskSet = MFBGetStr("SRM",&bufPtr);
449  if(mfb->strings.readMaskSet == NULL ||
450  *mfb->strings.readMaskSet == 0)
451  mfb->readMaskBool = false;
452  else
453  mfb->readMaskBool = true;
454 
455  /*
456  * graphics input (pointing device) control
457  */
458  mfb->PointingDeviceBool = (Bool)MFBGetFlag("POD");
459  if(mfb->PointingDeviceBool){
460  mfb->buttonsBool = (Bool)MFBGetFlag("PDB");
461  if(mfb->buttonsBool){
462  mfb->numberOfButtons = MFBmin(MFBGetNum("NPB"),12);
463  mfb->buttonMask[0] = MFBGetNum("BU1");
464  mfb->buttonMask[1] = MFBGetNum("BU2");
465  mfb->buttonMask[2] = MFBGetNum("BU3");
466  mfb->buttonMask[3] = MFBGetNum("BU4");
467  mfb->buttonMask[4] = MFBGetNum("BU5");
468  mfb->buttonMask[5] = MFBGetNum("BU6");
469  mfb->buttonMask[6] = MFBGetNum("BU7");
470  mfb->buttonMask[7] = MFBGetNum("BU8");
471  mfb->buttonMask[8] = MFBGetNum("BU9");
472  mfb->buttonMask[9] = MFBGetNum("BU10");
473  mfb->buttonMask[10] = MFBGetNum("BU11");
474  mfb->buttonMask[11] = MFBGetNum("BU12");
475  /* -1 flags an unused and inapplicable button mask */
476  for(i = mfb->numberOfButtons; i < 12; ++i)
477  mfb->buttonMask[i] = -1;
478  }
479  mfb->readImmediateBool = (Bool)MFBGetFlag("PRI");
480  mfb->strings.enablePointingDevice = MFBGetStr("PDS",&bufPtr);
481  mfb->strings.disablePointingDevice = MFBGetStr("PDE",&bufPtr);
482  mfb->strings.enableRubberBanding = MFBGetStr("PRBON",&bufPtr);
483  mfb->strings.disableRubberBanding = MFBGetStr("PRBOFF",&bufPtr);
484  mfb->strings.readPointingDevice = MFBGetStr("PDR",&bufPtr);
485  mfb->strings.formatPointingDevice = MFBGetStr("PDF",&bufPtr);
486  }
487 
488  /*
489  * keyboard control
490  */
491  mfb->keyboardBool = (Bool)MFBGetFlag("KYBRD");
492  mfb->strings.keyboardStart = MFBGetStr("KYS",&bufPtr);
493  mfb->strings.keyboardEnd = MFBGetStr("KYE",&bufPtr);
494  mfb->strings.keyboardBackspace = MFBGetStr("KYB",&bufPtr);
495  mfb->keyboardXOffset = MFBGetNum("KYX");
496  mfb->keyboardYOffset = MFBGetNum("KYY");
497  mfb->strings.audio = MFBGetStr("BELL",&bufPtr);
498 
499  /*
500  * blinker control
501  */
502  mfb->blinkersBool = (Bool)MFBGetFlag("BLD");
503  mfb->maxBlinkers = MFBGetNum("NBL");
504  mfb->numBlinkers = 0;
505  mfb->strings.blinkerON = MFBGetStr("BLS",&bufPtr);
506  mfb->strings.blinkerOFF = MFBGetStr("BLE",&bufPtr);
507 
508  /*
509  * line geometry control
510  */
511  mfb->maxLineStyles = MFBGetNum("MLS");
512  mfb->reissueLineStyleBool = (Bool)MFBGetFlag("RLS");
513  mfb->linePatternDefineBool = (Bool)MFBGetFlag("DLP");
514  mfb->strings.setLineStyle = MFBGetStr("SLS",&bufPtr);
515  mfb->strings.setSolidLineStyle = MFBGetStr("SSLS",&bufPtr);
516  mfb->strings.movePenSequence = MFBGetStr("MPS",&bufPtr);
517  mfb->strings.drawLineSequence = MFBGetStr("DLS",&bufPtr);
518  mfb->strings.drawSolidLineSequence = MFBGetStr("DSL",&bufPtr);
519  mfb->strings.drawLineToSequence = MFBGetStr("DLT",&bufPtr);
520  mfb->strings.drawSolidLineToSequence = MFBGetStr("DSLT",&bufPtr);
521  if(mfb->linePatternDefineBool) {
522  mfb->strings.lineDefineStart = MFBGetStr("LDS",&bufPtr);
523  mfb->strings.lineDefineFormat = MFBGetStr("LDF",&bufPtr);
524  mfb->strings.lineDefineEnd = MFBGetStr("LDE",&bufPtr);
525  mfb->lineDefineLength = MFBGetNum("LDL");
526  }
527 
528  /*
529  * box geometry control
530  */
531  mfb->strings.drawBoxSequence = MFBGetStr("DBS",&bufPtr);
532  mfb->strings.drawSolidBoxSequence = MFBGetStr("DSB",&bufPtr);
533 
534  /*
535  * polygon geometry control
536  */
537  mfb->filledPlygnBool = (Bool)MFBGetFlag("FPOLY");
538  mfb->strings.beginPlygnSequence = MFBGetStr("PLS",&bufPtr);
539  mfb->strings.beginSolidPlygnSequence = MFBGetStr("PLSOL",&bufPtr);
540  mfb->strings.sendPlygnVertex = MFBGetStr("PLV",&bufPtr);
541  mfb->strings.endPlygnSequence = MFBGetStr("PLE",&bufPtr);
542 
543  /*
544  * fill pattern control
545  */
546  mfb->maxFillPatterns = MFBGetNum("MFP");
547  mfb->fillPtrnDefineBool = (Bool)MFBGetFlag("DFP");
548  mfb->strings.setFillPattern = MFBGetStr("SFP",&bufPtr);
549  mfb->strings.setSolidFillPattern = MFBGetStr("SSFP",&bufPtr);
550  if(mfb->fillPtrnDefineBool) {
551  mfb->fillDefineHeight = MFBGetNum("FDH");
552  mfb->fillDefineWidth = MFBGetNum("FDW");
553  mfb->fillDefineRowMajorBool = (Bool)MFBGetFlag("FDR");
554  mfb->strings.fillDefineStart = MFBGetStr("FDS",&bufPtr);
555  mfb->strings.fillDefineFormat = MFBGetStr("FDF",&bufPtr);
556  mfb->strings.fillDefineEnd = MFBGetStr("FDE",&bufPtr);
557  }
558 
559  /*
560  * Circle geometry control
561  */
562  mfb->strings.drawCircleSequence = MFBGetStr("DCS",&bufPtr);
563 
564  /*
565  * ALU modes
566  */
567  mfb->strings.setALUJAM = MFBGetStr("ALUJAM",&bufPtr);
568  mfb->strings.setALUOR = MFBGetStr("ALUOR",&bufPtr);
569  mfb->strings.setALUNOR = MFBGetStr("ALUNOR",&bufPtr);
570  mfb->strings.setALUEOR = MFBGetStr("ALUEOR",&bufPtr);
571 
572  /*
573  * set defaults in mfb tty structure
574  */
575  mfb->cursorColor1Id = 0;
576  mfb->cursorColor2Id = 1;
577  mfb->fgColorId = UNINITIALIZED;
578  mfb->fillPattern = UNINITIALIZED;
579  mfb->lineStyle = UNINITIALIZED;
580  mfb->channelMask = UNINITIALIZED;
581  mfb->readMask = UNINITIALIZED;
582  mfb->textMode = UNINITIALIZED;
583 
584  /*this is changed by MFBInitialize*/
585  mfb->ttyIsSet = false;
586 
587  mfb->lastX = -1;
588  mfb->lastY = -1;
589  }
590  else{
591  /*
592  * Hardcopy devices not yet implemented.
593  */
594  mfb->deviceType = HCOPY;
595  }
596 
597  /*
598  * Now try to initialize everything,return status.
599  */
600  *errorcode = MFBInitialize();
601  mfb->initializedBool = true;
602 
603  return(mfb);
604 }
605 
606 
607 int
609  /*
610  * Notes:
611  * Called to reinitialize a graphics terminal.
612  * TTY mode is reset if necessary (UNIX only).
613  */
614 {
615  int i;
616 
617  if(MFBCurrent->deviceType == TTY) {
618  i = MFBInitTTY();
619  if(i < 0)
620  return(i);
621 
622  /*
623  * Output initialization start string
624  */
625  MFBGenCode(MFBFORMAT.startSequence);
626 
627  /*
628  * Flush the buffer
629  */
630  MFBUpdate();
631 
632  /*
633  * Output initialization
634  */
635  MFBGenCode(MFBFORMAT.initLineStyles);
636  MFBGenCode(MFBFORMAT.initColorStyles);
637  MFBGenCode(MFBFORMAT.initFillPatterns);
638  MFBCurrent->lastX = -1;
639  MFBCurrent->lastY = -1;
640 
641  /*
642  * And flush the buffer again
643  */
644  MFBUpdate();
645  return(MFBOK);
646  } else{
647  return(MFBOK);
648  }
649 }
650 
651 
652 int
654 {
655  /*
656  * Notes:
657  * Initialize TTY and save current state in MFB structure.
658  * Also,the output buffer is flushed.
659  */
660  long litout = 1;
661 
662  if(MFBCurrent->deviceType != TTY)
663  return(MFBBADTTY);
665  if(!MFBCurrent->ttyIsSet) {
666  if(*MFBCurrent->name == 0) { /* => stdout not in /dev */
667  return(MFBBADTTY);
668  }
669  /*
670  * Set keyboard tty options if necessary.
671  * We put the terminal in CBREAK so that any keyboard
672  * input will be echoed on the graphics display.
673  */
674 
675  /* the isatty() is necessary because user may be piping output */
676  if(MFBCurrent->fileDesc != 1 && isatty(1)){
677  /*
678  * Disable user messages by changing the fstats of stdin.
679  * Yes, this is necessary; the user may open his own terminal
680  * as the graphics device in which case user messages will
681  * still interrupt the graphics via stdio.
682  */
683  if(fstat(1,&MFBCurrent->oldstat.kybrdstat) < 0)
684  return(MFBBADOPT);
685  /* 0022 corresponds to write by group and others */
686  /* This is bad -- Wayne
687  if(chmod(ttyname(2),MFBCurrent->oldstat.kybrdstat.st_mode & ~0022)
688  < 0) return(MFBBADOPT);
689  */
690  if(ioget(1, &MFBCurrent->kybrdTtyb.oldttyb) < 0)
691  return(MFBBADOPT);
692  if(iogetl(1, &MFBCurrent->oldstat.kybrdttyw) < 0)
693  return(MFBBADOPT);
695 
696  iosetmfb_flags(MFBCurrent->kybrdTtyb.newttyb);
697 #ifdef notdef
698  MFBCurrent->kybrdTtyb.newttyb.sg_erase = 8; /* ctrl-h */
699  MFBCurrent->kybrdTtyb.newttyb.sg_kill = 24; /* ctrl-x */
700 #endif
701  if(ioset(1, &MFBCurrent->kybrdTtyb.newttyb) < 0)
702  return(MFBBADOPT);
703  }
704  /*
705  * Set graphics device tty options
706  */
707 
708  /* the isatty() is necessary because user may be piping output */
709  if(isatty(MFBCurrent->fileDesc)){
710  /* Disable user messages */
711  if(stat(MFBCurrent->name,&MFBCurrent->oldstat.graphstat) < 0)
712  return(MFBBADOPT);
713  /* 0022 corresponds to write by group and others */
714  /*
715  if(chmod(MFBCurrent->name,
716  MFBCurrent->oldstat.graphstat.st_mode & ~0022) < 0)
717  return(MFBBADOPT);
718  */
719  if(ioget(MFBCurrent->fileDesc, &MFBCurrent->graphTtyb.oldttyb) < 0)
720  return(MFBBADOPT);
721  if(iogetl(MFBCurrent->fileDesc, &MFBCurrent->oldstat.graphttyw) < 0)
722  return(MFBBADOPT);
723 
725  iosetmfb_flags(MFBCurrent->graphTtyb.newttyb);
726 #ifdef notdef
727  /* Speed should not be messed with */
728  if(MFBCurrent->fileDesc != 1){
729  if(MFBCurrent->graphTtyb.newttyb.sg_ispeed < B1200)
730  MFBCurrent->graphTtyb.newttyb.sg_ispeed = B9600;
731  if(MFBCurrent->graphTtyb.newttyb.sg_ospeed < B1200)
732  MFBCurrent->graphTtyb.newttyb.sg_ospeed = B9600;
733  }
734 #endif
735  if(MFBCurrent->litout){
736  if (iolitout(MFBCurrent->fileDesc,
738  return(MFBBADOPT);
739  }
740  if(MFBCurrent->raw)
741  iosetraw(MFBCurrent->graphTtyb.newttyb);
742 #ifdef notdef
743  /* XXX No one should be doing this */
744  MFBCurrent->graphTtyb.newttyb.sg_erase = 8; /* ctrl-h */
745  MFBCurrent->graphTtyb.newttyb.sg_kill = 24; /* ctrl-x */
746 #endif
747  if(ioset(MFBCurrent->fileDesc, &MFBCurrent->graphTtyb.newttyb) < 0)
748  return(MFBBADOPT);
749  }
757  }
758  else{
761  }
762  MFBCurrent->ttyIsSet = true;
763  }
764  return(MFBOK);
765 }
766 
767 
768 
769 
770 
771 
772 /*****************************************************************************
773  *
774  * TERMINATION ROUTINES
775  *
776  *****************************************************************************/
777 
778 int
780  /*
781  * Notes:
782  * Called to end the graphics sequence. Must be last procedure
783  * invoked because it frees the MFB struct.
784  */
785 
786  /*
787  * Flush the buffer
788  */
789  MFBUpdate();
791  free((char *) MFBCurrent);
792  return(MFBOK);
793  }
794 
795  /*
796  * Put terminal in the state that existed before MFBOpen
797  */
798  if(MFBCurrent->deviceType == TTY) {
799  /*
800  * Output initialization end string
801  */
802  MFBGenCode(MFBFORMAT.endSequence);
803 
804  /*
805  * Flush the buffer
806  */
807  MFBUpdate();
808 
809 #if defined(HAVE_SGTTY_H) || defined(HAVE_TERMIO_H)
810  /*
811  * Reset graphics tty options
812  *
813  * NOTE: we must reset these options in just the opposite order
814  * in which they were set. The user might have opened his own
815  * terminal, in which case the fileDesc is not unity, but we
816  * are still setting the standard i/o device.
817  */
818 
819  /* the isatty() is necessary because user may be piping output */
820  if(isatty(MFBCurrent->fileDesc)){
821  /*
822  if(chmod(MFBCurrent->name,
823  MFBCurrent->oldstat.graphstat.st_mode) < 0) return(MFBBADOPT);
824  */
825  if(ioset(MFBCurrent->fileDesc, &MFBCurrent->graphTtyb.oldttyb) < 0)
826  return(MFBBADOPT);
827  if(iosetl(MFBCurrent->fileDesc, &MFBCurrent->oldstat.graphttyw) < 0)
828  return(MFBBADOPT);
829  }
830 
831  /* the isatty() is necessary because user may be piping output */
832  if(MFBCurrent->fileDesc != 1 && isatty(1)){
833  /*
834  if(chmod(ttyname(2),MFBCurrent->oldstat.kybrdstat.st_mode) < 0)
835  return(MFBBADOPT);
836  */
837  if (ioset(1, &MFBCurrent->kybrdTtyb.oldttyb) < 0)
838  return(MFBBADOPT);
839  if (iosetl(1, &MFBCurrent->oldstat.kybrdttyw) < 0)
840  return(MFBBADOPT);
841  return(MFBBADOPT);
842  }
843 #endif
844 
845  /*
846  * don't close stdout
847  */
848  if(MFBCurrent->fileDesc != 1)
849  if(close(MFBCurrent->fileDesc) < 0)
850  return(MFBBADDEV);
851  }
852 
853  /*
854  * Deinitialize the mfb structure
855  */
856  MFBCurrent->initializedBool = false;
857  free((char *) MFBCurrent);
858  return(MFBOK);
859 }
860 
861 
862 int
864 {
865  /*
866  * Notes:
867  * Called to disable the graphics sequence.
868  * Has same effect as MFBHalt, except that the MFBCurrent is not freed.
869  *
870  * PERFECT FOR SUSPENDING A JOB IN UNIX!
871  */
872 
873 
874  /*
875  * Put terminal in the state that existed before MFBOpen
876  */
877  if(MFBCurrent->deviceType == TTY) {
878  /*
879  * Clear the output buffer
880  */
881  MFBUpdate();
882 
883  /*
884  * Output initialization end string
885  */
886  MFBGenCode(MFBFORMAT.endSequence);
887 
888  /*
889  * Flush the buffer
890  */
891  MFBUpdate();
892 
893 #if defined(HAVE_SGTTY_H) || defined(HAVE_TERMIO_H)
894  /*
895  * Reset graphics tty options
896  *
897  * NOTE: we must reset these options in just the opposite order
898  * in which they were set. The user might have opened his own
899  * terminal, in which case the fileDesc is not unity, but we
900  * are still setting the standard i/o device.
901  */
902 
903  /* the isatty() is necessary because user may be piping output */
904  if(isatty(MFBCurrent->fileDesc)){
905  /*
906  if(chmod(MFBCurrent->name,
907  MFBCurrent->oldstat.graphstat.st_mode) < 0) return(MFBBADOPT);
908  */
909  if(ioset(MFBCurrent->fileDesc, &MFBCurrent->graphTtyb.oldttyb) < 0)
910  return(MFBBADOPT);
911  if(iosetl(MFBCurrent->fileDesc, &MFBCurrent->oldstat.graphttyw) < 0)
912  return(MFBBADOPT);
913  }
914 
915  /* the isatty() is necessary because user may be piping output */
916  if(MFBCurrent->fileDesc != 1 && isatty(1)){
917  /*
918  if(chmod(ttyname(2),MFBCurrent->oldstat.kybrdstat.st_mode) < 0)
919  return(MFBBADOPT);
920  */
921  if(ioset(1, &MFBCurrent->kybrdTtyb.oldttyb) < 0)
922  return(MFBBADOPT);
923  if(iosetl(1, &MFBCurrent->oldstat.kybrdttyw) < 0)
924  return(MFBBADOPT);
925  }
926 #endif
927  MFBCurrent->ttyIsSet = false;
928  }
929  return(MFBOK);
930 }
931 
932 
933 
934 
935 
936  /*****************************************************************************
937  *
938  * INPUT ROUTINES
939  *
940  *****************************************************************************/
941 
942 int
943 MFBPoint(x,y,key,button)
944 int *x,*y,*key,*button;
945  /*
946  * Notes:
947  * None at this time.
948  */
949 {
950  int status;
951  int retrnd;
952 
954  return(MFBNOPNT);
955  if((retrnd = MFBFlushInput()) < 0)
956  return(retrnd);
957  /*
958  * Enable Pointing Device
959  */
962  MFBGenCode(MFBFORMAT.enablePointingDevice);
963  MFBCurrent->X = MFBCurrent->Y = -1;
964  MFBCurrent->Z = MFBCurrent->T = 0;
965 
966  /*
967  * If Read Will Cause Immediate Transfer,Wait For a Character
968  */
970  MFBUpdate();
972  }
973 
974  /*
975  * Trigger Pointing Device Read
976  */
977  MFBGenCode(MFBFORMAT.readPointingDevice);
978 
979  /*
980  * And Flush The Buffer
981  */
982  MFBUpdate();
983 
984  /*
985  * Read and Format Cursor Data
986  */
987  /* MFBDecode returns >= 0 if OK, character barfed on if ERROR. */
988  status = MFBDecode(MFBFORMAT.formatPointingDevice);
989  *button = MFBCurrent->T;
990  *key = MFBCurrent->Z;
991  *x = MFBCurrent->X;
992  *y = MFBCurrent->Y;
993 
994  /*
995  * Disable Pointing Device
996  */
997  MFBGenCode(MFBFORMAT.disablePointingDevice);
998 
999  /*
1000  * MFBPoint may destroy last x/y,so be safe about it.
1001  */
1002  MFBCurrent->lastX = MFBCurrent->lastY = -1;
1003 
1004  if((retrnd = MFBFlushInput()) < 0)
1005  return(retrnd);
1006  if(status >= 0) {
1007  /* character returned */
1008  *key = status;
1009  return(MFBOK);
1010  }
1011  else if(status == MFBCAPNOFORMAT)
1012  return(MFBNOPTFT);
1013  else if(status == MFBCAPOK)
1014  return(MFBOK);
1015  else
1016  return(MFBPNTERR);
1017 }
1018 
1019 
1020 char
1021 *MFBKeyboard(x,y,background,foreground)
1022 int x,y;
1023 int background;
1024 int foreground;
1025 {
1026  /*
1027  * Notes:
1028  * Read type-in from keyboard until user types return key.
1029  * Do rub-out processing--rub out and ctrl-h keys.
1030  */
1031  int Int1;
1032  int X,Y;
1033  int MaxX,MaxY;
1034  int OldTextMode;
1035  int OldForeground;
1036  int OldFillPattern;
1037  static char MFBTypeIn[161];
1038  char c[2];
1039 
1040  if(MFBCurrent->deviceType != TTY)
1041  return(NULL);
1042  Int1 = 0;
1043  c[1] = 0;
1044  OldTextMode = MFBCurrent->textMode;
1045  OldForeground = MFBCurrent->fgColorId;
1046  OldFillPattern = MFBCurrent->fillPattern;
1047  MFBSetFillPattern(0);
1048  MFBSetTextMode(true);
1049  MFBSetColor(foreground);
1050  if(MFBFORMAT.keyboardStart == NULL ||
1051  *MFBFORMAT.keyboardStart == 0) {
1052  /*
1053  * NAIVE KEYBOARD
1054  */
1056  return(NULL);
1059  /* echo characters using graphtext */
1060  X = x + MFBCurrent->keyboardXOffset;
1061  Y = y + MFBCurrent->keyboardYOffset;
1062  for(;;){
1064  MFBUpdate();
1065  if((*c = (*MFBCurrent->kybrd_getchar)()) == 13 || *c == 10){
1066  MFBTypeIn[Int1] = 0;
1067  break;
1068  }
1069  else if(*c == 8 || *c == 0177){ /* ctrl-h or del */
1071  if(Int1 > 0){ /* can't bs further . . . */
1072  MFBSetColor(background);
1078  MFBSetColor(foreground);
1080  Int1--;
1081  }
1082  }
1083  else if(*c == 24 || *c == 21){ /* ctrl-x or ctrl-u */
1084  MFBSetColor(background);
1089  MFBSetColor(foreground);
1090  X = x + MFBCurrent->keyboardXOffset;
1091  Int1 = 0;
1092  }
1093  else if(*c == 27){ /* esc */
1094  MFBText(" ESCAPE",X,Y,0);
1095  MFBTypeIn[0] = 0;
1096  Int1 = 0;
1097  break;
1098  } else{
1099  MFBTypeIn[Int1++] = *c;
1100  X = MFBmin(MaxX,X);
1101  Y = MFBmin(MaxY,Y);
1102  if(*c >= ' ' && *c <= '~')
1103  MFBText(c,X,Y,0);
1104  else
1105  MFBText("^",X,Y,0);
1106  }
1107  }
1108  }
1109  else {
1112  MFBGenCode(MFBFORMAT.keyboardStart);
1113  MFBPutchar(' ');
1114  for(;;){
1115  MFBPutchar(' ');
1116  MFBGenCode(MFBFORMAT.keyboardBackspace);
1117  MFBUpdate();
1118  if((*c = (*MFBCurrent->kybrd_getchar)()) == 13 || *c == 10){
1119  MFBTypeIn[Int1] = 0;
1120  break;
1121  }
1122  else if(*c == 8 || *c == 0177){
1123  if(Int1 == 0) /* can't bs further . . . */
1124  MFBPutchar(7);
1125  else{
1126  MFBPutchar(' ');
1127  MFBGenCode(MFBFORMAT.keyboardBackspace);
1128  MFBGenCode(MFBFORMAT.keyboardBackspace);
1129  Int1--;
1130  }
1131  }
1132  else if(*c == 24 || *c == 21){ /* ctrl-x or ctrl-u */
1133  for(; Int1 > 0; Int1--){
1134  MFBPutchar(' ');
1135  MFBGenCode(MFBFORMAT.keyboardBackspace);
1136  MFBGenCode(MFBFORMAT.keyboardBackspace);
1137  }
1138  MFBPutchar(' ');
1139  MFBGenCode(MFBFORMAT.keyboardBackspace);
1140  }
1141  else if(*c == 27){ /* esc */
1142  MFBTypeIn[0] = 0;
1143  break;
1144  }
1145  else{
1146  MFBTypeIn[Int1++] = *c;
1147  if(*c >= ' ' && *c <= '~')
1148  MFBPutchar(*c);
1149  else
1150  MFBPutchar('^');
1151  }
1152  }
1153  MFBGenCode(MFBFORMAT.keyboardEnd);
1154  }
1155  MFBSetTextMode(OldTextMode);
1156  MFBSetColor(OldForeground);
1157  MFBSetFillPattern(OldFillPattern);
1158  /*
1159  * MFBKeyboard may destroy last x/y,so be safe about it.
1160  */
1161  MFBCurrent->lastX = MFBCurrent->lastY = -1;
1162 
1163  return(MFBTypeIn);
1164 }
1165 
1166 
1167 
1168 
1169 
1170 
1171 /*****************************************************************************
1172  *
1173  * ERROR HANDLING ROUTINES
1174  *
1175  *****************************************************************************/
1176 
1177 char *
1179 int errnum;
1180 {
1181  int i;
1182  static char result[200];
1183  for(i = 0; i < NUMERRORS; i++) {
1184  if(errors[i].errnum == errnum) {
1185  (void) strcpy(result,errors[i].message);
1186  return(result);
1187  }
1188  }
1189  (void) sprintf(result,"Illegal Error Number %d in MFBError!",errnum);
1190  return(result);
1191 }
1192 
int maxFillPatterns
Definition: mfb.h:262
#define MFBTMBLNK
Definition: mfb.h:507
char * drawBoxSequence
Definition: mfb.h:177
char * channelMaskSet
Definition: mfb.h:151
static char buf[MAXPROMPT]
Definition: arg.c:18
#define MFBFORMAT
Definition: mfbio.c:79
Bool textRotateBool
Definition: mfb.h:333
int lineStyle
Definition: mfb.h:269
int offScreenDX
Definition: mfb.h:230
int OldGetchar()
Definition: mfbio.c:189
int keyboardYOffset
Definition: mfb.h:242
char ttyBuffer[TTYBUFSIZE]
Definition: mfb.h:377
#define MFBNOBLNK
Definition: mfb.h:506
char gEntBuf[BUFSIZE]
Definition: mfb.h:86
struct stat graphstat
Definition: mfb.h:135
char * screenFlood
Definition: mfb.h:149
#define MFBBADMCF
Definition: mfb.h:493
#define MFBBADTM1
Definition: mfb.h:501
char * cp_tildexpand()
char * enableRubberBanding
Definition: mfb.h:155
int maxLineStyles
Definition: mfb.h:247
Bool keyboardBool
Definition: mfb.h:322
int(* outstr)()
Definition: mfb.h:300
char * Default_MFB_Cap
Definition: ivars.c:13
Bool readMaskBool
Definition: mfb.h:314
MFBSAVETTYB kybrdTtyb
Definition: mfb.h:366
char * lineDefineStart
Definition: mfb.h:166
int MFBGetEnt()
char * fillDefineEnd
Definition: mfb.h:209
int kybrdttyw
Definition: mfb.h:134
int MFBGetFlag()
#define MFBNODFLP
Definition: mfb.h:503
char * strcpy()
int graphttyw
Definition: mfb.h:133
#define MFBPNTERR
Definition: mfb.h:512
Definition: cddefs.h:119
struct err errors[]
Definition: mfbio.c:81
#define NUMERRORS
Definition: mfbio.c:110
int MFBGetchar()
Definition: mfbio.c:158
#define HCOPY
Definition: mfb.h:38
int numTtyBuffer
Definition: mfb.h:277
int errnum
Definition: mfb.h:384
#define MFBBADDEV
Definition: mfb.h:509
int readMask
Definition: mfb.h:271
int lineDefineLength
Definition: mfb.h:246
char * replaceON
Definition: mfb.h:190
int numberOfButtons
Definition: mfb.h:239
int maxIntensity
Definition: mfb.h:234
#define MFBOK
Definition: mfb.h:491
char * audio
Definition: mfb.h:164
int(* kybrd_ungetchar)()
Definition: mfb.h:298
int newttyb
Definition: mfb.h:125
int MFBSetTextMode()
int MFBFlushInput()
Definition: mfbio.c:240
int fillDefineWidth
Definition: mfb.h:261
int T
Definition: mfb.h:222
char * keyboardBackspace
Definition: mfb.h:163
int fillDefineHeight
Definition: mfb.h:260
Bool initializedBool
Definition: mfb.h:306
struct mfbformatstrs strings
Definition: mfb.h:357
MFBPutstr(char *c, int n)
Definition: mfbio.c:135
char * malloc()
char * rastCopyEnd
Definition: mfb.h:203
#define MFBBADCST
Definition: mfb.h:500
#define MFBBADTM2
Definition: mfb.h:502
int fgColorId
Definition: mfb.h:267
char * disableRubberBanding
Definition: mfb.h:157
int Y
Definition: mfb.h:222
char * rastCopyDest
Definition: mfb.h:204
int fontWidth
Definition: mfb.h:251
int lastX
Definition: mfb.h:221
#define MFBNOPNT
Definition: mfb.h:514
#define MFBCAPOK
Definition: mfb.h:392
char * drawLineSequence
Definition: mfb.h:172
char * vltEntry
Definition: mfb.h:147
int keyboardXOffset
Definition: mfb.h:243
MFBPutchar(char c)
Definition: mfbio.c:121
int maxColors
Definition: mfb.h:227
char * name
Definition: mfb.h:291
Bool buttonsBool
Definition: mfb.h:318
int minOffScreenX
Definition: mfb.h:228
char * setLineStyle
Definition: mfb.h:169
int MFBUngetchar()
Definition: mfbio.c:182
Bool litout
Definition: mfb.h:349
char * copy()
#define MFBBADFST
Definition: mfb.h:499
char * getenv(char *c)
Definition: libfuncs.c:106
char * rastCopyStart
Definition: mfb.h:202
char * graphicsTextEnd
Definition: mfb.h:189
char * setFillPattern
Definition: mfb.h:210
MFBSAVESTAT oldstat
Definition: mfb.h:369
void MFBAudio()
Definition: mfbio.c:265
Bool channelMaskBool
Definition: mfb.h:313
int Z
Definition: mfb.h:222
Bool linePatternDefineBool
Definition: mfb.h:325
char * MFBError(int errnum)
Definition: mfbio.c:1178
int fontXOffset
Definition: mfb.h:252
int MFBUpdate()
Definition: mfbio.c:219
long X
Definition: actions.c:450
Bool textPositionableBool
Definition: mfb.h:332
void SetCurrentMFB(MFB *mfb)
Definition: mfbbasic.c:198
char * setALUEOR
Definition: mfb.h:194
Bool vltUseHLSBool
Definition: mfb.h:310
char * endSequence
Definition: mfb.h:142
Bool
Definition: mfb.h:18
Definition: mfb.h:215
char * sendPlygnVertex
Definition: mfb.h:182
char * drawSolidBoxSequence
Definition: mfb.h:178
char * drawCircleSequence
Definition: mfb.h:185
int fileDesc
Definition: mfb.h:276
char * setSolidFillPattern
Definition: mfb.h:211
char * beginSolidPlygnSequence
Definition: mfb.h:181
int maxX
Definition: mfb.h:225
#define MFBBADALU
Definition: mfb.h:516
MFBSAVETTYB graphTtyb
Definition: mfb.h:363
char * terminalName
Definition: mfb.h:292
void MFBText()
#define NULL
Definition: spdefs.h:121
int lastY
Definition: mfb.h:221
void MFBZeroCounters()
Definition: mfbbasic.c:213
#define MFBNOMASK
Definition: mfb.h:508
int fontYOffset
Definition: mfb.h:253
char * enablePointingDevice
Definition: mfb.h:154
char * blinkerON
Definition: mfb.h:199
MFB * MFBOpen(char *TerminalName, char *DeviceName, int *errorcode)
Definition: mfbio.c:294
#define MFBmin(a, b)
Definition: mfb.h:34
#define UNINITIALIZED
Definition: mfb.h:30
#define TTYBUFSIZE
Definition: mfb.h:84
int MFBInitialize()
Definition: mfbio.c:608
#define MFBNORBND
Definition: mfb.h:515
char * disablePointingDevice
Definition: mfb.h:156
int(* kybrd_getchar)()
Definition: mfb.h:296
char * beginPlygnSequence
Definition: mfb.h:180
int fillPattern
Definition: mfb.h:268
#define MFBNODFCO
Definition: mfb.h:505
MFBDecode(char *PM)
Definition: mfbdec.c:95
char * lineDefineFormat
Definition: mfb.h:167
char * drawSolidLineToSequence
Definition: mfb.h:175
char * rastCopySource
Definition: mfb.h:205
int MFBInitTTY()
Definition: mfbio.c:653
Bool filledPlygnBool
Definition: mfb.h:329
#define MFBBADOPT
Definition: mfb.h:510
char * setALUNOR
Definition: mfb.h:195
int fontHeight
Definition: mfb.h:250
int MFBGetNum()
char * MFBGetStr()
#define MFBBADENT
Definition: mfb.h:492
#define MFBCAPNOFORMAT
Definition: mfb.h:393
char * lineDefineEnd
Definition: mfb.h:168
int channelMask
Definition: mfb.h:270
int MFBSetColor()
static double c
Definition: vectors.c:16
int buttonMask[12]
Definition: mfb.h:238
int maxY
Definition: mfb.h:226
int oldttyb
Definition: mfb.h:125
int minOffScreenY
Definition: mfb.h:229
int MFBClose()
Definition: mfbio.c:779
char * fillDefineStart
Definition: mfb.h:207
char * setALUOR
Definition: mfb.h:196
char * endPlygnSequence
Definition: mfb.h:183
int cursorColor2Id
Definition: mfb.h:266
MFB * MFBCurrent
Definition: mfbopen.c:13
char * overstrikeON
Definition: mfb.h:191
char * blinkerOFF
Definition: mfb.h:200
void MFBGenCode(char *PM)
Definition: mfbgnc.c:99
int(* dsply_ungetchar)()
Definition: mfb.h:297
Bool ttyIsSet
Definition: mfb.h:351
int textMode
Definition: mfb.h:272
Definition: cddefs.h:177
int MFBPoint(int *x, int *y, int *key, int *button)
Definition: mfbio.c:943
MFBSetFillPattern(int styleId)
Definition: mfbbasic.c:288
char * graphicsTextStart
Definition: mfb.h:188
Bool readImmediateBool
Definition: mfb.h:319
char * setForegroundColor
Definition: mfb.h:148
int numBlinkers
Definition: mfb.h:273
int X
Definition: mfb.h:222
#define TTY
Definition: mfb.h:37
char * drawSolidLineSequence
Definition: mfb.h:173
#define MFBNOPTFT
Definition: mfb.h:513
char deviceType
Definition: mfb.h:375
char strBuf[BUFSIZE]
Definition: mfb.h:376
#define MFBNODFFP
Definition: mfb.h:504
Bool rastRSCSFBool
Definition: mfb.h:342
Bool raw
Definition: mfb.h:350
char * setSolidLineStyle
Definition: mfb.h:170
Definition: cddefs.h:162
#define MFBBADTTY
Definition: mfb.h:497
static void message(char *instr, char *outstr)
Definition: hcopy.c:13
char * readPointingDevice
Definition: mfb.h:158
int(* dsply_getchar)()
Definition: mfb.h:295
Bool reissueLineStyleBool
Definition: mfb.h:326
#define MFBBADMCE
Definition: mfb.h:495
Definition: mfb.h:383
char * formatPointingDevice
Definition: mfb.h:159
int lengthOfVLT
Definition: mfb.h:235
#define MFBBADLST
Definition: mfb.h:498
int cursorColor1Id
Definition: mfb.h:265
int maxBlinkers
Definition: mfb.h:257
#define MFBINFMCE
Definition: mfb.h:496
char * writePixel
Definition: mfb.h:192
char * keyboardStart
Definition: mfb.h:161
char * initColorStyles
Definition: mfb.h:145
char * rotateTextSequence
Definition: mfb.h:187
Bool replaceTextBool
Definition: mfb.h:334
Bool blinkersBool
Definition: mfb.h:338
Bool rastCopyBool
Definition: mfb.h:341
void MFBBox()
char * initFillPatterns
Definition: mfb.h:144
char * MFBKeyboard(int x, int y, int background, int foreground)
Definition: mfbio.c:1021
#define MFBBADWRT
Definition: mfb.h:511
char * fillDefineFormat
Definition: mfb.h:208
long Y
Definition: actions.c:450
Bool vltBool
Definition: mfb.h:309
char * keyboardEnd
Definition: mfb.h:162
char * setALUJAM
Definition: mfb.h:197
char * readMaskSet
Definition: mfb.h:152
char * startSequence
Definition: mfb.h:141
#define MFBMCELNG
Definition: mfb.h:494
int offScreenDY
Definition: mfb.h:231
int OldUngetchar()
Definition: mfbio.c:212
char * drawLineToSequence
Definition: mfb.h:174
Bool fillDefineRowMajorBool
Definition: mfb.h:346
void free()
char * initLineStyles
Definition: mfb.h:143
static int Oldsaveflg
Definition: mfbio.c:77
char * movePenSequence
Definition: mfb.h:171
static int MFBsaveflg
Definition: mfbio.c:76
Bool PointingDeviceBool
Definition: mfb.h:317
struct stat kybrdstat
Definition: mfb.h:136
int(* outchar)()
Definition: mfb.h:299
Bool fillPtrnDefineBool
Definition: mfb.h:345
Bool overstrikeTextBool
Definition: mfb.h:335
int MFBHalt()
Definition: mfbio.c:863