diff --git a/src/odoors/GNUmakefile b/src/odoors/GNUmakefile index ceab60f2b76bdd13daa8fc9f3831d3abf7b0570e..997a4bf3701e593886b9f4f3f180e1253045523f 100644 --- a/src/odoors/GNUmakefile +++ b/src/odoors/GNUmakefile @@ -138,6 +138,7 @@ OBJECTS := ${OBJDIR}ODAuto${OBJFILE}\ ${OBJDIR}ODSpawn${OBJFILE}\ ${OBJDIR}ODStand${OBJFILE}\ ${OBJDIR}ODStat${OBJFILE}\ + ${OBJDIR}ODStr${OBJFILE}\ ${OBJDIR}ODUtil${OBJFILE}\ ${OBJDIR}ODWCat${OBJFILE}\ ${OBJDIR}ODWin${OBJFILE} diff --git a/src/odoors/ODAuto.c b/src/odoors/ODAuto.c index a674a66906999cb3b517d513941f3661674ec8af..e41f3e74af34365214517f25f88b6c6043446266 100644 --- a/src/odoors/ODAuto.c +++ b/src/odoors/ODAuto.c @@ -42,6 +42,7 @@ #include <ctype.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODTypes.h" #include "ODGen.h" #include "ODPlat.h" diff --git a/src/odoors/ODCFile.c b/src/odoors/ODCFile.c index ad14f3cb11f7dc5248dc8bd22b54e57caa7d4602..eb3a4a3a4345332f8506bb7e49f897d3728014f8 100644 --- a/src/odoors/ODCFile.c +++ b/src/odoors/ODCFile.c @@ -45,6 +45,7 @@ #include <time.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODInEx.h" diff --git a/src/odoors/ODCmdLn.c b/src/odoors/ODCmdLn.c index 76b3862e3a3cd29dfa8f9de314aef588b7284f3b..5d0da98ce1709665f17c1f8866e2c6fc61c924d6 100644 --- a/src/odoors/ODCmdLn.c +++ b/src/odoors/ODCmdLn.c @@ -52,9 +52,7 @@ #include <ctype.h> #include "OpenDoor.h" -#ifdef ODPLAT_NIX -#define stricmp strcasecmp -#endif +#include "ODStr.h" #include "ODPlat.h" #include "ODCore.h" #include "ODInEx.h" diff --git a/src/odoors/ODCore.c b/src/odoors/ODCore.c index 39e61eaa218f33a14614d07aa339cab633470317..1d4df8520b3b6e7fb1ff7c6cd47af6f74236e9d8 100644 --- a/src/odoors/ODCore.c +++ b/src/odoors/ODCore.c @@ -80,6 +80,7 @@ #include <errno.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODGen.h" #include "ODPlat.h" #include "ODCom.h" diff --git a/src/odoors/ODEmu.c b/src/odoors/ODEmu.c index b45abb0dc025f981a4226de192cc427ba75b901b..b9eda1b15db4341328fef3dd9fdc5ba1cfd2a277 100644 --- a/src/odoors/ODEmu.c +++ b/src/odoors/ODEmu.c @@ -56,6 +56,7 @@ #include <stdarg.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODCom.h" diff --git a/src/odoors/ODInEx1.c b/src/odoors/ODInEx1.c index a8d7abe219c4ffb7b0c31e76f477eb7b0b8781a2..4d978f98b3374f4078c5842bc30b45f765aeb70e 100644 --- a/src/odoors/ODInEx1.c +++ b/src/odoors/ODInEx1.c @@ -87,9 +87,7 @@ #include <time.h> #include "OpenDoor.h" -#ifdef ODPLAT_NIX -#define strnicmp strncasecmp -#endif +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODScrn.h" diff --git a/src/odoors/ODInEx2.c b/src/odoors/ODInEx2.c index 2a1ac137e149b1c19100321b83e5052527e25ac4..82000bc2e47a1df02604f407ec5e62dd1c19defe 100644 --- a/src/odoors/ODInEx2.c +++ b/src/odoors/ODInEx2.c @@ -73,6 +73,7 @@ #include <time.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODCom.h" diff --git a/src/odoors/ODMulti.c b/src/odoors/ODMulti.c index f2b244fdb3fe408efc0ad8267a07a73a7f68f279..a81c4822f46eba8b781be850b1aabe84edcc1fac 100644 --- a/src/odoors/ODMulti.c +++ b/src/odoors/ODMulti.c @@ -48,6 +48,7 @@ #include <stdio.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODScrn.h" diff --git a/src/odoors/ODPCB.c b/src/odoors/ODPCB.c index 85cc550eb92a29d51e44323cecc134e662637ce9..f5b50955973464a0eb7417dd015e64e921007922 100644 --- a/src/odoors/ODPCB.c +++ b/src/odoors/ODPCB.c @@ -43,6 +43,7 @@ #include <time.h> #include "OpenDoor.h" +#include "ODStr.h" #include "ODCore.h" #include "ODGen.h" #include "ODScrn.h" diff --git a/src/odoors/ODSpawn.c b/src/odoors/ODSpawn.c index f29049a10f68de7d9a20403cfd21ca375e2eb49a..db6881d0783c5d50cacf6929a18efb1d6c63dc1d 100644 --- a/src/odoors/ODSpawn.c +++ b/src/odoors/ODSpawn.c @@ -58,6 +58,8 @@ #include "OpenDoor.h" #ifdef ODPLAT_NIX #include <signal.h> +#include <sys/types.h> +#include <sys/wait.h> #endif #include "ODCore.h" #include "ODGen.h" diff --git a/src/odoors/ODStr.c b/src/odoors/ODStr.c new file mode 100644 index 0000000000000000000000000000000000000000..15883f91c64cae4cd81f6a551dc60ca92993756b --- /dev/null +++ b/src/odoors/ODStr.c @@ -0,0 +1,54 @@ +/* OpenDoors Online Software Programming Toolkit + * (C) Copyright 1991 - 1999 by Brian Pirie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * File: ODStr.c + * + * Description: Functions used to mainuplate strings + * + * Revisions: Date Ver Who Change + * --------------------------------------------------------------- + * Aug 10, 2003 6.23 SH *nix support + */ + +#include "OpenDoor.h" + +#ifdef ODPLAT_NIX +#include <string.h> + +int +strlwr(char *str) +{ + size_t i; + for(i=0;i<strlen(str);i++) + { + if(str[i]>64 && str[i]<=91) str[i]=str[i]|32; + } + return 0; +} + +int +strupr(char *str) +{ + size_t i; + for(i=0;i<strlen(str);i++) + { + if(str[i]>96 && str[i]<123) str[i] &= 223; + } + return 0; +} +#endif diff --git a/src/odoors/ODStr.h b/src/odoors/ODStr.h new file mode 100644 index 0000000000000000000000000000000000000000..fe96011f8c1e89d8bc74704ee166fbf35ad6e8b8 --- /dev/null +++ b/src/odoors/ODStr.h @@ -0,0 +1,40 @@ +/* OpenDoors Online Software Programming Toolkit + * (C) Copyright 1991 - 1999 by Brian Pirie. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * File: ODStr.h + * + * Description: Functions used to maipulate strings + * + * Revisions: Date Ver Who Change + * --------------------------------------------------------------- + * Aug 10, 2003 6.23 SH Initial rev. + */ + +#include "OpenDoor.h" + +#ifndef _INC_ODSTR +#define _INC_ODSTR + +#ifdef ODPLAT_NIX +#define strnicmp strncasecmp +#define stricmp strcasecmp +int strlwr(char *str); +int strupr(char *str); +#endif + +#endif diff --git a/src/odoors/ODUtil.c b/src/odoors/ODUtil.c index def257bae0c68583d30e983722f8112f21e8d2af..df6f63594836321fba2c2438c5bc0fe0e381d819 100644 --- a/src/odoors/ODUtil.c +++ b/src/odoors/ODUtil.c @@ -44,9 +44,7 @@ #include <stdio.h> #include "OpenDoor.h" -#ifdef ODPLAT_NIX -#define stricmp strcasecmp -#endif +#include "ODStr.h" #include "ODUtil.h" #include "ODGen.h"