locale.mh

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 140 行

MH
140
字号
::
:: This file generates three different headers: locale.h, clocale, and
:: locale. The "default" wsplice operation produces locale.h, the header
:: used in the C library. A CNAME wsplice operation produces clocale, the
:: C++ partner to C's locale.h. A special CPPLOCALE wsplice operation
:: generates C++'s locale header. That header is not directly related to
:: either locale.h or clocale.
:: (Peter Chapin)
::
:segment !CPPLOCALE
/***************************************************************************
 * FILE: locale.h/clocale (Localization)
 *
:include crwatqnx.sp
 *
 * Description: This header is part of the C/C++ standard library. It
 *              declares facilities for controlling localization.
 ***************************************************************************/
:segment CNAME
#ifndef _CLOCALE_INCLUDED
#define _CLOCALE_INCLUDED

#ifndef __cplusplus
#error The header clocale requires C++
#endif
:elsesegment
#ifndef _LOCALE_H_INCLUDED
#define _LOCALE_H_INCLUDED
:endsegment

:include readonly.sp
::
:: The following segment only appears in locale.h.
:segment !CNAME
#ifdef __cplusplus
#include <clocale>

// C99 types in locale.h.
using std::lconv;

// C99 functions in locale.h.
using std::setlocale;
using std::localeconv;

#else /* __cplusplus not defined */
:: End of segment that is only in locale.h
:endsegment

:: Only need extern "C" in clocale
:segment CNAME
:include cpluspro.sp
:endsegment

#ifndef _COMDEF_H_INCLUDED
 #include <_comdef.h>
#endif

:include pshpackl.sp

:include wchar_t.sp

:include null.sp

#define LC_CTYPE        0
#define LC_NUMERIC      1
#define LC_TIME         2
#define LC_COLLATE      3
#define LC_MONETARY     4
#define LC_MESSAGES     5
#define LC_ALL          6

:segment CNAME
namespace std {
:endsegment
struct lconv {
        char *decimal_point;
        char *thousands_sep;
        char *int_curr_symbol;
        char *currency_symbol;
        char *mon_decimal_point;
        char *mon_thousands_sep;
        char *mon_grouping;
        char *grouping;
        char *positive_sign;
        char *negative_sign;
        char int_frac_digits;
        char frac_digits;
        char p_cs_precedes;
        char p_sep_by_space;
        char n_cs_precedes;
        char n_sep_by_space;
        char p_sign_posn;
        char n_sign_posn;
};

_WCRTLINK extern char    *setlocale( int __category,const char *__locale );
_WCRTLINK extern struct lconv *localeconv(void);
:segment CNAME
}
:endsegment

:segment !NO_WIDECHAR
_WCRTLINK extern wchar_t *_wsetlocale( int __category,const wchar_t *__locale );
:endsegment

:include poppack.sp
:segment CNAME
:include cplusepi.sp
:endsegment

:segment !CNAME
#endif /* __cplusplus */
:endsegment

#endif
:elsesegment
///////////////////////////////////////////////////////////////////////////
// FILE: locale (...)
//
:keep CPP_HDR
:include crwatcnt.sp
//
// Description: This header is part of the C++ standard library.
///////////////////////////////////////////////////////////////////////////
#ifndef _LOCALE_INCLUDED
#define _LOCALE_INCLUDED

:include readonly.sp

#ifndef __cplusplus
#error The header locale requires C++
#endif

namespace std {

} // namespace std

#endif
:endsegment

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?