home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / langapi.h < prev    next >
C/C++ Source or Header  |  1999-09-15  |  3KB  |  107 lines

  1. /*
  2.  * $Id: langapi.h,v 1.5 1999/09/15 14:03:37 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for the Language API
  8.  *
  9.  * Copyright 1999 Victor Szel <info@szelvesz.hu>
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. #ifndef HB_LANGAPI_H_
  37. #define HB_LANGAPI_H_
  38.  
  39. #define HB_LANG_TEXT_DATEFMT    0
  40. #define HB_LANG_TEXT_YESCHAR    1
  41. #define HB_LANG_TEXT_NOCHAR     2
  42. #define HB_LANG_TEXT_MAX_    3
  43.  
  44. #define HB_LANG_ED_MAX_        51
  45. #define HB_LANG_EI_MAX_        6
  46.  
  47. /* ; */
  48.  
  49. typedef struct
  50. {
  51.    BYTE nWeight;
  52.    BYTE nFlags;
  53. } HB_LANGCHAR;
  54.  
  55. typedef struct
  56. {
  57.    char * szName;
  58.    char * szID;
  59.    char * szCodepage;
  60.    char * szTextList [ HB_LANG_TEXT_MAX_ ];
  61.    char * szMonthNameList [ 12 ];
  62.    char * szDayNameList [ 7 ];
  63.    char * szErrorDescList [ HB_LANG_ED_MAX_ ];
  64.    char * szErrorIntrList [ HB_LANG_EI_MAX_ ];
  65.    HB_LANGCHAR * langcharList [ 256 ];
  66. } HB_LANG, * PHB_LANG, * HB_LANG_PTR;
  67.  
  68. typedef struct _HB_LANGNODE
  69. {
  70.    PHB_LANG pLang;
  71.    struct _HB_LANGNODE * pNext;
  72. } HB_LANGNODE, * PHB_LANGNODE;
  73.  
  74. /* TODO: check if it have to be visible outside of langapi.c
  75.  * It it is required then there is a conflict:
  76.  * it is declared here as 'extern' and in langapi.c it is declared as
  77.  * 'static' - Watcom compiler reports error for this conflict
  78.  */
  79. /* extern PHB_LANG langDef; */
  80. extern PHB_LANGNODE langList;
  81.  
  82. /* Supported language list management */
  83.  
  84. extern void     hb_langListAdd          ( PHB_LANG lang );
  85. extern PHB_LANG hb_langListFind         ( char * szName );
  86. extern void     hb_langListRelease      ( void );
  87.  
  88. /* Default language selection and data query */
  89.  
  90. extern void     hb_langDSet           ( PHB_LANG lang );
  91. extern PHB_LANG hb_langDGet           ( void );
  92.  
  93. extern char *   hb_langDGetName      ( void );
  94. extern char *   hb_langDGetID        ( void );
  95. extern char *   hb_langDGetText        ( ULONG ulIndex );
  96. extern char *   hb_langDGetDayName    ( ULONG ulIndex );
  97. extern char *   hb_langDGetMonthName    ( ULONG ulIndex );
  98. extern char *   hb_langDGetErrorDesc    ( ULONG ulIndex );
  99. extern char *   hb_langDGetErrorIntr    ( ULONG ulIndex );
  100.  
  101. /* Single language */
  102.  
  103. extern PHB_LANG hb_langNew              ( void );
  104. extern void     hb_langDelete           ( PHB_LANG lang );
  105.  
  106. #endif /* HB_LANGAPI_H_ */
  107.