Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:04

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
0011 #define _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H
0012 
0013 #if defined(__MVS__)
0014 #  include <locale.h>
0015 #  include <string>
0016 
0017 #  ifdef __cplusplus
0018 extern "C" {
0019 #  endif
0020 
0021 #  define _LC_MAX LC_MESSAGES /* highest real category */
0022 #  define _NCAT (_LC_MAX + 1) /* maximum + 1 */
0023 
0024 #  define _CATMASK(n) (1 << (n))
0025 #  define LC_COLLATE_MASK _CATMASK(LC_COLLATE)
0026 #  define LC_CTYPE_MASK _CATMASK(LC_CTYPE)
0027 #  define LC_MONETARY_MASK _CATMASK(LC_MONETARY)
0028 #  define LC_NUMERIC_MASK _CATMASK(LC_NUMERIC)
0029 #  define LC_TIME_MASK _CATMASK(LC_TIME)
0030 #  define LC_MESSAGES_MASK _CATMASK(LC_MESSAGES)
0031 #  define LC_ALL_MASK (_CATMASK(_NCAT) - 1)
0032 
0033 typedef struct locale_struct {
0034   int category_mask;
0035   std::string lc_collate;
0036   std::string lc_ctype;
0037   std::string lc_monetary;
0038   std::string lc_numeric;
0039   std::string lc_time;
0040   std::string lc_messages;
0041 }* locale_t;
0042 
0043 // z/OS does not have newlocale, freelocale and uselocale.
0044 // The functions below are workarounds in single thread mode.
0045 locale_t newlocale(int category_mask, const char* locale, locale_t base);
0046 void freelocale(locale_t locobj);
0047 locale_t uselocale(locale_t newloc);
0048 
0049 #  ifdef __cplusplus
0050 }
0051 #  endif
0052 #endif // defined(__MVS__)
0053 #endif // _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H