y_va_header.inc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #if defined _INC_y_va_header
  2. #endinput
  3. #endif
  4. #define _INC_y_va_header
  5. /*
  6. Legal:
  7. Version: MPL 1.1
  8. The contents of this file are subject to the Mozilla Public License Version
  9. 1.1 the "License"; you may not use this file except in compliance with
  10. the License. You may obtain a copy of the License at
  11. http://www.mozilla.org/MPL/
  12. Software distributed under the License is distributed on an "AS IS" basis,
  13. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  14. for the specific language governing rights and limitations under the
  15. License.
  16. The Original Code is the YSI framework.
  17. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  18. Portions created by the Initial Developer are Copyright C 2011
  19. the Initial Developer. All Rights Reserved.
  20. Contributors:
  21. Y_Less
  22. koolk
  23. JoeBullet/Google63
  24. g_aSlice/Slice
  25. Misiur
  26. samphunter
  27. tianmeta
  28. maddinat0r
  29. spacemud
  30. Crayder
  31. Dayvison
  32. Ahmad45123
  33. Zeex
  34. irinel1996
  35. Yiin-
  36. Chaprnks
  37. Konstantinos
  38. Masterchen09
  39. Southclaws
  40. PatchwerkQWER
  41. m0k1
  42. paulommu
  43. udan111
  44. Thanks:
  45. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  46. ZeeX - Very productive conversations.
  47. koolk - IsPlayerinAreaEx code.
  48. TheAlpha - Danish translation.
  49. breadfish - German translation.
  50. Fireburn - Dutch translation.
  51. yom - French translation.
  52. 50p - Polish translation.
  53. Zamaroht - Spanish translation.
  54. Los - Portuguese translation.
  55. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  56. me to strive to better.
  57. Pixels^ - Running XScripters where the idea was born.
  58. Matite - Pestering me to release it and using it.
  59. Very special thanks to:
  60. Thiadmer - PAWN, whose limits continue to amaze me!
  61. Kye/Kalcor - SA:MP.
  62. SA:MP Team past, present and future - SA:MP.
  63. Optional plugins:
  64. Gamer_Z - GPS.
  65. Incognito - Streamer.
  66. Me - sscanf2, fixes2, Whirlpool.
  67. */
  68. #if 0
  69. // Example:
  70. stock MyPrintf(const format[], {Float, File, _}:...)
  71. {
  72. // The triple underscore is used to mirror the triple dots in the
  73. // function definition. You can't easily tell it is three from a
  74. // glance, but it is.
  75. printf(format, ___1); // Or `___(1)`.
  76. print("Printed many things");
  77. return 42;
  78. }
  79. #endif
  80. #define ___ YVA2_DummyPush()
  81. // For optional parameter skips.
  82. #define YVA2_DummyPush()(%1) YVA2_DummyPush((%1) * 4)
  83. // Shortcuts.
  84. #define ___0 ___(0)
  85. #define ___1 ___(1)
  86. #define ___2 ___(2)
  87. #define ___3 ___(3)
  88. #define ___4 ___(4)
  89. #define ___5 ___(5)
  90. #define ___6 ___(6)
  91. #define ___7 ___(7)
  92. #define ___8 ___(8)
  93. #define ___9 ___(9)
  94. #define va_args<%0> GLOBAL_TAG_TYPES:...
  95. #define va_start<%0> ___(%0)
  96. // Detect Slice's va_formatex function, which now doesn't need to exist. This
  97. // is my first ever use of `#pragma deprecated`! Actually quite happy about
  98. // that - it's one of the few language features I've never used in earnest, so
  99. // its almost an occassion when that happens.
  100. #pragma deprecated Use formatex instead
  101. forward va_formatex(output[], size = sizeof(output), const fmat[], va_:STATIC_ARGS);
  102. // Backwards compatability.
  103. #if defined BAD_printf
  104. native va_printf (const format[], GLOBAL_TAG_TYPES:...) = BAD_printf;
  105. #else
  106. native va_printf (const format[], GLOBAL_TAG_TYPES:...) = printf;
  107. #endif
  108. #if defined BAD_CallRemoteFunction
  109. native va_CallRemoteFunction(const function[], const format[], GLOBAL_TAG_TYPES:...) = BAD_CallRemoteFunction;
  110. #else
  111. native va_CallRemoteFunction(const function[], const format[], GLOBAL_TAG_TYPES:...) = CallRemoteFunction;
  112. #endif
  113. #if defined BAD_CallLocalFunction
  114. native va_CallLocalFunction (const function[], const format[], GLOBAL_TAG_TYPES:...) = BAD_CallLocalFunction;
  115. #else
  116. native va_CallLocalFunction (const function[], const format[], GLOBAL_TAG_TYPES:...) = CallLocalFunction;
  117. #endif
  118. #if defined BAD_SetTimerEx
  119. native va_SetTimerEx (const function[], interval, repeating, const format[], GLOBAL_TAG_TYPES:...) = BAD_SetTimerEx;
  120. #else
  121. native va_SetTimerEx (const function[], interval, repeating, const format[], GLOBAL_TAG_TYPES:...) = SetTimerEx;
  122. #endif
  123. #if defined BAD_format
  124. native va_format (output[], len, const format[], GLOBAL_TAG_TYPES:...) = BAD_format;
  125. #else
  126. native va_format (output[], len, const format[], GLOBAL_TAG_TYPES:...) = format;
  127. #endif