diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1998-08-01 15:03:02 +0300 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-02 05:20:12 +0000 |
commit | 9d116dd7c895b17badf4ad422ae44da0c4df7bc2 (patch) | |
tree | 6e0cd77e3539952c892983238473264f672472b9 /handy.h | |
parent | e6df7ed16ebd06f5315f3016c00996876580109c (diff) | |
download | perl-9d116dd7c895b17badf4ad422ae44da0c4df7bc2.tar.gz |
support OE/MVS
Message-Id: <199808010903.MAA09371@alpha.hut.fi>
Subject: [PATCH] 5.005_01: OE MVS
p4raw-id: //depot/maint-5.005/perl@1697
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 28 |
1 files changed, 21 insertions, 7 deletions
@@ -183,11 +183,20 @@ typedef unsigned short U16; #define isSPACE(c) \ ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f') #define isDIGIT(c) ((c) >= '0' && (c) <= '9') -#define isUPPER(c) ((c) >= 'A' && (c) <= 'Z') -#define isLOWER(c) ((c) >= 'a' && (c) <= 'z') -#define isPRINT(c) (((c) > 32 && (c) < 127) || isSPACE(c)) -#define toUPPER(c) (isLOWER(c) ? (c) - ('a' - 'A') : (c)) -#define toLOWER(c) (isUPPER(c) ? (c) + ('a' - 'A') : (c)) +#ifdef EBCDIC + /* In EBCDIC we do not do locales: therefore() isupper() is fine. */ +# define isUPPER(c) isupper(c) +# define isLOWER(c) islower(c) +# define isPRINT(c) isprint(c) +# define toUPPER(c) toupper(c) +# define toLOWER(c) tolower(c) +#else +# define isUPPER(c) ((c) >= 'A' && (c) <= 'Z') +# define isLOWER(c) ((c) >= 'a' && (c) <= 'z') +# define isPRINT(c) (((c) > 32 && (c) < 127) || isSPACE(c)) +# define toUPPER(c) (isLOWER(c) ? (c) - ('a' - 'A') : (c)) +# define toLOWER(c) (isUPPER(c) ? (c) + ('a' - 'A') : (c)) +#endif #ifdef USE_NEXT_CTYPE @@ -238,8 +247,13 @@ typedef unsigned short U16; # endif #endif /* USE_NEXT_CTYPE */ -/* This conversion works both ways, strangely enough. */ -#define toCTRL(c) (toUPPER(c) ^ 64) +#ifdef EBCDIC +EXT int ebcdic_control _((int)); +# define toCTRL(c) ebcdic_control(c) +#else + /* This conversion works both ways, strangely enough. */ +# define toCTRL(c) (toUPPER(c) ^ 64) +#endif /* Line numbers are unsigned, 16 bits. */ typedef U16 line_t; |