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 / FRCWRTS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  923 b   |  49 lines

  1. /*
  2.  * frcwrts.c
  3.  * contains: frcwrts()
  4.  *
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include "gfuncts.h"
  10.  
  11.  
  12. /*
  13.  *  void
  14.  * frcwrts(int cols,int attr,char *string)
  15.  *
  16.  * ARGUMENT
  17.  *  cols    -    Number of columns to center on.
  18.  *  attr    -    Attribute to use when writing.
  19.  *  string    -    String to be centered.
  20.  *
  21.  * DESCRIPTION
  22.  *  The string is centered on a width which is the lesser of "cols" or the
  23.  *  global variable gmaxcol on the current row and displayed with the
  24.  *  specified attribute.
  25.  *
  26.  * RETURNS
  27.  *  void
  28.  *
  29.  * AUTHOR
  30.  *  ""   20-DEC-1988  10:36:53.53
  31.  *   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  32.  *
  33.  * MODIFICATIONS
  34.  *
  35.  *
  36.  */
  37. void GF_CONV frcwrts(cols,attr,string)
  38. int cols,attr;
  39. char *string;
  40. {
  41.     
  42.     int icols;
  43.     
  44.     icols=xmin(cols,gmaxcol);
  45.     if(icols<=1)
  46.         return;
  47.     fratwstr((getcur(0)>>8)&0x00ff,(icols/2)-(strlen(string)/2),attr,string);
  48. }
  49.