home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / SRC_DBCS / VDHV / VDHGETCP.C < prev    next >
C/C++ Source or Header  |  1995-04-14  |  4KB  |  97 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*****************************************************************************
  14.  *
  15.  * SOURCE FILE NAME = VdhGetCP.C
  16.  *
  17.  * DESCRIPTIVE NAME = Get CodePage Fonts from the Font File
  18.  *
  19.  *
  20.  * VERSION      V2.0
  21.  *
  22.  * DATE
  23.  *
  24.  * DESCRIPTION
  25.  *
  26.  * FUNCTIONS    GetCodePage
  27.  *
  28.  * NOTES        NONE
  29.  *
  30.  * STRUCTURES   NONE
  31.  *
  32.  * EXTERNAL REFERENCES  CDIB
  33.  *
  34.  * EXTERNAL FUNCTIONS   DOSOPEN, DOSREAD, DOSCHGFILEPTR, DOSCLOSE,
  35.  *                      DOSGETSHRSEG, DOSFREESEG, DOSALLOCSEG, DOSREALLOCSEG
  36.  *
  37. */
  38.  
  39.  
  40. /*********************** START OF SPECIFICATIONS ***********************/
  41. /*                                                                     */
  42. /* SUBROUTINE NAME:  GetCodePage                                       */
  43. /*                                                                     */
  44. /* DESCRIPTIVE NAME:   Get the Prepared CodePages for the VDH          */
  45. /*                                                                     */
  46. /* FUNCTION:   Get Valid Code Page List from DOSGETCP.                 */
  47. /*                                                                     */
  48. /* NOTES:  Executes on Level 3                                         */
  49. /*                                                                     */
  50. /* ENTRY POINT:  GetCodePage                                           */
  51. /*   LINKAGE:  Call GetCodePage                                        */
  52. /*                                                                     */
  53. /* INPUT:                                                              */
  54. /*                                                                     */
  55. /* EXIT-NORMAL:  AX = 0                                                */
  56. /*                                                                     */
  57. /* EXIT-ERROR:  AX = DOSxxx return code                                */
  58. /*                                                                     */
  59. /* EFFECTS:  None                                                      */
  60. /*                                                                     */
  61. /* INTERNAL REFERENCES: None                                           */
  62. /*                                                                     */
  63. /* EXTERNAL REFERENCES:  None                                          */
  64. /*   ROUTINES: DOSGETCP                                                */
  65. /************************ END OF SPECIFICATIONS ************************/
  66.  
  67. #define INCL_BASE               /* ALL of OS/2 Base                */
  68. #include <os2.h>
  69. #include <cdib.h>               /* CDIB defines                    */
  70.  
  71. #include "vdhctl.h"             /* Conditional compilation control */
  72. #include "vdh.h"                /* Type definitions                */
  73.  
  74. /*
  75.  *  Externally defined global variables
  76.  */
  77.  
  78. extern  USHORT CodePageTable[];
  79.  
  80. USHORT PASCAL near GetCodePage()
  81. {
  82. USHORT rc, i;
  83. USHORT CodePage[3];
  84.  
  85. //
  86. // Initialize CodePage Table.
  87. //
  88.  
  89.   rc = DosGetCp( sizeof(CodePage), (PUSHORT)CodePage, (PUSHORT)&i );
  90.   CodePageTable[0] = CodePage[1];
  91.   CodePageTable[1] = CodePage[2];
  92.  
  93.   return(rc);
  94. }
  95.  
  96. //---------------------------------------------------------------------------
  97.