home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 5.ddi / C / STBFOLD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.0 KB  |  40 lines

  1. /**
  2. *
  3. * Name        stbfold -- Fold character to upper case in national
  4. *               character set
  5. *
  6. * Synopsis    outch = stbfold(ch,pinfo);
  7. *
  8. *        char outch    The resulting character
  9. *        int  ch     The character before folding
  10. *        COUNTRY_INFO *pinfo
  11. *                Pointer to structure with country info
  12. *
  13. * Description    This function converts a character into "upper case"
  14. *        taking into account DOS's information about national
  15. *        character sets.  pinfo must point to a COUNTRY_INFO
  16. *        structure in the format returned by QYGCOUN:  in
  17. *        particular, the cmap member of the structure must point
  18. *        to a valid function to do the mapping.    (This may not be
  19. *        true if the structure was filled by DOS 2.x, or if
  20. *        QYGCOUN reported an error.)
  21. *
  22. * Returns    outch        Character folded to upper case.
  23. *
  24. * Version    3.0 (C)Copyright Blaise Computing Inc.    1986
  25. *
  26. **/
  27.  
  28. #include <ctype.h>
  29.  
  30. #include <bstring.h>
  31.  
  32. char stbfold(ch,pinfo)
  33. char         ch;
  34. COUNTRY_INFO *pinfo;
  35. {
  36.     return (((unsigned char) ch) <= 0x7f)
  37.         ? ((char) toupper(ch))
  38.         : casemap(ch,&(pinfo->cmap));
  39. }
  40.