1
0

ns-eel-func-ref.h 5.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _NSEEL_FUNC_REF_H_
  2. #define _NSEEL_FUNC_REF_H_
  3. #include "ns-eel.h"
  4. #define TMP_MKSTR2(x) #x
  5. #define TMP_MKSTR(x) TMP_MKSTR2(x)
  6. const char *nseel_builtin_function_reference=
  7. "while\texpression\tExecutes expression until expression evaluates to zero"
  8. #if NSEEL_LOOPFUNC_SUPPORT_MAXLEN
  9. ", or until " TMP_MKSTR(NSEEL_LOOPFUNC_SUPPORT_MAXLEN) "iterations occur"
  10. #endif
  11. ". An alternate and more useful syntax is while (expression) ( statements ), which evaluates statements after "
  12. "every non-zero evaluation of expression.\0"
  13. "loop\tcount,expression\tEvaluates count once, and then executes expression count"
  14. #if NSEEL_LOOPFUNC_SUPPORT_MAXLEN
  15. ", but not more than " TMP_MKSTR(NSEEL_LOOPFUNC_SUPPORT_MAXLEN) ","
  16. #endif
  17. " times.\0"
  18. "sin\tangle\tReturns the sine of the angle specified (specified in radians -- to convert from degrees to radians, multiply by $pi/180, or 0.017453).\0"
  19. "cos\tangle\tReturns the cosine of the angle specified (specified in radians).\0"
  20. "tan\tangle\tReturns the tangent of the angle specified (specified in radians).\0"
  21. "sqrt\tvalue\tReturns the square root of the parameter. If the parameter is negative, the return value is undefined.\0"
  22. "log\tvalue\tReturns the natural logarithm (base e) of the parameter. If the value is not greater than 0, the return value is undefined.\0"
  23. "log10\tvalue\tReturns the base-10 logarithm of the parameter. If the value is not greater than 0, the return value is undefined.\0"
  24. "asin\tvalue\tReturns the arc sine of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.\0"
  25. "acos\tvalue\tReturns the arc cosine of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.\0"
  26. "atan\tvalue\tReturns the arc tangent of the value specified (return value is in radians). If the parameter is not between -1.0 and 1.0 inclusive, the return value is undefined.\0"
  27. "atan2\tnumerator,denominator\tReturns the arc tangent of the numerator divided by the denominator, allowing the denominator to be 0, and using their signs to produce a more meaningful result.\0"
  28. "exp\texponent\tReturns the number e ($e, approximately 2.718) raised to the parameter-th power. This function is significantly faster than pow() or the ^ operator.\0"
  29. "abs\tvalue\tReturns the absolute value of the parameter.\0"
  30. "sqr\tvalue\tReturns the square of the parameter (similar to value*value, but only evaluating value once).\0"
  31. "min\t&value,&value\tReturns (by reference) the minimum value of the two parameters. Since min() returns by reference, expressions such as min(x,y) = 5 are possible.\0"
  32. "max\t&value,&value\tReturns (by reference) the maximum value of the two parameters. Since max() returns by reference, expressions such as max(x,y) = 5 are possible.\0"
  33. "sign\tvalue\tReturns 1.0 if the parameter is greater than 0, -1.0 if the parameter is less than 0, or 0 if the parameter is 0.\0"
  34. "floor\tvalue\tReturns the value rounded to the next lowest integer (floor(3.9)==3, floor(-3.1)==-4).\0"
  35. "ceil\tvalue\tReturns the value rounded to the next highest integer (ceil(3.1)==4, ceil(-3.9)==-3).\0"
  36. "invsqrt\tvalue\tReturns a fast inverse square root (1/sqrt(x)) approximation of the parameter.\0"
  37. "freembuf\taddress\tHints the runtime that memory above the address specified may no longer be used. The runtime may, at its leisure, choose to lose the contents of memory above the address specified.\0"
  38. "memcpy\tdest,src,length\tCopies length items of memory from src to dest. Regions are permitted to overlap.\0"
  39. "memset\toffset,value,length\tSets length items of memory at offset to value.\0"
  40. "mem_get_values\toffset, ...\tReads values from memory starting at offset into variables specified. Slower than regular memory reads for less than a few variables, faster for more than a few. Undefined behavior if used with more than 32767 variables.\0"
  41. "mem_set_values\toffset, ...\tWrites values to memory starting at offset from variables specified. Slower than regular memory writes for less than a few variables, faster for more than a few. Undefined behavior if used with more than 32767 variables.\0"
  42. "stack_push\t&value\tPushes value onto the user stack, returns a reference to the parameter.\0"
  43. "stack_pop\t&value\tPops a value from the user stack into value, or into a temporary buffer if value is not specified, and returns a reference to where the stack was popped. Note that no checking is done to determine if the stack is empty, and as such stack_pop() will never fail.\0"
  44. "stack_peek\tindex\tReturns a reference to the item on the top of the stack (if index is 0), or to the Nth item on the stack if index is greater than 0. \0"
  45. "stack_exch\t&value\tExchanges a value with the top of the stack, and returns a reference to the parameter (with the new value).\0"
  46. #ifdef NSEEL_EEL1_COMPAT_MODE
  47. "rand\tmax\tReturns a psuedorandom non-negative integer number less than the parameter.\0"
  48. "sigmoid\tvalue,constraint\tReturns 1.0/(1+exp(-x * (constraint))), or 0 if a divide by 0 would occur.\0"
  49. "band\tx,y\tReturns 1 if both x and y evaluate to nonzero, 0 if otherwise. Both parameters are always evaluated.\0"
  50. "bor\tx,y\tReturns 1 if either x or y evaluate to nonzero, 0 if otherwise. Both parameters are always evaluated.\0"
  51. "exec2\tx,y\tEvaluates x, then evaluates and returns y.\0"
  52. "exec3\tx,y,z\tEvaluates x, evaluates y, then evaluates and returns z.\0"
  53. #else
  54. "rand\t[max]\tReturns a psuedorandom real number between 0 and the parameter, inclusive. If the parameter is omitted or less than 1.0, 1.0 is used as a maximum instead.\0"
  55. #endif
  56. ;
  57. #undef TMP_MKSTR
  58. #endif