pike.git / src / pike_error.h

version» Context lines:

pike.git/src/pike_error.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_error.h,v 1.26 2003/03/28 18:18:48 mast Exp $ + || $Id: pike_error.h,v 1.27 2003/03/28 22:00:46 mast Exp $   */      #ifndef PIKE_ERROR_H   #define PIKE_ERROR_H      #include "machine.h"      #ifdef HAVE_SETJMP_H   #include <setjmp.h>   #undef HAVE_SETJMP_H
pike.git/src/pike_error.h:233:    struct svalue *val,    struct svalue *ind,    const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 6, 7)));   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func,    struct svalue *base_sp, int args,    int which_arg,    const char *expected_type,    struct svalue *got,    const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 7, 8))); + PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error_2( +  const char *func, +  struct svalue *base_sp, int args, +  int which_arg, +  struct svalue *got, +  const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 6, 7)));   PMOD_EXPORT void DECLSPEC(noreturn) math_error(    const char *func,    struct svalue *base_sp, int args,    struct svalue *number,    const char *desc, ...) ATTRIBUTE((noreturn,format (printf, 5, 6)));   PMOD_EXPORT void DECLSPEC(noreturn) resource_error(    const char *func,    struct svalue *base_sp, int args,    const char *resource_type,    size_t howmuch,
pike.git/src/pike_error.h:257:    const char *permission_type,    const char *desc, ...) ATTRIBUTE((noreturn, format(printf, 5, 6)));   PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expected);   void init_error(void);   void cleanup_error(void);   /* Prototypes end here */      /* Some useful error macros. */       + /* This one should be used when the type of the argument is wrong. */   PMOD_EXPORT extern const char msg_bad_arg[]; -  + #define SIMPLE_ARG_TYPE_ERROR(FUNC, ARG, EXPECT) \ +  bad_arg_error(FUNC, Pike_sp-args, 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, Pike_sp-args, args, ARG, EXPECT, Pike_sp+ARG-1-args,\    msg_bad_arg, ARG, FUNC, EXPECT)    - PMOD_EXPORT extern const char msg_too_few_args[]; - #define SIMPLE_TOO_FEW_ARGS_ERROR(FUNC, ARG) \ -  bad_arg_error(FUNC, Pike_sp-args, args, ARG, "void", 0,\ -  msg_too_few_args,FUNC, ARG) + /* This one should be used when there's some other problem with the +  * argument than a bogus type. PROBLEM is a full sentence without a +  * trailing newline. */ + PMOD_EXPORT extern const char msg_bad_arg_2[]; + #define SIMPLE_ARG_ERROR(FUNC, ARG, PROBLEM) \ +  bad_arg_error_2(FUNC, Pike_sp-args, args, ARG, Pike_sp+ARG-1-args,\ +  msg_bad_arg_2, ARG, FUNC, PROBLEM)    - PMOD_EXPORT extern const char msg_wrong_num_args[]; +    #define SIMPLE_WRONG_NUM_ARGS_ERROR(FUNC, ARG) \ -  bad_arg_error(FUNC, Pike_sp-args, args, ARG, "void", 0,\ -  msg_wrong_num_args,FUNC, ARG) +  wrong_number_of_args_error (FUNC, args, ARG) + /* The following is for compatibility. */ + #define SIMPLE_TOO_FEW_ARGS_ERROR(FUNC, ARG) \ +  wrong_number_of_args_error (FUNC, args, ARG)      PMOD_EXPORT extern const char msg_out_of_mem[];   #define SIMPLE_OUT_OF_MEMORY_ERROR(FUNC, AMOUNT) \    resource_error(FUNC, Pike_sp-args, args, "memory", AMOUNT, msg_out_of_mem)      PMOD_EXPORT extern const char msg_div_by_zero[];   #define SIMPLE_DIVISION_BY_ZERO_ERROR(FUNC) \    math_error(FUNC, Pike_sp-args, args, 0, msg_div_by_zero)      #ifndef PIKE_DEBUG