pike.git / src / pike_error.h

version» Context lines:

pike.git/src/pike_error.h:247:    int args,    struct svalue *val,    struct svalue *ind,    const char *desc, ...) ATTRIBUTE((noreturn));   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func, int args,    int which_arg,    const char *expected_type,    struct svalue *got,    const char *desc, ...) ATTRIBUTE((noreturn)); + PMOD_EXPORT DECLSPEC(noreturn) void bad_args_error( +  int args) ATTRIBUTE((noreturn));   PMOD_EXPORT void DECLSPEC(noreturn) math_error(    const char *func, int args,    struct svalue *number,    const char *desc, ...) ATTRIBUTE((noreturn));   PMOD_EXPORT void DECLSPEC(noreturn) out_of_memory_error (    const char *func, int args,    size_t amount) ATTRIBUTE((noreturn));   PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expected)    ATTRIBUTE((noreturn));   void init_error(void);
pike.git/src/pike_error.h:269:      /* Some useful error macros. */      PMOD_EXPORT extern const char msg_bad_arg[];      /**    * Throw an exception that the type of an argument is wrong. ARG, FUNC    * and EXPECT will be inserted into "Bad argument %d to %s(). Expected    * %s.\n"    * -  * @param FUNC The name of the function, e.g. "create". +  * @param FUNC The name of the function, e.g. "create". If NULL the +  * name will be looked up from the current frame.    * @param ARG The number of the argument, e.g. 1 for the first.    * @param EXPECT The expected type, e.g. "int(0..1)".    */   #define SIMPLE_ARG_TYPE_ERROR(FUNC, ARG, EXPECT) \    bad_arg_error(FUNC, args, ARG, EXPECT, Pike_sp+ARG-1-args,\    msg_bad_arg, ARG, FUNC, EXPECT)   /* Less descriptive macro name kept for compatibility. */   #define SIMPLE_BAD_ARG_ERROR(FUNC, ARG, EXPECT) \    bad_arg_error(FUNC, args, ARG, EXPECT, Pike_sp+ARG-1-args,\    msg_bad_arg, ARG, FUNC, EXPECT)      PMOD_EXPORT extern const char msg_bad_arg_2[];      /**    * Throw an exception that there is some problem with the argument    * other than the wrong type. PROBLEM is a full sentence without a    * trailing newline. Together with FUNC and ARG they will be inserted -  * into "Bad argument %d to %s(). %s\n" +  * into "Bad argument %d to %s(). %s\n".    * -  * @param FUNC The name of the function, e.g. "create". +  * @param FUNC The name of the function, e.g. "create". If NULL the +  * name will be looked up from the current frame.    * @param ARG The number of the argument, e.g. 1 for the first.    * @param PROBLEM Describes the problem with the argument, e.g. "The    * number of bytes has to be even."    */   #define SIMPLE_ARG_ERROR(FUNC, ARG, PROBLEM) \    bad_arg_error (FUNC, args, ARG, NULL, Pike_sp+ARG-1-args, \    msg_bad_arg_2, ARG, FUNC, PROBLEM)      /** -  +  * Throw an exception that there is a generic problem with the +  * arguments, not tied to any one specific argument. +  */ + #define GENERIC_ARGS_ERROR() bad_args_error(args) +  + /**    * Throw an exception that the number of arguents to the function is    * wrong. This macro will use the variable args as the number of given    * arguments.    *    * @param FUNC The name of the function, e.g. "create".    * @param ARG The number of expected arguments.    */   #define SIMPLE_WRONG_NUM_ARGS_ERROR(FUNC, ARG) \    wrong_number_of_args_error (FUNC, args, ARG)   /* The following is for compatibility. */