home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwphescr.zip / XWPH0208.ZIP / include / helpers / nls.h < prev    next >
C/C++ Source or Header  |  2002-07-28  |  5KB  |  141 lines

  1.  
  2. /*
  3.  *@@sourcefile nls.h:
  4.  *      header file for nls.c. See notes there.
  5.  *
  6.  *      Note: Version numbering in this file relates to XWorkplace version
  7.  *            numbering.
  8.  *
  9.  *@@include #define INCL_DOSDATETIME
  10.  *@@include #include <os2.h>
  11.  *@@include #include "helpers\nls.h"
  12.  */
  13.  
  14. /*
  15.  *      Copyright (C) 1997-2001 Ulrich Möller.
  16.  *      This file is part of the "XWorkplace helpers" source package.
  17.  *      This is free software; you can redistribute it and/or modify
  18.  *      it under the terms of the GNU General Public License as published
  19.  *      by the Free Software Foundation, in version 2 as it comes in the
  20.  *      "COPYING" file of the XWorkplace main distribution.
  21.  *      This program is distributed in the hope that it will be useful,
  22.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *      GNU General Public License for more details.
  25.  */
  26.  
  27. #if __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. #ifndef NLS_HEADER_INCLUDED
  32.     #define NLS_HEADER_INCLUDED
  33.  
  34.     #include "helpers\simples.h"
  35.             // V0.9.19 (2002-06-13) [umoeller]
  36.  
  37.     /* ******************************************************************
  38.      *
  39.      *   DBCS support
  40.      *
  41.      ********************************************************************/
  42.  
  43.     #define TYPE_SBCS           0x0000
  44.     #define TYPE_DBCS_1ST       0x0001
  45.     #define TYPE_DBCS_2ND       0x0002
  46.  
  47.     BOOL XWPENTRY nlsDBCS(VOID);
  48.  
  49.     ULONG XWPENTRY nlsQueryDBCSChar(PCSZ pcszString,
  50.                                     ULONG ulOfs);
  51.  
  52.     PSZ XWPENTRY nlschr(PCSZ p, char c);
  53.  
  54.     PSZ XWPENTRY nlsrchr(PCSZ p, char c);
  55.  
  56.     /* ******************************************************************
  57.      *
  58.      *   Country-dependent formatting
  59.      *
  60.      ********************************************************************/
  61.  
  62.     #ifdef OS2_INCLUDED
  63.  
  64.         /*
  65.          *@@ COUNTRYSETTINGS:
  66.          *      structure used for returning country settings
  67.          *      with nlsQueryCountrySettings.
  68.          */
  69.  
  70.         typedef struct _COUNTRYSETTINGS
  71.         {
  72.             ULONG   ulDateFormat,
  73.                             // date format:
  74.                             // --  0   mm.dd.yyyy  (English)
  75.                             // --  1   dd.mm.yyyy  (e.g. German)
  76.                             // --  2   yyyy.mm.dd  (Japanese)
  77.                             // --  3   yyyy.dd.mm
  78.                     ulTimeFormat;
  79.                             // time format:
  80.                             // --  0   12-hour clock
  81.                             // --  >0  24-hour clock
  82.             CHAR    cDateSep,
  83.                             // date separator (e.g. '/')
  84.                     cTimeSep,
  85.                             // time separator (e.g. ':')
  86.                     cDecimal,
  87.                             // decimal separator (e.g. '.')
  88.                     cThousands;
  89.                             // thousands separator (e.g. ',')
  90.         } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
  91.  
  92.         VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS pcs);
  93.  
  94.         PSZ XWPENTRY nlsThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
  95.         typedef PSZ XWPENTRY NLSTHOUSANDSULONG(PSZ pszTarget, ULONG ul, CHAR cThousands);
  96.         typedef NLSTHOUSANDSULONG *PNLSTHOUSANDSULONG;
  97.  
  98.         PSZ XWPENTRY nlsThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
  99.  
  100.         PSZ XWPENTRY nlsVariableDouble(PSZ pszTarget,
  101.                                        double dbl,
  102.                                        PCSZ pszUnits,
  103.                                        CHAR cThousands);
  104.  
  105.         VOID XWPENTRY nlsFileDate(PSZ pszBuf,
  106.                                   FDATE *pfDate,
  107.                                   ULONG ulDateFormat,
  108.                                   CHAR cDateSep);
  109.  
  110.         VOID XWPENTRY nlsFileTime(PSZ pszBuf,
  111.                                   FTIME *pfTime,
  112.                                   ULONG ulTimeFormat,
  113.                                   CHAR cTimeSep);
  114.  
  115.         VOID XWPENTRY nlsDateTime(PSZ pszDate,
  116.                                   PSZ pszTime,
  117.                                   DATETIME *pDateTime,
  118.                                   ULONG ulDateFormat,
  119.                                   CHAR cDateSep,
  120.                                   ULONG ulTimeFormat,
  121.                                   CHAR cTimeSep);
  122.         typedef VOID XWPENTRY NLSDATETIME(PSZ pszDate,
  123.                                           PSZ pszTime,
  124.                                           DATETIME *pDateTime,
  125.                                           ULONG ulDateFormat,
  126.                                           CHAR cDateSep,
  127.                                           ULONG ulTimeFormat,
  128.                                           CHAR cTimeSep);
  129.         typedef NLSDATETIME *PNLSDATETIME;
  130.  
  131.         ULONG nlsUpper(PSZ psz);
  132.  
  133.     #endif
  134.  
  135. #endif
  136.  
  137. #if __cplusplus
  138. }
  139. #endif
  140.  
  141.