y_stripnumbers.inc 3.1 KB

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