summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-30 06:16:08 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-30 06:16:08 +0000
commit2d33d82794559b83131b83528279ce898716c112 (patch)
tree0cf9f625341314a54010e027a9c01305de797c08 /src/map/atcommand.c
parent5b5afa7bb6cad66880bbbeee26d0851f25f85d45 (diff)
downloadhercules-2d33d82794559b83131b83528279ce898716c112.tar.gz
hercules-2d33d82794559b83131b83528279ce898716c112.tar.bz2
hercules-2d33d82794559b83131b83528279ce898716c112.tar.xz
hercules-2d33d82794559b83131b83528279ce898716c112.zip
* Added all the missing defines for ctype.h functions and converted all the direct uses to the defines.
Ref: http://www.eathena.ws/board/index.php?showtopic=145235 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10091 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e47deeb25..1b12d336c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -798,12 +798,12 @@ AtCommandType is_atcommand_sub(const int fd, struct map_session_data* sd, const
memset(command, '\0', sizeof(command));
memset(atcmd_output, '\0', sizeof(atcmd_output));
- while (*p && !isspace(*p))
+ while (*p && !ISSPACE(*p))
p++;
if (p - str >= sizeof(command)) // too long
return AtCommand_Unknown;
strncpy(command, str, p - str);
- while (isspace(*p))
+ while (ISSPACE(*p))
p++;
if (type == AtCommand_Unknown || info.proc == NULL) {
@@ -842,7 +842,7 @@ AtCommandType is_atcommand(const int fd, struct map_session_data* sd, const char
return AtCommand_None;
str += strlen(sd->status.name);
- while (*str && (isspace(*str) || (s_flag == 0 && *str == ':'))) {
+ while (*str && (ISSPACE(*str) || (s_flag == 0 && *str == ':'))) {
if (*str == ':')
s_flag = 1;
str++;
@@ -1107,8 +1107,8 @@ int atcommand_send(const int fd, struct map_session_data* sd, const char* comman
#define SKIP_VALUE(p) \
{\
- while(*(p) && !isspace(*(p))) ++(p); /* non-space */\
- while(*(p) && isspace(*(p))) ++(p); /* space */\
+ while(*(p) && !ISSPACE(*(p))) ++(p); /* non-space */\
+ while(*(p) && ISSPACE(*(p))) ++(p); /* space */\
}
//define SKIP_VALUE
@@ -1148,30 +1148,30 @@ int atcommand_send(const int fd, struct map_session_data* sd, const char* comman
// parse packet contents
SKIP_VALUE(message);
while(*message != 0 && off < len){
- if(isdigit(*message) || *message == '-' || *message == '+')
+ if(ISDIGIT(*message) || *message == '-' || *message == '+')
{// default (byte)
GET_VALUE(message,num);
WFIFOB(fd,off)=TOB(num);
++off;
- } else if(toupper(*message) == 'B')
+ } else if(TOUPPER(*message) == 'B')
{// byte
++message;
GET_VALUE(message,num);
WFIFOB(fd,off)=TOB(num);
++off;
- } else if(toupper(*message) == 'W')
+ } else if(TOUPPER(*message) == 'W')
{// word (2 bytes)
++message;
GET_VALUE(message,num);
WFIFOW(fd,off)=TOW(num);
off+=2;
- } else if(toupper(*message) == 'L')
+ } else if(TOUPPER(*message) == 'L')
{// long word (4 bytes)
++message;
GET_VALUE(message,num);
WFIFOL(fd,off)=TOL(num);
off+=4;
- } else if(toupper(*message) == 'S')
+ } else if(TOUPPER(*message) == 'S')
{// string - escapes are valid
// get string length - num <= 0 means not fixed length (default)
++message;
@@ -1181,7 +1181,7 @@ int atcommand_send(const int fd, struct map_session_data* sd, const char* comman
GET_VALUE(message,num);
while(*message != '"')
{// find start of string
- if(*message == 0 || isspace(*message)){
+ if(*message == 0 || ISSPACE(*message)){
PARSE_ERROR("Not a string:",message);
return -1;
}
@@ -1211,16 +1211,16 @@ int atcommand_send(const int fd, struct map_session_data* sd, const char* comman
{
++message;
CHECK_EOS(message);
- if(!isxdigit(*message)){
+ if(!ISXDIGIT(*message)){
PARSE_ERROR("Not a hexadecimal digit:",message);
return -1;
}
- num=(isdigit(*message)?*message-'0':tolower(*message)-'a'+10);
- if(isxdigit(*message)){
+ num=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10);
+ if(ISXDIGIT(*message)){
++message;
CHECK_EOS(message);
num<<=8;
- num+=(isdigit(*message)?*message-'0':tolower(*message)-'a'+10);
+ num+=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10);
}
WFIFOB(fd,off)=TOB(num);
++message;
@@ -1239,12 +1239,12 @@ int atcommand_send(const int fd, struct map_session_data* sd, const char* comman
num=*message-'0'; // 1st octal digit
++message;
CHECK_EOS(message);
- if(isdigit(*message) && *message < '8'){
+ if(ISDIGIT(*message) && *message < '8'){
num<<=3;
num+=*message-'0'; // 2nd octal digit
++message;
CHECK_EOS(message);
- if(isdigit(*message) && *message < '8'){
+ if(ISDIGIT(*message) && *message < '8'){
num<<=3;
num+=*message-'0'; // 3rd octal digit
++message;
@@ -1492,7 +1492,7 @@ int atcommand_who3(const int fd, struct map_session_data* sd, const char* comman
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
- match_text[j] = tolower(match_text[j]);
+ match_text[j] = TOLOWER(match_text[j]);
count = 0;
GM_level = pc_isGM(sd);
@@ -1503,7 +1503,7 @@ int atcommand_who3(const int fd, struct map_session_data* sd, const char* comman
if (!((battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
for (j = 0; player_name[j]; j++)
- player_name[j] = tolower(player_name[j]);
+ player_name[j] = TOLOWER(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
if (battle_config.who_display_aid > 0 && pc_isGM(sd) >= battle_config.who_display_aid) {
@@ -1565,7 +1565,7 @@ int atcommand_who2(const int fd, struct map_session_data* sd, const char* comman
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
- match_text[j] = tolower(match_text[j]);
+ match_text[j] = TOLOWER(match_text[j]);
count = 0;
GM_level = pc_isGM(sd);
@@ -1576,7 +1576,7 @@ int atcommand_who2(const int fd, struct map_session_data* sd, const char* comman
if (!((battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
for (j = 0; player_name[j]; j++)
- player_name[j] = tolower(player_name[j]);
+ player_name[j] = TOLOWER(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
//Players Name
//sprintf(atcmd_output, "Name: %s ", pl_sd->status.name);
@@ -1636,7 +1636,7 @@ int atcommand_who(const int fd, struct map_session_data* sd, const char* command
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
- match_text[j] = tolower(match_text[j]);
+ match_text[j] = TOLOWER(match_text[j]);
count = 0;
GM_level = pc_isGM(sd);
@@ -1647,7 +1647,7 @@ int atcommand_who(const int fd, struct map_session_data* sd, const char* command
if (!((battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
for (j = 0; player_name[j]; j++)
- player_name[j] = tolower(player_name[j]);
+ player_name[j] = TOLOWER(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
g = guild_search(pl_sd->status.guild_id);
p = party_search(pl_sd->status.party_id);
@@ -1901,7 +1901,7 @@ int atcommand_whogm(const int fd, struct map_session_data* sd, const char* comma
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
- match_text[j] = tolower(match_text[j]);
+ match_text[j] = TOLOWER(match_text[j]);
count = 0;
GM_level = pc_isGM(sd);
@@ -1913,7 +1913,7 @@ int atcommand_whogm(const int fd, struct map_session_data* sd, const char* comma
if (!((battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
for (j = 0; player_name[j]; j++)
- player_name[j] = tolower(player_name[j]);
+ player_name[j] = TOLOWER(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
sprintf(atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
clif_displaymessage(fd, atcmd_output);
@@ -1968,7 +1968,7 @@ int atcommand_whozeny(const int fd, struct map_session_data* sd, const char* com
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
for (j = 0; match_text[j]; j++)
- match_text[j] = tolower(match_text[j]);
+ match_text[j] = TOLOWER(match_text[j]);
count = 0;
pl_allsd = map_getallusers(&users);
@@ -1983,7 +1983,7 @@ int atcommand_whozeny(const int fd, struct map_session_data* sd, const char* com
if ((pl_sd = pl_allsd[i])) {
memcpy(player_name, pl_sd->status.name, NAME_LENGTH);
for (j = 0; player_name[j]; j++)
- player_name[j] = tolower(player_name[j]);
+ player_name[j] = TOLOWER(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
zeny[count]=pl_sd->status.zeny;
counted[i]=0;
@@ -3248,7 +3248,7 @@ int atcommand_go(const int fd, struct map_session_data* sd, const char* command,
// get possible name of the city
map_name[MAP_NAME_LENGTH-1] = '\0';
for (i = 0; map_name[i]; i++)
- map_name[i] = tolower(map_name[i]);
+ map_name[i] = TOLOWER(map_name[i]);
// try to see if it's a name, and not a number (try a lot of possibilities, write errors and abbreviations too)
if (strncmp(map_name, "prontera", 3) == 0) { // 3 first characters
town = 0;