1: /*
   2:  * scanw and friends
   3:  *
   4:  * 1/26/81 (Berkeley) @(#)scanw.c	1.1
   5:  */
   6: 
   7: # include   "curses.ext"
   8: 
   9: /*
  10:  *	This routine implements a scanf on the standard screen.
  11:  */
  12: scanw(fmt, args)
  13: char    *fmt;
  14: int args; {
  15: 
  16:     return _sscans(stdscr, fmt, &args);
  17: }
  18: /*
  19:  *	This routine implements a scanf on the given window.
  20:  */
  21: wscanw(win, fmt, args)
  22: WINDOW  *win;
  23: char    *fmt;
  24: int args; {
  25: 
  26:     return _sscans(win, fmt, &args);
  27: }
  28: /*
  29:  *	This routine actually executes the scanf from the window.
  30:  *
  31:  *	This is really a modified version of "sscanf".  As such,
  32:  * it assumes that sscanf interfaces with the other scanf functions
  33:  * in a certain way.  If this is not how your system works, you
  34:  * will have to modify this routine to use the interface that your
  35:  * "sscanf" uses.
  36:  */
  37: _sscans(win, fmt, args)
  38: WINDOW  *win;
  39: char    *fmt;
  40: int *args; {
  41: 
  42:     char    buf[100];
  43:     FILE    junk;
  44: 
  45:     junk._flag = _IOREAD|_IOSTRG;
  46:     junk._base = junk._ptr = buf;
  47:     if (wgetstr(win, buf) == ERR)
  48:         return ERR;
  49:     junk._cnt = strlen(buf);
  50:     return _doscan(&junk, fmt, args);
  51: }

Defined functions

_sscans defined in line 37; used 4 times
scanw defined in line 12; never used
wscanw defined in line 21; never used
Last modified: 1983-05-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 562
Valid CSS Valid XHTML 1.0 Strict