Category : Miscellaneous Language Source Code
Archive   : ADAMAKE.ZIP
Filename : CTYPE.PKG

 
Output of file : CTYPE.PKG contained in archive : ADAMAKE.ZIP
package body CTYPE is

-- A character handling library.
--
-- By : Robert Monroe
-- Date : 06/05/88

function CAP (CH : in CHARACTER) return CHARACTER is
-- check for a lowercase character and
-- convert to uppercase.
begin
if CH in 'a'..'z' then
return CHARACTER'Val (
CHARACTER'Pos (CH)-32);
else
return CH;
end if;
end CAP;


function IS_ALNUM (CH : in CHARACTER) return BOOLEAN is
-- Return true if CH is alphanumeric
begin
return CAP (CH) in 'A'..'Z' or
CH in '0'..'9';
end IS_ALNUM;


function IS_ALPHA (CH : in CHARACTER) return BOOLEAN is
-- Return true if CH is alphabetic
begin
return CAP (CH) in 'A'..'Z';
end IS_ALPHA;


function IS_DIGIT (CH : in CHARACTER) return BOOLEAN is
-- Return true if CH is a digit
begin
return CH in '0'..'9';
end IS_DIGIT;


function IS_PRINT (CH : in CHARACTER) return BOOLEAN is
-- Return true if CH is a printable character
begin
return CH in '!'..'~';
end IS_PRINT;


function IS_CNTRL (CH : in CHARACTER) return BOOLEAN is
begin
return CH in ASCII.NUL..ASCII.US;
end IS_CNTRL;


function IS_SPACE (CH : in CHARACTER) return BOOLEAN is
-- Return true if CH is a whitespace character
begin
return CH = ' ' or
CH = ASCII.CR or
CH = ASCII.HT or
CH = ASCII.LF;
end IS_SPACE;


end CTYPE;




  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : ADAMAKE.ZIP
Filename : CTYPE.PKG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/