mirror of
https://github.com/antoinevignau/source.git
synced 2024-10-31 22:06:40 +00:00
1 line
614 B
C
Executable File
1 line
614 B
C
Executable File
#include <string.h>
|
|
|
|
extern char *D_TOUPPERTABLE, *D_TOLOWERTABLE;
|
|
extern pascal void D_ISLETTER();
|
|
|
|
|
|
char tolower(c)
|
|
char c;
|
|
{
|
|
char ch;
|
|
|
|
asm {
|
|
lda c
|
|
and #0xFF
|
|
tax
|
|
lda >D_TOLOWERTABLE,x
|
|
and #0xFF
|
|
sta ch
|
|
}
|
|
return ch;
|
|
}
|
|
|
|
|
|
char _toupper(c)
|
|
char c;
|
|
{
|
|
char ch;
|
|
|
|
asm {
|
|
lda c
|
|
and #0xFF
|
|
tax
|
|
lda >D_TOUPPERTABLE,x
|
|
and #0xFF
|
|
sta ch
|
|
}
|
|
return ch;
|
|
}
|
|
|
|
|
|
isupper(c)
|
|
char c;
|
|
{
|
|
return (isalpha(c) && c == _toupper(c));
|
|
}
|
|
|
|
|
|
islower(c)
|
|
char c;
|
|
{
|
|
return (isalpha(c) && c == tolower(c));
|
|
}
|
|
|
|
isalpha(c)
|
|
char c;
|
|
{
|
|
asm {
|
|
lda c
|
|
jsl >D_ISLETTER
|
|
bcs no
|
|
}
|
|
return 1;
|
|
no: return 0;
|
|
}
|