home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / Rw / rwcats.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  3.6 KB  |  120 lines

  1. #ifndef __RWCATS_H
  2. #define __RWCATS_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  4. #ifndef _RWCATS_H
  5. #define _RWCATS_H
  6. /***************************************************************************
  7.  *
  8.  * rwcats.h - Declarations for XPG4 messages
  9.  *
  10.  ***************************************************************************
  11.  *
  12.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  13.  *
  14.  * This computer software is owned by Rogue Wave Software, Inc. and is
  15.  * protected by U.S. copyright laws and other laws and by international
  16.  * treaties.  This computer software is furnished by Rogue Wave Software,
  17.  * Inc. pursuant to a written license agreement and may be used, copied,
  18.  * transmitted, and stored only in accordance with the terms of such
  19.  * license and with the inclusion of the above copyright notice.  This
  20.  * computer software or any other copies thereof may not be provided or
  21.  * otherwise made available to any other person.
  22.  *
  23.  * U.S. Government Restricted Rights.  This computer software is provided
  24.  * with Restricted Rights.  Use, duplication, or disclosure by the
  25.  * Government is subject to restrictions as set forth in subparagraph (c)
  26.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  27.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  28.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  29.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  30.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  31.  *
  32.  **************************************************************************/
  33.  
  34. #include <stdcomp.h>
  35. #include <stddef.h>
  36. #include <rw/locvector>
  37. #include <map>
  38. #include <string>
  39.  
  40. #ifdef __WIN32__
  41. #define _RWSTD_USE_RC 1
  42. #endif
  43.  
  44. #ifndef LC_MESSAGES
  45. #define LC_MESSAGES LC_MAX + 1
  46. #endif
  47.  
  48. #define NL_SETD                 1    /* XPG3 Conformant Default set number. */
  49. #define NL_CAT_LOCALE           (-1) /* XPG4 requirement */
  50. #define NL_CAT_LOCALE           (-1) /* XPG4 requirement */
  51.  
  52. #define _RWCAT_COOKIE            0xAB34BC56
  53.  
  54. #ifndef _RWSTD_NO_NAMESPACE
  55. namespace __rwstd {
  56. #endif
  57.  
  58. #ifndef _RWSTD_USE_RC
  59.   // NULL implementation (does nothing)
  60.   class __rwcat
  61.   {
  62.     public:
  63.       __rwcat(const char* fname, int oflag) { ; }
  64.       ~__rwcat() { ; }
  65.       __rwcat* id() { return this; }
  66.       bool good() { return false; }
  67.       char * catgets(int set_num, int msg_num, const char* s) { return s; }
  68.   };
  69.  
  70. #else
  71.  
  72. #ifndef _RWSTD_NO_NAMESPACE
  73. } // namespace __rwstd // RW_BUG
  74. #endif
  75. #include <windows.h>
  76. #ifndef _RWSTD_NO_NAMESPACE
  77. namespace __rwstd {    // RW_BUG
  78. #endif
  79.  
  80. #ifndef _RWSTD_NO_NAMESPACE
  81.   using namespace std;
  82. #endif
  83. #define NL_TEXTMAX 8024 
  84.   // Catalog type hold relationship between cat id and file
  85.   class __rwcat
  86.   {
  87.     public:
  88.       typedef map<int,string,less<int>,allocator<pair<const int, string> > >__cat_type;
  89.       typedef __cat_type::value_type __msg_type;
  90.       
  91.     protected:
  92.       HINSTANCE __cat;
  93.       __cat_type __msgs;
  94.  
  95.     public:
  96.       __rwcat(const char* fname, int oflag);
  97.       ~__rwcat();
  98.       __rwcat* id() { return this; }
  99.       bool good() { return __cat ? true : false; }      
  100.       HINSTANCE cat() { return __cat; }
  101.       char * catgets(int set_num, int msg_num, const char* s);
  102.   };
  103.  
  104. #endif //_RWSTD_USE_RC
  105.  
  106. #ifndef _RWSTD_NO_NAMESPACE
  107. }
  108. #endif
  109.  
  110. typedef  __RWSTD::__rwcat* nl_catd;
  111. typedef int nl_item;
  112.  
  113. int     catclose(nl_catd);
  114. char    *catgets(nl_catd, int, int, const char *);
  115. nl_catd catopen(const char *, int);
  116. #endif  /* _RWCATS_H */
  117.  
  118. #pragma option pop
  119. #endif /* __RWCATS_H */
  120.