45 #ifndef OTPBIF_INCLUDED
46 #define OTPBIF_INCLUDED
91 #define fix_args(x) expandArgs(arguments, argcount, x##_MIN, x##_MAX, CHAR_##x)
92 #define check_args(x) expandArgs(arguments, argcount, x##_MIN, x##_MAX, CHAR_##x)
94 #define get_arg(x,n) arguments[x##_##n - 1]
95 #define set_arg(x,n1,n2) arguments[x##_##n1 - 1] = arguments[x##_##n2 - 1]
97 #define required_string(x,n) requiredStringArg(x##_##n, arguments, argcount, CHAR_##x)
98 #define optional_string(x,n) optionalStringArg(x##_##n, arguments, argcount, CHAR_##x)
100 #define required_text(x,n) requiredTextArg(x##_##n, arguments, argcount, CHAR_##x)
102 #define required_integer(x,n) requiredIntegerArg(x##_##n, arguments, argcount, CHAR_##x)
103 #define optional_integer(x,n) optionalIntegerArg(x##_##n, arguments, argcount, CHAR_##x)
105 #define required_big_integer(x,n) requiredBigIntegerArg(x##_##n, arguments, argcount, CHAR_##x)
106 #define optional_big_integer(x,n) optionalBigIntegerArg(x##_##n, arguments, argcount, CHAR_##x)
108 #define optional_argument(x,n) ((argcount >= x##_##n) ? arguments[x##_##n -1] : OREF_NULL )
109 #define arg_exists(x,n) ((argcount < x##_##n) ? false : arguments[x##_##n - 1] != OREF_NULL )
110 #define arg_omitted(x,n) ((argcount < x##_##n) ? true : arguments[x##_##n - 1] == OREF_NULL )
112 #define BUILTIN(x) RexxObject *builtin_function_##x ( RexxActivation * context, RexxObject **arguments, size_t argcount, size_t named_argcount, RexxExpressionStack *stack )
114 #define positive_integer(n,f,p) if (n <= 0) reportException(Error_Incorrect_call_positive, CHAR_##f, OREF_positional, p, n)
115 #define nonnegative_integer(n,f,p) if (n < 0) reportException(Error_Incorrect_call_nonnegative, CHAR_##f, OREF_positional, p, n)
117 #define ALPHANUM "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
RexxString * requiredStringArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)
void expandArgs(RexxObject **arguments, size_t argcount, size_t min, size_t max, const char *function)
RexxInteger * requiredIntegerArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)
RexxString * optionalStringArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)
RexxObject * optionalBigIntegerArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)
RexxInteger * optionalIntegerArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)
RexxObject * requiredBigIntegerArg(size_t position, RexxObject **arguments, size_t argcount, const char *function)