home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / CDIB.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  9KB  |  280 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*static char *SCCSID = "@(#)cdib.h    6.1 90/11/15";*/
  13. /*static char *SCCSID = "@(#)cdib.h    13.3 89/04/19";*/
  14.  
  15. /*
  16.  *    Codepage Data Information Block
  17.  */
  18.  
  19. /*
  20.  *    Any pointer set to zero indicates that the section is nonexistent
  21.  */
  22.  
  23. /*
  24.  *    The following field follows the ROM resident font definitions:
  25.  */
  26.  
  27. struct    CDIB_dev_filename_section
  28. {
  29. char CDIB_dev_filename[128];                /* font file name    */
  30. };
  31.  
  32. /*
  33.  *    The following 2 fields appear once for each ROM resident font:
  34.  */
  35.  
  36. struct    CDIB_dev_ROM_font_section
  37. {
  38. unsigned CDIB_dev_ROM_codepage;            /* code page identifier         */
  39. unsigned CDIB_dev_ROM_font;            /* font identifier         */
  40. };
  41.  
  42. /*
  43.  *    Device Section
  44.  *    This section appears once for each device (screen, keyboard,
  45.  *    LPT1, LPT2, and LPT3) for which a DEVINFO= statement was
  46.  *    specified in the CONFIG.SYS file
  47.  */
  48.  
  49. struct    CDIB_device_section
  50. {
  51. unsigned CDIB_dev_length;                  /* lenght of device
  52.                                * section
  53.                                */
  54. char CDIB_dev_subtype[8];                  /* subtype         */
  55. struct CDIB_dev_filename_section near *CDIB_dev_filename_ptr;  /* offset to font
  56.                                * file name
  57.                                */
  58. unsigned CDIB_dev_number_ROM_fonts;              /* number of ROM
  59.                                * resident fonts
  60.                                */
  61. struct CDIB_dev_ROM_font_section CDIB_dev_first_ROM_font; /* location of first
  62.                                * ROM font section
  63.                                * WARNING! This
  64.                                * section may not
  65.                                * exist, see warning
  66.                                * for
  67.                                * CDIB_cp_first_id
  68.                                */
  69. };
  70.  
  71. /*
  72.  *    Country Section
  73.  *    This section appears only once
  74.  */
  75.  
  76. struct    CDIB_country_section
  77. {
  78. unsigned CDIB_ct_length;            /* length of country section */
  79. unsigned CDIB_ct_code;                /* country code             */
  80. char CDIB_ct_filename[128];            /* name of country information
  81.                          * file
  82.                          */
  83. };
  84.  
  85. /*
  86.  *    The following field appears once for each DBCS range:
  87.  */
  88.  
  89. struct    CDIB_DBCS_range_section
  90. {
  91. unsigned char CDIB_DBCS_start;                /* start of range    */
  92. unsigned char CDIB_DBCS_end;                /* end of range         */
  93. };
  94.  
  95. /*
  96.  *    DBCS Environment Vector Section
  97.  *    This section appears once for each prepared code page
  98.  */
  99.  
  100. struct CDIB_DBCS_section
  101. {
  102. unsigned CDIB_DBCS_length;                  /* length of DBCS vector
  103.                                * section
  104.                                */
  105. struct CDIB_DBCS_range_section CDIB_DBCS_first_range; /* location of first DBCS
  106.                                * range
  107.                                */
  108. };
  109.  
  110. /*
  111.  *    Case Map Table Section
  112.  *    This section appears once for each prepared code page
  113.  */
  114.  
  115. struct    CDIB_casemap_section
  116. {
  117. unsigned CDIB_cm_length;        /* length of case map section         */
  118. char CDIB_cm_data[128];            /* upper case equivalent for each
  119.                      * ASCII chracter from 80h to FFh
  120.                      */
  121. };
  122.  
  123. /*
  124.  *    Collate Table Section
  125.  *    This section appears once for each prepared code page
  126.  */
  127.  
  128. struct    CDIB_collate_section
  129. {
  130. unsigned CDIB_col_length;        /* length of collate table section   */
  131. unsigned char CDIB_col_weight[256];    /* weight in the collating sequence
  132.                      * for each ASCII character
  133.                      */
  134. };
  135.  
  136. /*
  137.  *    Format Table Section
  138.  *    This section appears once for each prepared code page
  139.  */
  140.  
  141. struct    CDIB_format_section
  142. {
  143. unsigned CDIB_fmt_length;        /* length of format section        */
  144. unsigned CDIB_fmt_date_format;        /* date format                */
  145. char CDIB_fmt_currency_symbol[5];    /* currency symbol, null terminated */
  146. char CDIB_fmt_thousands_separator[2];    /* thousands separator, null term.  */
  147. char CDIB_fmt_decimal_separator[2];    /* decimal separator, null term.    */
  148. char CDIB_fmt_date_separator[2];    /* date separator, null terminated  */
  149. char CDIB_fmt_time_separator[2];    /* time separator, null terminated  */
  150. unsigned char CDIB_fmt_currency_format; /* currency format flags
  151.                      *  .....0.0 = currency symbol
  152.                      *         preceeds money value
  153.                      *  .....0.1 = currency symbol
  154.                      *         follows money value
  155.                      *  .....00. = zero spaces between
  156.                      *         currency symbol
  157.                      *         and money value
  158.                      *  .....01. = one space between
  159.                      *         currency symbol
  160.                      *         and money value
  161.                      *  .....1.. = currency symbol
  162.                      *         replaces decimal
  163.                      *         separator
  164.                      */
  165. unsigned char CDIB_fmt_decimal_places;     /* # decimal places in money value */
  166. unsigned char CDIB_fmt_time_format;     /* time format                */
  167. unsigned long CDIB_fmt_monocase_routine; /* Monocase Routine            */
  168. char CDIB_fmt_data_list_separator[2];     /* data list separator, null term. */
  169. unsigned CDIB_fmt_reserved[5];         /* reserved                */
  170. };
  171.  
  172. /*
  173.  *    Values for CDIB_fmt_date_format (date format)
  174.  */
  175.  
  176. #define CDIB_fmt_date_mmddyy    0    /* 0 = mm/dd/yy */
  177. #define CDIB_fmt_date_ddmmyy    1    /* 1 = dd/mm/yy */
  178. #define CDIB_fmt_date_yymmdd    2    /* 2 = yy/mm/dd */
  179.  
  180. /*
  181.  *    Values for CDIB_fmt_currency_format (currency format)
  182.  */
  183.  
  184. #define CDIB_fmt_currency_cbm      0x05    /* currency symbol before money value,
  185.                      * a non-zero AND test result indicates
  186.                      * that this is not the correct flag
  187.                      */
  188. #define CDIB_fmt_currency_mbc      0x01    /* currency symbol after money value,
  189.                      * a non-zero AND test result indicates
  190.                      * that this is the correct flag,
  191.                      * this test should be preceeded by a
  192.                      * zero AND test result against
  193.                      * CDIB_fmt_currency_cbd
  194.                      */
  195. #define CDIB_fmt_currency_zerosp  0x06    /* zero spaces between currency symbol
  196.                      * and money value,
  197.                      * a non-zero AND test result indicates
  198.                      * that this is not the correct flag
  199.                      */
  200. #define CDIB_fmt_currency_onesp      0x02    /* one space between currency symbol
  201.                      * and money value,
  202.                      * a non-zero AND test result indicates
  203.                      * that this is the correct flag,
  204.                      * this test should be preceeded by a
  205.                      * zero AND test result against
  206.                      * CDIB_fmt_currency_cbd
  207.                      */
  208. #define CDIB_fmt_currency_currdec 0x04    /* currency symbol replaces decimal
  209.                      * separator
  210.                      * a non-zero AND test result indicates
  211.                      * that this is the correct flag
  212.                      */
  213.  
  214. /*
  215.  *    Code Page Data Section
  216.  *    This section appears once for each prepared code page
  217.  */
  218.  
  219. struct    CDIB_codepage_data_section
  220. {
  221. unsigned             CDIB_cpd_length;       /* length of cp data sec. */
  222. struct CDIB_format_section  near *CDIB_cpd_format_ptr;    /* ptr to format section  */
  223. struct CDIB_collate_section near *CDIB_cpd_collate_ptr; /* ptr to collate section */
  224. struct CDIB_casemap_section near *CDIB_cpd_casemap_ptr; /* ptr to casemap section */
  225. struct CDIB_DBCS_section    near *CDIB_cpd_DBCS_ptr;    /* ptr to DBCS vector sec.*/
  226. };
  227.  
  228. /*
  229.  *    The following section appears once for each prepared code page
  230.  */
  231.  
  232. struct    CDIB_cp_id_section
  233. {
  234. unsigned CDIB_cp_id;                     /* code page identifier */
  235. struct CDIB_codepage_data_section near *CDIB_cp_data_ptr; /* ptr to cp data sec.  */
  236. };
  237.  
  238. /*
  239.  *    Code Page Section
  240.  *    This section appears once
  241.  */
  242.  
  243. struct    CDIB_codepage_section
  244. {
  245. unsigned CDIB_cp_length;            /* length of code page section   */
  246. unsigned CDIB_cp_number_codepages;        /* number of prepared code pages */
  247. struct CDIB_cp_id_section CDIB_cp_first_id; /* location of first codepage id
  248.                          * section.  WARNING!  This field
  249.                          * may not exist; since an id
  250.                          * section may exist with number
  251.                          * codepages zero, check for
  252.                          * existence by comparing cp length
  253.                          * against size of codepage section
  254.                          * if cp length < size, first id is
  255.                          * not present
  256.                          */
  257. };
  258.  
  259. /*
  260.  *    Base Section
  261.  *
  262.  *    This Section appears once, at offset 0 of the CDIB segment
  263.  *
  264.  *    Changed pointers to explicit near, so can use this file with
  265.  *    large memory model.
  266.  */
  267.  
  268. struct    CDIB
  269. {
  270. unsigned             CDIB_length;     /* length of the CDIB         */
  271. struct CDIB_codepage_section near *CDIB_codepage_ptr; /* offset to code page sec. */
  272. struct CDIB_country_section  near *CDIB_country_ptr;  /* offset to country sec.      */
  273. struct CDIB_device_section   near *CDIB_screen_ptr;   /* offset to screen section */
  274. struct CDIB_device_section   near *CDIB_keyboard_ptr; /* offset to kbd section      */
  275. struct CDIB_device_section   near *CDIB_lpt1_ptr;     /* offset to LPT1 section      */
  276. struct CDIB_device_section   near *CDIB_lpt2_ptr;     /* offset to LPT2 section      */
  277. struct CDIB_device_section   near *CDIB_lpt3_ptr;     /* offset to LPT3 section      */
  278. };
  279.  
  280.