9
3

unix.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "unix.h"
  17. #include <string.h>
  18. #include <ctype.h>
  19. void Sleep(unsigned int x) {
  20. if (x > 0)
  21. usleep(x*1000);
  22. }
  23. char* strupr(char* tmp) {
  24. int l = strlen(tmp);
  25. for (int x = 0; x < l; x++) {
  26. tmp[x] = toupper(tmp[x]);
  27. }
  28. return tmp;
  29. }
  30. char* strlwr(char* tmp) {
  31. int l = strlen(tmp);
  32. for (int x = 0; x < l; x++) {
  33. tmp[x] = tolower(tmp[x]);
  34. }
  35. return tmp;
  36. }