home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / EEEBEL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  2.2 KB  |  132 lines

  1. /*
  2.  * eeebel.c
  3.  * contains: eeol(), ebol(), eeos(), ebos(), eline()
  4.  *
  5.  *   Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include "gfuncts.h"
  10.  
  11. /*
  12.  *  void
  13.  * eeol(void)
  14.  *
  15.  * DESCRIPTION
  16.  *  Erase to end of cursor line
  17.  *
  18.  * AUTHOR
  19.  *  ""   10-APR-1987  11:23:50.26
  20.  */
  21. void GF_CONV eeol()
  22. {
  23.     unsigned curpos;
  24.     int toclear;
  25.     
  26.     if(!_gvmtrp)
  27.         vmode(-1);
  28.     curpos=_gcurvpc();
  29.     toclear=gmaxcol-(int)(curpos&0x00ff);
  30.     if(toclear)
  31.         _wcvchr((char)' ',toclear);
  32. }
  33.  
  34. /*
  35.  *  void
  36.  * ebol(void)
  37.  *
  38.  * DESCRIPTION
  39.  *  Erase to beginning of cursor line.
  40.  *
  41.  * AUTHOR
  42.  *  David Nienhiser   10-APR-1987  11:25:49.12
  43.  */
  44. void GF_CONV ebol()
  45. {
  46.     unsigned curpos;
  47.     int toclear;
  48.     
  49.     if(!_gvmtrp)
  50.         vmode(-1);
  51.     curpos=_gcurvpc();
  52.     toclear=(int)(curpos&0x00ff)+1;
  53.     _cursetc((int)(curpos>>8)&0x00ff,0);
  54.     _wcvchr((char)' ',toclear);
  55.     _cursetc((int)(curpos>>8)&0x00ff,curpos&0x00ff);
  56. }
  57.  
  58. /*
  59.  *  void
  60.  * eeos(void)
  61.  *
  62.  * DESCRIPTION
  63.  *  Erase to end of screen.
  64.  *
  65.  * AUTHOR
  66.  *  David Nienhiser   10-APR-1987  11:26:41.84
  67.  */
  68. void GF_CONV eeos()
  69. {
  70.     unsigned curpos;
  71.     int toclear,currentrow;
  72.     
  73.     if(!_gvmtrp)
  74.         vmode(-1);
  75.     curpos=_gcurvpc();
  76.     toclear=gmaxcol-(int)(curpos&0x00ff);
  77.     currentrow=(int)(curpos>>8)&0x00ff;
  78.     if(currentrow<gmaxrow-1)
  79.         toclear+=((gmaxrow-1)-currentrow)*gmaxcol;
  80.     if(toclear)
  81.         _wcvchr((char)' ',toclear);
  82. }
  83.  
  84. /*
  85.  *  void
  86.  * ebos(void)
  87.  *
  88.  * DESCRIPTION
  89.  *  Erase to beginning of screen.
  90.  *
  91.  * AUTHOR
  92.  *  David Nienhiser   10-APR-1987  11:27:48.25
  93.  */
  94. void GF_CONV ebos()
  95. {
  96.     unsigned curpos;
  97.     int toclear,currentrow;
  98.     
  99.     if(!_gvmtrp)
  100.         vmode(-1);
  101.     curpos=_gcurvpc();
  102.     toclear=(int)(curpos&0x00ff)+1;
  103.     currentrow=(int)(curpos>>8)&0x00ff;
  104.     if(currentrow)
  105.         toclear+=gmaxcol*currentrow;
  106.     _cursetc(0,0);
  107.     _wcvchr((char)' ',toclear);
  108.     _cursetc((int)(curpos>>8)&0x00ff,curpos&0x00ff);
  109. }
  110.  
  111. /*
  112.  *  void
  113.  * eline(void)
  114.  *
  115.  * DESCRIPTION
  116.  *  Erase all of current line.
  117.  *
  118.  * AUTHOR
  119.  *  David Nienhiser   10-APR-1987  16:46:45.19
  120.  */
  121. void GF_CONV eline()
  122. {
  123.     unsigned curpos;
  124.     
  125.     if(!_gvmtrp)
  126.         vmode(-1);
  127.     curpos=_gcurvpc();
  128.     _cursetc((int)(curpos>>8)&0x00ff,0);
  129.     _wcvchr((char)' ',gmaxcol);
  130.     _cursetc((int)(curpos>>8)&0x00ff,curpos&0x00ff);
  131. }
  132.