sscanf.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Version: MPL 1.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is the sscanf 2.0 SA:MP plugin.
  15. *
  16. * The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  17. * Portions created by the Initial Developer are Copyright (C) 2010
  18. * the Initial Developer. All Rights Reserved.
  19. *
  20. * Contributor(s):
  21. *
  22. * Special Thanks to:
  23. *
  24. * SA:MP Team past, present and future
  25. */
  26. #pragma once
  27. typedef
  28. void (* logprintf_t)(char *, ...);
  29. typedef
  30. char * (* GetServer_t)();
  31. // 0.3 compatible
  32. /*typedef
  33. unsigned short
  34. PLAYERID;
  35. #define SERVER_VERSION_0221 (0x0221)
  36. #define SERVER_VERSION_0222 (0x0222)
  37. #define SERVER_VERSION_0223 (0x0223)
  38. #define SERVER_VERSION_0224 (0x0224)
  39. #define SERVER_VERSION_0200 (0x0200)
  40. #define SERVER_VERSION_0300 (0x0300)
  41. #define SERVER_VERSION_0340 (0x0340) // 0.3d
  42. #define SERVER_VERSION_0342 (0x0342) // 0.3dR2
  43. #define MAX_PLAYERS_0200 (200)
  44. #define INVALID_PLAYER_ID_0200 (255)
  45. // Change after 0.3 real release.
  46. #define MAX_PLAYERS_0300 (500)
  47. #define INVALID_PLAYER_ID_0300 (65535)
  48. #define MAX_PLAYER_NAME (24)
  49. #ifndef NULL
  50. #define NULL (0)
  51. #endif
  52. #ifdef WIN32
  53. #define LOGPRINTF_0221 ((logprintf_t)0x00476D90)
  54. #define LOGPRINTF_0222 ((logprintf_t)0x00477020)
  55. #define LOGPRINTF_0223 ((logprintf_t)3)
  56. #define LOGPRINTF_0224 ((logprintf_t)0x0046A590)
  57. // Change after final release.
  58. #define LOGPRINTF_0300 ((logprintf_t)0x00476380)
  59. #define LOGPRINTF_0340 ((logprintf_t)0x004823D0) // Maybe 0x004823D0
  60. #define LOGPRINTF_0342 ((logprintf_t)0x00482400) // by dnee`THA
  61. #else
  62. #define LOGPRINTF_0221 ((logprintf_t)1)
  63. #define LOGPRINTF_0222 ((logprintf_t)2)
  64. #define LOGPRINTF_0223 ((logprintf_t)3)
  65. #define LOGPRINTF_0224 ((logprintf_t)0x0807D760)
  66. // Change after final release.
  67. #define LOGPRINTF_0300 ((logprintf_t)5)
  68. #define LOGPRINTF_0340 ((logprintf_t)0x080765D0)
  69. #define LOGPRINTF_0342 ((logprintf_t)0x08076600) // by dnee`THA
  70. #endif*/
  71. #define SSCANF_FAIL_RETURN (-1)
  72. #define SSCANF_CONT_RETURN (((unsigned int)-1) >> 1)
  73. #define SSCANF_TRUE_RETURN (0)
  74. // Capped for memory reasons. I chose 32 because it's a reasonable length for
  75. // many uses and frankly if they get warnings and don't fix them it's their
  76. // own fault if they have problems with strings!
  77. #define SSCANF_MAX_LENGTH (32)
  78. // 32 bit special float values.
  79. #define FLOAT_INFINITY (0x7F800000)
  80. #define FLOAT_NEG_INFINITY (0xFF800000)
  81. #define FLOAT_NAN (0xFFFFFFFF)
  82. #define FLOAT_NAN_E (0x7FFFFFFF)
  83. #define FLOAT_NEGATIVE_INFINITY (FLOAT_NEG_INFINITY)
  84. #define SSCANF_QUIET 0