home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXTST8F.ZIP / EMX / TEST / OS2TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-19  |  1007 b   |  42 lines

  1. /* os2test.c (emx+gcc) */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <os2.h>
  6.  
  7. char upper_case[] = "upper case";
  8.  
  9. int main (void)
  10. {
  11.   COUNTRYCODE cc;
  12.   ULONG aul[100];
  13.   ULONG cb, i, rc;
  14.   CHAR ach[256];
  15.  
  16.   cc.country = 0;
  17.   cc.codepage = 0;
  18.   if ((rc = DosMapCase (strlen (upper_case), &cc, upper_case)) != 0)
  19.     printf ("DosMapCase failed: %lu\n", rc);
  20.   else
  21.     printf ("DosMapCase: %s\n", upper_case);
  22.   if ((rc = DosQueryCp (sizeof (aul), aul, &cb)) != 0)
  23.     printf ("DosQueryCp failed: %lu\n", rc);
  24.   else
  25.     {
  26.       printf ("Code pages:");
  27.       for (i = 0; i < cb / sizeof (aul[0]); ++i)
  28.         printf (" %lu", aul[i]);
  29.       putchar ('\n');
  30.     }
  31.   if ((rc = DosQueryCollate (sizeof (ach), &cc, ach, &cb)) != 0)
  32.     printf ("DosQueryCollate failed: %lu\n", rc);
  33.   else
  34.     {
  35.       printf ("DosQueryCollate:");
  36.       for (i = 0; i < cb / sizeof (ach[0]); ++i)
  37.         printf (" %d", (int)(UCHAR)ach[i]);
  38.       putchar ('\n');
  39.     }
  40.   return (0);
  41. }
  42.