y_stripnumbers.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**--------------------------------------------------------------------------**\
  2. =====================
  3. YSI - Strip Numbers
  4. =====================
  5. Description:
  6. Removes tag overrides which are actually numbers. This allows for:
  7. uvar g_a[MAX_PLAYERS][E_SOME_ENUM];
  8. uvar g_b[MAX_PLAYERS][42];
  9. Without stripping you would end with code doing "42:0" or getting a tag
  10. mismatch on "E_SOME_ENUM", both of which are problems.
  11. Legal:
  12. Version: MPL 1.1
  13. The contents of this file are subject to the Mozilla Public License Version
  14. 1.1 (the "License"); you may not use this file except in compliance with
  15. the License. You may obtain a copy of the License at
  16. http://www.mozilla.org/MPL/
  17. Software distributed under the License is distributed on an "AS IS" basis,
  18. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  19. for the specific language governing rights and limitations under the
  20. License.
  21. The Original Code is the YSI master systems include.
  22. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  23. Portions created by the Initial Developer are Copyright (C) 2011
  24. the Initial Developer. All Rights Reserved.
  25. Contributors:
  26. ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice
  27. Thanks:
  28. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  29. ZeeX - Very productive conversations.
  30. koolk - IsPlayerinAreaEx code.
  31. TheAlpha - Danish translation.
  32. breadfish - German translation.
  33. Fireburn - Dutch translation.
  34. yom - French translation.
  35. 50p - Polish translation.
  36. Zamaroht - Spanish translation.
  37. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes
  38. for me to strive to better.
  39. Pixels^ - Running XScripters where the idea was born.
  40. Matite - Pestering me to release it and using it.
  41. Very special thanks to:
  42. Thiadmer - PAWN, whose limits continue to amaze me!
  43. Kye/Kalcor - SA:MP.
  44. SA:MP Team past, present and future - SA:MP.
  45. Version:
  46. 1.0
  47. Changelog:
  48. -
  49. Functions:
  50. Public:
  51. -
  52. Core:
  53. -
  54. Stock:
  55. -
  56. Static:
  57. -
  58. Inline:
  59. -
  60. API:
  61. -
  62. Hooks:
  63. -
  64. Callbacks:
  65. -
  66. Definitions:
  67. -
  68. Enums:
  69. -
  70. Macros:
  71. -
  72. Tags:
  73. -
  74. Variables:
  75. Global:
  76. -
  77. Static:
  78. -
  79. Commands:
  80. -
  81. Compile options:
  82. -
  83. Operators:
  84. -
  85. Natives:
  86. -
  87. </remarks>
  88. \**--------------------------------------------------------------------------**/
  89. #if defined _INC_y_stripnumbers
  90. #endinput
  91. #endif
  92. #define _INC_y_stripnumbers
  93. // This code uses the "@S.:" prefix, where "." is a number or underscore (for
  94. // any other symbol. y_stringise (aka. y_stringize) uses several letters from
  95. // this same set.
  96. #define STRIP_NUMBERS:%0|||%1:%2||| _:@S0:@S1:@S2:@S3:@S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||%1:%2|||
  97. #define @S0:@S1:@S2:@S3:@S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||0%1:%2||| %0[%2]
  98. #define @S1:@S2:@S3:@S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||1%1:%2||| %0[%2]
  99. #define @S2:@S3:@S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||2%1:%2||| %0[%2]
  100. #define @S3:@S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||3%1:%2||| %0[%2]
  101. #define @S4:@S5:@S6:@S7:@S8:@S9:@S_:%0|||4%1:%2||| %0[%2]
  102. #define @S5:@S6:@S7:@S8:@S9:@S_:%0|||5%1:%2||| %0[%2]
  103. #define @S6:@S7:@S8:@S9:@S_:%0|||6%1:%2||| %0[%2]
  104. #define @S7:@S8:@S9:@S_:%0|||7%1:%2||| %0[%2]
  105. #define @S8:@S9:@S_:%0|||8%1:%2||| %0[%2]
  106. #define @S9:@S_:%0|||9%1:%2||| %0[%2]
  107. #define @S_:%0|||%1:%2||| %0[%1:%2]