home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / emacs / src / upreg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-07  |  896 b   |  38 lines

  1. #include    "stdio.h"
  2. #include    "ed.h"
  3. /*
  4.  * Upper case region. Zap all of the lower
  5.  * case characters in the region to upper case. Use
  6.  * the region code to set the limits. Scan the buffer,
  7.  * doing the changes. Call "lchange" to ensure that
  8.  * redisplay is done in all buffers. Bound to 
  9.  * "C-X C-L".
  10.  */
  11. ovmain(x, f, n)
  12. {
  13.     register LINE    *linep;
  14.     register int    loffs;
  15.     register int    c;
  16.     register int    s;
  17.     REGION        region;
  18.  
  19.     if ((s=getregion(®ion)) != TRUE)
  20.         return (s);
  21.     lchange(WFHARD);
  22.     linep = region.r_linep;
  23.     loffs = region.r_offset;
  24.     while (region.r_size--) {
  25.         if (loffs == llength(linep)) {
  26.             linep = lforw(linep);
  27.             loffs = 0;
  28.         } else {
  29.             c = lgetc(linep, loffs);
  30.             if (c>='a' && c<='z')
  31.                 lputc(linep, loffs, c-'a'+'A');
  32.             ++loffs;
  33.         }
  34.     }
  35.     return (TRUE);
  36. }
  37. #include "getreg.c"
  38.