diff --git a/src/array.c b/src/array.c index 3b1c65b119c9c988381b6ca2d778b4a4dc25f43f..403d9f8c9954b419fe7a58c40092b803b1a09081 100644 --- a/src/array.c +++ b/src/array.c @@ -12,7 +12,7 @@ #include "stralloc.h" #include "interpret.h" #include "opcodes.h" -#include "error.h" +#include "pike_error.h" #include "pike_types.h" #include "fsort.h" #include "builtin_functions.h" @@ -23,7 +23,7 @@ #include "stuff.h" #include "bignum.h" -RCSID("$Id: array.c,v 1.96 2000/12/01 01:14:56 hubbe Exp $"); +RCSID("$Id: array.c,v 1.97 2000/12/01 08:09:43 hubbe Exp $"); PMOD_EXPORT struct array empty_array= { @@ -62,7 +62,7 @@ PMOD_EXPORT struct array *low_allocate_array(ptrdiff_t size, ptrdiff_t extra_spa v=(struct array *)malloc(sizeof(struct array)+ (size+extra_space-1)*sizeof(struct svalue)); if(!v) - error("Couldn't allocate array, out of memory.\n"); + Pike_error("Couldn't allocate array, out of memory.\n"); GC_ALLOC(v); @@ -246,9 +246,9 @@ PMOD_EXPORT void simple_set_index(struct array *a,struct svalue *ind,struct sval if(i<0) i+=a->size; if(i<0 || i>=a->size) { if (a->size) { - error("Index %d is out of array range 0 - %d.\n", i, a->size-1); + Pike_error("Index %d is out of array range 0 - %d.\n", i, a->size-1); } else { - error("Attempt to index the empty array with %d.\n", i); + Pike_error("Attempt to index the empty array with %d.\n", i); } } array_set_index(a,i,s); @@ -1033,14 +1033,14 @@ PMOD_EXPORT union anything *array_get_item_ptr(struct array *a, { INT32 i; if(ind->type != T_INT) - error("Index is not an integer.\n"); + Pike_error("Index is not an integer.\n"); i=ind->u.integer; if(i<0) i+=a->size; if(i<0 || i>=a->size) { if (a->size) { - error("Index %d is out of array range 0 - %d.\n", i, a->size-1); + Pike_error("Index %d is out of array range 0 - %d.\n", i, a->size-1); } else { - error("Attempt to index the empty array with %d.\n", i); + Pike_error("Attempt to index the empty array with %d.\n", i); } } return low_array_get_item_ptr(a,i,t); @@ -2292,7 +2292,7 @@ PMOD_EXPORT struct array *implode_array(struct array *a, struct array *b) for(e=0;e<a->size;e++) { if(ITEM(a)[e].type!=T_ARRAY) - error("Implode array contains non-arrays.\n"); + Pike_error("Implode array contains non-arrays.\n"); size+=ITEM(a)[e].u.array->size; } diff --git a/src/backend.c b/src/backend.c index aacc1970c2b29775a669ba92a31ae5ae9ad5a279..9895d504a4e9914799bb3ce10ad5ce30988fabf1 100644 --- a/src/backend.c +++ b/src/backend.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: backend.c,v 1.60 2000/11/20 01:20:24 mast Exp $"); +RCSID("$Id: backend.c,v 1.61 2000/12/01 08:09:43 hubbe Exp $"); #include "fdlib.h" #include "backend.h" #include <errno.h> @@ -18,7 +18,7 @@ RCSID("$Id: backend.c,v 1.60 2000/11/20 01:20:24 mast Exp $"); #include <string.h> #include "interpret.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "fd_control.h" #include "main.h" #include "callback.h" @@ -869,7 +869,7 @@ void backend(void) if((active_poll_fds[i].revents & POLLHUP) || (active_poll_fds[i].revents & POLLERR)) { - /* Closed or error */ + /* Closed or Pike_error */ #ifdef PIKE_DEBUG if (active_poll_fds[i].revents & POLLERR) { fprintf(stderr, "Got POLLERR on fd %d\n", i); @@ -1051,7 +1051,7 @@ void backend(void) #ifdef WSAENOTSOCK case WSAENOTSOCK: #endif - fatal("Filedescriptor %d (%s) caused fatal error %d in backend.\n",i,fd_info(i),errno); + fatal("Filedescriptor %d (%s) caused fatal Pike_error %d in backend.\n",i,fd_info(i),errno); case EINTR: break; diff --git a/src/bignum.c b/src/bignum.c index 3926d18dafb2343e5dd213914360a2096a90e828..cc907af397210c2a4bfa789499cd522471f4cd28 100644 --- a/src/bignum.c +++ b/src/bignum.c @@ -6,7 +6,7 @@ #include "program.h" #include "object.h" #include "svalue.h" -#include "error.h" +#include "pike_error.h" struct svalue auto_bignum_program = { T_INT }; @@ -25,7 +25,7 @@ static void resolve_auto_bignum_program(void) SAFE_APPLY_MASTER("resolv", 1); if(sp[-1].type != T_FUNCTION) - error("Failed to resolv Gmp.mpz!\n"); + Pike_error("Failed to resolv Gmp.mpz!\n"); auto_bignum_program=sp[-1]; sp--; @@ -61,7 +61,7 @@ PMOD_EXPORT void convert_stack_top_to_bignum(void) apply_svalue(&auto_bignum_program, 1); if(sp[-1].type != T_OBJECT) - error("Gmp.mpz conversion failed.\n"); + Pike_error("Gmp.mpz conversion failed.\n"); } PMOD_EXPORT void convert_stack_top_with_base_to_bignum(void) @@ -70,7 +70,7 @@ PMOD_EXPORT void convert_stack_top_with_base_to_bignum(void) apply_svalue(&auto_bignum_program, 2); if(sp[-1].type != T_OBJECT) - error("Gmp.mpz conversion failed.\n"); + Pike_error("Gmp.mpz conversion failed.\n"); } int is_bignum_object(struct object *o) @@ -114,7 +114,7 @@ PMOD_EXPORT struct pike_string *string_from_bignum(struct object *o, int base) safe_apply(o, "digits", 1); if(sp[-1].type != T_STRING) - error("Gmp.mpz string conversion failed.\n"); + Pike_error("Gmp.mpz string conversion failed.\n"); return (--sp)->u.string; } @@ -190,7 +190,7 @@ PMOD_EXPORT int int64_from_bignum(INT64 *i, struct object *bignum) push_int(0); apply_low(bignum, FIND_LFUN(bignum->prog, LFUN_LT), 1); if(sp[-1].type != T_INT) - error("Result from Gmp.bignum->`< not an integer.\n"); + Pike_error("Result from Gmp.bignum->`< not an integer.\n"); neg = (--sp)->u.integer; if(neg) @@ -206,7 +206,7 @@ PMOD_EXPORT int int64_from_bignum(INT64 *i, struct object *bignum) push_int(BIGNUM_INT64_MASK); apply_low(sp[-2].u.object, andfun, 1); if(sp[-1].type != T_INT) - error("Result from Gmp.bignum->`& not an integer.\n"); + Pike_error("Result from Gmp.bignum->`& not an integer.\n"); *i |= (INT64)(--sp)->u.integer << (INT64)pos; pos += BIGNUM_INT64_SHIFT; diff --git a/src/block_alloc.h b/src/block_alloc.h index 04b6126c3d5154a1844c404be881f9e590adc3b7..1ed339d9215e1ddfe7ad154c3d64937448fb0097 100644 --- a/src/block_alloc.h +++ b/src/block_alloc.h @@ -1,4 +1,4 @@ -/* $Id: block_alloc.h,v 1.25 2000/11/25 16:33:22 grubba Exp $ */ +/* $Id: block_alloc.h,v 1.26 2000/12/01 08:09:44 hubbe Exp $ */ #undef PRE_INIT_BLOCK #undef INIT_BLOCK #undef EXIT_BLOCK @@ -186,7 +186,7 @@ struct DATA *PIKE_CONCAT(make_,DATA)(void *ptr, ptrdiff_t hval) \ struct DATA *p; \ \ DO_IF_DEBUG( if(!PIKE_CONCAT(DATA,_hash_table)) \ - fatal("Hash table error!\n"); ) \ + fatal("Hash table Pike_error!\n"); ) \ PIKE_CONCAT(num_,DATA)++; \ \ if(( PIKE_CONCAT(num_,DATA)>>2 ) >= \ diff --git a/src/builtin_functions.c b/src/builtin_functions.c index e0451c11c9cfbbd30a6550a2cf4ad459e9e96c3c..1887a4b0ce2b9443a94a6da4447d1525c97b971d 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -5,14 +5,14 @@ \*/ /**/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.317 2000/10/31 10:05:21 mirar Exp $"); +RCSID("$Id: builtin_functions.c,v 1.318 2000/12/01 08:09:44 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "constants.h" #include "mapping.h" #include "stralloc.h" @@ -556,7 +556,7 @@ PMOD_EXPORT void f_has_prefix(INT32 args) CASE_SHIFT(2,0); CASE_SHIFT(2,1); default: - error("has_prefix(): Unexpected string shift combination: a:%d, b:%d!\n", + Pike_error("has_prefix(): Unexpected string shift combination: a:%d, b:%d!\n", a->size_shift, b->size_shift); break; } @@ -603,7 +603,7 @@ PMOD_EXPORT void f_has_index(INT32 args) case T_OBJECT: /* FIXME: If the object behaves like an array, it will throw an - error for non-valid indices. Therefore it's not a good idea + Pike_error for non-valid indices. Therefore it's not a good idea to use the index operator. Maybe we should use object->_has_index(index) provided that @@ -1127,12 +1127,12 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args) /* 0xfffe: Byte-order detection illegal character. * 0xffff: Illegal character. */ - error("string_to_unicode(): Illegal character 0x%04x (index %ld) " + Pike_error("string_to_unicode(): Illegal character 0x%04x (index %ld) " "is not a Unicode character.", str2[i], PTRDIFF_T_TO_LONG(i)); } if (str2[i] > 0x10ffff) { - error("string_to_unicode(): Character 0x%08x (index %ld) " + Pike_error("string_to_unicode(): Character 0x%08x (index %ld) " "is out of range (0x00000000 - 0x0010ffff).", str2[i], PTRDIFF_T_TO_LONG(i)); } @@ -1164,7 +1164,7 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args) } #ifdef PIKE_DEBUG if (j) { - fatal("string_to_unicode(): Indexing error: len:%ld, j:%ld.\n", + fatal("string_to_unicode(): Indexing Pike_error: len:%ld, j:%ld.\n", PTRDIFF_T_TO_LONG(len), PTRDIFF_T_TO_LONG(j)); } #endif /* PIKE_DEBUG */ @@ -1172,7 +1172,7 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args) } break; default: - error("string_to_unicode(): Bad string shift: %d!\n", in->size_shift); + Pike_error("string_to_unicode(): Bad string shift: %d!\n", in->size_shift); break; } pop_n_elems(args); @@ -1260,7 +1260,7 @@ void f_string_to_utf8(INT32 args) if (c & ~0x7fffffff) { /* 32bit or more. */ if (!extended) { - error("string_to_utf8(): " + Pike_error("string_to_utf8(): " "Value 0x%08x (index %ld) is larger than 31 bits.\n", c, PTRDIFF_T_TO_LONG(i)); } @@ -1363,7 +1363,7 @@ PMOD_EXPORT void f_utf8_to_string(INT32 args) if (c & 0x80) { int cont = 0; if ((c & 0xc0) == 0x80) { - error("utf8_to_string(): " + Pike_error("utf8_to_string(): " "Unexpected continuation block 0x%02x at index %d.\n", c, i); } @@ -1395,13 +1395,13 @@ PMOD_EXPORT void f_utf8_to_string(INT32 args) } else if (c == 0xfe) { /* 36bit */ if (!extended) { - error("utf8_to_string(): " + Pike_error("utf8_to_string(): " "Character 0xfe at index %d when not in extended mode.\n", i); } cont = 6; } else { - error("utf8_to_string(): " + Pike_error("utf8_to_string(): " "Unexpected character 0xff at index %d.\n", i); } @@ -1409,11 +1409,11 @@ PMOD_EXPORT void f_utf8_to_string(INT32 args) while(cont--) { i++; if (i >= in->len) { - error("utf8_to_string(): Truncated UTF8 sequence.\n"); + Pike_error("utf8_to_string(): Truncated UTF8 sequence.\n"); } c = ((unsigned char *)(in->str))[i]; if ((c & 0xc0) != 0x80) { - error("utf8_to_string(): " + Pike_error("utf8_to_string(): " "Expected continuation character at index %d (got 0x%02x).\n", i, c); } @@ -1485,7 +1485,7 @@ static void f_parse_pike_type( INT32 args ) struct pike_string *res; if( Pike_sp[-1].type != T_STRING || Pike_sp[-1].u.string->size_shift ) - error( "__parse_type requires a 8bit string as its first argument\n" ); + Pike_error( "__parse_type requires a 8bit string as its first argument\n" ); res = parse_type( (char *)STR0(Pike_sp[-1].u.string) ); pop_stack(); push_string( res ); @@ -1590,7 +1590,7 @@ PMOD_EXPORT void f_exit(INT32 args) if(Pike_sp[-args].type != T_INT) SIMPLE_BAD_ARG_ERROR("exit", 1, "int"); - if(in_exit) error("exit already called!\n"); + if(in_exit) Pike_error("exit already called!\n"); in_exit=1; assign_svalue(&throw_value, Pike_sp-args); @@ -1705,7 +1705,7 @@ PMOD_EXPORT void f_destruct(INT32 args) PIKE_ERROR("destruct", "Object can't be destructed explicitly.\n", Pike_sp, args); #ifdef PIKE_SECURITY if(!CHECK_DATA_SECURITY(o, SECURITY_BIT_DESTRUCT)) - error("Destruct permission denied.\n"); + Pike_error("Destruct permission denied.\n"); #endif destruct(o); pop_n_elems(args); @@ -2284,7 +2284,7 @@ static struct pike_string * replace_many(struct pike_string *str, int set_end[256]; if(from->size != to->size) - error("Replace must have equal-sized from and to arrays.\n"); + Pike_error("Replace must have equal-sized from and to arrays.\n"); if(!from->size) { @@ -2299,13 +2299,13 @@ static struct pike_string * replace_many(struct pike_string *str, if(ITEM(from)[e].type != T_STRING) { free((char *)v); - error("Replace: from array is not array(string)\n"); + Pike_error("Replace: from array is not array(string)\n"); } if(ITEM(to)[e].type != T_STRING) { free((char *)v); - error("Replace: to array is not array(string)\n"); + Pike_error("Replace: to array is not array(string)\n"); } if(ITEM(from)[e].u.string->size_shift > str->size_shift) @@ -3076,7 +3076,7 @@ static ptrdiff_t low_parse_format(p_wchar0 *s, ptrdiff_t slen) i = j + 1 + low_parse_format(s + j + 1, slen - (j+1)); f_aggregate(1); if ((i + 2 >= slen) || (s[i] != '%') || (s[i+1] != '}')) { - error("parse_format(): Expected %%}.\n"); + Pike_error("parse_format(): Expected %%}.\n"); } i += 2; break; @@ -3094,7 +3094,7 @@ static ptrdiff_t low_parse_format(p_wchar0 *s, ptrdiff_t slen) break; } if (j == slen) { - error("parse_format(): Unterminated %%-expression.\n"); + Pike_error("parse_format(): Unterminated %%-expression.\n"); } offset = i = j; } @@ -3122,7 +3122,7 @@ static void f_parse_format(INT32 args) len = low_parse_format(STR0(s), s->len); if (len != s->len) { - error("parse_format(): Unexpected %%} in format string at offset %ld\n", + Pike_error("parse_format(): Unexpected %%} in format string at offset %ld\n", PTRDIFF_T_TO_LONG(len)); } #ifdef PIKE_DEBUG @@ -3274,18 +3274,18 @@ static void f_interleave_array(INT32 args) INT_TYPE low = 0x7fffffff; #ifdef PIKE_DEBUG if (ITEM(arr)[i].type != T_MAPPING) { - error("interleave_array(): Element %d is not a mapping!\n", i); + Pike_error("interleave_array(): Element %d is not a mapping!\n", i); } #endif /* PIKE_DEBUG */ m = ITEM(arr)[i].u.mapping; MAPPING_LOOP(m) { if (k->ind.type != T_INT) { - error("interleave_array(): Index not an integer in mapping %d!\n", i); + Pike_error("interleave_array(): Index not an integer in mapping %d!\n", i); } if (low > k->ind.u.integer) { low = k->ind.u.integer; if (low < 0) { - error("interleave_array(): Index %d in mapping %d is negative!\n", + Pike_error("interleave_array(): Index %d in mapping %d is negative!\n", low, i); } } @@ -3369,7 +3369,7 @@ static void f_interleave_array(INT32 args) char *newtab = realloc(tab, size*2 + max); if (!newtab) { free(tab); - error("interleave_array(): Couldn't extend table!\n"); + Pike_error("interleave_array(): Couldn't extend table!\n"); } tab = newtab; MEMSET(tab + size + max, 0, size); @@ -3461,7 +3461,7 @@ static struct array *longest_ordered_sequence(struct array *a) stack[pos] = i; } - /* FIXME(?) memory unfreed upon error here */ + /* FIXME(?) memory unfreed upon Pike_error here */ res = low_allocate_array(top, 0); while (ltop != -1) { @@ -3901,7 +3901,7 @@ static struct array *diff_longest_sequence(struct array *cmptbl, int blen) free(marks); - /* FIXME(?) memory unfreed upon error here. */ + /* FIXME(?) memory unfreed upon Pike_error here. */ a=low_allocate_array(top,0); if (top) { @@ -4075,7 +4075,7 @@ static struct array *diff_dyn_longest_sequence(struct array *cmptbl, int blen) while(dml) { #ifdef PIKE_DEBUG if (i >= sz) { - fatal("Consistency error in diff_dyn_longest_sequence()\n"); + fatal("Consistency Pike_error in diff_dyn_longest_sequence()\n"); } #endif /* PIKE_DEBUG */ #ifdef DIFF_DEBUG @@ -4089,7 +4089,7 @@ static struct array *diff_dyn_longest_sequence(struct array *cmptbl, int blen) } #ifdef PIKE_DEBUG if (i != sz) { - fatal("Consistency error in diff_dyn_longest_sequence()\n"); + fatal("Consistency Pike_error in diff_dyn_longest_sequence()\n"); } #endif /* PIKE_DEBUG */ @@ -4104,7 +4104,7 @@ static struct array* diff_build(struct array *a, struct array *ad,*bd; ptrdiff_t bi, ai, lbi, lai, i, eqstart; - /* FIXME(?) memory unfreed upon error here (and later) */ + /* FIXME(?) memory unfreed upon Pike_error here (and later) */ ad=low_allocate_array(0,32); bd=low_allocate_array(0,32); @@ -4771,14 +4771,14 @@ PMOD_EXPORT void f_transpose(INT32 args) { array_fix_type_field(in); if(!in->type_field || in->type_field & ~BIT_ARRAY) - error("The array given as argument 1 to transpose must contain arrays only.\n"); + Pike_error("The array given as argument 1 to transpose must contain arrays only.\n"); } sizeininner=in->item->u.array->size; for(i=1 ; i<sizein; i++) if (sizeininner!=(in->item+i)->u.array->size) - error("The array given as argument 1 to transpose must contain arrays of the same size.\n"); + Pike_error("The array given as argument 1 to transpose must contain arrays of the same size.\n"); out=allocate_array(sizeininner); @@ -4930,9 +4930,9 @@ PMOD_EXPORT void f_map(INT32 args) if arr->_sizeof && arr->`[] array ret; ret[i]=arr[i]; ret=map(ret,fun,@extra); - error + Pike_error - * * error (ie arr or fun = float or bad int ) + * * Pike_error (ie arr or fun = float or bad int ) */ diff --git a/src/callback.c b/src/callback.c index d3b8e67ef1b860175787f828d5aa22ee44fcaaa3..28bb9a81228169aafe93859762a7638ef039100f 100644 --- a/src/callback.c +++ b/src/callback.c @@ -7,10 +7,10 @@ #include "global.h" #include "pike_macros.h" #include "callback.h" -#include "error.h" +#include "pike_error.h" #include "block_alloc.h" -RCSID("$Id: callback.c,v 1.20 2000/07/28 17:16:54 hubbe Exp $"); +RCSID("$Id: callback.c,v 1.21 2000/12/01 08:09:44 hubbe Exp $"); struct callback_list fork_child_callback; diff --git a/src/constants.c b/src/constants.c index 9ca334d39d3f918a63ba031978d40ca03c0e100e..09e07f88ac16cea5c6a67787d58b7a864e6732e7 100644 --- a/src/constants.c +++ b/src/constants.c @@ -13,10 +13,10 @@ #include "pike_memory.h" #include "interpret.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "block_alloc.h" -RCSID("$Id: constants.c,v 1.23 2000/08/10 14:46:54 grubba Exp $"); +RCSID("$Id: constants.c,v 1.24 2000/12/01 08:09:44 hubbe Exp $"); struct mapping *builtin_constants = 0; diff --git a/src/cpp.c b/src/cpp.c index 574ee24b8d0e70ca56aa3b346b14e4cec1068b6a..93f9d342a1b3432547da69f1b68ae8a749a60e17 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.77 2000/09/28 03:39:15 hubbe Exp $ + * $Id: cpp.c,v 1.78 2000/12/01 08:09:45 hubbe Exp $ */ #include "global.h" #include "stralloc.h" @@ -16,7 +16,7 @@ #include "hashtable.h" #include "program.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "array.h" #include "mapping.h" #include "builtin_functions.h" @@ -640,7 +640,7 @@ static struct pike_string *recode_string(struct pike_string *data) * according to EBCDIC-US, and then the rest of the string * according to the encoding specified by the first line. * - * * It's an error for a program written in EBCDIC not to + * * It's an Pike_error for a program written in EBCDIC not to * start with a #charset directive. * * Obfuscation note: @@ -1204,10 +1204,10 @@ void f_cpp(INT32 args) #endif /* PIKE_DEBUG */ if(args<1) - error("Too few arguments to cpp()\n"); + Pike_error("Too few arguments to cpp()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to cpp()\n"); + Pike_error("Bad argument 1 to cpp()\n"); data = sp[-args].u.string; @@ -1221,13 +1221,13 @@ void f_cpp(INT32 args) if(args > 5) { if(sp[4-args].type != T_INT) - error("Bad argument 5 to cpp()\n"); + Pike_error("Bad argument 5 to cpp()\n"); if(sp[5-args].type != T_INT) - error("Bad argument 6 to cpp()\n"); + Pike_error("Bad argument 6 to cpp()\n"); } if(sp[1-args].type != T_STRING) { free_string(data); - error("Bad argument 2 to cpp()\n"); + Pike_error("Bad argument 2 to cpp()\n"); } copy_shared_string(this.current_file, sp[1-args].u.string); @@ -1239,7 +1239,7 @@ void f_cpp(INT32 args) SAFE_APPLY_MASTER("decode_charset", 2); if (sp[-1].type != T_STRING) { free_string(this.current_file); - error("Unknown charset\n"); + Pike_error("Unknown charset\n"); } data = sp[-1].u.string; sp--; @@ -1248,7 +1248,7 @@ void f_cpp(INT32 args) auto_convert = sp[2-args].u.integer; } else { free_string(data); - error("Bad argument 3 to cpp()\n"); + Pike_error("Bad argument 3 to cpp()\n"); } if (args > 3) { if (sp[3-args].type == T_OBJECT) { @@ -1256,7 +1256,7 @@ void f_cpp(INT32 args) } else if (sp[3-args].type != T_INT) { free_string(data); free_string(this.current_file); - error("Bad argument 4 to cpp()\n"); + Pike_error("Bad argument 4 to cpp()\n"); } } } @@ -1367,7 +1367,7 @@ void f_cpp(INT32 args) if(this.compile_errors) { free_string_builder(&this.buf); - error("Cpp() failed\n"); + Pike_error("Cpp() failed\n"); }else{ pop_n_elems(sp - save_sp); push_string(finish_string_builder(&this.buf)); diff --git a/src/cyclic.h b/src/cyclic.h index 2793a964c030725f2fb58e519aaa5619a72516da..77225050ce2ac3d588a513337bd9b72a1a7430e5 100644 --- a/src/cyclic.h +++ b/src/cyclic.h @@ -1,10 +1,10 @@ /* - * $Id: cyclic.h,v 1.4 2000/08/14 20:18:29 grubba Exp $ + * $Id: cyclic.h,v 1.5 2000/12/01 08:09:45 hubbe Exp $ */ #ifndef CYCLIC_H #define CYCLIC_H -#include "error.h" +#include "pike_error.h" #include "threads.h" typedef struct CYCLIC diff --git a/src/docode.c b/src/docode.c index 01b2337688c15e2069c1c5ac3d2f5e60f79ac5bf..09f7bb75222422da9f0458cf43dbd482c4146c64 100644 --- a/src/docode.c +++ b/src/docode.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: docode.c,v 1.85 2000/12/01 01:13:43 hubbe Exp $"); +RCSID("$Id: docode.c,v 1.86 2000/12/01 08:09:45 hubbe Exp $"); #include "las.h" #include "program.h" #include "pike_types.h" @@ -14,7 +14,7 @@ RCSID("$Id: docode.c,v 1.85 2000/12/01 01:13:43 hubbe Exp $"); #include "constants.h" #include "array.h" #include "pike_macros.h" -#include "error.h" +#include "pike_error.h" #include "pike_memory.h" #include "svalue.h" #include "main.h" @@ -149,7 +149,7 @@ static void code_expression(node *n, INT16 flags, char *err) case 0: my_yyerror("Void expression for %s",err); case 1: return; case 2: - fatal("Internal compiler error (%s), line %ld, file %s\n", + fatal("Internal compiler Pike_error (%s), line %ld, file %s\n", err, (long)lex.current_line, lex.current_file?lex.current_file->str:"Unknown"); @@ -623,12 +623,12 @@ static int do_docode2(node *n, INT16 flags) case F_NOT: case F_COMPL: case F_NEGATE: - fatal("Optimizer error.\n"); + fatal("Optimizer Pike_error.\n"); case F_RANGE: tmp1=do_docode(CAR(n),DO_NOT_COPY); if(do_docode(CDR(n),DO_NOT_COPY)!=2) - fatal("Compiler internal error (at %ld).\n",(long)lex.current_line); + fatal("Compiler internal Pike_error (at %ld).\n",(long)lex.current_line); emit0(n->token); return DO_NOT_WARN((INT32)tmp1); @@ -972,7 +972,7 @@ static int do_docode2(node *n, INT16 flags) #endif if(do_docode(CAR(n),0)!=1) - fatal("Internal compiler error, time to panic\n"); + fatal("Internal compiler Pike_error, time to panic\n"); if (!(CAR(n) && (current_switch_type = CAR(n)->type))) { current_switch_type = mixed_type_string; @@ -1065,7 +1065,7 @@ static int do_docode2(node *n, INT16 flags) current_break=break_save; #ifdef PIKE_DEBUG if(Pike_interpreter.recoveries && Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) - fatal("Stack error after F_SWITCH (underflow)\n"); + fatal("Stack Pike_error after F_SWITCH (underflow)\n"); #endif return 0; } @@ -1224,7 +1224,7 @@ static int do_docode2(node *n, INT16 flags) tmp1=do_docode(CAR(n),DO_LVALUE); #ifdef PIKE_DEBUG if(tmp1 & 1) - fatal("Very internal compiler error.\n"); + fatal("Very internal compiler Pike_error.\n"); #endif emit1(F_ARRAY_LVALUE, DO_NOT_WARN((INT32)(tmp1>>1))); return 2; @@ -1266,7 +1266,7 @@ static int do_docode2(node *n, INT16 flags) } if(do_docode(CDR(n),0) != 1) - fatal("Internal compiler error, please report this (1)."); + fatal("Internal compiler Pike_error, please report this (1)."); if(CDR(n)->token != F_CONSTANT && match_types(CDR(n)->type, string_type_string)) emit0(F_CLEAR_STRING_SUBTYPE); @@ -1332,7 +1332,7 @@ static int do_docode2(node *n, INT16 flags) #ifdef PIKE_DEBUG case T_OBJECT: if(n->u.sval.u.object->next == n->u.sval.u.object) - fatal("Internal error: Pointer to parent cannot be a compile time constant!\n"); + fatal("Internal Pike_error: Pointer to parent cannot be a compile time constant!\n"); #endif default: @@ -1412,7 +1412,7 @@ static int do_docode2(node *n, INT16 flags) do_docode(CDR(n), (INT16)(flags | DO_LVALUE)); default: - fatal("Infernal compiler error (unknown parse-tree-token).\n"); + fatal("Infernal compiler Pike_error (unknown parse-tree-token).\n"); return 0; /* make gcc happy */ } } diff --git a/src/dynamic_buffer.c b/src/dynamic_buffer.c index 6958cb64561f36184305465f42887d89a84fa82e..b9e6247b2c4848d5a3e4967f2276c9058d54c398 100644 --- a/src/dynamic_buffer.c +++ b/src/dynamic_buffer.c @@ -7,10 +7,10 @@ #include "global.h" #include "dynamic_buffer.h" #include "stralloc.h" -#include "error.h" +#include "pike_error.h" #include "pike_memory.h" -RCSID("$Id: dynamic_buffer.c,v 1.12 2000/08/10 09:03:10 grubba Exp $"); +RCSID("$Id: dynamic_buffer.c,v 1.13 2000/12/01 08:09:45 hubbe Exp $"); static dynamic_buffer buff; @@ -31,7 +31,7 @@ PMOD_EXPORT char *low_make_buf_space(size_t space, dynamic_buffer *buf) buf->s.str=(char *)realloc(buf->s.str, buf->bufsize); if(!buf->s.str) - error("Out of memory.\n"); + Pike_error("Out of memory.\n"); } ret = buf->s.str + buf->s.len; buf->s.len += space; diff --git a/src/dynamic_load.c b/src/dynamic_load.c index a54113035322b3bdae41dc91ae1db83688325884..9d84873981dbd51321513b089c8e285ad7d907a9 100644 --- a/src/dynamic_load.c +++ b/src/dynamic_load.c @@ -2,13 +2,13 @@ # include "global.h" # include "interpret.h" # include "constants.h" -# include "error.h" +# include "pike_error.h" # include "module.h" # include "stralloc.h" # include "pike_macros.h" # include "main.h" -RCSID("$Id: dynamic_load.c,v 1.46 2000/09/29 15:31:31 mast Exp $"); +RCSID("$Id: dynamic_load.c,v 1.47 2000/12/01 08:09:46 hubbe Exp $"); #endif /* !TESTING */ @@ -82,7 +82,7 @@ static void *dlopen(const char *foo, int how) static char * dlerror(void) { static char buffer[200]; - sprintf(buffer,"LoadLibrary failed with error: %d",GetLastError()); + sprintf(buffer,"LoadLibrary failed with Pike_error: %d",GetLastError()); return buffer; } @@ -263,7 +263,7 @@ void f_load_module(INT32 args) const char *module_name; if(sp[-args].type != T_STRING) - error("Bad argument 1 to load_module()\n"); + Pike_error("Bad argument 1 to load_module()\n"); module_name = sp[-args].u.string->str; @@ -279,10 +279,10 @@ void f_load_module(INT32 args) const char *err = dlerror(); if(!err) err = "Unknown reason"; if (sp[-args].u.string->len < 1024) { - error("load_module(\"%s\") failed: %s\n", + Pike_error("load_module(\"%s\") failed: %s\n", sp[-args].u.string->str, err); } else { - error("load_module() failed: %s\n", err); + Pike_error("load_module() failed: %s\n", err); } } @@ -300,9 +300,9 @@ void f_load_module(INT32 args) dlclose(module); if (strlen(module_name) < 1024) { - error("Failed to initialize dynamic module \"%s\".\n", module_name); + Pike_error("Failed to initialize dynamic module \"%s\".\n", module_name); } else { - error("Failed to initialize dynamic module.\n"); + Pike_error("Failed to initialize dynamic module.\n"); } } diff --git a/src/encode.c b/src/encode.c index 48a11fd929ba06105e2f1bf8c826b6833bbca59f..38a079d3206e859d2f25310fd7c65c981acf537f 100644 --- a/src/encode.c +++ b/src/encode.c @@ -15,7 +15,7 @@ #include "array.h" #include "multiset.h" #include "dynamic_buffer.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "builtin_functions.h" #include "module_support.h" @@ -25,7 +25,7 @@ #include "version.h" #include "bignum.h" -RCSID("$Id: encode.c,v 1.77 2000/11/08 20:03:45 hubbe Exp $"); +RCSID("$Id: encode.c,v 1.78 2000/12/01 08:09:46 hubbe Exp $"); /* #define ENCODE_DEBUG */ @@ -271,7 +271,7 @@ one_more_type: switch(EXTRACT_UCHAR(t++)) { default: - fatal("error in type string.\n"); + fatal("Pike_error in type string.\n"); /*NOTREACHED*/ break; @@ -398,8 +398,8 @@ static void encode_value2(struct svalue *val, struct encode_data *data) case T_TYPE: if (data->canonic) - error("Canonical encoding of the type type not supported.\n"); - error("Encoding of the type type not supported yet!\n"); + Pike_error("Canonical encoding of the type type not supported.\n"); + Pike_error("Encoding of the type type not supported yet!\n"); break; case T_FLOAT: @@ -469,7 +469,7 @@ static void encode_value2(struct svalue *val, struct encode_data *data) * long as they aren't handled deterministically by the * sort function. */ /* They should be hanled deterministically now - Hubbe */ - error("Canonical encoding requires basic types in indices.\n"); + Pike_error("Canonical encoding requires basic types in indices.\n"); } order = get_switch_order(Pike_sp[-2].u.array); order_array(Pike_sp[-2].u.array, order); @@ -496,7 +496,7 @@ static void encode_value2(struct svalue *val, struct encode_data *data) /* This doesn't let bignums through. That's necessary as * long as they aren't handled deterministically by the * sort function. */ - error("Canonical encoding requires basic types in indices.\n"); + Pike_error("Canonical encoding requires basic types in indices.\n"); } check_stack(1); ref_push_array(val->u.multiset->ind); @@ -528,7 +528,7 @@ static void encode_value2(struct svalue *val, struct encode_data *data) push_int(36); apply(val->u.object,"digits",1); if(Pike_sp[-1].type != T_STRING) - error("Gmp.mpz->digits did not return a string!\n"); + Pike_error("Gmp.mpz->digits did not return a string!\n"); encode_value2(Pike_sp-1, data); pop_stack(); break; @@ -536,7 +536,7 @@ static void encode_value2(struct svalue *val, struct encode_data *data) #endif if (data->canonic) - error("Canonical encoding of objects not supported.\n"); + Pike_error("Canonical encoding of objects not supported.\n"); push_svalue(val); apply(data->codec, "nameof", 1); switch(Pike_sp[-1].type) @@ -568,7 +568,7 @@ static void encode_value2(struct svalue *val, struct encode_data *data) case T_FUNCTION: if (data->canonic) - error("Canonical encoding of functions not supported.\n"); + Pike_error("Canonical encoding of functions not supported.\n"); check_stack(1); push_svalue(val); apply(data->codec,"nameof", 1); @@ -616,19 +616,19 @@ static void encode_value2(struct svalue *val, struct encode_data *data) { int d; if (data->canonic) - error("Canonical encoding of programs not supported.\n"); + Pike_error("Canonical encoding of programs not supported.\n"); check_stack(1); push_svalue(val); apply(data->codec,"nameof", 1); if(Pike_sp[-1].type == val->type) - error("Error in master()->nameof(), same type returned.\n"); + Pike_error("Error in master()->nameof(), same type returned.\n"); if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype == NUMBER_UNDEFINED) { INT32 e; struct program *p=val->u.program; if(p->init || p->exit || p->gc_recurse_func || p->gc_check_func || (p->flags & PROGRAM_HAS_C_METHODS)) - error("Cannot encode C programs.\n"); + Pike_error("Cannot encode C programs.\n"); code_entry(type_to_tag(val->type), 1,data); f_version(0); encode_value2(Pike_sp-1,data); @@ -797,7 +797,7 @@ static void decode_value2(struct decode_data *data); static int my_extract_char(struct decode_data *data) { if(data->ptr >= data->len) - error("Format error, not enough data in string.\n"); + Pike_error("Format Pike_error, not enough data in string.\n"); return data->data [ data->ptr++ ]; } @@ -841,13 +841,13 @@ static int my_extract_char(struct decode_data *data) INT32 what, e, num, numh; \ DECODE("decode_entry"); \ if((what & TAG_MASK) != (X)) \ - error("Failed to decode, wrong bits (%d).\n", what & TAG_MASK); \ + Pike_error("Failed to decode, wrong bits (%d).\n", what & TAG_MASK); \ (Y)=num; \ } while(0); #define getdata2(S,L) do { \ if(data->ptr + (ptrdiff_t)(sizeof(S[0])*(L)) > data->len) \ - error("Failed to decode string. (string range error)\n"); \ + Pike_error("Failed to decode string. (string range Pike_error)\n"); \ MEMCPY((S),(data->data + data->ptr), sizeof(S[0])*(L)); \ data->ptr+=sizeof(S[0])*(L); \ }while(0) @@ -870,9 +870,9 @@ static int my_extract_char(struct decode_data *data) DECODE("get_string_data"); \ what &= TAG_MASK; \ if(data->ptr + num > data->len || num <0) \ - error("Failed to decode string. (string range error)\n"); \ + Pike_error("Failed to decode string. (string range Pike_error)\n"); \ if(what<0 || what>2) \ - error("Failed to decode string. (Illegal size shift)\n"); \ + Pike_error("Failed to decode string. (Illegal size shift)\n"); \ STR=begin_wide_shared_string(num, what); \ MEMCPY(STR->str, data->data + data->ptr, num << what); \ data->ptr+=(num << what); \ @@ -880,7 +880,7 @@ static int my_extract_char(struct decode_data *data) STR=end_shared_string(STR); \ }else{ \ if(data->ptr + (LEN) > data->len || (LEN) <0) \ - error("Failed to decode string. (string range error)\n"); \ + Pike_error("Failed to decode string. (string range Pike_error)\n"); \ STR=make_shared_binary_string((char *)(data->data + data->ptr), (LEN)); \ data->ptr+=(LEN); \ } \ @@ -906,7 +906,7 @@ static int my_extract_char(struct decode_data *data) break; \ \ default: \ - error("Failed to decode string, tag is wrong: %d\n", \ + Pike_error("Failed to decode string, tag is wrong: %d\n", \ what & TAG_MASK); \ } \ }while(0) @@ -963,7 +963,7 @@ one_more_type: switch(tmp) { default: - fatal("error in type string.\n"); + fatal("Pike_error in type string.\n"); /*NOTREACHED*/ break; @@ -1042,18 +1042,18 @@ one_more_type: { struct program *prog; if (Pike_sp[-1].subtype == FUNCTION_BUILTIN) { - error("Failed to decode object type.\n"); + Pike_error("Failed to decode object type.\n"); } prog = program_from_svalue(Pike_sp-1); if (!prog) { - error("Failed to decode object type.\n"); + Pike_error("Failed to decode object type.\n"); } push_type_int(prog->id); } break; default: - error("Failed to decode type " + Pike_error("Failed to decode type " "(object(%s), expected object(zero|program)).\n", get_name_of_type(Pike_sp[-1].type)); } @@ -1101,7 +1101,7 @@ static void decode_value2(struct decode_data *data) { push_svalue(tmp2); }else{ - error("Failed to decode string. (invalid T_AGAIN)\n"); + Pike_error("Failed to decode string. (invalid T_AGAIN)\n"); } return; @@ -1145,7 +1145,7 @@ static void decode_value2(struct decode_data *data) case TAG_TYPE: { - error("Failed to decode string. " + Pike_error("Failed to decode string. " "(decode of the type type isn't supported yet).\n"); break; } @@ -1154,11 +1154,11 @@ static void decode_value2(struct decode_data *data) { struct array *a; if(num < 0) - error("Failed to decode string. (array size is negative)\n"); + Pike_error("Failed to decode string. (array size is negative)\n"); /* Heruetical */ if(data->ptr + num > data->len) - error("Failed to decode array. (not enough data)\n"); + Pike_error("Failed to decode array. (not enough data)\n"); tmp.type=T_ARRAY; tmp.u.array=a=allocate_array(num); @@ -1186,11 +1186,11 @@ static void decode_value2(struct decode_data *data) { struct mapping *m; if(num<0) - error("Failed to decode string. (mapping size is negative)\n"); + Pike_error("Failed to decode string. (mapping size is negative)\n"); /* Heruetical */ if(data->ptr + num > data->len) - error("Failed to decode mapping. (not enough data)\n"); + Pike_error("Failed to decode mapping. (not enough data)\n"); m=allocate_mapping(num); tmp.type=T_MAPPING; @@ -1215,11 +1215,11 @@ static void decode_value2(struct decode_data *data) struct multiset *m; struct array *a; if(num<0) - error("Failed to decode string. (multiset size is negative)\n"); + Pike_error("Failed to decode string. (multiset size is negative)\n"); /* Heruetical */ if(data->ptr + num > data->len) - error("Failed to decode multiset. (not enough data)\n"); + Pike_error("Failed to decode multiset. (not enough data)\n"); /* NOTE: This code knows stuff about the implementation of multisets...*/ a = low_allocate_array(num, 0); @@ -1274,12 +1274,12 @@ static void decode_value2(struct decode_data *data) push_svalue(Pike_sp-1); decode_value2(data); if(!data->codec) - error("Failed to decode (no codec)\n"); + Pike_error("Failed to decode (no codec)\n"); apply(data->codec,"decode_object",2); pop_stack(); } if(data->pickyness && Pike_sp[-1].type != T_OBJECT) - error("Failed to decode object.\n"); + Pike_error("Failed to decode object.\n"); return; #ifdef AUTO_BIGNUM @@ -1302,11 +1302,11 @@ static void decode_value2(struct decode_data *data) #endif default: - error("Object coding not compatible.\n"); + Pike_error("Object coding not compatible.\n"); break; } if(data->pickyness && Pike_sp[-1].type != T_OBJECT) - error("Failed to decode (got type %d; expected object).\n", + Pike_error("Failed to decode (got type %d; expected object).\n", Pike_sp[-1].type); break; @@ -1339,11 +1339,11 @@ static void decode_value2(struct decode_data *data) break; default: - error("Function coding not compatible.\n"); + Pike_error("Function coding not compatible.\n"); break; } if(data->pickyness && Pike_sp[-1].type != T_FUNCTION) - error("Failed to decode function.\n"); + Pike_error("Failed to decode function.\n"); break; @@ -1358,7 +1358,7 @@ static void decode_value2(struct decode_data *data) data->counter.u.integer++; decode_value2(data); - /* Keep the value so that we can make a good error-message. */ + /* Keep the value so that we can make a good Pike_error-message. */ prog_code = Pike_sp-1; stack_dup(); @@ -1374,10 +1374,10 @@ static void decode_value2(struct decode_data *data) if ((prog_code->type == T_STRING) && (prog_code->u.string->len < 128) && (!prog_code->u.string->size_shift)) { - error("Failed to decode program \"%s\".\n", + Pike_error("Failed to decode program \"%s\".\n", prog_code->u.string->str); } - error("Failed to decode program.\n"); + Pike_error("Failed to decode program.\n"); } /* Remove the extra entry from the stack. */ stack_swap(); @@ -1410,7 +1410,7 @@ static void decode_value2(struct decode_data *data) decode_value2(data); f_version(0); if(!is_eq(Pike_sp-1,Pike_sp-2)) - error("Cannot decode programs encoded with other driver version.\n"); + Pike_error("Cannot decode programs encoded with other driver version.\n"); pop_n_elems(2); decode_number(p->flags,data); @@ -1473,7 +1473,7 @@ static void decode_value2(struct decode_data *data) if(p->identifier_index[d] > p->num_identifier_references) { p->identifier_index[d]=0; - error("Malformed program in decode.\n"); + Pike_error("Malformed program in decode.\n"); } } @@ -1483,7 +1483,7 @@ static void decode_value2(struct decode_data *data) if(p->variable_index[d] > p->num_identifiers) { p->variable_index[d]=0; - error("Malformed program in decode.\n"); + Pike_error("Malformed program in decode.\n"); } } @@ -1493,7 +1493,7 @@ static void decode_value2(struct decode_data *data) if(p->identifier_references[d].inherit_offset > p->num_inherits) { p->identifier_references[d].inherit_offset=0; - error("Malformed program in decode.\n"); + Pike_error("Malformed program in decode.\n"); } decode_number(p->identifier_references[d].identifier_offset,data); decode_number(p->identifier_references[d].id_flags,data); @@ -1524,7 +1524,7 @@ static void decode_value2(struct decode_data *data) { if(Pike_sp[-1].type != T_PROGRAM || Pike_sp[-1].u.program != p) - error("Program decode failed!\n"); + Pike_error("Program decode failed!\n"); p->refs--; } @@ -1532,12 +1532,12 @@ static void decode_value2(struct decode_data *data) { case T_FUNCTION: if(Pike_sp[-1].subtype == FUNCTION_BUILTIN) - error("Failed to decode parent.\n"); + Pike_error("Failed to decode parent.\n"); p->inherits[d].parent_identifier=Pike_sp[-1].subtype; p->inherits[d].prog=program_from_svalue(Pike_sp-1); if(!p->inherits[d].prog) - error("Failed to decode parent.\n"); + Pike_error("Failed to decode parent.\n"); add_ref(p->inherits[d].prog); p->inherits[d].parent=Pike_sp[-1].u.object; Pike_sp--; @@ -1550,7 +1550,7 @@ static void decode_value2(struct decode_data *data) dmalloc_touch_svalue(Pike_sp); break; default: - error("Failed to decode inheritance.\n"); + Pike_error("Failed to decode inheritance.\n"); } getdata3(p->inherits[d].name); @@ -1616,12 +1616,12 @@ static void decode_value2(struct decode_data *data) } default: - error("Cannot decode program encoding type %d\n",num); + Pike_error("Cannot decode program encoding type %d\n",num); } break; default: - error("Failed to restore string. (Illegal type)\n"); + Pike_error("Failed to restore string. (Illegal type)\n"); } mapping_insert(data->decoded, & tmp, Pike_sp-1); @@ -1668,7 +1668,7 @@ static INT32 my_decode(struct pike_string *tmp, static unsigned char extract_char(char **v, ptrdiff_t *l) { - if(!*l) error("Format error, not enough place for char.\n"); + if(!*l) Pike_error("Format Pike_error, not enough place for char.\n"); else (*l)--; (*v)++; return ((unsigned char *)(*v))[-1]; @@ -1683,7 +1683,7 @@ static ptrdiff_t extract_int(char **v, ptrdiff_t *l) if(j & 0x80) return (j & 0x7f); if((j & ~8) > 4) - error("Format Error: Error in format string, invalid integer.\n"); + Pike_error("Format Error: Error in format string, invalid integer.\n"); i=0; while(j & 7) { i=(i<<8) | extract_char(v,l); j--; } if(j & 8) return -i; @@ -1704,39 +1704,39 @@ static void rec_restore_value(char **v, ptrdiff_t *l) case TAG_FLOAT: if(sizeof(ptrdiff_t) < sizeof(FLOAT_TYPE)) /* FIXME FIXME FIXME FIXME */ - error("Float architecture not supported.\n"); + Pike_error("Float architecture not supported.\n"); push_int(DO_NOT_WARN(t)); /* WARNING! */ Pike_sp[-1].type = T_FLOAT; return; case TAG_TYPE: - error("Format error:decoding of the type type not supported yet.\n"); + Pike_error("Format Pike_error:decoding of the type type not supported yet.\n"); return; case TAG_STRING: - if(t<0) error("Format error, length of string is negative.\n"); - if(*l < t) error("Format error, string to short\n"); + if(t<0) Pike_error("Format Pike_error, length of string is negative.\n"); + if(*l < t) Pike_error("Format Pike_error, string to short\n"); push_string(make_shared_binary_string(*v, t)); (*l)-= t; (*v)+= t; return; case TAG_ARRAY: - if(t<0) error("Format error, length of array is negative.\n"); + if(t<0) Pike_error("Format Pike_error, length of array is negative.\n"); check_stack(t); for(i=0;i<t;i++) rec_restore_value(v,l); f_aggregate(DO_NOT_WARN(t)); return; case TAG_MULTISET: - if(t<0) error("Format error, length of multiset is negative.\n"); + if(t<0) Pike_error("Format Pike_error, length of multiset is negative.\n"); check_stack(t); for(i=0;i<t;i++) rec_restore_value(v,l); f_aggregate_multiset(DO_NOT_WARN(t)); return; case TAG_MAPPING: - if(t<0) error("Format error, length of mapping is negative.\n"); + if(t<0) Pike_error("Format Pike_error, length of mapping is negative.\n"); check_stack(t*2); for(i=0;i<t;i++) { @@ -1747,31 +1747,31 @@ static void rec_restore_value(char **v, ptrdiff_t *l) return; case TAG_OBJECT: - if(t<0) error("Format error, length of object is negative.\n"); - if(*l < t) error("Format error, string to short\n"); + if(t<0) Pike_error("Format Pike_error, length of object is negative.\n"); + if(*l < t) Pike_error("Format Pike_error, string to short\n"); push_string(make_shared_binary_string(*v, t)); (*l) -= t; (*v) += t; APPLY_MASTER("objectof", 1); return; case TAG_FUNCTION: - if(t<0) error("Format error, length of function is negative.\n"); - if(*l < t) error("Format error, string to short\n"); + if(t<0) Pike_error("Format Pike_error, length of function is negative.\n"); + if(*l < t) Pike_error("Format Pike_error, string to short\n"); push_string(make_shared_binary_string(*v, t)); (*l) -= t; (*v) += t; APPLY_MASTER("functionof", 1); return; case TAG_PROGRAM: - if(t<0) error("Format error, length of program is negative.\n"); - if(*l < t) error("Format error, string to short\n"); + if(t<0) Pike_error("Format Pike_error, length of program is negative.\n"); + if(*l < t) Pike_error("Format Pike_error, string to short\n"); push_string(make_shared_binary_string(*v, t)); (*l) -= t; (*v) += t; APPLY_MASTER("programof", 1); return; default: - error("Format error. Unknown type tag %ld:%ld\n", + Pike_error("Format Pike_error. Unknown type tag %ld:%ld\n", PTRDIFF_T_TO_LONG(i), PTRDIFF_T_TO_LONG(t)); } } diff --git a/src/error.c b/src/error.c index 6391b2d848e62b8d680dc9af6fb612b62d2bad03..bbdce7306d12dfb87df03b2da183d79a63d328ce 100644 --- a/src/error.c +++ b/src/error.c @@ -7,7 +7,7 @@ #define NO_PIKE_SHORTHAND #include "global.h" #include "pike_macros.h" -#include "error.h" +#include "pike_error.h" #include "interpret.h" #include "stralloc.h" #include "builtin_functions.h" @@ -21,7 +21,7 @@ #include "threads.h" #include "gc.h" -RCSID("$Id: error.c,v 1.64 2000/12/01 01:14:56 hubbe Exp $"); +RCSID("$Id: error.c,v 1.65 2000/12/01 08:09:46 hubbe Exp $"); #undef ATTRIBUTE #define ATTRIBUTE(X) @@ -277,11 +277,11 @@ PMOD_EXPORT DECLSPEC(noreturn) void pike_throw(void) ATTRIBUTE((noreturn)) } if(!Pike_interpreter.recoveries) - fatal("No error recovery context.\n"); + fatal("No Pike_error recovery context.\n"); #ifdef PIKE_DEBUG if(Pike_sp - Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) - fatal("Stack error in error.\n"); + fatal("Stack Pike_error in Pike_error.\n"); #endif while(Pike_fp != Pike_interpreter.recoveries->frame_pointer) @@ -337,7 +337,7 @@ void DECLSPEC(noreturn) va_error(const char *fmt, va_list args) ATTRIBUTE((noret { const char *tmp=in_error; in_error=0; - fatal("Recursive error() calls, original error: %s",tmp); + fatal("Recursive Pike_error() calls, original Pike_error: %s",tmp); } in_error=buf; @@ -354,12 +354,12 @@ void DECLSPEC(noreturn) va_error(const char *fmt, va_list args) ATTRIBUTE((noret dump_backlog(); #endif - fprintf(stderr,"No error recovery context!\n%s",buf); + fprintf(stderr,"No Pike_error recovery context!\n%s",buf); exit(99); } if((size_t)strlen(buf) >= (size_t)sizeof(buf)) - fatal("Buffer overflow in error()\n"); + fatal("Buffer overflow in Pike_error()\n"); low_error(buf); } @@ -375,7 +375,7 @@ PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name, const char *text { const char *tmp=in_error; in_error=0; - fatal("Recursive error() calls, original error: %s",tmp); + fatal("Recursive Pike_error() calls, original Pike_error: %s",tmp); } in_error=text; @@ -386,7 +386,7 @@ PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name, const char *text dump_backlog(); #endif - fprintf(stderr,"No error recovery context!\n%s():%s",name,text); + fprintf(stderr,"No Pike_error recovery context!\n%s():%s",name,text); if(file) fprintf(stderr,"at %s:%d\n",file,line); exit(99); @@ -438,7 +438,7 @@ PMOD_EXPORT void exit_on_error(void *msg) #ifdef PIKE_DEBUG { char *s; - fprintf(stderr,"Attempting to dump raw error: (may fail)\n"); + fprintf(stderr,"Attempting to dump raw Pike_error: (may fail)\n"); init_buf(); describe_svalue(&throw_value,0,0); s=simple_free_buf(); @@ -471,7 +471,7 @@ PMOD_EXPORT void fatal_on_error(void *msg) do_abort(); } -PMOD_EXPORT DECLSPEC(noreturn) void error(const char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2))) +PMOD_EXPORT DECLSPEC(noreturn) void Pike_error(const char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2))) { va_list args; va_start(args,fmt); @@ -532,7 +532,7 @@ PMOD_EXPORT DECLSPEC(noreturn) void debug_fatal(const char *fmt, ...) ATTRIBUTE( void f_error_cast(INT32 args) { char *s; - get_all_args("error->cast",args,"%s",&s); + get_all_args("Pike_error->cast",args,"%s",&s); if(!strncmp(s,"array",5)) { pop_n_elems(args); @@ -540,14 +540,14 @@ void f_error_cast(INT32 args) ref_push_array(GENERIC_ERROR_THIS->backtrace); f_aggregate(2); }else{ - SIMPLE_BAD_ARG_ERROR("error->cast", 1, "the value \"array\""); + SIMPLE_BAD_ARG_ERROR("Pike_error->cast", 1, "the value \"array\""); } } void f_error_index(INT32 args) { INT_TYPE ind; - get_all_args("error->`[]",args,"%i",&ind); + get_all_args("Pike_error->`[]",args,"%i",&ind); switch(ind) { @@ -560,7 +560,7 @@ void f_error_index(INT32 args) ref_push_array(GENERIC_ERROR_THIS->backtrace); break; default: - index_error("error->`[]", Pike_sp-args, args, NULL, Pike_sp-args, + index_error("Pike_error->`[]", Pike_sp-args, args, NULL, Pike_sp-args, "Index %d is out of range 0 - 1.\n", ind); break; } @@ -592,7 +592,7 @@ void f_error_backtrace(INT32 args) va_start(foo,desc); \ ASSERT_THREAD_SWAPPED_IN(); \ o=low_clone(PIKE_CONCAT(FEL,_error_program)); \ - DWERROR((stderr, "%s(): Throwing a " #FEL " error\n", func)) + DWERROR((stderr, "%s(): Throwing a " #FEL " Pike_error\n", func)) #define ERROR_DONE(FOO) \ PIKE_CONCAT(FOO,_error_va(o,func, \ @@ -642,7 +642,7 @@ DECLSPEC(noreturn) void generic_error_va(struct object *o, VSPRINTF(buf, fmt, foo); if(buf[sizeof(buf)-1]) - fatal("Buffer overflow in error()\n"); + fatal("Buffer overflow in Pike_error()\n"); #endif /* HAVE_VSNPRINTF */ in_error=buf; diff --git a/src/fd_control.c b/src/fd_control.c index 9ee7ad36ab9ab9391942fb63ba0ff6797cebee52..5927d2525930b6fcd93b1307ac638612a3446d30 100644 --- a/src/fd_control.c +++ b/src/fd_control.c @@ -7,10 +7,10 @@ #ifndef TESTING #include "global.h" -#include "error.h" +#include "pike_error.h" #include "fdlib.h" -RCSID("$Id: fd_control.c,v 1.33 2000/07/28 19:54:23 hubbe Exp $"); +RCSID("$Id: fd_control.c,v 1.34 2000/12/01 08:09:46 hubbe Exp $"); #else /* TESTING */ @@ -98,7 +98,7 @@ PMOD_EXPORT int set_nonblocking(int fd,int which) ret=fcntl(fd, F_SETFL, which?FNDELAY:0); #else -#error Do not know how to set your filedescriptors nonblocking. +#Pike_error Do not know how to set your filedescriptors nonblocking. #endif #endif diff --git a/src/fdlib.c b/src/fdlib.c index 4959bb1043a57e07b42e6e8dba43a6f4ceb89fec..1178860b798b74b1a3961c3ea8032b568f9e51d0 100644 --- a/src/fdlib.c +++ b/src/fdlib.c @@ -1,9 +1,9 @@ #include "global.h" #include "fdlib.h" -#include "error.h" +#include "pike_error.h" #include <math.h> -RCSID("$Id: fdlib.c,v 1.46 2000/09/01 20:48:34 grubba Exp $"); +RCSID("$Id: fdlib.c,v 1.47 2000/12/01 08:09:47 hubbe Exp $"); #ifdef HAVE_WINSOCK_H diff --git a/src/fsort.c b/src/fsort.c index 09bae0f2673449242b989afc843a45452d1a3e5d..1828fe90b40bd94bd0c8e31df84c33b6cb18c56e 100644 --- a/src/fsort.c +++ b/src/fsort.c @@ -7,11 +7,11 @@ /* Optimized for minimum amount of compares */ #include "global.h" -#include "error.h" +#include "pike_error.h" #include "fsort.h" #include "main.h" -RCSID("$Id: fsort.c,v 1.14 2000/08/15 16:04:48 grubba Exp $"); +RCSID("$Id: fsort.c,v 1.15 2000/12/01 08:09:47 hubbe Exp $"); #define CMP(X,Y) ( (*cmpfun)((void *)(X),(void *)(Y)) ) #define EXTRA_ARGS ,fsortfun cmpfun diff --git a/src/gc.c b/src/gc.c index d51934fd55de69662bba93ea2d7f000594b74c9c..4d61d42154fa0c1426c03ad4685c7d2e89dc0ebe 100644 --- a/src/gc.c +++ b/src/gc.c @@ -15,7 +15,7 @@ struct callback *gc_evaluator_callback=0; #include "program.h" #include "stralloc.h" #include "stuff.h" -#include "error.h" +#include "pike_error.h" #include "pike_memory.h" #include "pike_macros.h" #include "pike_types.h" @@ -30,7 +30,7 @@ struct callback *gc_evaluator_callback=0; #include "block_alloc.h" -RCSID("$Id: gc.c,v 1.142 2000/12/01 01:14:57 hubbe Exp $"); +RCSID("$Id: gc.c,v 1.143 2000/12/01 08:09:47 hubbe Exp $"); /* Run garbage collect approximately every time * 20 percent of all arrays, objects and programs is diff --git a/src/hashtable.c b/src/hashtable.c index c554467808efd912588047153e611a1402bcad63..0ec39a73ecfc4c2e02ddb0c0a44c41ecdf0ae675 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -8,9 +8,9 @@ #include "hashtable.h" #include "stralloc.h" #include "stuff.h" -#include "error.h" +#include "pike_error.h" -RCSID("$Id: hashtable.c,v 1.7 2000/08/15 16:03:48 grubba Exp $"); +RCSID("$Id: hashtable.c,v 1.8 2000/12/01 08:09:47 hubbe Exp $"); static size_t gobble(struct pike_string *s) { diff --git a/src/interpret.c b/src/interpret.c index 4144cb1d7b9e2ed0d39370a893d18fc2a02a0275..29c9ad42662aa3a5915f42fc5df32c7cf1a19119 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -5,14 +5,14 @@ \*/ /**/ #include "global.h" -RCSID("$Id: interpret.c,v 1.175 2000/12/01 01:14:58 hubbe Exp $"); +RCSID("$Id: interpret.c,v 1.176 2000/12/01 08:09:48 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" #include "svalue.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "language.h" #include "stralloc.h" #include "constants.h" @@ -82,7 +82,7 @@ int mark_stack_malloced = 0; void push_sp_mark(void) { if(Pike_mark_sp == Pike_interpreter.mark_stack + stack_size) - error("No more mark stack!\n"); + Pike_error("No more mark stack!\n"); *Pike_mark_sp++=Pike_sp; } ptrdiff_t pop_sp_mark(void) @@ -222,7 +222,7 @@ void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval) #ifdef PIKE_SECURITY if(lval->type <= MAX_COMPLEX) if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_INDEX)) - error("Index permission denied.\n"); + Pike_error("Index permission denied.\n"); #endif switch(lval->type) { @@ -287,7 +287,7 @@ PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from) #ifdef PIKE_SECURITY if(lval->type <= MAX_COMPLEX) if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) - error("Assign index permission denied.\n"); + Pike_error("Assign index permission denied.\n"); #endif switch(lval->type) @@ -296,13 +296,13 @@ PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from) { INT32 e; if(from->type != T_ARRAY) - error("Trying to assign combined lvalue from non-array.\n"); + Pike_error("Trying to assign combined lvalue from non-array.\n"); if(from->u.array->size < (lval[1].u.array->size>>1)) - error("Not enough values for multiple assign.\n"); + Pike_error("Not enough values for multiple assign.\n"); if(from->u.array->size > (lval[1].u.array->size>>1)) - error("Too many values for multiple assign.\n"); + Pike_error("Too many values for multiple assign.\n"); for(e=0;e<from->u.array->size;e++) assign_lvalue(lval[1].u.array->item+(e<<1),from->u.array->item+e); @@ -349,7 +349,7 @@ union anything *get_pointer_if_this_type(struct svalue *lval, TYPE_T t) #ifdef PIKE_SECURITY if(lval->type <= MAX_COMPLEX) if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) - error("Assign index permission denied.\n"); + Pike_error("Assign index permission denied.\n"); #endif switch(lval->type) @@ -452,7 +452,7 @@ PMOD_EXPORT void find_external_context(struct external_variable_context *loc, DO_NOT_WARN((long)(loc->o->prog ? loc->inherit - loc->o->prog->inherits : 0)))); if(!loc->o) - error("Current object is destructed\n"); + Pike_error("Current object is destructed\n"); while(--arg2>=0) { @@ -507,10 +507,10 @@ PMOD_EXPORT void find_external_context(struct external_variable_context *loc, } if(!loc->o) - error("Parent was lost during cloning.\n"); + Pike_error("Parent was lost during cloning.\n"); if(!(p=loc->o->prog)) - error("Attempting to access variable in destructed object\n"); + Pike_error("Attempting to access variable in destructed object\n"); #ifdef DEBUG_MALLOC if (loc->o->refs == 0x55555555) { @@ -932,19 +932,19 @@ PMOD_EXPORT void mega_apply2(enum apply_type type, INT32 args, void *arg1, void if (!s->u.integer) { PIKE_ERROR("0", "Attempt to call the NULL-value\n", Pike_sp, args); } else { - error("Attempt to call the value %d\n", s->u.integer); + Pike_error("Attempt to call the value %d\n", s->u.integer); } case T_STRING: if (s->u.string->len > 20) { - error("Attempt to call the string \"%20s\"...\n", s->u.string->str); + Pike_error("Attempt to call the string \"%20s\"...\n", s->u.string->str); } else { - error("Attempt to call the string \"%s\"\n", s->u.string->str); + Pike_error("Attempt to call the string \"%s\"\n", s->u.string->str); } case T_MAPPING: - error("Attempt to call a mapping\n"); + Pike_error("Attempt to call a mapping\n"); default: - error("Call to non-function value type:%s.\n", + Pike_error("Call to non-function value type:%s.\n", get_name_of_type(s->type)); case T_FUNCTION: @@ -1297,7 +1297,7 @@ PMOD_EXPORT void mega_apply2(enum apply_type type, INT32 args, void *arg1, void } #ifdef PIKE_DEBUG if(Pike_sp<Pike_interpreter.evaluator_stack) - fatal("Stack error (also simple).\n"); + fatal("Stack Pike_error (also simple).\n"); #endif break; } @@ -1492,7 +1492,7 @@ PMOD_EXPORT int apply_low_safe_and_stupid(struct object *o, INT32 offset) #ifdef PIKE_DEBUG if(Pike_sp<Pike_interpreter.evaluator_stack) - fatal("Stack error (simple).\n"); + fatal("Stack Pike_error (simple).\n"); #endif ret=0; } diff --git a/src/interpret.h b/src/interpret.h index 4e7c346f1defa5e29fbb4a065c08ae20adddc08e..b7e49d7b6f51550d3b0a2c217f3508762f215306 100644 --- a/src/interpret.h +++ b/src/interpret.h @@ -5,14 +5,14 @@ \*/ /* - * $Id: interpret.h,v 1.68 2000/11/20 01:20:24 mast Exp $ + * $Id: interpret.h,v 1.69 2000/12/01 08:09:48 hubbe Exp $ */ #ifndef INTERPRET_H #define INTERPRET_H #include "global.h" #include "program.h" -#include "error.h" +#include "pike_error.h" struct Pike_interpreter { /* Swapped variables */ @@ -74,9 +74,9 @@ struct external_variable_context }; #ifdef PIKE_DEBUG -#define debug_check_stack() do{if(Pike_sp<Pike_interpreter.evaluator_stack)fatal("Stack error.\n");}while(0) +#define debug_check_stack() do{if(Pike_sp<Pike_interpreter.evaluator_stack)fatal("Stack Pike_error.\n");}while(0) #define check__positive(X,Y) if((X)<0) fatal Y -#include "error.h" +#include "pike_error.h" #else #define check__positive(X,Y) #define debug_check_stack() @@ -85,7 +85,7 @@ struct external_variable_context #define check_stack(X) do { \ if(Pike_sp - Pike_interpreter.evaluator_stack + \ Pike_interpreter.svalue_stack_margin + (X) >= Pike_stack_size) \ - error("Svalue stack overflow. " \ + Pike_error("Svalue stack overflow. " \ "(%ld of %ld entries on stack, needed %ld more entries)\n", \ PTRDIFF_T_TO_LONG(Pike_sp - Pike_interpreter.evaluator_stack), \ PTRDIFF_T_TO_LONG(Pike_stack_size), \ @@ -94,7 +94,7 @@ struct external_variable_context #define check_mark_stack(X) do { \ if(Pike_mark_sp - Pike_interpreter.mark_stack + (X) >= Pike_stack_size) \ - error("Mark stack overflow.\n"); \ + Pike_error("Mark stack overflow.\n"); \ }while(0) #define check_c_stack(X) do { \ diff --git a/src/interpret_functions.h b/src/interpret_functions.h index b98d36a195510e34de5bbbea4d2091bd3c15ee0d..58271ca284937961892098c6c4bf05c7328361ea 100644 --- a/src/interpret_functions.h +++ b/src/interpret_functions.h @@ -1,5 +1,5 @@ /* - * $Id: interpret_functions.h,v 1.33 2000/12/01 03:19:00 hubbe Exp $ + * $Id: interpret_functions.h,v 1.34 2000/12/01 08:09:48 hubbe Exp $ * * Opcode definitions for the interpreter. */ @@ -106,7 +106,7 @@ OPCODE2(F_EXTERNAL,"external") loc.o=Pike_fp->current_object; if(!loc.o->prog) - error("Cannot access parent of destructed object.\n"); + Pike_error("Cannot access parent of destructed object.\n"); loc.parent_identifier=Pike_fp->fun; loc.inherit=INHERIT_FROM_INT(loc.o->prog, Pike_fp->fun); @@ -133,7 +133,7 @@ OPCODE2(F_EXTERNAL_LVALUE,"& external") loc.o=Pike_fp->current_object; if(!loc.o->prog) - error("Cannot access parent of destructed object.\n"); + Pike_error("Cannot access parent of destructed object.\n"); loc.parent_identifier=Pike_fp->fun; loc.inherit=INHERIT_FROM_INT(loc.o->prog, Pike_fp->fun); @@ -182,11 +182,11 @@ OPCODE2(F_LOCAL_2_GLOBAL, "global = local") struct identifier *i; if(!Pike_fp->current_object->prog) - error("Cannot access global variables in destructed object.\n"); + Pike_error("Cannot access global variables in destructed object.\n"); i = ID_FROM_INT(Pike_fp->current_object->prog, tmp); if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) - error("Cannot assign functions or constants.\n"); + Pike_error("Cannot assign functions or constants.\n"); if(i->run_time_type == PIKE_T_MIXED) { assign_svalue((struct svalue *)GLOBAL_FROM_INT(tmp), @@ -222,7 +222,7 @@ OPCODE2(F_LEXICAL_LOCAL,"lexical local") while(arg2--) { f=f->scope; - if(!f) error("Lexical scope error.\n"); + if(!f) Pike_error("Lexical scope Pike_error.\n"); } push_svalue(f->locals + arg1); print_return_value(); @@ -235,7 +235,7 @@ OPCODE2(F_LEXICAL_LOCAL_LVALUE,"&lexical local") while(arg2--) { f=f->scope; - if(!f) error("Lexical scope error.\n"); + if(!f) Pike_error("Lexical scope Pike_error.\n"); } Pike_sp[0].type=T_LVALUE; Pike_sp[0].u.lval=f->locals+arg1; @@ -449,11 +449,11 @@ OPCODE1(F_GLOBAL_LVALUE, "& global") struct identifier *i; INT32 tmp=arg1 + Pike_fp->context.identifier_level; if(!Pike_fp->current_object->prog) - error("Cannot access global variables in destructed object.\n"); + Pike_error("Cannot access global variables in destructed object.\n"); i=ID_FROM_INT(Pike_fp->current_object->prog, tmp); if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) - error("Cannot re-assign functions or constants.\n"); + Pike_error("Cannot re-assign functions or constants.\n"); if(i->run_time_type == PIKE_T_MIXED) { @@ -647,11 +647,11 @@ OPCODE1(F_ASSIGN_GLOBAL, "assign global") struct identifier *i; INT32 tmp=arg1 + Pike_fp->context.identifier_level; if(!Pike_fp->current_object->prog) - error("Cannot access global variables in destructed object.\n"); + Pike_error("Cannot access global variables in destructed object.\n"); i=ID_FROM_INT(Pike_fp->current_object->prog, tmp); if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) - error("Cannot assign functions or constants.\n"); + Pike_error("Cannot assign functions or constants.\n"); if(i->run_time_type == PIKE_T_MIXED) { assign_svalue((struct svalue *)GLOBAL_FROM_INT(tmp), Pike_sp-1); @@ -668,11 +668,11 @@ OPCODE1(F_ASSIGN_GLOBAL_AND_POP, "assign global and pop") struct identifier *i; INT32 tmp=arg1 + Pike_fp->context.identifier_level; if(!Pike_fp->current_object->prog) - error("Cannot access global variables in destructed object.\n"); + Pike_error("Cannot access global variables in destructed object.\n"); i=ID_FROM_INT(Pike_fp->current_object->prog, tmp); if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) - error("Cannot assign functions or constants.\n"); + Pike_error("Cannot assign functions or constants.\n"); if(i->run_time_type == PIKE_T_MIXED) { @@ -1180,7 +1180,7 @@ OPCODE0(F_PUSH_ARRAY, "@") apply_lfun(Pike_sp[-1].u.object, LFUN__VALUES, 0); if(Pike_sp[-1].type != PIKE_T_ARRAY) - error("Bad return type from o->_values() in @\n"); + Pike_error("Bad return type from o->_values() in @\n"); free_svalue(Pike_sp-2); Pike_sp[-2]=Pike_sp[-1]; Pike_sp--; diff --git a/src/interpreter.h b/src/interpreter.h index 162e157736b591a815da3158f31e01be3d79d323..2ad17261369a035de7600b23e6f6d4e62594a999 100644 --- a/src/interpreter.h +++ b/src/interpreter.h @@ -50,7 +50,7 @@ static int eval_instruction(unsigned char *pc) Pike_sp[3].type=99; if(Pike_sp<Pike_interpreter.evaluator_stack || Pike_mark_sp < Pike_interpreter.mark_stack || Pike_fp->locals>Pike_sp) - fatal("Stack error (generic) Pike_sp=%p/%p Pike_mark_sp=%p/%p locals=%p.\n", + fatal("Stack Pike_error (generic) Pike_sp=%p/%p Pike_mark_sp=%p/%p locals=%p.\n", Pike_sp, Pike_interpreter.evaluator_stack, Pike_mark_sp, @@ -58,24 +58,24 @@ static int eval_instruction(unsigned char *pc) Pike_fp->locals); if(Pike_mark_sp > Pike_interpreter.mark_stack+Pike_stack_size) - fatal("Mark Stack error (overflow).\n"); + fatal("Mark Stack Pike_error (overflow).\n"); if(Pike_mark_sp < Pike_interpreter.mark_stack) - fatal("Mark Stack error (underflow).\n"); + fatal("Mark Stack Pike_error (underflow).\n"); if(Pike_sp > Pike_interpreter.evaluator_stack+Pike_stack_size) - fatal("stack error (overflow).\n"); + fatal("stack Pike_error (overflow).\n"); if(/* Pike_fp->fun>=0 && */ Pike_fp->current_object->prog && Pike_fp->locals+Pike_fp->num_locals > Pike_sp) - fatal("Stack error (stupid!).\n"); + fatal("Stack Pike_error (stupid!).\n"); if(Pike_interpreter.recoveries && Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer) - fatal("Stack error (underflow).\n"); + fatal("Stack Pike_error (underflow).\n"); if(Pike_mark_sp > Pike_interpreter.mark_stack && Pike_mark_sp[-1] > Pike_sp) - fatal("Stack error (underflow?)\n"); + fatal("Stack Pike_error (underflow?)\n"); if(d_flag > 9) do_debug(); diff --git a/src/las.c b/src/las.c index cf0e38d541d221450af3b20a4b0c04021e72b841..f50c18c98e299f25c924852056d5b027f437991c 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.225 2000/11/27 00:02:08 grubba Exp $"); +RCSID("$Id: las.c,v 1.226 2000/12/01 08:09:49 hubbe Exp $"); #include "language.h" #include "interpret.h" @@ -19,7 +19,7 @@ RCSID("$Id: las.c,v 1.225 2000/11/27 00:02:08 grubba Exp $"); #include "constants.h" #include "mapping.h" #include "multiset.h" -#include "error.h" +#include "pike_error.h" #include "docode.h" #include "main.h" #include "pike_memory.h" @@ -1451,7 +1451,7 @@ void resolv_constant(node *n) { yyerror("Expected constant, got void expression"); }else{ - yyerror("Possible internal error!!!"); + yyerror("Possible internal Pike_error!!!"); pop_n_elems(DO_NOT_WARN(args-1)); return; } @@ -1623,9 +1623,9 @@ node *index_node(node *n, char *node_name, struct pike_string *id) struct svalue *save_sp = Pike_sp-2; JMP_BUF recovery; if (SETJMP(recovery)) { - /* f_index() threw an error! + /* f_index() threw an Pike_error! * - * FIXME: Report the error thrown. + * FIXME: Report the Pike_error thrown. */ if (Pike_sp > save_sp) { pop_n_elems(Pike_sp - save_sp); @@ -2327,7 +2327,7 @@ static struct used_vars *copy_vars(struct used_vars *a) src = tmp; } free(ret); - error("Out of memory in copy_vars.\n"); + Pike_error("Out of memory in copy_vars.\n"); return NULL; /* Make sure that the optimizer knows we exit here. */ } MEMCPY(*dst, src, sizeof(struct scope_info)); @@ -2354,7 +2354,7 @@ static struct used_vars *copy_vars(struct used_vars *a) src = tmp; } free(ret); - error("Out of memory in copy_vars.\n"); + Pike_error("Out of memory in copy_vars.\n"); return NULL; /* Make sure that the optimizer knows we exit here. */ } MEMCPY(*dst, src, sizeof(struct scope_info)); @@ -3531,7 +3531,7 @@ static void find_usage(node *n, unsigned char *usage, { int i; - /* catch_usage is restored if sscanf throws an error. */ + /* catch_usage is restored if sscanf throws an Pike_error. */ for (i=0; i < MAX_LOCAL; i++) { usage[i] |= catch_u[i]; } @@ -3560,7 +3560,7 @@ static void find_usage(node *n, unsigned char *usage, { int i; - /* catch_usage is restored if the function throws an error. */ + /* catch_usage is restored if the function throws an Pike_error. */ for (i=0; i < MAX_LOCAL; i++) { usage[i] |= catch_u[i]; } @@ -3815,7 +3815,7 @@ static node *low_localopt(node *n, { int i; - /* catch_usage is restored if sscanf throws an error. */ + /* catch_usage is restored if sscanf throws an Pike_error. */ for (i=0; i < MAX_LOCAL; i++) { usage[i] |= catch_u[i]; } @@ -3852,7 +3852,7 @@ static node *low_localopt(node *n, { int i; - /* catch_usage is restored if the function throws an error. */ + /* catch_usage is restored if the function throws an Pike_error. */ for (i=0; i < MAX_LOCAL; i++) { usage[i] |= catch_u[i]; } @@ -4496,7 +4496,7 @@ ptrdiff_t eval_low(node *n) if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump)) { - /* Generate error message */ + /* Generate Pike_error message */ if(!Pike_compiler->catch_level) { if(throw_value.type == T_ARRAY && throw_value.u.array->size) @@ -4507,7 +4507,7 @@ ptrdiff_t eval_low(node *n) { yyerror(a->string->str); }else{ - yyerror("Nonstandard error format."); + yyerror("Nonstandard Pike_error format."); } } else if(throw_value.type == T_OBJECT) @@ -4516,14 +4516,14 @@ ptrdiff_t eval_low(node *n) push_int(0); f_index(2); if(Pike_sp[-1].type != T_STRING) - yyerror("Nonstandard error format."); + yyerror("Nonstandard Pike_error format."); else yyerror(Pike_sp[-1].u.string->str); pop_stack(); } else { - yyerror("Nonstandard error format."); + yyerror("Nonstandard Pike_error format."); } } }else{ diff --git a/src/lex.c b/src/lex.c index 963428cf5ff3016593bcf3ad12a104ddf3146684..529bc7465349649f06c62c76280002e2605e1e94 100644 --- a/src/lex.c +++ b/src/lex.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: lex.c,v 1.84 2000/12/01 01:14:59 hubbe Exp $"); +RCSID("$Id: lex.c,v 1.85 2000/12/01 08:09:49 hubbe Exp $"); #include "language.h" #include "array.h" #include "lex.h" @@ -16,7 +16,7 @@ RCSID("$Id: lex.c,v 1.84 2000/12/01 01:14:59 hubbe Exp $"); #include "stuff.h" #include "pike_memory.h" #include "interpret.h" -#include "error.h" +#include "pike_error.h" #include "object.h" #include "las.h" #include "operators.h" diff --git a/src/lexer.h b/src/lexer.h index e1c0d9962b545fef5c5ae09134036a50d3c7a84f..65ddc2e66b68d5f4d1bf37133a3c3f42a9619b46 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -1,5 +1,5 @@ /* - * $Id: lexer.h,v 1.23 2000/11/25 16:49:49 grubba Exp $ + * $Id: lexer.h,v 1.24 2000/12/01 08:09:49 hubbe Exp $ * * Lexical analyzer template. * Based on lex.c 1.62 @@ -8,7 +8,7 @@ */ #ifndef SHIFT -#error Internal error: SHIFT not defined +#Pike_error Internal Pike_error: SHIFT not defined #endif /* @@ -503,13 +503,13 @@ static int low_yylex(YYSTYPE *yylval) break; case 'e': - if(ISWORD("error")) + if(ISWORD("Pike_error")) { SKIPSPACE(); READBUF(C!='\n'); /* FIXME: Does the following actually work? * Where does the NUL-termination come from? - * Suspicion: #error is usually handled by cpp(). + * Suspicion: #Pike_error is usually handled by cpp(). * What about wide-strings? * /grubba 2000-11-19 (in Versailles) */ @@ -581,7 +581,7 @@ static int low_yylex(YYSTYPE *yylval) struct pike_string *dir = make_shared_binary_string2((p_wchar2 *)buf, len); #else /* SHIFT != 2 */ -#error Unsupported SHIFT. +#Pike_error Unsupported SHIFT. #endif /* SHIFT == 2 */ #endif /* SHIFT == 1 */ if (!dir->size_shift) { diff --git a/src/main.c b/src/main.c index 8ab70d1fe397b7cb42dbc0bc80236ee77d4edec9..094f4b3532a9bc6297fa4673c3f35151583c4915 100644 --- a/src/main.c +++ b/src/main.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: main.c,v 1.107 2000/11/20 01:20:25 mast Exp $"); +RCSID("$Id: main.c,v 1.108 2000/12/01 08:09:49 hubbe Exp $"); #include "fdlib.h" #include "backend.h" #include "module.h" @@ -17,7 +17,7 @@ RCSID("$Id: main.c,v 1.107 2000/11/20 01:20:25 mast Exp $"); #include "array.h" #include "stralloc.h" #include "interpret.h" -#include "error.h" +#include "pike_error.h" #include "pike_macros.h" #include "callback.h" #include "signal_handler.h" diff --git a/src/mapping.c b/src/mapping.c index ba9da14492e3f28d50f0ee937758cdb2028c2f41..370da6a356e8b581f15ac2cf80b0cab725472ba2 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -5,14 +5,14 @@ \*/ /**/ #include "global.h" -RCSID("$Id: mapping.c,v 1.111 2000/11/08 20:03:45 hubbe Exp $"); +RCSID("$Id: mapping.c,v 1.112 2000/12/01 08:09:50 hubbe Exp $"); #include "main.h" #include "object.h" #include "mapping.h" #include "svalue.h" #include "array.h" #include "pike_macros.h" -#include "error.h" +#include "pike_error.h" #include "pike_memory.h" #include "dynamic_buffer.h" #include "interpret.h" @@ -1687,7 +1687,7 @@ PMOD_EXPORT void f_aggregate_mapping(INT32 args) struct mapping *m; if(args & 1) - error("Uneven number of arguments to aggregate_mapping.\n"); + Pike_error("Uneven number of arguments to aggregate_mapping.\n"); m=allocate_mapping(MAP_SLOTS(args / 2)); diff --git a/src/module.c b/src/module.c index 80d4de361230013c13ffb18d13d3598fca93a1b2..37091ad954d5d36e844e1bfbe607df26a6ee3dbf 100644 --- a/src/module.c +++ b/src/module.c @@ -6,7 +6,7 @@ #include "global.h" #include "module.h" #include "pike_macros.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "main.h" #include "svalue.h" @@ -18,7 +18,7 @@ #include "modules/modlist_headers.h" -RCSID("$Id: module.c,v 1.11 2000/07/07 02:38:08 hubbe Exp $"); +RCSID("$Id: module.c,v 1.12 2000/12/01 08:09:50 hubbe Exp $"); typedef void (*modfun)(void); diff --git a/src/module_support.c b/src/module_support.c index b1b2d849289ae2c50ae2f53af27b5a3cb6a66ea6..498084ab2d5ae02394b33d24ce05e6884029b62f 100644 --- a/src/module_support.c +++ b/src/module_support.c @@ -4,9 +4,9 @@ #include "svalue.h" #include "stralloc.h" #include "pike_types.h" -#include "error.h" +#include "pike_error.h" -RCSID("$Id: module_support.c,v 1.37 2000/08/17 19:03:15 grubba Exp $"); +RCSID("$Id: module_support.c,v 1.38 2000/12/01 08:09:50 hubbe Exp $"); /* Checks that args_to_check arguments are OK. * Returns 1 if everything worked ok, zero otherwise. @@ -108,7 +108,7 @@ PMOD_EXPORT void check_all_args(const char *fnname, int args, ... ) } } - error("Bad argument %d to %s(), (expecting %s, got %s)\n", + Pike_error("Bad argument %d to %s(), (expecting %s, got %s)\n", tmp.argno+1, fnname, buf, @@ -184,7 +184,7 @@ int va_get_args(struct svalue *s, *va_arg(ap, int *)= DO_NOT_WARN((int)sp[-1].u.float_number); else - error("Cast to int failed.\n"); + Pike_error("Cast to int failed.\n"); pop_stack(); } break; @@ -204,7 +204,7 @@ int va_get_args(struct svalue *s, *va_arg(ap, INT_TYPE *)= DO_NOT_WARN((INT_TYPE)sp[-1].u.float_number); else - error("Cast to int failed.\n"); + Pike_error("Cast to int failed.\n"); pop_stack(); } break; diff --git a/src/modules/CommonLog/clf.c b/src/modules/CommonLog/clf.c index db6a580bb9b78aa3a57e22b80676ecfd5ef33d56..f0ac32fba7ee41dfd9902f0472be5b99fa9fbec4 100644 --- a/src/modules/CommonLog/clf.c +++ b/src/modules/CommonLog/clf.c @@ -1,6 +1,6 @@ /* MUST BE FIRST */ #include "global.h" -RCSID("$Id: clf.c,v 1.4 2000/08/19 11:12:21 grubba Exp $"); +RCSID("$Id: clf.c,v 1.5 2000/12/01 08:09:56 hubbe Exp $"); #include "fdlib.h" #include "stralloc.h" #include "pike_macros.h" @@ -9,7 +9,7 @@ RCSID("$Id: clf.c,v 1.4 2000/08/19 11:12:21 grubba Exp $"); #include "interpret.h" #include "builtin_functions.h" #include "module_support.h" -#include "error.h" +#include "pike_error.h" #include "bignum.h" #include "threads.h" @@ -118,14 +118,14 @@ static void f_read_clf( INT32 args ) get_all_args("CommonLog.read", args, "%*%*", &logfun, &file); if(logfun->type != T_FUNCTION) - error("Bad argument 1 to CommonLog.read, expected function.\n"); + Pike_error("Bad argument 1 to CommonLog.read, expected function.\n"); if(file->type == T_OBJECT) { f = fd_from_object(file->u.object); if(f == -1) - error("CommonLog.read: File is not open.\n"); + Pike_error("CommonLog.read: File is not open.\n"); my_fd = 0; } else if(file->type == T_STRING && file->u.string->size_shift == 0) { @@ -136,10 +136,10 @@ static void f_read_clf( INT32 args ) THREADS_DISALLOW(); if(errno < 0) - error("CommonLog.read(): Failed to open file for reading (errno=%d).\n", + Pike_error("CommonLog.read(): Failed to open file for reading (errno=%d).\n", errno); } else - error("Bad argument 1 to CommonLog.read, expected string or object .\n"); + Pike_error("Bad argument 1 to CommonLog.read, expected string or object .\n"); #ifdef HAVE_LSEEK64 lseek64(f, offs0, SEEK_SET); diff --git a/src/modules/Gdbm/gdbmmod.c b/src/modules/Gdbm/gdbmmod.c index 45a4608b00f0e9180edc4d6504846dad78ddab6c..7181c951ef71e0472ef755c7ae6ff51114569d70 100644 --- a/src/modules/Gdbm/gdbmmod.c +++ b/src/modules/Gdbm/gdbmmod.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: gdbmmod.c,v 1.11 2000/07/28 07:11:52 hubbe Exp $"); +RCSID("$Id: gdbmmod.c,v 1.12 2000/12/01 08:09:56 hubbe Exp $"); #include "gdbm_machine.h" #include "threads.h" @@ -62,7 +62,7 @@ static int fixmods(char *mods) case 0: switch(mode & 15) { - default: error("No mode given for gdbm->open()\n"); + default: Pike_error("No mode given for gdbm->open()\n"); case 1|16: case 1: mode=GDBM_READER; break; case 3: mode=GDBM_WRITER; break; @@ -81,14 +81,14 @@ static int fixmods(char *mods) case 'f': case 'F': mode|=16; break; default: - error("Bad mode flag in gdbm->open.\n"); + Pike_error("Bad mode flag in gdbm->open.\n"); } } } void gdbmmod_fatal(char *err) { - error("GDBM: %s\n",err); + Pike_error("GDBM: %s\n",err); } static void gdbmmod_create(INT32 args) @@ -102,12 +102,12 @@ static void gdbmmod_create(INT32 args) int rwmode = GDBM_WRCREAT; if(sp[-args].type != T_STRING) - error("Bad argument 1 to gdbm->create()\n"); + Pike_error("Bad argument 1 to gdbm->create()\n"); if(args>1) { if(sp[1-args].type != T_STRING) - error("Bad argument 2 to gdbm->create()\n"); + Pike_error("Bad argument 2 to gdbm->create()\n"); rwmode=fixmods(sp[1-args].u.string->str); } @@ -123,13 +123,13 @@ static void gdbmmod_create(INT32 args) if(!Pike_fp->current_object->prog) { if(tmp) gdbm_close(tmp); - error("Object destructed in gdbm->open()n"); + Pike_error("Object destructed in gdbm->open()n"); } THIS->dbf=tmp; pop_n_elems(args); if(!THIS->dbf) - error("Failed to open GDBM database.\n"); + Pike_error("Failed to open GDBM database.\n"); } } @@ -142,13 +142,13 @@ static void gdbmmod_fetch(INT32 args) datum key,ret; if(!args) - error("Too few arguments to gdbm->fetch()\n"); + Pike_error("Too few arguments to gdbm->fetch()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gdbm->fetch()\n"); + Pike_error("Bad argument 1 to gdbm->fetch()\n"); if(!THIS->dbf) - error("GDBM database not open.\n"); + Pike_error("GDBM database not open.\n"); STRING_TO_DATUM(key, sp[-args].u.string); @@ -174,13 +174,13 @@ static void gdbmmod_delete(INT32 args) datum key; int ret; if(!args) - error("Too few arguments to gdbm->delete()\n"); + Pike_error("Too few arguments to gdbm->delete()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gdbm->delete()\n"); + Pike_error("Bad argument 1 to gdbm->delete()\n"); if(!this->dbf) - error("GDBM database not open.\n"); + Pike_error("GDBM database not open.\n"); STRING_TO_DATUM(key, sp[-args].u.string); @@ -200,7 +200,7 @@ static void gdbmmod_firstkey(INT32 args) datum ret; pop_n_elems(args); - if(!this->dbf) error("GDBM database not open.\n"); + if(!this->dbf) Pike_error("GDBM database not open.\n"); THREADS_ALLOW(); mt_lock(& gdbm_lock); @@ -222,13 +222,13 @@ static void gdbmmod_nextkey(INT32 args) struct gdbm_glue *this=THIS; datum key,ret; if(!args) - error("Too few arguments to gdbm->nextkey()\n"); + Pike_error("Too few arguments to gdbm->nextkey()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gdbm->nextkey()\n"); + Pike_error("Bad argument 1 to gdbm->nextkey()\n"); if(!THIS->dbf) - error("GDBM database not open.\n"); + Pike_error("GDBM database not open.\n"); STRING_TO_DATUM(key, sp[-args].u.string); @@ -254,16 +254,16 @@ static void gdbmmod_store(INT32 args) datum key,data; int ret; if(args<2) - error("Too few arguments to gdbm->store()\n"); + Pike_error("Too few arguments to gdbm->store()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gdbm->store()\n"); + Pike_error("Bad argument 1 to gdbm->store()\n"); if(sp[1-args].type != T_STRING) - error("Bad argument 2 to gdbm->store()\n"); + Pike_error("Bad argument 2 to gdbm->store()\n"); if(!THIS->dbf) - error("GDBM database not open.\n"); + Pike_error("GDBM database not open.\n"); STRING_TO_DATUM(key, sp[-args].u.string); STRING_TO_DATUM(data, sp[1-args].u.string); @@ -275,7 +275,7 @@ static void gdbmmod_store(INT32 args) THREADS_DISALLOW(); if(ret == -1) - error("GDBM database not open for writing.\n"); + Pike_error("GDBM database not open for writing.\n"); pop_n_elems(args); push_int(ret == 0); @@ -287,7 +287,7 @@ static void gdbmmod_reorganize(INT32 args) int ret; pop_n_elems(args); - if(!THIS->dbf) error("GDBM database not open.\n"); + if(!THIS->dbf) Pike_error("GDBM database not open.\n"); THREADS_ALLOW(); mt_lock(& gdbm_lock); ret=gdbm_reorganize(this->dbf); @@ -302,7 +302,7 @@ static void gdbmmod_sync(INT32 args) struct gdbm_glue *this=THIS; pop_n_elems(args); - if(!THIS->dbf) error("GDBM database not open.\n"); + if(!THIS->dbf) Pike_error("GDBM database not open.\n"); THREADS_ALLOW(); mt_lock(& gdbm_lock); gdbm_sync(this->dbf); diff --git a/src/modules/Gettext/gettext.c b/src/modules/Gettext/gettext.c index ad24af35b7505a804fa3893ab40e95d7e73e742d..20525e885a1d71b79d1b822dd29c915a70fefbe3 100644 --- a/src/modules/Gettext/gettext.c +++ b/src/modules/Gettext/gettext.c @@ -12,7 +12,7 @@ #endif #include "stralloc.h" -#include "error.h" +#include "pike_error.h" #include "pike_macros.h" #include "constants.h" #include "interpret.h" @@ -23,7 +23,7 @@ /* This must be included last */ #include "module_magic.h" -RCSID("$Id: gettext.c,v 1.5 2000/08/10 09:51:52 per Exp $"); +RCSID("$Id: gettext.c,v 1.6 2000/12/01 08:09:57 hubbe Exp $"); /* **! module Locale.Gettext @@ -31,7 +31,7 @@ RCSID("$Id: gettext.c,v 1.5 2000/08/10 09:51:52 per Exp $"); **! This module enables access to localization functions from within Pike. **! **! note -**! $Id: gettext.c,v 1.5 2000/08/10 09:51:52 per Exp $ +**! $Id: gettext.c,v 1.6 2000/12/01 08:09:57 hubbe Exp $ */ /******************** PUBLIC FUNCTIONS BELOW THIS LINE */ @@ -51,9 +51,9 @@ void f_gettext(INT32 args) { char *translated; if (args != 1) - error( "Wrong number of arguments to Gettext.gettext()\n" ); + Pike_error( "Wrong number of arguments to Gettext.gettext()\n" ); if (sp[-1].type != T_STRING) - error( "Bad argument 1 to Gettext.gettext(), expected string\n" ); + Pike_error( "Bad argument 1 to Gettext.gettext(), expected string\n" ); translated = gettext(sp[-1].u.string->str); pop_n_elems(args); @@ -149,12 +149,12 @@ void f_textdomain(INT32 args) { char *domain=NULL, *returnstring; if (args != 0 && args != 1) - error( "Wrong number of arguments to Gettext.textdomain()\n" ); + Pike_error( "Wrong number of arguments to Gettext.textdomain()\n" ); if(sp[-args].type == T_STRING) domain = sp[-args].u.string->str; else if(!(sp[-args].type == T_INT && sp[-args].u.integer == 0)) - error( "Bad argument 1 to Gettext.textdomain(), expected string|void\n" ); + Pike_error( "Bad argument 1 to Gettext.textdomain(), expected string|void\n" ); returnstring = textdomain(domain); pop_n_elems(args); push_string(make_shared_string(returnstring)); @@ -193,21 +193,21 @@ void f_bindtextdomain(INT32 args) { char *returnstring, *domain = NULL, *dirname = NULL; if (args < 1 || args > 2) - error( "Wrong number of arguments to Gettext.bindtextdomain()\n" ); + Pike_error( "Wrong number of arguments to Gettext.bindtextdomain()\n" ); switch(args) { case 2: if(sp[-1].type == T_STRING) dirname = sp[-1].u.string->str; else if(!(sp[-1].type == T_INT && sp[-1].u.integer == 0)) - error( "Bad argument 2 to Gettext.bindtextdomain(), expected string|void\n" ); + Pike_error( "Bad argument 2 to Gettext.bindtextdomain(), expected string|void\n" ); /* FALLTHROUGH */ case 1: if(sp[-args].type == T_STRING) domain = sp[-args].u.string->str; else if(!(sp[-args].type == T_INT && sp[-args].u.integer == 0)) - error( "Bad argument 1 to Gettext.bindtextdomain(), expected string|void\n" ); + Pike_error( "Bad argument 1 to Gettext.bindtextdomain(), expected string|void\n" ); } returnstring = bindtextdomain(domain, dirname); pop_n_elems(args); diff --git a/src/modules/Gmp/mpz_glue.c b/src/modules/Gmp/mpz_glue.c index 8410cba4ab89243b940ce11f64c2b51ca9abaa38..11c080afe86720e92faf0ac721e5e352eb77355e 100644 --- a/src/modules/Gmp/mpz_glue.c +++ b/src/modules/Gmp/mpz_glue.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: mpz_glue.c,v 1.82 2000/08/24 17:05:38 grubba Exp $"); +RCSID("$Id: mpz_glue.c,v 1.83 2000/12/01 08:09:57 hubbe Exp $"); #include "gmp_machine.h" #if defined(HAVE_GMP2_GMP_H) && defined(HAVE_LIBGMP2) @@ -26,7 +26,7 @@ RCSID("$Id: mpz_glue.c,v 1.82 2000/08/24 17:05:38 grubba Exp $"); #include "stralloc.h" #include "object.h" #include "pike_types.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "opcodes.h" #include "module_support.h" @@ -121,7 +121,7 @@ static void get_mpz_from_digits(MP_INT *tmp, } if (mpz_set_str(tmp, digits->str + offset, base)) - error("invalid digits, cannot convert to mpz\n"); + Pike_error("invalid digits, cannot convert to mpz\n"); if(neg) mpz_neg(tmp, tmp); @@ -143,7 +143,7 @@ static void get_mpz_from_digits(MP_INT *tmp, } else { - error("invalid base.\n"); + Pike_error("invalid base.\n"); } } @@ -165,7 +165,7 @@ static void get_new_mpz(MP_INT *tmp, struct svalue *s) && s->u.object->prog != bignum_program #endif ) - error("Wrong type of object, cannot convert to mpz.\n"); + Pike_error("Wrong type of object, cannot convert to mpz.\n"); mpz_set(tmp, OBTOMPZ(s->u.object)); break; @@ -178,13 +178,13 @@ static void get_new_mpz(MP_INT *tmp, struct svalue *s) if ( (s->u.array->size != 2) || (ITEM(s->u.array)[0].type != T_STRING) || (ITEM(s->u.array)[1].type != T_INT)) - error("cannot convert array to mpz.\n"); + Pike_error("cannot convert array to mpz.\n"); get_mpz_from_digits(tmp, ITEM(s->u.array)[0].u.string, ITEM(s->u.array)[1]); break; #endif default: - error("cannot convert argument to mpz.\n"); + Pike_error("cannot convert argument to mpz.\n"); } } @@ -207,16 +207,16 @@ static void mpzmod_create(INT32 args) case 2: /* Args are string of digits and integer base */ if(sp[-args].type != T_STRING) - error("bad argument 1 for Mpz->create()\n"); + Pike_error("bad argument 1 for Mpz->create()\n"); if (sp[1-args].type != T_INT) - error("wrong type for base in Mpz->create()\n"); + Pike_error("wrong type for base in Mpz->create()\n"); get_mpz_from_digits(THIS, sp[-args].u.string, sp[1-args].u.integer); break; default: - error("Too many arguments to Mpz->create()\n"); + Pike_error("Too many arguments to Mpz->create()\n"); case 0: break; /* Needed by AIX cc */ @@ -272,7 +272,7 @@ static struct pike_string *low_get_digits(MP_INT *mpz, int base) #endif if (mpz_sgn(mpz) < 0) - error("only non-negative numbers can be converted to base 256.\n"); + Pike_error("only non-negative numbers can be converted to base 256.\n"); #if 0 len = (mpz_sizeinbase(mpz, 2) + 7) / 8; s = begin_shared_string(len); @@ -321,7 +321,7 @@ static struct pike_string *low_get_digits(MP_INT *mpz, int base) } else { - error("invalid base.\n"); + Pike_error("invalid base.\n"); return 0; /* Make GCC happy */ } @@ -346,7 +346,7 @@ static void mpzmod_digits(INT32 args) else { if (sp[-args].type != T_INT) - error("Bad argument 1 for Mpz->digits().\n"); + Pike_error("Bad argument 1 for Mpz->digits().\n"); base = sp[-args].u.integer; } @@ -363,22 +363,22 @@ static void mpzmod__sprintf(INT32 args) INT_TYPE flag_left; if(args < 1 || sp[-args].type != T_INT) - error("Bad argument 1 for Mpz->_sprintf().\n"); + Pike_error("Bad argument 1 for Mpz->_sprintf().\n"); if(args < 2 || sp[1-args].type != T_MAPPING) - error("Bad argument 2 for Mpz->_sprintf().\n"); + Pike_error("Bad argument 2 for Mpz->_sprintf().\n"); push_svalue(&sp[1-args]); push_constant_text("precision"); f_index(2); if(sp[-1].type != T_INT) - error("\"precision\" argument to Mpz->_sprintf() is not an integer.\n"); + Pike_error("\"precision\" argument to Mpz->_sprintf() is not an integer.\n"); precision = (--sp)->u.integer; push_svalue(&sp[1-args]); push_constant_text("width"); f_index(2); if(sp[-1].type != T_INT) - error("\"width\" argument to Mpz->_sprintf() is not an integer.\n"); + Pike_error("\"width\" argument to Mpz->_sprintf() is not an integer.\n"); width_undecided = ((sp-1)->subtype != NUMBER_NUMBER); width = (--sp)->u.integer; @@ -386,7 +386,7 @@ static void mpzmod__sprintf(INT32 args) push_constant_text("flag_left"); f_index(2); if(sp[-1].type != T_INT) - error("\"flag_left\" argument to Mpz->_sprintf() is not an integer.\n"); + Pike_error("\"flag_left\" argument to Mpz->_sprintf() is not an integer.\n"); flag_left=sp[-1].u.integer; pop_stack(); @@ -523,7 +523,7 @@ static void mpzmod__sprintf(INT32 args) static void mpzmod__is_type(INT32 args) { if(args < 1 || sp[-args].type != T_STRING) - error("Bad argument 1 for Mpz->_is_type().\n"); + Pike_error("Bad argument 1 for Mpz->_is_type().\n"); pop_n_elems(args-1); push_constant_text("int"); @@ -541,10 +541,10 @@ static void mpzmod_size(INT32 args) else { if (sp[-args].type != T_INT) - error("bad argument 1 for Mpz->size()\n"); + Pike_error("bad argument 1 for Mpz->size()\n"); base = sp[-args].u.integer; if ((base != 256) && ((base < 2) || (base > 36))) - error("invalid base\n"); + Pike_error("invalid base\n"); } pop_n_elems(args); @@ -559,9 +559,9 @@ static void mpzmod_cast(INT32 args) struct pike_string *s; if(args < 1) - error("mpz->cast() called without arguments.\n"); + Pike_error("mpz->cast() called without arguments.\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to mpz->cast().\n"); + Pike_error("Bad argument 1 to mpz->cast().\n"); s = sp[-args].u.string; add_ref(s); @@ -613,9 +613,9 @@ static void mpzmod_cast(INT32 args) } - push_string(s); /* To get it freed when error() pops the stack. */ + push_string(s); /* To get it freed when Pike_error() pops the stack. */ - error("mpz->cast() to \"%s\" is other type than string, int or float.\n", + Pike_error("mpz->cast() to \"%s\" is other type than string, int or float.\n", s->str); } @@ -629,7 +629,7 @@ static void mpzmod_cast(INT32 args) /* Converts an svalue, located on the stack, to an mpz object */ static MP_INT *debug_get_mpz(struct svalue *s, int throw_error) { -#define MPZ_ERROR(x) if (throw_error) error(x) +#define MPZ_ERROR(x) if (throw_error) Pike_error(x) struct object *o; switch(s->type) { @@ -702,7 +702,7 @@ double double_from_sval(struct svalue *s) s->u.object->prog == bignum_program) return mpz_get_d(OBTOMPZ(s->u.object)); default: - error("Bad argument, expected a number of some sort.\n"); + Pike_error("Bad argument, expected a number of some sort.\n"); } /* NOT_REACHED */ return (double)0.0; /* Keep the compiler happy. */ @@ -906,7 +906,7 @@ static void mpzmod_rsub(INT32 args) MP_INT *a; if(args!=1) - error("Gmp.mpz->``- called with more or less than one argument.\n"); + Pike_error("Gmp.mpz->``- called with more or less than one argument.\n"); a=get_mpz(sp-1,1); @@ -926,7 +926,7 @@ static void mpzmod_div(INT32 args) { if(sp[e-args].type != T_INT || sp[e-args].u.integer<=0) if (!mpz_sgn(get_mpz(sp+e-args, 1))) - error("Division by zero.\n"); + Pike_error("Division by zero.\n"); } res = fast_clone_object(THIS_PROGRAM, 0); @@ -948,10 +948,10 @@ static void mpzmod_rdiv(INT32 args) MP_INT *a; struct object *res = NULL; if(!mpz_sgn(THIS)) - error("Division by zero.\n"); + Pike_error("Division by zero.\n"); if(args!=1) - error("Gmp.mpz->``/() called with more than one argument.\n"); + Pike_error("Gmp.mpz->``/() called with more than one argument.\n"); a=get_mpz(sp-1,1); @@ -968,7 +968,7 @@ static void mpzmod_mod(INT32 args) for(e=0;e<args;e++) if (!mpz_sgn(get_mpz(sp+e-args, 1))) - error("Division by zero.\n"); + Pike_error("Division by zero.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_set(OBTOMPZ(res), THIS); @@ -984,10 +984,10 @@ static void mpzmod_rmod(INT32 args) MP_INT *a; struct object *res = NULL; if(!mpz_sgn(THIS)) - error("Modulo by zero.\n"); + Pike_error("Modulo by zero.\n"); if(args!=1) - error("Gmp.mpz->``%%() called with more than one argument.\n"); + Pike_error("Gmp.mpz->``%%() called with more than one argument.\n"); a=get_mpz(sp-1,1); @@ -1004,7 +1004,7 @@ static void mpzmod_gcdext(INT32 args) MP_INT *a; if (args != 1) - error("Gmp.mpz->gcdext: Wrong number of arguments.\n"); + Pike_error("Gmp.mpz->gcdext: Wrong number of arguments.\n"); a = get_mpz(sp-1, 1); @@ -1024,7 +1024,7 @@ static void mpzmod_gcdext2(INT32 args) MP_INT *a; if (args != 1) - error("Gmp.mpz->gcdext: Wrong number of arguments.\n"); + Pike_error("Gmp.mpz->gcdext: Wrong number of arguments.\n"); a = get_mpz(sp-args, 1); @@ -1043,15 +1043,15 @@ static void mpzmod_invert(INT32 args) struct object *res; if (args != 1) - error("Gmp.mpz->invert: wrong number of arguments.\n"); + Pike_error("Gmp.mpz->invert: wrong number of arguments.\n"); modulo = get_mpz(sp-args, 1); if (!mpz_sgn(modulo)) - error("divide by zero\n"); + Pike_error("divide by zero\n"); res = fast_clone_object(THIS_PROGRAM, 0); if (mpz_invert(OBTOMPZ(res), THIS, modulo) == 0) { free_object(res); - error("Gmp.mpz->invert: not invertible\n"); + Pike_error("Gmp.mpz->invert: not invertible\n"); } pop_n_elems(args); PUSH_REDUCED(res); @@ -1091,7 +1091,7 @@ static void mpzmod_compl(INT32 args) static void name(INT32 args) \ { \ INT32 i; \ - if(!args) error("Comparison with one argument?\n"); \ + if(!args) Pike_error("Comparison with one argument?\n"); \ i=mpz_cmp(THIS, get_mpz(sp-args, 1)) cmp 0; \ pop_n_elems(args); \ push_int(i); \ @@ -1102,7 +1102,7 @@ static void name(INT32 args) \ { \ INT32 i; \ MP_INT *arg; \ - if(!args) error("Comparison with one argument?\n"); \ + if(!args) Pike_error("Comparison with one argument?\n"); \ if (!(arg = get_mpz(sp-args, 0))) \ i = default; \ else \ @@ -1126,7 +1126,7 @@ static void mpzmod_probably_prime_p(INT32 args) get_all_args("Gmp.mpz->probably_prime_p", args, "%i", &count); count = sp[-1].u.integer; if (count <= 0) - error("Gmp.mpz->probably_prime_p: count argument must be positive.\n"); + Pike_error("Gmp.mpz->probably_prime_p: count argument must be positive.\n"); } else count = 25; pop_n_elems(args); @@ -1141,7 +1141,7 @@ static void mpzmod_small_factor(INT32 args) { get_all_args("Gmp.mpz->small_factor", args, "%i", &limit); if (limit < 1) - error("Gmp.mpz->small_factor: limit argument must be at least 1.\n"); + Pike_error("Gmp.mpz->small_factor: limit argument must be at least 1.\n"); } else limit = INT_MAX; @@ -1186,7 +1186,7 @@ static void mpzmod_sqrt(INT32 args) struct object *o = 0; /* Make gcc happy. */ pop_n_elems(args); if(mpz_sgn(THIS)<0) - error("mpz->sqrt() on negative number.\n"); + Pike_error("mpz->sqrt() on negative number.\n"); o=fast_clone_object(THIS_PROGRAM,0); mpz_sqrt(OBTOMPZ(o), THIS); @@ -1199,7 +1199,7 @@ static void mpzmod_sqrtrem(INT32 args) pop_n_elems(args); if(mpz_sgn(THIS)<0) - error("mpz->sqrtrem() on negative number.\n"); + Pike_error("mpz->sqrtrem() on negative number.\n"); root = fast_clone_object(THIS_PROGRAM,0); rem = fast_clone_object(THIS_PROGRAM,0); @@ -1212,12 +1212,12 @@ static void mpzmod_lsh(INT32 args) { struct object *res = NULL; if (args != 1) - error("Wrong number of arguments to Gmp.mpz->`<<.\n"); + Pike_error("Wrong number of arguments to Gmp.mpz->`<<.\n"); ref_push_string(int_type_string); stack_swap(); f_cast(); if(sp[-1].u.integer < 0) - error("mpz->lsh on negative number.\n"); + Pike_error("mpz->lsh on negative number.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_mul_2exp(OBTOMPZ(res), THIS, sp[-1].u.integer); pop_n_elems(args); @@ -1228,12 +1228,12 @@ static void mpzmod_rsh(INT32 args) { struct object *res = NULL; if (args != 1) - error("Wrong number of arguments to Gmp.mpz->`>>.\n"); + Pike_error("Wrong number of arguments to Gmp.mpz->`>>.\n"); ref_push_string(int_type_string); stack_swap(); f_cast(); if (sp[-1].u.integer < 0) - error("Gmp.mpz->rsh: Shift count must be positive.\n"); + Pike_error("Gmp.mpz->rsh: Shift count must be positive.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_fdiv_q_2exp(OBTOMPZ(res), THIS, sp[-1].u.integer); pop_n_elems(args); @@ -1245,11 +1245,11 @@ static void mpzmod_rlsh(INT32 args) struct object *res = NULL; INT32 i; if (args != 1) - error("Wrong number of arguments to Gmp.mpz->``<<.\n"); + Pike_error("Wrong number of arguments to Gmp.mpz->``<<.\n"); get_mpz(sp-1,1); i=mpz_get_si(THIS); if(i < 0) - error("mpz->``<< on negative number.\n"); + Pike_error("mpz->``<< on negative number.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_mul_2exp(OBTOMPZ(res), OBTOMPZ(sp[-1].u.object), i); @@ -1262,11 +1262,11 @@ static void mpzmod_rrsh(INT32 args) struct object *res = NULL; INT32 i; if (args != 1) - error("Wrong number of arguments to Gmp.mpz->``>>.\n"); + Pike_error("Wrong number of arguments to Gmp.mpz->``>>.\n"); get_mpz(sp-1,1); i=mpz_get_si(THIS); if(i < 0) - error("mpz->``>> on negative number.\n"); + Pike_error("mpz->``>> on negative number.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_fdiv_q_2exp(OBTOMPZ(res), OBTOMPZ(sp[-1].u.object), i); pop_n_elems(args); @@ -1279,11 +1279,11 @@ static void mpzmod_powm(INT32 args) MP_INT *n; if(args != 2) - error("Wrong number of arguments to Gmp.mpz->powm()\n"); + Pike_error("Wrong number of arguments to Gmp.mpz->powm()\n"); n = get_mpz(sp - 1, 1); if (!mpz_sgn(n)) - error("Gmp.mpz->powm: Divide by zero\n"); + Pike_error("Gmp.mpz->powm: Divide by zero\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_powm(OBTOMPZ(res), THIS, get_mpz(sp - 2, 1), n); pop_n_elems(args); @@ -1295,11 +1295,11 @@ static void mpzmod_pow(INT32 args) struct object *res = NULL; if (args != 1) - error("Gmp.mpz->pow: Wrong number of arguments.\n"); + Pike_error("Gmp.mpz->pow: Wrong number of arguments.\n"); if (sp[-1].type != T_INT) - error("Gmp.mpz->pow: Non int exponent.\n"); + Pike_error("Gmp.mpz->pow: Non int exponent.\n"); if (sp[-1].u.integer < 0) - error("Gmp.mpz->pow: Negative exponent.\n"); + Pike_error("Gmp.mpz->pow: Negative exponent.\n"); res = fast_clone_object(THIS_PROGRAM, 0); mpz_pow_ui(OBTOMPZ(res), THIS, sp[-1].u.integer); pop_n_elems(args); @@ -1339,10 +1339,10 @@ static void gmp_pow(INT32 args) { struct object *res = NULL; if (args != 2) - error("Gmp.pow: Wrong number of arguments"); + Pike_error("Gmp.pow: Wrong number of arguments"); if ( (sp[-2].type != T_INT) || (sp[-2].u.integer < 0) || (sp[-1].type != T_INT) || (sp[-1].u.integer < 0)) - error("Gmp.pow: Negative arguments"); + Pike_error("Gmp.pow: Negative arguments"); res = fast_clone_object(mpzmod_program, 0); mpz_ui_pow_ui(OBTOMPZ(res), sp[-2].u.integer, sp[-1].u.integer); pop_n_elems(args); @@ -1353,11 +1353,11 @@ static void gmp_fac(INT32 args) { struct object *res = NULL; if (args != 1) - error("Gmp.fac: Wrong number of arguments.\n"); + Pike_error("Gmp.fac: Wrong number of arguments.\n"); if (sp[-1].type != T_INT) - error("Gmp.fac: Non int argument.\n"); + Pike_error("Gmp.fac: Non int argument.\n"); if (sp[-1].u.integer < 0) - error("Gmp.mpz->pow: Negative exponent.\n"); + Pike_error("Gmp.mpz->pow: Negative exponent.\n"); res = fast_clone_object(mpzmod_program, 0); mpz_fac_ui(OBTOMPZ(res), sp[-1].u.integer); pop_n_elems(args); @@ -1369,7 +1369,7 @@ static void mpzmod_random(INT32 args) struct object *res = 0; /* Make gcc happy. */ pop_n_elems(args); if(mpz_sgn(THIS) <= 0) - error("random on negative number.\n"); + Pike_error("random on negative number.\n"); res=fast_clone_object(THIS_PROGRAM,0); /* We add two to assure reasonably uniform randomness */ diff --git a/src/modules/Gz/gz_test.c b/src/modules/Gz/gz_test.c index f864238f1967ca05f0fe217fd0e711d00f30960e..b057bee83b1631bbca77b9266241f661d69fcb43 100644 --- a/src/modules/Gz/gz_test.c +++ b/src/modules/Gz/gz_test.c @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id: gz_test.c,v 1.3 2000/01/30 00:07:22 hubbe Exp $ */ +/* @(#) $Id: gz_test.c,v 1.4 2000/12/01 08:09:57 hubbe Exp $ */ #include <stdio.h> #include <zlib.h> @@ -17,7 +17,7 @@ #define CHECK_ERR(err, msg) { \ if (err != Z_OK) { \ - fprintf(stderr, "%s error: %d\n", msg, err); \ + fprintf(stderr, "%s Pike_error: %d\n", msg, err); \ exit(1); \ } \ } @@ -273,7 +273,7 @@ void test_flush(compr, comprLen) err = deflate(&c_stream, Z_FULL_FLUSH); CHECK_ERR(err, "deflate"); - compr[3]++; /* force an error in first compressed block */ + compr[3]++; /* force an Pike_error in first compressed block */ c_stream.avail_in = len - 3; err = deflate(&c_stream, Z_FINISH); diff --git a/src/modules/Gz/zlibmod.c b/src/modules/Gz/zlibmod.c index 5e170b415b47514703a51c9582f0b9f4a3514df8..c8da6740c09b34c0a70b030d95c9043b8cb314ba 100644 --- a/src/modules/Gz/zlibmod.c +++ b/src/modules/Gz/zlibmod.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: zlibmod.c,v 1.31 2000/08/17 15:41:30 grubba Exp $"); +RCSID("$Id: zlibmod.c,v 1.32 2000/12/01 08:09:57 hubbe Exp $"); #include "zlib_machine.h" @@ -60,12 +60,12 @@ static void gz_deflate_create(INT32 args) if(args) { if(sp[-args].type != T_INT) - error("Bad argument 1 to gz->create()\n"); + Pike_error("Bad argument 1 to gz->create()\n"); level=sp[-args].u.integer; if(level < Z_NO_COMPRESSION || level > Z_BEST_COMPRESSION) { - error("Compression level out of range for gz_deflate->create()\n"); + Pike_error("Compression level out of range for gz_deflate->create()\n"); } } @@ -83,14 +83,14 @@ static void gz_deflate_create(INT32 args) return; case Z_VERSION_ERROR: - error("libz not compatible with zlib.h!!!\n"); + Pike_error("libz not compatible with zlib.h!!!\n"); break; default: if(THIS->gz.msg) - error("Failed to initialize gz_deflate: %s\n",THIS->gz.msg); + Pike_error("Failed to initialize gz_deflate: %s\n",THIS->gz.msg); else - error("Failed to initialize gz_deflate\n"); + Pike_error("Failed to initialize gz_deflate\n"); } } @@ -137,20 +137,20 @@ static void gz_deflate(INT32 args) dynamic_buffer buf; if(!THIS->gz.state) - error("gz_deflate not initialized or destructed\n"); + Pike_error("gz_deflate not initialized or destructed\n"); if(args<1) - error("Too few arguments to gz_deflate->deflate()\n"); + Pike_error("Too few arguments to gz_deflate->deflate()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gz_deflate->deflate()\n"); + Pike_error("Bad argument 1 to gz_deflate->deflate()\n"); data=sp[-args].u.string; if(args>1) { if(sp[1-args].type != T_INT) - error("Bad argument 2 to gz_deflate->deflate()\n"); + Pike_error("Bad argument 2 to gz_deflate->deflate()\n"); flush=sp[1-args].u.integer; @@ -163,7 +163,7 @@ static void gz_deflate(INT32 args) break; default: - error("Argument 2 to gz_deflate->deflate() out of range.\n"); + Pike_error("Argument 2 to gz_deflate->deflate() out of range.\n"); } }else{ flush=Z_FINISH; @@ -181,9 +181,9 @@ static void gz_deflate(INT32 args) { free(buf.s.str); if(THIS->gz.msg) - error("Error in gz_deflate->deflate(): %s\n",THIS->gz.msg); + Pike_error("Error in gz_deflate->deflate(): %s\n",THIS->gz.msg); else - error("Error in gz_deflate->deflate(): %d\n",fail); + Pike_error("Error in gz_deflate->deflate(): %d\n",fail); } push_string(low_free_buf(&buf)); @@ -236,14 +236,14 @@ static void gz_inflate_create(INT32 args) return; case Z_VERSION_ERROR: - error("libz not compatible with zlib.h!!!\n"); + Pike_error("libz not compatible with zlib.h!!!\n"); break; default: if(THIS->gz.msg) - error("Failed to initialize gz_inflate: %s\n",THIS->gz.msg); + Pike_error("Failed to initialize gz_inflate: %s\n",THIS->gz.msg); else - error("Failed to initialize gz_inflate\n"); + Pike_error("Failed to initialize gz_inflate\n"); } } @@ -289,13 +289,13 @@ static void gz_inflate(INT32 args) dynamic_buffer buf; if(!THIS->gz.state) - error("gz_inflate not initialized or destructed\n"); + Pike_error("gz_inflate not initialized or destructed\n"); if(args<1) - error("Too few arguments to gz_inflate->inflate()\n"); + Pike_error("Too few arguments to gz_inflate->inflate()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to gz_inflate->inflate()\n"); + Pike_error("Bad argument 1 to gz_inflate->inflate()\n"); data=sp[-args].u.string; @@ -311,9 +311,9 @@ static void gz_inflate(INT32 args) { free(buf.s.str); if(THIS->gz.msg) - error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg); + Pike_error("Error in gz_inflate->inflate(): %s\n",THIS->gz.msg); else - error("Error in gz_inflate->inflate(): %d\n",fail); + Pike_error("Error in gz_inflate->inflate(): %d\n",fail); } push_string(low_free_buf(&buf)); if(fail != Z_STREAM_END && fail!=Z_OK && !sp[-1].u.string->len) @@ -348,11 +348,11 @@ static void gz_crc32(INT32 args) unsigned INT32 crc; if (!args || sp[-args].type!=T_STRING) - error("Gz.crc32: illegal or missing argument 1 (expected string)\n"); + Pike_error("Gz.crc32: illegal or missing argument 1 (expected string)\n"); if (args>1) { if (sp[1-args].type!=T_INT) - error("Gz.crc32: illegal argument 2 (expected integer)\n"); + Pike_error("Gz.crc32: illegal argument 2 (expected integer)\n"); else crc=(unsigned INT32)sp[1-args].u.integer; } else diff --git a/src/modules/HTTPLoop/accept_and_parse.c b/src/modules/HTTPLoop/accept_and_parse.c index e23c9579494b80f23cbefa512e9847e6a7188bb1..bb25a3b4e173872fb0b7f51a100aaca3714164f3 100644 --- a/src/modules/HTTPLoop/accept_and_parse.c +++ b/src/modules/HTTPLoop/accept_and_parse.c @@ -130,7 +130,7 @@ struct args *new_args( ) /* This should probably be improved to include the reason for the * failure. Currently, all failed requests get the same (hardcoded) - * error message. + * Pike_error message. * * It is virtually impossible to call a pike function from here, so that * is not an option. @@ -339,7 +339,7 @@ void aap_handle_connection(struct args *arg) if(data_read <= 0) { #ifdef AAP_DEBUG - fprintf(stderr, "AAP: Read error/eof.\n"); + fprintf(stderr, "AAP: Read Pike_error/eof.\n"); #endif /* AAP_DEBUG */ arg->res.data = buffer; free_args( arg ); @@ -611,7 +611,7 @@ static void f_accept_with_http_parse(INT32 nargs) if(!request_program) { free_args(args); - error("Invalid request program\n"); + Pike_error("Invalid request program\n"); } if(!my_callback) my_callback = add_backend_callback( finished_p, 0, 0 ); diff --git a/src/modules/HTTPLoop/log.c b/src/modules/HTTPLoop/log.c index 44dea5b8760ab2f1986b7206e9fe12e73d5f5101..c9d9f08ded9c8e2948bdc33b89089bb9d592b3af 100644 --- a/src/modules/HTTPLoop/log.c +++ b/src/modules/HTTPLoop/log.c @@ -147,12 +147,12 @@ void f_aap_log_as_commonlog_to_file(INT32 args) pop_n_elems(args); apply(f, "query_fd", 0); mfd = fd_dup(sp[-1].u.integer); - if(mfd < 1)error("Bad fileobject to ->log_as_commonlog_to_file\n"); + if(mfd < 1)Pike_error("Bad fileobject to ->log_as_commonlog_to_file\n"); pop_stack(); foo = fdopen( mfd, "w" ); if(!foo) - error("Bad fileobject to ->log_as_commonlog_to_file\n"); + Pike_error("Bad fileobject to ->log_as_commonlog_to_file\n"); THREADS_ALLOW(); diff --git a/src/modules/HTTPLoop/requestobject.c b/src/modules/HTTPLoop/requestobject.c index 402d17aa8414a1f550d7bc4899fcb82fd5523c44..5233d48b9110a3e2c80b0461dd331a423975649d 100644 --- a/src/modules/HTTPLoop/requestobject.c +++ b/src/modules/HTTPLoop/requestobject.c @@ -1,5 +1,5 @@ /* - * $Id: requestobject.c,v 1.15 2000/11/02 12:01:14 grubba Exp $ + * $Id: requestobject.c,v 1.16 2000/12/01 08:09:58 hubbe Exp $ */ #include "global.h" @@ -420,7 +420,7 @@ void f_aap_index_op(INT32 args) { struct svalue *res; struct pike_string *s; - if (!args) error("HTTP C object->`[]: too few args\n"); + if (!args) Pike_error("HTTP C object->`[]: too few args\n"); pop_n_elems(args-1); if(!THIS->misc_variables) { @@ -439,7 +439,7 @@ void f_aap_index_op(INT32 args) return; } - if(!THIS->request) error("Reply called. No data available\n"); + if(!THIS->request) Pike_error("Reply called. No data available\n"); get_all_args("`[]", args, "%S", &s); if(s == s_not_query || s==s_query || s==s_prestate) @@ -682,7 +682,7 @@ void f_aap_end(INT32 args) void f_aap_output(INT32 args) { - if(sp[-1].type != T_STRING) error("Bad argument 1 to output\n"); + if(sp[-1].type != T_STRING) Pike_error("Bad argument 1 to output\n"); WRITE(THIS->request->fd, sp[-1].u.string->str, sp[-1].u.string->len); } @@ -967,18 +967,18 @@ void f_aap_reply(INT32 args) int reply_string=0, reply_object=0; struct send_args *q; if(!THIS->request) - error("reply already called.\n"); + Pike_error("reply already called.\n"); if(args && sp[-args].type == T_STRING) reply_string = 1; if(args>1) { if(args<3) - error("->reply(string|void pre,object(Stdio.file) fd,int len)\n"); + Pike_error("->reply(string|void pre,object(Stdio.file) fd,int len)\n"); if(sp[-args+1].type != T_OBJECT) - error("Bad argument 2 to reply\n"); + Pike_error("Bad argument 2 to reply\n"); if(sp[-args+2].type != T_INT) - error("Bad argument 3 to reply\n"); + Pike_error("Bad argument 3 to reply\n"); reply_object = 1; } @@ -993,10 +993,10 @@ void f_aap_reply(INT32 args) if((sp[-1].type != T_INT) || (sp[-1].u.integer <= 0)) { aap_free(q); - error("Bad fileobject to request_object->reply()\n"); + Pike_error("Bad fileobject to request_object->reply()\n"); } if((q->from_fd = fd_dup(sp[-1].u.integer)) == -1) - error("Bad file object to request_object->reply()\n"); + Pike_error("Bad file object to request_object->reply()\n"); pop_stack(); q->len = sp[-1].u.integer; @@ -1026,7 +1026,7 @@ void f_aap_reply_with_cache(INT32 args) struct pike_string *reply; INT_TYPE time_to_keep, t, freed=0; if(!THIS->request) - error("Reply already called.\n"); + Pike_error("Reply already called.\n"); get_all_args("reply_with_cache", args, "%S%d", &reply, &time_to_keep); diff --git a/src/modules/Image/blit.c b/src/modules/Image/blit.c index 2c9da83c1c3f657f7006b8cd0e657ad8d608727b..18d9dca10de24f64e0cb0613c15bc6444e5b4877 100644 --- a/src/modules/Image/blit.c +++ b/src/modules/Image/blit.c @@ -1,10 +1,10 @@ -/* $Id: blit.c,v 1.48 2000/08/23 18:57:27 grubba Exp $ */ +/* $Id: blit.c,v 1.49 2000/12/01 08:09:58 hubbe Exp $ */ #include "global.h" /* **! module Image **! note -**! $Id: blit.c,v 1.48 2000/08/23 18:57:27 grubba Exp $ +**! $Id: blit.c,v 1.49 2000/12/01 08:09:58 hubbe Exp $ **! class Image */ @@ -19,7 +19,7 @@ #include "interpret.h" #include "svalue.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "image.h" @@ -101,14 +101,14 @@ static INLINE int getrgb(struct image *img, for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); img->rgb.r=(unsigned char)sp[-args+args_start].u.integer; img->rgb.g=(unsigned char)sp[1-args+args_start].u.integer; img->rgb.b=(unsigned char)sp[2-args+args_start].u.integer; if (max > 3 && args-args_start>=4) { if (sp[3-args+args_start].type!=T_INT) { - error("Illegal alpha argument to %s\n",name); + Pike_error("Illegal alpha argument to %s\n",name); } img->alpha=sp[3-args+args_start].u.integer; return 4; @@ -461,7 +461,7 @@ void image_paste_mask(INT32 args) CHRONO("image_paste_mask init"); if (args<2) - error("illegal number of arguments to image->paste_mask()\n"); + Pike_error("illegal number of arguments to image->paste_mask()\n"); if (sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) bad_arg_error("image->paste_mask",sp-args,args,1,"",sp+1-1-args, @@ -479,7 +479,7 @@ CHRONO("image_paste_mask init"); { if (sp[2-args].type!=T_INT || sp[3-args].type!=T_INT) - error("illegal coordinate arguments to image->paste_mask()\n"); + Pike_error("illegal coordinate arguments to image->paste_mask()\n"); x1=sp[2-args].u.integer; y1=sp[3-args].u.integer; } @@ -581,7 +581,7 @@ void image_paste_alpha_color(INT32 args) { if (sp[arg-args].type!=T_INT || sp[1+arg-args].type!=T_INT) - error("illegal coordinate arguments to image->paste_alpha_color()\n"); + Pike_error("illegal coordinate arguments to image->paste_alpha_color()\n"); x1=sp[arg-args].u.integer; y1=sp[1+arg-args].u.integer; } diff --git a/src/modules/Image/colors.c b/src/modules/Image/colors.c index 3bddb2e857eb95021553769600f1e6591450673e..d42eaacc3319dbb93d36b4ef10b0c00cb5859e97 100644 --- a/src/modules/Image/colors.c +++ b/src/modules/Image/colors.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: colors.c,v 1.40 2000/09/10 01:23:58 per Exp $ +**! $Id: colors.c,v 1.41 2000/12/01 08:09:58 hubbe Exp $ **! submodule Color **! **! This module keeps names and easy handling @@ -152,9 +152,9 @@ **! pike 0.7 **! **! note: -**! <tt>Image.Color["something"]</tt> will never(!) generate an error, +**! <tt>Image.Color["something"]</tt> will never(!) generate an Pike_error, **! but a zero_type 0, if the color is unknown. This is enough -**! to give the error "not present in module", if used +**! to give the Pike_error "not present in module", if used **! as <tt>Image.Color.something</tt>, though. **! **! If you are using colors from for instance a webpage, you might @@ -179,7 +179,7 @@ #include "global.h" -RCSID("$Id: colors.c,v 1.40 2000/09/10 01:23:58 per Exp $"); +RCSID("$Id: colors.c,v 1.41 2000/12/01 08:09:58 hubbe Exp $"); #include "image_machine.h" @@ -482,7 +482,7 @@ static void image_color_hsvf(INT32 args) if(max != 0.0) s = (max - min)/max; else - error("internal error, max==0.0\n"); + Pike_error("internal Pike_error, max==0.0\n"); delta = max-min; @@ -685,7 +685,7 @@ static void image_color_hex(INT32 args) sprintf(buf,"#%08x%08x%08x",THIS->rgb.r,THIS->rgb.g,THIS->rgb.b); break; default: - error("unknown size of colortype\n"); + Pike_error("unknown size of colortype\n"); } push_text(buf); } @@ -748,7 +748,7 @@ static void image_color_cast(INT32 args) image_color_name(args); return; } - error("Image.Color.Color->cast(): Can't cast to that\n"); + Pike_error("Image.Color.Color->cast(): Can't cast to that\n"); } /* @@ -842,7 +842,7 @@ static void image_color_index(INT32 args) struct svalue s; if (args!=1) - error("Image.Color[]: illegal number of arguments\n"); + Pike_error("Image.Color[]: illegal number of arguments\n"); object_index_no_free2(&s,THISOBJ,sp-1); if (s.type==T_INT && sp[-1].type==T_STRING) @@ -922,7 +922,7 @@ static void image_color_index(INT32 args) static void image_color_equal(INT32 args) { if (args!=1) - error("Image.Color.Color->`==: illegal number of arguments"); + Pike_error("Image.Color.Color->`==: illegal number of arguments"); if (sp[-1].type==T_OBJECT) { @@ -1224,7 +1224,7 @@ static void image_get_color(INT32 args) static char *callables[]={"light","dark","neon","dull","bright"}; if (args!=1) - error("Image.Color[]: illegal number of args"); + Pike_error("Image.Color[]: illegal number of args"); if (!colors) make_colors(); @@ -1571,7 +1571,7 @@ static void image_make_hsv_color(INT32 args) case 3: r = p; g = q; b = v; break; case 4: r = t; g = p; b = v; break; case 5: r = v; g = p; b = q; break; - default: error("internal error (hue=%d <= hsv[%f,%f,%f])\n", + default: Pike_error("internal Pike_error (hue=%d <= hsv[%f,%f,%f])\n", DOUBLE_TO_INT(i), h, s, v); } } diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c index 429e43d39a7a1dbb7f85fa58c4f8773b69166c05..9a5f75f146f19b6d606a4a3a3c986d2f9c8e7f29 100644 --- a/src/modules/Image/colortable.c +++ b/src/modules/Image/colortable.c @@ -1,11 +1,11 @@ #include "global.h" -/* $Id: colortable.c,v 1.100 2000/11/29 21:38:19 hubbe Exp $ */ +/* $Id: colortable.c,v 1.101 2000/12/01 08:09:59 hubbe Exp $ */ /* **! module Image **! note -**! $Id: colortable.c,v 1.100 2000/11/29 21:38:19 hubbe Exp $ +**! $Id: colortable.c,v 1.101 2000/12/01 08:09:59 hubbe Exp $ **! class Colortable **! **! This object keeps colortable information, @@ -20,7 +20,7 @@ #undef COLORTABLE_DEBUG #undef COLORTABLE_REDUCE_DEBUG -RCSID("$Id: colortable.c,v 1.100 2000/11/29 21:38:19 hubbe Exp $"); +RCSID("$Id: colortable.c,v 1.101 2000/12/01 08:09:59 hubbe Exp $"); #include <math.h> /* fabs() */ @@ -36,7 +36,7 @@ RCSID("$Id: colortable.c,v 1.100 2000/11/29 21:38:19 hubbe Exp $"); #include "mapping.h" #include "threads.h" #include "builtin_functions.h" -#include "../../error.h" +#include "../../pike_error.h" #include "module_support.h" #include "operators.h" #include "dmalloc.h" @@ -926,7 +926,7 @@ static struct nct_flat _img_get_flat_from_string(struct pike_string *str) flat.numentries = str->len/3; if (flat.numentries<1) - error("Can't make a colortable with less then one (1) color.\n"); + Pike_error("Can't make a colortable with less then one (1) color.\n"); flat.entries=(struct nct_flat_entry*) xalloc(flat.numentries*sizeof(struct nct_flat_entry)); @@ -950,7 +950,7 @@ static struct nct_flat _img_get_flat_from_bgr_string(struct pike_string *str) flat.numentries=str->len/3; if (flat.numentries<1) - error("Can't make a colortable with less then one (1) color.\n"); + Pike_error("Can't make a colortable with less then one (1) color.\n"); flat.entries=(struct nct_flat_entry*) xalloc(flat.numentries*sizeof(struct nct_flat_entry)); @@ -974,7 +974,7 @@ static struct nct_flat _img_get_flat_from_bgrz_string(struct pike_string *str) flat.numentries=str->len/4; if (flat.numentries<1) - error("Can't make a colortable with less then one (1) color.\n"); + Pike_error("Can't make a colortable with less then one (1) color.\n"); flat.entries=(struct nct_flat_entry*) xalloc(flat.numentries*sizeof(struct nct_flat_entry)); @@ -1075,7 +1075,7 @@ static struct nct_cube _img_get_cube_from_args(INT32 args) sp[-args].type!=T_INT || sp[1-args].type!=T_INT || sp[2-args].type!=T_INT) - error("Image.Colortable->create (get cube from args): Illegal argument(s) 1, 2 or 3\n"); + Pike_error("Image.Colortable->create (get cube from args): Illegal argument(s) 1, 2 or 3\n"); cube.r=sp[-args].u.integer; cube.g=sp[1-args].u.integer; @@ -1114,7 +1114,7 @@ static struct nct_cube _img_get_cube_from_args(INT32 args) if (!image_color_arg(1-args,&high)) SIMPLE_BAD_ARG_ERROR("colortable",2,"color"); if (sp[2+ap-args].type!=T_INT) - error("illegal argument(s) %d, %d or %d\n",ap,ap+1,ap+2); + Pike_error("illegal argument(s) %d, %d or %d\n",ap,ap+1,ap+2); steps=isteps=sp[2+ap-args].u.integer; ap+=3; @@ -1960,7 +1960,7 @@ int image_colortable_initiate_dither(struct neo_colortable *nct, return 1; } - error("Illegal dither method\n"); + Pike_error("Illegal dither method\n"); return 0; /* uh */ } @@ -3561,7 +3561,7 @@ void image_colortable_map(INT32 args) rgb_group *d; if (args!=3) - error("illegal number of arguments to colortable->map()\n"); + Pike_error("illegal number of arguments to colortable->map()\n"); o=clone_object(image_program,2); img=(struct image*)get_storage(o,image_program); d=img->img; @@ -3627,7 +3627,7 @@ void image_colortable_map(INT32 args) "Bad argument 1 to colortable->map()\n"); if (!src->img) - error("Called Image.Image object is not initialized\n");; + Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); dest=(struct image*)(o->storage); @@ -3644,7 +3644,7 @@ void image_colortable_map(INT32 args) src->xsize*src->ysize,src->xsize)) { free_object(o); - error("colortable->map(): called colortable is not initiated\n"); + Pike_error("colortable->map(): called colortable is not initiated\n"); } pop_n_elems(args); @@ -3749,7 +3749,7 @@ void image_colortable_spacefactors(INT32 args) **! arg int|float downforward **! arg int|float down **! arg int|float downback -**! Set error correction directions. Default is +**! Set Pike_error correction directions. Default is **! forward=7, downforward=1, down=5, downback=3. **! arg int|float factor **! Error keeping factor. @@ -3861,9 +3861,9 @@ void image_colortable_nodither(INT32 args) **! method object randomgrey(int err) **! Set random cube dithering. **! Color choosen is the closest one to color in picture -**! plus (flat) random error; <tt>color�random(error)</tt>. +**! plus (flat) random Pike_error; <tt>color�random(Pike_error)</tt>. **! -**! The randomgrey method uses the same random error on red, green +**! The randomgrey method uses the same random Pike_error on red, green **! and blue and the randomcube method has three random errors. **! **! <table><tr valign=center> @@ -3904,7 +3904,7 @@ void image_colortable_nodither(INT32 args) **! arg int g **! arg int b **! arg int err -**! The maximum error. Default is 32, or colorcube step. +**! The maximum Pike_error. Default is 32, or colorcube step. **! **! returns the called object **! @@ -4103,7 +4103,7 @@ static int *ordered_make_diff(int *errors,int sz,int err) **! method object ordered(int r,int g,int b,int xsize,int ysize) **! method object ordered(int r,int g,int b,int xsize,int ysize,int x,int y) **! method object ordered(int r,int g,int b,int xsize,int ysize,int rx,int ry,int gx,int gy,int bx,int by) -**! Set ordered dithering, which gives a position-dependent error added +**! Set ordered dithering, which gives a position-dependent Pike_error added **! to the pixel values. **! **! <table><tr valign=center> @@ -4152,11 +4152,11 @@ static int *ordered_make_diff(int *errors,int sz,int err) **! arg int r **! arg int g **! arg int b -**! The maximum error. Default is 32, or colorcube steps (256/size). +**! The maximum Pike_error. Default is 32, or colorcube steps (256/size). **! **! arg int xsize **! arg int ysize -**! Size of error matrix. Default is 8�8. +**! Size of Pike_error matrix. Default is 8�8. **! Only values which factors to multiples of 2 and 3 are **! possible to choose (2,3,4,6,8,12,...). **! @@ -4168,7 +4168,7 @@ static int *ordered_make_diff(int *errors,int sz,int err) **! arg int gy **! arg int bx **! arg int by -**! Offset for the error matrix. <tt>x</tt> and <tt>y</tt> is for +**! Offset for the Pike_error matrix. <tt>x</tt> and <tt>y</tt> is for **! both red, green and blue values, the other is individual. **! **! returns the called object diff --git a/src/modules/Image/colortable.h b/src/modules/Image/colortable.h index 1fc2c09a267098d4ece1fce91551f05a851b2ca7..3457e476ad053d0b6c4f6a58c1835fe1b67b0844 100644 --- a/src/modules/Image/colortable.h +++ b/src/modules/Image/colortable.h @@ -1,17 +1,17 @@ /* **! module Image **! note -**! $Id: colortable.h,v 1.22 2000/08/11 18:51:24 grubba Exp $ +**! $Id: colortable.h,v 1.23 2000/12/01 08:09:59 hubbe Exp $ */ #ifdef PIKE_IMAGE_COLORTABLE_H -#error colortable.h included twice +#Pike_error colortable.h included twice #endif #define PIKE_IMAGE_COLORTABLE_H #ifndef PIKE_IMAGE_IMAGE_H -#error colortable.h needs image.h +#Pike_error colortable.h needs image.h #endif /* !PIKE_IMAGE_IMAGE_H */ diff --git a/src/modules/Image/colortable_lookup.h b/src/modules/Image/colortable_lookup.h index 634bbddb67541322508b298cbfff932dc317e0ad..65889193216d14db83a0a001b8a55e113e0c7001 100644 --- a/src/modules/Image/colortable_lookup.h +++ b/src/modules/Image/colortable_lookup.h @@ -1,10 +1,10 @@ -/* $Id: colortable_lookup.h,v 1.14 2000/09/08 15:55:01 grubba Exp $ */ +/* $Id: colortable_lookup.h,v 1.15 2000/12/01 08:09:59 hubbe Exp $ */ /* included w/ defines in colortable.c */ /* **! module Image **! note -**! $Id: colortable_lookup.h,v 1.14 2000/09/08 15:55:01 grubba Exp $ +**! $Id: colortable_lookup.h,v 1.15 2000/12/01 08:09:59 hubbe Exp $ **! class colortable */ @@ -40,7 +40,7 @@ CHRONO("init flat/cubicles"); cub=cubs->cubicles=malloc(sizeof(struct nctlu_cubicle)*n2); - if (!cub) error("out of memory\n"); + if (!cub) Pike_error("out of memory\n"); while (n2--) /* initiate all to empty */ { diff --git a/src/modules/Image/dct.c b/src/modules/Image/dct.c index 95389a06c287ae1dd4db6edaadd4cd706bec5b23..5a671cb005050978cdfe426e0f4b6236222c60db 100644 --- a/src/modules/Image/dct.c +++ b/src/modules/Image/dct.c @@ -1,9 +1,9 @@ -/* $Id: dct.c,v 1.16 2000/08/10 16:48:59 grubba Exp $ */ +/* $Id: dct.c,v 1.17 2000/12/01 08:10:00 hubbe Exp $ */ /* **! module Image **! note -**! $Id: dct.c,v 1.16 2000/08/10 16:48:59 grubba Exp $ +**! $Id: dct.c,v 1.17 2000/12/01 08:10:00 hubbe Exp $ **! class Image */ @@ -20,7 +20,7 @@ #include "interpret.h" #include "svalue.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "image.h" @@ -81,7 +81,7 @@ void image_dct(INT32 args) double *costbl; rgb_group *pix; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; fprintf(stderr,"%lu bytes, %lu bytes\n", DO_NOT_WARN((unsigned long)(sizeof(rgbd_group)*THIS->xsize*THIS->ysize)), diff --git a/src/modules/Image/encodings/_xpm.c b/src/modules/Image/encodings/_xpm.c index 04f81f9ae17fceb29463e76e565bd58825b840fa..4743e5a235eb866421eb7a9d31db3f4f2212b638 100644 --- a/src/modules/Image/encodings/_xpm.c +++ b/src/modules/Image/encodings/_xpm.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: _xpm.c,v 1.14 2000/08/10 09:51:54 per Exp $"); +RCSID("$Id: _xpm.c,v 1.15 2000/12/01 08:10:03 hubbe Exp $"); #include "image_machine.h" @@ -9,7 +9,7 @@ RCSID("$Id: _xpm.c,v 1.14 2000/08/10 09:51:54 per Exp $"); #include "object.h" #include "program.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "constants.h" #include "mapping.h" #include "stralloc.h" @@ -103,10 +103,10 @@ static rgba_group decode_color( struct buffer *s ) push_text("Image"); push_int(0); SAFE_APPLY_MASTER( "resolv", 2 ); - if(IS_ZERO(sp-1)) error("Internal error: No Image module!\n"); + if(IS_ZERO(sp-1)) Pike_error("Internal Pike_error: No Image module!\n"); push_text("Color"); f_index(2); - if(IS_ZERO(sp-1)) error("Internal error: No Image[] function!\n"); + if(IS_ZERO(sp-1)) Pike_error("Internal Pike_error: No Image[] function!\n"); _parse_color = sp[-1]; parse_color = &_parse_color; sp--; @@ -235,7 +235,7 @@ void f__xpm_write_rows( INT32 args ) iimg = (struct image *)get_storage( img, image_program ); ialpha = (struct image *)get_storage( alpha, image_program ); if(!iimg || !ialpha) - error("Sluta pilla p� interna saker..\n"); + Pike_error("Sluta pilla p� interna saker..\n"); dst = iimg->img; adst = ialpha->img; @@ -390,7 +390,7 @@ void f__xpm_trim_rows( INT32 args ) int len,start; struct pike_string *s = a->item[i].u.string; if(a->item[i].type != T_STRING) - error("Ajabaja\n"); + Pike_error("Ajabaja\n"); if(s->len > 4) { for(start=0; start<s->len; start++) diff --git a/src/modules/Image/encodings/any.c b/src/modules/Image/encodings/any.c index 0e170b56478029f6d5c7c494144aca4a8e381377..16b09e60dbf6cb4a1fb87321d33e58b8bb30c9b5 100644 --- a/src/modules/Image/encodings/any.c +++ b/src/modules/Image/encodings/any.c @@ -1,9 +1,9 @@ -/* $Id: any.c,v 1.19 2000/09/11 16:04:57 grubba Exp $ */ +/* $Id: any.c,v 1.20 2000/12/01 08:10:03 hubbe Exp $ */ /* **! module Image **! note -**! $Id: any.c,v 1.19 2000/09/11 16:04:57 grubba Exp $ +**! $Id: any.c,v 1.20 2000/12/01 08:10:03 hubbe Exp $ **! submodule ANY **! **! This method calls the other decoding methods @@ -23,7 +23,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: any.c,v 1.19 2000/09/11 16:04:57 grubba Exp $"); +RCSID("$Id: any.c,v 1.20 2000/12/01 08:10:03 hubbe Exp $"); #include "pike_macros.h" #include "operators.h" #include "builtin_functions.h" @@ -33,7 +33,7 @@ RCSID("$Id: any.c,v 1.19 2000/09/11 16:04:57 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "image.h" @@ -64,10 +64,10 @@ RCSID("$Id: any.c,v 1.19 2000/09/11 16:04:57 grubba Exp $"); void image_any__decode(INT32 args) { if (args!=1 || sp[-args].type!=T_STRING) - error("Image.ANY.decode: illegal arguments\n"); + Pike_error("Image.ANY.decode: illegal arguments\n"); if (sp[-args].u.string->len<4) - error("Image.ANY.decode: too short string\n"); + Pike_error("Image.ANY.decode: too short string\n"); #define CHAR2(a,b) ((((unsigned char)(a))<<8)|((unsigned char)(b))) /* ok, try the heuristics */ @@ -178,7 +178,7 @@ void image_any__decode(INT32 args) default: unknown_format: - error("Unknown image format.\n"); + Pike_error("Unknown image format.\n"); } simple_image: @@ -195,10 +195,10 @@ simple_image: void image_any_decode_header(INT32 args) { if (args!=1 || sp[-args].type!=T_STRING) - error("Image.ANY.decode_header: illegal arguments\n"); + Pike_error("Image.ANY.decode_header: illegal arguments\n"); if (sp[-args].u.string->len<4) - error("Image.ANY.decode_header: too short string\n"); + Pike_error("Image.ANY.decode_header: too short string\n"); #define CHAR2(a,b) ((((unsigned char)(a))<<8)|((unsigned char)(b))) /* ok, try the heuristics */ @@ -211,7 +211,7 @@ void image_any_decode_header(INT32 args) case CHAR2('P','5'): case CHAR2('P','6'): case CHAR2('P','7'): - error("Image.ANY.decode: decoding of PNM header unimplemented\n"); + Pike_error("Image.ANY.decode: decoding of PNM header unimplemented\n"); case CHAR2(255,216): /* JFIF */ @@ -266,7 +266,7 @@ void image_any_decode_header(INT32 args) return; case CHAR2('F','O'): - error("Image.ANY.decode: decoding of ILBM header unimplemented\n"); + Pike_error("Image.ANY.decode: decoding of ILBM header unimplemented\n"); case CHAR2('B','M'): /* BMP */ @@ -275,7 +275,7 @@ void image_any_decode_header(INT32 args) case CHAR2(0x59,0xa6): /* RAS */ - error("Image.ANY.decode: decoding of RAS header unimplemented\n"); + Pike_error("Image.ANY.decode: decoding of RAS header unimplemented\n"); case CHAR2('P','V'): case CHAR2('G','B'): @@ -301,7 +301,7 @@ void image_any_decode_header(INT32 args) default: unknown_format: - error("Unknown image format.\n"); + Pike_error("Unknown image format.\n"); } } diff --git a/src/modules/Image/encodings/avs.c b/src/modules/Image/encodings/avs.c index e8f6b52b4224151811046a845117f20f9438b8c7..d501fd85466fd6fd5e50372e02e79fe5672ade10 100644 --- a/src/modules/Image/encodings/avs.c +++ b/src/modules/Image/encodings/avs.c @@ -8,7 +8,7 @@ #endif #include "stralloc.h" -RCSID("$Id: avs.c,v 1.11 2000/08/16 19:55:39 grubba Exp $"); +RCSID("$Id: avs.c,v 1.12 2000/12/01 08:10:03 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -16,7 +16,7 @@ RCSID("$Id: avs.c,v 1.11 2000/08/16 19:55:39 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "mapping.h" #include "operators.h" @@ -62,10 +62,10 @@ void image_avs_f__decode(INT32 args) h = q[4]<<24 | q[5]<<16 | q[6]<<8 | q[7]; if( w <= 0 || h <= 0) - error("This is not an AVS file (w=%d; h=%d)\n", w, h); + Pike_error("This is not an AVS file (w=%d; h=%d)\n", w, h); if((size_t)w*h*4+8 > (size_t)s->len) - error("This is not an AVS file (w=%d; h=%d; s=%ld)\n", + Pike_error("This is not an AVS file (w=%d; h=%d; s=%ld)\n", w, h, DO_NOT_WARN((long)s->len)); @@ -113,7 +113,7 @@ void image_avs_f_encode(INT32 args ) get_all_args( "encode", args, "%o", &io); if(!(i = (struct image *)get_storage( io, image_program))) - error("Wrong argument 1 to Image.AVS.encode\n"); + Pike_error("Wrong argument 1 to Image.AVS.encode\n"); s = begin_shared_string( i->xsize*i->ysize*4+8 ); MEMSET(s->str, 0, s->len ); diff --git a/src/modules/Image/encodings/bmp.c b/src/modules/Image/encodings/bmp.c index 0d03a6731a79fe1b5414c2f431edf3ee67457fb4..8ed0246380a5ebf55c9beefb3f99e7e7010c5ca2 100644 --- a/src/modules/Image/encodings/bmp.c +++ b/src/modules/Image/encodings/bmp.c @@ -1,9 +1,9 @@ -/* $Id: bmp.c,v 1.29 2000/09/05 12:46:12 grubba Exp $ */ +/* $Id: bmp.c,v 1.30 2000/12/01 08:10:03 hubbe Exp $ */ /* **! module Image **! note -**! $Id: bmp.c,v 1.29 2000/09/05 12:46:12 grubba Exp $ +**! $Id: bmp.c,v 1.30 2000/12/01 08:10:03 hubbe Exp $ **! submodule BMP **! **! This submodule keeps the BMP (Windows Bitmap) @@ -22,7 +22,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: bmp.c,v 1.29 2000/09/05 12:46:12 grubba Exp $"); +RCSID("$Id: bmp.c,v 1.30 2000/12/01 08:10:03 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -31,7 +31,7 @@ RCSID("$Id: bmp.c,v 1.29 2000/09/05 12:46:12 grubba Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "image.h" @@ -254,7 +254,7 @@ void img_bmp_encode(INT32 args) if (!(nct=(struct neo_colortable*) get_storage(oc, image_colortable_program))) { free_object(oc); - error("Unexpected result from clone_object().\n"); + Pike_error("Unexpected result from clone_object().\n"); } } else if (image_colortable_size(nct)>(1<<bpp)) @@ -281,7 +281,7 @@ void img_bmp_encode(INT32 args) free_object(o); if (sp[-1].type!=T_OBJECT || !(img=(struct image*)get_storage(o=sp[-1].u.object,image_program))) - error("Image.BMP.encode: wierd result from ->mirrory()\n"); + Pike_error("Image.BMP.encode: wierd result from ->mirrory()\n"); if (nct) push_object(oc); /* bitmapinfo */ @@ -579,10 +579,10 @@ void i_img_bmp__decode(INT32 args,int header_only) pop_n_elems(args-1); if (len<20) - error("Image.BMP.decode: not a BMP (file to short)\n"); + Pike_error("Image.BMP.decode: not a BMP (file to short)\n"); if (s[0]!='B' || s[1]!='M') - error("Image.BMP.decode: not a BMP (illegal header)\n"); + Pike_error("Image.BMP.decode: not a BMP (illegal header)\n"); /* ignore stupid info like file size */ @@ -592,7 +592,7 @@ void i_img_bmp__decode(INT32 args,int header_only) case 68: /* fuji jpeg mode */ if (len<54) - error("Image.BMP.decode: unexpected EOF in header (at byte %ld)\n", + Pike_error("Image.BMP.decode: unexpected EOF in header (at byte %ld)\n", PTRDIFF_T_TO_LONG(len)); push_text("xsize"); @@ -647,7 +647,7 @@ void i_img_bmp__decode(INT32 args,int header_only) case 12: /* dos (?) mode */ if (len<54) - error("Image.BMP.decode: unexpected EOF in header (at byte %ld)\n", + Pike_error("Image.BMP.decode: unexpected EOF in header (at byte %ld)\n", DO_NOT_WARN((long)len)); push_text("xsize"); @@ -676,7 +676,7 @@ void i_img_bmp__decode(INT32 args,int header_only) break; default: - error("Image.BMP.decode: not a known BMP type " + Pike_error("Image.BMP.decode: not a known BMP type " "(illegal info size %ld, expected 68, 40 or 12)\n", int_from_32bit(s+14)); } @@ -696,7 +696,7 @@ void i_img_bmp__decode(INT32 args,int header_only) push_text("image"); if (olen-n<0) - error("Image.BMP.decode: unexpected EOF in JFIF data\n"); + Pike_error("Image.BMP.decode: unexpected EOF in JFIF data\n"); push_text("Image"); push_int(0); @@ -736,7 +736,7 @@ void i_img_bmp__decode(INT32 args,int header_only) if (windows) { if ((4<<bpp)>len) - error("Image.BMP.decode: unexpected EOF in palette\n"); + Pike_error("Image.BMP.decode: unexpected EOF in palette\n"); push_string(make_shared_binary_string((char *)s,(4<<bpp))); push_int(2); @@ -749,7 +749,7 @@ void i_img_bmp__decode(INT32 args,int header_only) else { if ((3<<bpp)>len) - error("Image.BMP.decode: unexpected EOF in palette\n"); + Pike_error("Image.BMP.decode: unexpected EOF in palette\n"); push_string(make_shared_binary_string((char *)s,(3<<bpp))); push_int(1); @@ -781,7 +781,7 @@ void i_img_bmp__decode(INT32 args,int header_only) { case 24: if (comp) - error("Image.BMP.decode: can't handle compressed 24bpp BMP\n"); + Pike_error("Image.BMP.decode: can't handle compressed 24bpp BMP\n"); skip=(4-((img->xsize*3)&3))&3; @@ -805,7 +805,7 @@ void i_img_bmp__decode(INT32 args,int header_only) break; case 16: if (comp) - error("Image.BMP.decode: can't handle compressed 16bpp BMP\n"); + Pike_error("Image.BMP.decode: can't handle compressed 16bpp BMP\n"); skip=(4-((img->xsize*2)&3))&3; @@ -831,7 +831,7 @@ void i_img_bmp__decode(INT32 args,int header_only) break; case 8: if (comp != 0 && comp != 1 ) - error("Image.BMP.decode: can't handle compression %d for 8bpp BMP\n",comp); + Pike_error("Image.BMP.decode: can't handle compression %d for 8bpp BMP\n",comp); if (comp==1) { @@ -870,12 +870,12 @@ void i_img_bmp__decode(INT32 args,int header_only) case 1: /* EOD */ goto done_rle8; case 2: /* cursor */ - error("Image.BMP.decode: advanced RLE " + Pike_error("Image.BMP.decode: advanced RLE " "decompression (cursor movement) " "is unimplemented (please send this " "image to mirar@idonex.se)\n"); default: /* literal run */ - error("Image.BMP.decode: advanced RLE " + Pike_error("Image.BMP.decode: advanced RLE " "decompression (literal run) " "is unimplemented (please send this " "image to mirar@idonex.se)\n"); @@ -915,7 +915,7 @@ void i_img_bmp__decode(INT32 args,int header_only) break; case 4: if (comp != 0 && comp != 2 ) - error("Image.BMP.decode: can't handle compression %d for 4bpp BMP\n",comp); + Pike_error("Image.BMP.decode: can't handle compression %d for 4bpp BMP\n",comp); if (comp == 2) /* RLE4 */ { @@ -957,7 +957,7 @@ void i_img_bmp__decode(INT32 args,int header_only) #endif goto done_rle4; case 2: - error("Image.BMP.decode: advanced RLE " + Pike_error("Image.BMP.decode: advanced RLE " "decompression (cursor movement) " "is unimplemented (please send this " "image to mirar@idonex.se)\n"); @@ -970,7 +970,7 @@ void i_img_bmp__decode(INT32 args,int header_only) #endif break; default: - error("Image.BMP.decode: advanced RLE " + Pike_error("Image.BMP.decode: advanced RLE " "decompression (non-rle data) " "is unimplemented (please send this " "image to mirar@idonex.se)\n"); @@ -1034,7 +1034,7 @@ void i_img_bmp__decode(INT32 args,int header_only) break; case 1: if (comp) - error("Image.BMP.decode: can't handle compressed 1bpp BMP\n"); + Pike_error("Image.BMP.decode: can't handle compressed 1bpp BMP\n"); skip=(4-(((img->xsize+7)/8)&3))&3; j=len; @@ -1059,7 +1059,7 @@ void i_img_bmp__decode(INT32 args,int header_only) } break; default: - error("Image.BMP.decode: unknown bpp: %d\n",bpp); + Pike_error("Image.BMP.decode: unknown bpp: %d\n",bpp); } final: diff --git a/src/modules/Image/encodings/dsi.c b/src/modules/Image/encodings/dsi.c index 243642dd286ba1f9a068c1a2d9d6d5d770104314..3340f1db9c87e85f8da754391f4ce90948bafa0e 100644 --- a/src/modules/Image/encodings/dsi.c +++ b/src/modules/Image/encodings/dsi.c @@ -1,7 +1,7 @@ /* Dream SNES Image file */ #include "global.h" -RCSID("$Id: dsi.c,v 1.2 2000/10/19 13:40:02 grubba Exp $"); +RCSID("$Id: dsi.c,v 1.3 2000/12/01 08:10:04 hubbe Exp $"); #include "image_machine.h" @@ -17,7 +17,7 @@ RCSID("$Id: dsi.c,v 1.2 2000/10/19 13:40:02 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "builtin_functions.h" #include "operators.h" @@ -42,17 +42,17 @@ void f__decode( INT32 args ) struct image *ip, *ap; rgb_group black = {0,0,0}; if( sp[-args].type != T_STRING ) - error("Illegal argument 1 to Image.DSI._decode\n"); + Pike_error("Illegal argument 1 to Image.DSI._decode\n"); data = (unsigned char *)sp[-args].u.string->str; len = (size_t)sp[-args].u.string->len; - if( len < 10 ) error("Data too short\n"); + if( len < 10 ) Pike_error("Data too short\n"); xs = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24); ys = data[4] | (data[5]<<8) | (data[6]<<16) | (data[7]<<24); if( (xs * ys * 2) != (ptrdiff_t)(len-8) ) - error("Not a DSI %d * %d + 8 != %ld\n", + Pike_error("Not a DSI %d * %d + 8 != %ld\n", xs, ys, DO_NOT_WARN((long)len)); diff --git a/src/modules/Image/encodings/gd.c b/src/modules/Image/encodings/gd.c index f93c83c31cd5ad5dcb94375c29e26b55623d68c0..3a1e53b74c0ebf701fdbb0fb7b4623a7abbfa96f 100644 --- a/src/modules/Image/encodings/gd.c +++ b/src/modules/Image/encodings/gd.c @@ -8,7 +8,7 @@ #endif #include "stralloc.h" -RCSID("$Id: gd.c,v 1.4 2000/07/28 07:13:06 hubbe Exp $"); +RCSID("$Id: gd.c,v 1.5 2000/12/01 08:10:04 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -16,7 +16,7 @@ RCSID("$Id: gd.c,v 1.4 2000/07/28 07:13:06 hubbe Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "builtin_functions.h" #include "module_support.h" @@ -79,12 +79,12 @@ extern struct program *image_program; void image_gd_f_encode(INT32 args) { - error("not implemented\n"); + Pike_error("not implemented\n"); } void img_gd_decode(INT32 args,int header_only) { - error("not implemented\n"); + Pike_error("not implemented\n"); } static void image_gd_f_decode(INT32 args) diff --git a/src/modules/Image/encodings/hrz.c b/src/modules/Image/encodings/hrz.c index f836b84eebacd640d7a18eb89305f2dd44d1b12e..56e0cf487a7ae0e4a4c535c35bd3284dddb6aee9 100644 --- a/src/modules/Image/encodings/hrz.c +++ b/src/modules/Image/encodings/hrz.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: hrz.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $"); +RCSID("$Id: hrz.c,v 1.6 2000/12/01 08:10:04 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "mapping.h" @@ -13,7 +13,7 @@ RCSID("$Id: hrz.c,v 1.5 2000/07/28 07:13:06 hubbe Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" @@ -52,7 +52,7 @@ void image_hrz_f_decode(INT32 args) int c; get_all_args( "decode", args, "%S", &s); - if(s->len != 256*240*3) error("This is not a HRZ file\n"); + if(s->len != 256*240*3) Pike_error("This is not a HRZ file\n"); push_int( 256 ); push_int( 240 ); @@ -87,7 +87,7 @@ void image_hrz_f_encode(INT32 args ) get_all_args( "encode", args, "%o", &io); if(!(i = (struct image *)get_storage( io, image_program))) - error("Wrong argument 1 to Image.HRZ.encode\n"); + Pike_error("Wrong argument 1 to Image.HRZ.encode\n"); s = begin_shared_string( 256*240*3 ); diff --git a/src/modules/Image/encodings/iff.c b/src/modules/Image/encodings/iff.c index 9fbfa433104e9495f80d296625e203804cecf7d3..079e39440c7f269a53a93dd3eac268f31125d07f 100644 --- a/src/modules/Image/encodings/iff.c +++ b/src/modules/Image/encodings/iff.c @@ -1,9 +1,9 @@ -/* $Id: iff.c,v 1.8 2000/08/11 18:36:19 grubba Exp $ */ +/* $Id: iff.c,v 1.9 2000/12/01 08:10:04 hubbe Exp $ */ #include "global.h" #include "stralloc.h" -RCSID("$Id: iff.c,v 1.8 2000/08/11 18:36:19 grubba Exp $"); +RCSID("$Id: iff.c,v 1.9 2000/12/01 08:10:04 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -11,7 +11,7 @@ RCSID("$Id: iff.c,v 1.8 2000/08/11 18:36:19 grubba Exp $"); #include "svalue.h" #include "mapping.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "builtin_functions.h" @@ -31,9 +31,9 @@ static ptrdiff_t low_parse_iff(unsigned char *data, ptrdiff_t len, if(!memcmp(hdr, "FORM", 4)) clen -= 4; if(clen > len) - error("truncated file\n"); + Pike_error("truncated file\n"); else if(clen < 0) - error("invalid chunk length\n"); + Pike_error("invalid chunk length\n"); } if((!memcmp(hdr, "FORM", 4)) || (!memcmp(hdr, "LIST", 4))) { @@ -60,10 +60,10 @@ void parse_iff(char *id, unsigned char *data, ptrdiff_t len, struct mapping *m, char *stopchunk) { if(len<12 || memcmp("FORM", data, 4)) - error("invalid IFF FORM\n"); + Pike_error("invalid IFF FORM\n"); if(memcmp(id, data+8, 4)) - error("FORM is not %s\n", id); + Pike_error("FORM is not %s\n", id); low_parse_iff(data+12, len-12, data, m, (unsigned char *)stopchunk); } @@ -76,7 +76,7 @@ static struct pike_string *low_make_iff(struct svalue *s) if(s->type != T_ARRAY || s->u.array->size != 2 || s->u.array->item[0].type != T_STRING || s->u.array->item[1].type != T_STRING) - error("invalid chunk\n"); + Pike_error("invalid chunk\n"); add_ref(s->u.array); push_array_items(s->u.array); diff --git a/src/modules/Image/encodings/ilbm.c b/src/modules/Image/encodings/ilbm.c index 311fd134f45015eec30b72c0ed849b99332630d5..4371820bbc37aaf4d3102cf7a1082695161f2879 100644 --- a/src/modules/Image/encodings/ilbm.c +++ b/src/modules/Image/encodings/ilbm.c @@ -1,9 +1,9 @@ -/* $Id: ilbm.c,v 1.20 2000/09/15 21:27:56 grubba Exp $ */ +/* $Id: ilbm.c,v 1.21 2000/12/01 08:10:04 hubbe Exp $ */ /* **! module Image **! note -**! $Id: ilbm.c,v 1.20 2000/09/15 21:27:56 grubba Exp $ +**! $Id: ilbm.c,v 1.21 2000/12/01 08:10:04 hubbe Exp $ **! submodule ILBM **! **! This submodule keep the ILBM encode/decode capabilities @@ -14,7 +14,7 @@ #include "global.h" #include "stralloc.h" -RCSID("$Id: ilbm.c,v 1.20 2000/09/15 21:27:56 grubba Exp $"); +RCSID("$Id: ilbm.c,v 1.21 2000/12/01 08:10:04 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -22,7 +22,7 @@ RCSID("$Id: ilbm.c,v 1.20 2000/09/15 21:27:56 grubba Exp $"); #include "svalue.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "builtin_functions.h" #include "module_support.h" @@ -121,16 +121,16 @@ static void image_ilbm___decode(INT32 args) map_delete(m, &string_[string_BODY]); if(sp[-5].type != T_STRING) - error("Missing BMHD chunk\n"); + Pike_error("Missing BMHD chunk\n"); if(sp[-2].type != T_STRING) - error("Missing BODY chunk\n"); + Pike_error("Missing BODY chunk\n"); /* Extract image size from BMHD */ s = (unsigned char *)STR0(sp[-5].u.string); len = sp[-5].u.string->len; if(len<20) - error("Short BMHD chunk\n"); + Pike_error("Short BMHD chunk\n"); free_svalue(sp-7); @@ -165,7 +165,7 @@ static void image_ilbm___decode(INT32 args) static void parse_bmhd(struct BMHD *bmhd, unsigned char *s, ptrdiff_t len) { if(len<20) - error("Short BMHD chunk\n"); + Pike_error("Short BMHD chunk\n"); bmhd->w = (s[0]<<8)|s[1]; bmhd->h = (s[2]<<8)|s[3]; @@ -269,7 +269,7 @@ static void parse_body(struct BMHD *bmhd, unsigned char *body, ptrdiff_t blen, line = alloca(rbyt*eplanes); break; default: - error("Unsupported ILBM compression %d\n", bmhd->compression); + Pike_error("Unsupported ILBM compression %d\n", bmhd->compression); } switch(bmhd->masking) { @@ -278,9 +278,9 @@ static void parse_body(struct BMHD *bmhd, unsigned char *body, ptrdiff_t blen, case mskHasTransparentColor: break; case mskLasso: - error("Lasso masking not supported\n"); + Pike_error("Lasso masking not supported\n"); default: - error("Unsupported ILBM masking %d\n", bmhd->masking); + Pike_error("Unsupported ILBM masking %d\n", bmhd->masking); } THREADS_ALLOW(); @@ -428,7 +428,7 @@ static void parse_body(struct BMHD *bmhd, unsigned char *body, ptrdiff_t blen, THREADS_DISALLOW(); if(blen<0) - error("truncated or corrupt BODY chunk\n"); + Pike_error("truncated or corrupt BODY chunk\n"); } static void image_ilbm__decode(INT32 args) @@ -454,7 +454,7 @@ static void image_ilbm__decode(INT32 args) if(arr->size < 6 || ITEM(arr)[2].type != T_STRING || ITEM(arr)[2].u.string->size_shift != 0 || ITEM(arr)[5].type != T_STRING || ITEM(arr)[5].u.string->size_shift != 0) - error("Image.ILBM._decode: illegal argument\n"); + Pike_error("Image.ILBM._decode: illegal argument\n"); parse_bmhd(&bmhd, STR0(ITEM(arr)[2].u.string), ITEM(arr)[2].u.string->len); @@ -557,7 +557,7 @@ void img_ilbm_decode(INT32 args) struct svalue *sv; if (!args) - error("Image.ILBM.decode: too few argument\n"); + Pike_error("Image.ILBM.decode: too few argument\n"); if (sp[-args].type != T_MAPPING) { image_ilbm__decode(args); @@ -565,7 +565,7 @@ void img_ilbm_decode(INT32 args) } if (sp[-args].type != T_MAPPING) - error("Image.ILBM.decode: illegal argument\n"); + Pike_error("Image.ILBM.decode: illegal argument\n"); if(args>1) pop_n_elems(args-1); @@ -573,7 +573,7 @@ void img_ilbm_decode(INT32 args) sv = simple_mapping_string_lookup(sp[-args].u.mapping, "image"); if(sv == NULL || sv->type != T_OBJECT) - error("Image.ILBM.decode: illegal argument\n"); + Pike_error("Image.ILBM.decode: illegal argument\n"); ref_push_object(sv->u.object); stack_swap(); @@ -752,25 +752,25 @@ static void image_ilbm_encode(INT32 args) &imgo, &optm); if((img=(struct image*)get_storage(imgo, image_program))==NULL) - error("Image.ILBM.encode: illegal argument 1\n"); + Pike_error("Image.ILBM.encode: illegal argument 1\n"); if(optm != NULL) { struct svalue *s; if((s = simple_mapping_string_lookup(optm, "alpha"))!=NULL && !IS_ZERO(s)) if(s->type != T_OBJECT || (alpha=(struct image*)get_storage(s->u.object, image_program))==NULL) - error("Image.ILBM.encode: option (arg 2) \"alpha\" has illegal type\n"); + Pike_error("Image.ILBM.encode: option (arg 2) \"alpha\" has illegal type\n"); if((s=simple_mapping_string_lookup(optm, "palette"))!=NULL && !IS_ZERO(s)) if(s->type != T_OBJECT || (ct=(struct neo_colortable*) get_storage(s->u.object, image_colortable_program))==NULL) - error("Image.ILBM.encode: option (arg 2) \"palette\" has illegal type\n"); + Pike_error("Image.ILBM.encode: option (arg 2) \"palette\" has illegal type\n"); } if (!img->img) - error("Image.ILBM.encode: no image\n"); + Pike_error("Image.ILBM.encode: no image\n"); if (alpha && !alpha->img) - error("Image.ILBM.encode: no alpha image\n"); + Pike_error("Image.ILBM.encode: no alpha image\n"); if(ct && ct->type == NCT_NONE) ct = NULL; diff --git a/src/modules/Image/encodings/pcx.c b/src/modules/Image/encodings/pcx.c index c641ce751290d20973d691646ae18415ef1e74a6..41e80c918ad6a9555f32872d56ba9ba7a7f48b81 100644 --- a/src/modules/Image/encodings/pcx.c +++ b/src/modules/Image/encodings/pcx.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: pcx.c,v 1.13 2000/09/08 20:10:54 grubba Exp $"); +RCSID("$Id: pcx.c,v 1.14 2000/12/01 08:10:04 hubbe Exp $"); #include "image_machine.h" @@ -15,7 +15,7 @@ RCSID("$Id: pcx.c,v 1.13 2000/09/08 20:10:54 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "builtin_functions.h" #include "operators.h" @@ -249,7 +249,7 @@ static struct object *low_pcx_decode( struct pike_string *data ) b.len = data->len; if(b.len < sizeof(struct pcx_header)) - error("There is not enough data available for this to be a PCX image\n"); + Pike_error("There is not enough data available for this to be a PCX image\n"); pcx_header = *((struct pcx_header *)get_chunk(&b,sizeof(struct pcx_header))); #if BYTEORDER == 1234 SWAP_S(pcx_header.x1); @@ -262,21 +262,21 @@ static struct object *low_pcx_decode( struct pike_string *data ) if((pcx_header.manufacturer != 10) || (pcx_header.reserved) || (pcx_header.rle_encoded & ~1)) - error("This is not a known type of PCX\n"); + Pike_error("This is not a known type of PCX\n"); if ((pcx_header.bpp != 8) && (pcx_header.bpp != 1)) { - error("Unsupported bits per plane: %d\n", pcx_header.bpp); + Pike_error("Unsupported bits per plane: %d\n", pcx_header.bpp); } if ((pcx_header.planes < 1) || (pcx_header.planes > 4)) { - error("Unsupported number of planes: %d\n", pcx_header.planes); + Pike_error("Unsupported number of planes: %d\n", pcx_header.planes); } width = pcx_header.x2 - pcx_header.x1 + 1; height = pcx_header.y2 - pcx_header.y1 + 1; if ((width <= 0) || (height <= 0)) { - error("Unsupported PCX image.\n"); + Pike_error("Unsupported PCX image.\n"); } push_int64(width); @@ -298,7 +298,7 @@ static struct object *low_pcx_decode( struct pike_string *data ) load_rgb_pcx( &pcx_header, &b, dest ); break; default: - error("Unsupported number of planes for %d bpp image: %d\n", + Pike_error("Unsupported number of planes for %d bpp image: %d\n", pcx_header.bpp, pcx_header.planes); } break; @@ -312,11 +312,11 @@ static struct object *low_pcx_decode( struct pike_string *data ) load_planar_palette_pcx( &pcx_header, &b, dest ); break; default: - error("Unsupported number of planes for %d bpp image: %d\n", + Pike_error("Unsupported number of planes for %d bpp image: %d\n", pcx_header.bpp, pcx_header.planes); } default: - error("Unsupported bits per plane: %d\n", pcx_header.bpp); + Pike_error("Unsupported bits per plane: %d\n", pcx_header.bpp); } UNSET_ONERROR(onerr); return io; @@ -328,7 +328,7 @@ static struct object *low_pcx_decode( struct pike_string *data ) **! Decodes a PCX image. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ void image_pcx_decode( INT32 args ) { @@ -346,7 +346,7 @@ void image_pcx_decode( INT32 args ) **! Decodes a PCX image to a mapping. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ void image_pcx__decode( INT32 args ) { @@ -574,7 +574,7 @@ void image_pcx_encode( INT32 args ) get_all_args( "Image.PCX.encode", args, "%o", &i ); if(!get_storage( i, image_program )) - error("Invalid object argument to Image.PCX.encode\n"); + Pike_error("Invalid object argument to Image.PCX.encode\n"); img = ((struct image *)get_storage( i, image_program )); @@ -588,7 +588,7 @@ void image_pcx_encode( INT32 args ) { int dpy; if(sp[-args+1].type != T_MAPPING) - error("Invalid argument 2 to Image.PCX.encode. Expected mapping.\n"); + Pike_error("Invalid argument 2 to Image.PCX.encode. Expected mapping.\n"); parameter_int( sp-args+1, opt_raw, &c.raw ); if(parameter_int( sp-args+1, opt_dpy, &dpy )) c.hdpi = c.vdpi = dpy; diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c index 1fd2b84bbadcf415db34627ee1f10be50659b357..0e808242fd8c26fa889ff6518d68a937dd53fd7a 100644 --- a/src/modules/Image/encodings/png.c +++ b/src/modules/Image/encodings/png.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: png.c,v 1.39 2000/10/28 22:52:45 per Exp $"); +RCSID("$Id: png.c,v 1.40 2000/12/01 08:10:05 hubbe Exp $"); #include "image_machine.h" @@ -11,7 +11,7 @@ RCSID("$Id: png.c,v 1.39 2000/10/28 22:52:45 per Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "dynamic_buffer.h" #include "builtin_functions.h" @@ -86,7 +86,7 @@ static INLINE INT32 call_gz_crc32(INT32 args) INT32 z; apply_svalue(&gz_crc32,args); if (sp[-1].type!=T_INT) - error("Image.PNG: internal error (not integer from Gz.crc32)\n"); + Pike_error("Image.PNG: internal Pike_error (not integer from Gz.crc32)\n"); z=sp[-1].u.integer; pop_stack(); return z; @@ -130,7 +130,7 @@ static void png_decompress(int style) struct object *o; if (style) - error("internal error: illegal decompression style %d\n",style); + Pike_error("internal Pike_error: illegal decompression style %d\n",style); o=clone_object(gz_inflate,0); apply(o,"inflate",1); @@ -142,7 +142,7 @@ static void png_compress(int style) struct object *o; if (style) - error("internal error: illegal decompression style %d\n",style); + Pike_error("internal Pike_error: illegal decompression style %d\n",style); push_int(8); o=clone_object(gz_deflate,1); @@ -170,11 +170,11 @@ static void image_png__chunk(INT32 args) if (args!=2 || sp[-args].type!=T_STRING || sp[1-args].type!=T_STRING) - error("Image.PNG.chunk: Illegal argument(s)\n"); + Pike_error("Image.PNG.chunk: Illegal argument(s)\n"); a=sp[-args].u.string; if (a->len!=4) - error("Image.PNG.chunk: Type string not 4 characters\n"); + Pike_error("Image.PNG.chunk: Type string not 4 characters\n"); b=sp[1-args].u.string; pop_n_elems(args-2); sp-=2; @@ -216,9 +216,9 @@ static void image_png___decode(INT32 args) ONERROR uwp; if (args<1) - error("Image.PNG.__decode: too few arguments\n"); + Pike_error("Image.PNG.__decode: too few arguments\n"); if (sp[-args].type!=T_STRING) - error("Image.PNG.__decode: illegal argument 1\n"); + Pike_error("Image.PNG.__decode: illegal argument 1\n"); if (args==2 && (sp[1-args].type!=T_INT || @@ -374,7 +374,7 @@ static void image_png___decode(INT32 args) **! This function ignores any checksum errors in the file. **! A PNG of higher color resolution than the Image module **! supports (8 bit) will lose that information in the conversion. -**! It throws an error if the image data is erroneous. +**! It throws an Pike_error if the image data is erroneous. */ static struct pike_string *_png_unfilter(unsigned char *data, @@ -505,7 +505,7 @@ static struct pike_string *_png_unfilter(unsigned char *data, break; default: - error("Image.PNG._decode: unsupported filter %d\n",s[-1]); + Pike_error("Image.PNG._decode: unsupported filter %d\n",s[-1]); } } } @@ -521,7 +521,7 @@ static int _png_write_rgb(rgb_group *w1, struct pike_string *trns) { /* returns 1 if alpha channel, 0 if not */ - /* w1, wa1 will be freed upon error */ + /* w1, wa1 will be freed upon Pike_error */ static rgb_group white={255,255,255}; static rgb_group grey4[4]={{0,0,0},{85,85,85},{170,170,170},{255,255,255}}; @@ -616,7 +616,7 @@ static int _png_write_rgb(rgb_group *w1, break; default: free(wa1); free(w1); - error("Image.PNG->_decode: Unsupported color type/bit depth %d (grey)/%d bit.\n", + Pike_error("Image.PNG->_decode: Unsupported color type/bit depth %d (grey)/%d bit.\n", type,bpp); } if (trns && trns->len==2) @@ -657,7 +657,7 @@ static int _png_write_rgb(rgb_group *w1, break; default: free(wa1); free(w1); - error("Image.PNG->_decode: Unsupported color type/bit depth %d (rgb)/%d bit.\n", + Pike_error("Image.PNG->_decode: Unsupported color type/bit depth %d (rgb)/%d bit.\n", type,bpp); } if (trns && trns->len==6) @@ -678,20 +678,20 @@ static int _png_write_rgb(rgb_group *w1, { free(w1); free(wa1); - error("Image.PNG->decode: No palette (PLTE entry), but color type (3) needs one\n"); + Pike_error("Image.PNG->decode: No palette (PLTE entry), but color type (3) needs one\n"); } if (ct->type!=NCT_FLAT) { free(w1); free(wa1); - error("Image.PNG->decode: Internal error (created palette isn't flat)\n"); + Pike_error("Image.PNG->decode: Internal Pike_error (created palette isn't flat)\n"); } mz=ct->u.flat.numentries; if (mz==0) { free(w1); free(wa1); - error("Image.PNG->decode: palette is zero entries long; need at least one color.\n"); + Pike_error("Image.PNG->decode: palette is zero entries long; need at least one color.\n"); } #define CUTPLTE(X,Z) (((X)>=(Z))?0:(X)) @@ -858,7 +858,7 @@ static int _png_write_rgb(rgb_group *w1, default: free(w1); free(wa1); - error("Image.PNG->_decode: Unsupported color type/bit depth %d (palette)/%d bit.\n", + Pike_error("Image.PNG->_decode: Unsupported color type/bit depth %d (palette)/%d bit.\n", type,bpp); } return !!trns; /* alpha channel if trns chunk */ @@ -892,7 +892,7 @@ static int _png_write_rgb(rgb_group *w1, break; default: free(wa1); free(w1); - error("Image.PNG->_decode: Unsupported color type/bit depth %d (grey+a)/%d bit.\n", + Pike_error("Image.PNG->_decode: Unsupported color type/bit depth %d (grey+a)/%d bit.\n", type,bpp); } return 1; /* alpha channel */ @@ -930,16 +930,16 @@ static int _png_write_rgb(rgb_group *w1, break; default: free(wa1); free(w1); - error("Image.PNG->_decode: Unsupported color type/bit depth %d(rgba)/%d bit.\n", + Pike_error("Image.PNG->_decode: Unsupported color type/bit depth %d(rgba)/%d bit.\n", type,bpp); } return 1; /* alpha channel */ default: free(wa1); free(w1); - error("Image.PNG->_decode: Unknown color type %d (bit depth %d).\n", + Pike_error("Image.PNG->_decode: Unknown color type %d (bit depth %d).\n", type,bpp); } - error("Image.PNG->_decode: illegal state\n"); + Pike_error("Image.PNG->_decode: illegal state\n"); return 0; /* stupid */ } @@ -979,7 +979,7 @@ static void img_png_decode(INT32 args,int header_only) } ihdr={-1,-1,-1,0,-1,-1,-1}; if (args<1) - error("Image.PNG._decode: too few arguments\n"); + Pike_error("Image.PNG._decode: too few arguments\n"); m=allocate_mapping(10); push_mapping(m); @@ -987,7 +987,7 @@ static void img_png_decode(INT32 args,int header_only) if (args>=2) { if (sp[1-args-1].type!=T_MAPPING) - error("Image.PNG._decode: illegal argument 2\n"); + Pike_error("Image.PNG._decode: illegal argument 2\n"); push_svalue(sp+1-args-1); ref_push_string(param_palette); @@ -997,7 +997,7 @@ static void img_png_decode(INT32 args,int header_only) case T_OBJECT: push_string(make_shared_string("cast")); if (sp[-1].type==T_INT) - error("Image.PNG._decode: illegal value of option \"palette\"\n"); + Pike_error("Image.PNG._decode: illegal value of option \"palette\"\n"); f_index(2); push_string(make_shared_string("array")); f_call_function(2); @@ -1008,7 +1008,7 @@ static void img_png_decode(INT32 args,int header_only) ct=(struct neo_colortable*)get_storage(sp[-1].u.object, image_colortable_program); if (!ct) - error("Image.PNG._decode: internal error: cloned colortable isn't colortable\n"); + Pike_error("Image.PNG._decode: internal Pike_error: cloned colortable isn't colortable\n"); ref_push_string(param_palette); mapping_insert(m,sp-1,sp-2); pop_n_elems(2); @@ -1016,7 +1016,7 @@ static void img_png_decode(INT32 args,int header_only) case T_INT: pop_n_elems(1); default: - error("Image.PNG._decode: illegal value of option \"palette\"\n"); + Pike_error("Image.PNG._decode: illegal value of option \"palette\"\n"); } } @@ -1030,10 +1030,10 @@ static void img_png_decode(INT32 args,int header_only) push_int(1); /* no care crc */ image_png___decode(2); if (sp[-1].type!=T_ARRAY) - error("Image.PNG._decode: Not PNG data\n"); + Pike_error("Image.PNG._decode: Not PNG data\n"); } else if (sp[-1].type!=T_ARRAY) - error("Image.PNG._decode: Illegal argument 1\n"); + Pike_error("Image.PNG._decode: Illegal argument 1\n"); a=sp[-1].u.array; @@ -1048,7 +1048,7 @@ static void img_png_decode(INT32 args,int header_only) b->item[0].type!=T_STRING || b->item[1].type!=T_STRING || b->item[0].u.string->len!=4) - error("Image.PNG._decode: Illegal stuff in array index %d\n",i); + Pike_error("Image.PNG._decode: Illegal stuff in array index %d\n",i); data = (unsigned char *)b->item[1].u.string->str; len = (size_t)b->item[1].u.string->len; @@ -1056,7 +1056,7 @@ static void img_png_decode(INT32 args,int header_only) if (!i && int_from_32bit((unsigned char*)b->item[0].u.string->str) != 0x49484452 ) - error("Imge.PNG.decode: first chunk isn't IHDR\n"); + Pike_error("Imge.PNG.decode: first chunk isn't IHDR\n"); switch (int_from_32bit((unsigned char*)b->item[0].u.string->str)) { @@ -1064,7 +1064,7 @@ static void img_png_decode(INT32 args,int header_only) case 0x49484452: /* IHDR */ /* header info */ if (b->item[1].u.string->len!=13) - error("Image.PNG._decode: illegal header (IHDR chunk)\n"); + Pike_error("Image.PNG._decode: illegal header (IHDR chunk)\n"); ihdr.width=int_from_32bit(data+0); ihdr.height=int_from_32bit(data+4); @@ -1103,7 +1103,7 @@ static void img_png_decode(INT32 args,int header_only) if (header_only) break; if (ihdr.compression!=0) - error("Image.PNG._decode: unknown compression (%d)\n", + Pike_error("Image.PNG._decode: unknown compression (%d)\n", ihdr.compression); ref_push_string(b->item[1].u.string); @@ -1209,21 +1209,21 @@ static void img_png_decode(INT32 args,int header_only) if (ihdr.type==-1) { - error("Image.PNG._decode: missing header (IHDR chunk)\n"); + Pike_error("Image.PNG._decode: missing header (IHDR chunk)\n"); } if (ihdr.type==3 && !ct) { - error("Image.PNG._decode: missing palette (PLTE chunk)\n"); + Pike_error("Image.PNG._decode: missing palette (PLTE chunk)\n"); } if (ihdr.compression==0) { png_decompress(ihdr.compression); if (sp[-1].type!=T_STRING) - error("Image.PNG._decode: got wierd stuff from decompression\n"); + Pike_error("Image.PNG._decode: got wierd stuff from decompression\n"); } else - error("Image.PNG._decode: illegal compression type 0x%02x\n", + Pike_error("Image.PNG._decode: illegal compression type 0x%02x\n", ihdr.compression); fs=sp[-1].u.string; @@ -1236,13 +1236,13 @@ static void img_png_decode(INT32 args,int header_only) w1=d1=malloc(sizeof(rgb_group)*ihdr.width*ihdr.height); if (!d1) - error("Image.PNG._decode: Out of memory\n"); + Pike_error("Image.PNG._decode: Out of memory\n"); wa1=da1=malloc(sizeof(rgb_group)*ihdr.width*ihdr.height); if (!da1) { free(d1); - error("Image.PNG._decode: Out of memory\n"); + Pike_error("Image.PNG._decode: Out of memory\n"); } /* --- interlace decoding --- */ @@ -1279,7 +1279,7 @@ static void img_png_decode(INT32 args,int header_only) if (wa1) free(wa1); if (ta1) free(ta1); if (ta1) free(t1); - error("Image.PNG->_decode: out of memory (close one)\n"); + Pike_error("Image.PNG->_decode: out of memory (close one)\n"); } /* loop over adam7 interlace's and write them to the arena */ @@ -1334,7 +1334,7 @@ static void img_png_decode(INT32 args,int header_only) break; default: free(w1); if (wa1) free(wa1); - error("Image.PNG._decode: Unknown interlace type\n"); + Pike_error("Image.PNG._decode: Unknown interlace type\n"); } @@ -1432,20 +1432,20 @@ static void image_png_encode(INT32 args) char buf[20]; if (!args) - error("Image.PNG.encode: too few arguments\n"); + Pike_error("Image.PNG.encode: too few arguments\n"); if (sp[-args].type!=T_OBJECT || !(img=(struct image*) get_storage(sp[-args].u.object,image_program))) - error("Image.PNG.encode: illegal argument 1\n"); + Pike_error("Image.PNG.encode: illegal argument 1\n"); if (!img->img) - error("Image.PNG.encode: no image\n"); + Pike_error("Image.PNG.encode: no image\n"); if (args>1) { if (sp[1-args].type!=T_MAPPING) - error("Image.PNG.encode: illegal argument 2\n"); + Pike_error("Image.PNG.encode: illegal argument 2\n"); push_svalue(sp+1-args); ref_push_string(param_alpha); @@ -1454,15 +1454,15 @@ static void image_png_encode(INT32 args) if (sp[-1].type!=T_OBJECT || !(alpha=(struct image*) get_storage(sp[-1].u.object,image_program))) - error("Image.PNG.encode: option (arg 2) \"alpha\" has illegal type\n"); + Pike_error("Image.PNG.encode: option (arg 2) \"alpha\" has illegal type\n"); pop_stack(); if (alpha && (alpha->xsize!=img->xsize || alpha->ysize!=img->ysize)) - error("Image.PNG.encode option (arg 2) \"alpha\"; images differ in size\n"); + Pike_error("Image.PNG.encode option (arg 2) \"alpha\"; images differ in size\n"); if (alpha && !alpha->img) - error("Image.PNG.encode option (arg 2) \"alpha\"; no image\n"); + Pike_error("Image.PNG.encode option (arg 2) \"alpha\"; no image\n"); push_svalue(sp+1-args); ref_push_string(param_palette); @@ -1472,7 +1472,7 @@ static void image_png_encode(INT32 args) if (sp[-1].type!=T_OBJECT || !(ct=(struct neo_colortable*) get_storage(sp[-1].u.object,image_colortable_program))) - error("Image.PNG.encode: option (arg 2) \"palette\" has illegal type\n"); + Pike_error("Image.PNG.encode: option (arg 2) \"palette\" has illegal type\n"); pop_stack(); } @@ -1487,7 +1487,7 @@ static void image_png_encode(INT32 args) ptrdiff_t sz; sz = image_colortable_size(ct); if (sz>256) - error("Image.PNG.encode: palette size to large; " + Pike_error("Image.PNG.encode: palette size to large; " "PNG doesn't support bigger palettes then 256 colors\n"); if (sz>16) bpp=8; else if (sz>4) bpp=4; @@ -1528,13 +1528,13 @@ static void image_png_encode(INT32 args) if (alpha) sa=alpha->img; if (ct) if (alpha) - error("Image.PNG.encode: colortable and alpha channel not supported at the same time\n"); + Pike_error("Image.PNG.encode: colortable and alpha channel not supported at the same time\n"); else { unsigned char *tmp=malloc(img->xsize*img->ysize),*ts; if (!tmp) - error("Image.PNG.encode: out of memory\n"); + Pike_error("Image.PNG.encode: out of memory\n"); image_colortable_index_8bit_image(ct,img->img,tmp, img->xsize*img->ysize,img->xsize); ts=tmp; @@ -1634,13 +1634,13 @@ static void image_png_decode_header(INT32 args) **! </pre> **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ static void image_png_decode(INT32 args) { if (!args) - error("Image.PNG.decode: missing argument(s)\n"); + Pike_error("Image.PNG.decode: missing argument(s)\n"); image_png__decode(args); push_string(make_shared_string("image")); @@ -1651,7 +1651,7 @@ static void image_png_decode_alpha(INT32 args) { struct svalue s; if (!args) - error("Image.PNG.decode: missing argument(s)\n"); + Pike_error("Image.PNG.decode: missing argument(s)\n"); image_png__decode(args); assign_svalue_no_free(&s,sp-1); diff --git a/src/modules/Image/encodings/pnm.c b/src/modules/Image/encodings/pnm.c index 20da63fed42cb1b61c56c6647751eac506ad8528..bda1102589489a107bedf56cfc274174b7172358 100644 --- a/src/modules/Image/encodings/pnm.c +++ b/src/modules/Image/encodings/pnm.c @@ -1,9 +1,9 @@ -/* $Id: pnm.c,v 1.23 2000/08/15 12:49:59 grubba Exp $ */ +/* $Id: pnm.c,v 1.24 2000/12/01 08:10:05 hubbe Exp $ */ /* **! module Image **! note -**! $Id: pnm.c,v 1.23 2000/08/15 12:49:59 grubba Exp $ +**! $Id: pnm.c,v 1.24 2000/12/01 08:10:05 hubbe Exp $ **! submodule PNM **! **! This submodule keeps the PNM encode/decode capabilities @@ -49,7 +49,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: pnm.c,v 1.23 2000/08/15 12:49:59 grubba Exp $"); +RCSID("$Id: pnm.c,v 1.24 2000/12/01 08:10:05 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -57,7 +57,7 @@ RCSID("$Id: pnm.c,v 1.23 2000/08/15 12:49:59 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" @@ -142,20 +142,20 @@ void img_pnm_decode(INT32 args) if (args<1 || sp[-args].type!=T_STRING) - error("Image.PNM.decode(): Illegal arguments\n"); + Pike_error("Image.PNM.decode(): Illegal arguments\n"); s=sp[-args].u.string; skipwhite(s,&pos); if (getnext(s,&pos)!='P') - error("Image.PNM.decode(): given string is not a pnm file\n"); + Pike_error("Image.PNM.decode(): given string is not a pnm file\n"); type=getnext(s,&pos); if (type<'1'||type>'6') - error("Image.PNM.decode(): given pnm data has illegal or unknown type\n"); + Pike_error("Image.PNM.decode(): given pnm data has illegal or unknown type\n"); x=getnextnum(s,&pos); y=getnextnum(s,&pos); if (x<=0||y<=0) - error("Image.PNM.decode(): given pnm data has illegal size\n"); + Pike_error("Image.PNM.decode(): given pnm data has illegal size\n"); if (type=='3'||type=='2'||type=='6'||type=='5') maxval=getnextnum(s,&pos); @@ -165,7 +165,7 @@ void img_pnm_decode(INT32 args) o=clone_object(image_program,2); new=(struct image*)get_storage(o,image_program); if (!new) - error("Image.PNM.decode(): cloned image object isn't an image (internal)\n"); + Pike_error("Image.PNM.decode(): cloned image object isn't an image (internal)\n"); if (type=='1'||type=='2'||type=='3') { @@ -275,9 +275,9 @@ void img_pnm_encode_P1(INT32 args) /* ascii PBM */ if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_P1(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P1(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P1(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P1(): Given image is empty\n"); sprintf(buf,"P1\n%d %d\n",img->xsize,img->ysize); a=make_shared_string(buf); @@ -318,9 +318,9 @@ void img_pnm_encode_P2(INT32 args) /* ascii PGM */ if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage((o=sp[-args].u.object),image_program))) - error("Image.PNM.encode_P2(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P2(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P2(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P2(): Given image is empty\n"); add_ref(o); pop_n_elems(args); @@ -359,9 +359,9 @@ void img_pnm_encode_P3(INT32 args) /* ascii PPM */ if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage((o=sp[-args].u.object),image_program))) - error("Image.PNM.encode_P3(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P3(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P3(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P3(): Given image is empty\n"); add_ref(o); pop_n_elems(args); @@ -400,9 +400,9 @@ void img_pnm_encode_P4(INT32 args) /* binary PBM */ if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_P4(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P4(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P4(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P4(): Given image is empty\n"); sprintf(buf,"P4\n%d %d\n",img->xsize,img->ysize); a=make_shared_string(buf); @@ -446,9 +446,9 @@ void img_pnm_encode_P5(INT32 args) /* binary PGM */ if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_P5(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P5(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P5(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P5(): Given image is empty\n"); sprintf(buf,"P5\n%d %d\n255\n",img->xsize,img->ysize); a=make_shared_string(buf); @@ -478,9 +478,9 @@ void img_pnm_encode_P6(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_P6(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_P6(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_P6(): Given image is empty\n"); + Pike_error("Image.PNM.encode_P6(): Given image is empty\n"); sprintf(buf,"P6\n%d %d\n255\n",img->xsize,img->ysize); a=make_shared_string(buf); @@ -519,9 +519,9 @@ void img_pnm_encode_ascii(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_ascii(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_ascii(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_ascii(): Given image is empty\n"); + Pike_error("Image.PNM.encode_ascii(): Given image is empty\n"); func=img_pnm_encode_P1; /* PBM */ n=img->xsize*img->ysize; @@ -553,9 +553,9 @@ void img_pnm_encode_binary(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.PNM.encode_binary(): Illegal arguments\n"); + Pike_error("Image.PNM.encode_binary(): Illegal arguments\n"); if (!img->img) - error("Image.PNM.encode_binary(): Given image is empty\n"); + Pike_error("Image.PNM.encode_binary(): Given image is empty\n"); func=img_pnm_encode_P4; /* PBM */ n=img->xsize*img->ysize; diff --git a/src/modules/Image/encodings/psd.c b/src/modules/Image/encodings/psd.c index 06ea5c42ee3a298d7f1c272ed04de7643485773e..1e6c3ce23264df8e541e1b4ceeb730579dc60ee5 100644 --- a/src/modules/Image/encodings/psd.c +++ b/src/modules/Image/encodings/psd.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: psd.c,v 1.25 2000/11/23 11:08:37 per Exp $"); +RCSID("$Id: psd.c,v 1.26 2000/12/01 08:10:05 hubbe Exp $"); #include "image_machine.h" @@ -15,7 +15,7 @@ RCSID("$Id: psd.c,v 1.25 2000/11/23 11:08:37 per Exp $"); #include "interpret.h" #include "svalue.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "builtin_functions.h" #include "operators.h" @@ -70,7 +70,7 @@ static unsigned int psd_read_uint( struct buffer *from ) { unsigned int res; if(from->len < 4) - error("Not enough space for 4 bytes (uint32)\n"); + Pike_error("Not enough space for 4 bytes (uint32)\n"); res = from->str[0]<<24|from->str[1]<<16|from->str[2]<<8|from->str[3]; from->str += 4; from->len -= 4; @@ -86,7 +86,7 @@ static unsigned short psd_read_ushort( struct buffer *from ) { unsigned short res; if(from->len < 2) - error("Not enough space for 2 bytes (uint16)\n"); + Pike_error("Not enough space for 2 bytes (uint16)\n"); res = from->str[0]<<8 | from->str[1]; from->str += 2; from->len -= 2; @@ -120,7 +120,7 @@ static char *psd_read_data( struct buffer * from, size_t len ) { char *res; if( from->len < len ) - error("Not enough space for %lu bytes\n", + Pike_error("Not enough space for %lu bytes\n", DO_NOT_WARN((unsigned long)len)); res = (char *)from->str; from->str += len; @@ -135,7 +135,7 @@ static struct buffer psd_read_string( struct buffer *data ) res.str = (unsigned char *)psd_read_data( data, res.len ); if(res.len > 0) res.len--; /* len includes ending \0 */ if(!res.str) - error("String read failed\n"); + Pike_error("String read failed\n"); return res; } @@ -145,7 +145,7 @@ static struct buffer psd_read_pstring( struct buffer *data ) res.len = psd_read_uchar( data ); res.str = (unsigned char *)psd_read_data( data, res.len ); if(!res.str) - error("PString read failed\n"); + Pike_error("PString read failed\n"); return res; } @@ -355,7 +355,7 @@ static void f_decode_packbits_encoded(INT32 args) int compression = 0; struct buffer b, ob, d; if(sp[-args].type != T_STRING) - error("internal argument error"); + Pike_error("internal argument Pike_error"); if(args == 5) @@ -367,7 +367,7 @@ static void f_decode_packbits_encoded(INT32 args) pop_n_elems(4); } else if(args == 3) { if( src->str[0] ) - error("Impossible compression (%d)!\n", (src->str[0]<<8|src->str[1]) ); + Pike_error("Impossible compression (%d)!\n", (src->str[0]<<8|src->str[1]) ); compression = src->str[1]; b.str = (unsigned char *)src->str+2; b.len = src->len-2; @@ -392,7 +392,7 @@ static void f_decode_packbits_encoded(INT32 args) push_string( make_shared_binary_string((char *)b.str,b.len)); break; default: - error("Impossible compression (%d)!\n", src->str[1]); + Pike_error("Impossible compression (%d)!\n", src->str[1]); } stack_swap(); pop_stack(); @@ -417,7 +417,7 @@ static void f_decode_image_channel( INT32 args ) stack_swap(); pop_stack(); if(s->len < w*h) - error("Not enough data in string for this channel\n"); + Pike_error("Not enough data in string for this channel\n"); source = (unsigned char *)s->str; push_int( w ); push_int( h ); io = clone_object( image_program, 2 ); @@ -456,7 +456,7 @@ static void f_decode_image_data( INT32 args ) stack_swap(); pop_stack(); if(s->len < w*h*d) - error("Not enough data in string for this channel\n"); + Pike_error("Not enough data in string for this channel\n"); source = (unsigned char *)s->str; source2 = source+w*h; source3 = source+w*h*2; @@ -709,9 +709,9 @@ static void image_f_psd___decode( INT32 args ) pop_n_elems( args-1 ); if(s->str[0] != '8' || s->str[1] != 'B' || s->str[2] != 'P' || s->str[3] != 'S' ) - error("This is not a Photoshop PSD file (invalid signature)\n"); + Pike_error("This is not a Photoshop PSD file (invalid signature)\n"); if(s->str[4] || s->str[5] != 1) - error("This is not a Photoshop PSD file (invalid version)\n"); + Pike_error("This is not a Photoshop PSD file (invalid version)\n"); b.len = s->len-12; b.str = (unsigned char *)s->str+12; @@ -736,9 +736,9 @@ static void f_apply_cmap( INT32 args ) int n; get_all_args( "apply_cmap", args, "%o%S", &io, &cmap ); if(cmap->len < 256*3) - error("Invalid colormap resource\n"); + Pike_error("Invalid colormap resource\n"); if(!(i = (struct image *)get_storage( io, image_program ))) - error("Invalid image object\n"); + Pike_error("Invalid image object\n"); n = i->xsize * i->ysize; d = i->img; THREADS_ALLOW(); diff --git a/src/modules/Image/encodings/pvr.c b/src/modules/Image/encodings/pvr.c index 67533042287b5301046fa69027c3bf6b014ff8ac..c370f30ce80c3cc36387db3e1a67006182f9ef88 100644 --- a/src/modules/Image/encodings/pvr.c +++ b/src/modules/Image/encodings/pvr.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: pvr.c,v 1.11 2000/09/17 12:36:26 grubba Exp $"); +RCSID("$Id: pvr.c,v 1.12 2000/12/01 08:10:05 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -13,7 +13,7 @@ RCSID("$Id: pvr.c,v 1.11 2000/09/17 12:36:26 grubba Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "stralloc.h" #include "builtin_functions.h" @@ -241,14 +241,14 @@ void image_pvr_f_encode(INT32 args) "%o%m":"%o"), &imgo, &optm); if((img=(struct image*)get_storage(imgo, image_program))==NULL) - error("Image.PVR.encode: illegal argument 1\n"); + Pike_error("Image.PVR.encode: illegal argument 1\n"); if(optm != NULL) { struct svalue *s; if((s = simple_mapping_string_lookup(optm, "alpha"))!=NULL && !IS_ZERO(s)) if(s->type != T_OBJECT || (alpha=(struct image*)get_storage(s->u.object, image_program))==NULL) - error("Image.PVR.encode: option (arg 2) \"alpha\" has illegal type\n"); + Pike_error("Image.PVR.encode: option (arg 2) \"alpha\" has illegal type\n"); if((s = simple_mapping_string_lookup(optm, "global_index"))!=NULL && !IS_UNDEFINED(s)) { if(s->type == T_INT) { @@ -256,17 +256,17 @@ void image_pvr_f_encode(INT32 args) has_gbix=1; } else - error("Image.PVR.encode: option (arg 2) \"global_index\" has illegal type\n"); + Pike_error("Image.PVR.encode: option (arg 2) \"global_index\" has illegal type\n"); } } if (!img->img) - error("Image.PVR.encode: no image\n"); + Pike_error("Image.PVR.encode: no image\n"); if (alpha && !alpha->img) - error("Image.PVR.encode: no alpha image\n"); + Pike_error("Image.PVR.encode: no alpha image\n"); if (alpha && (alpha->xsize != img->xsize || alpha->ysize != img->ysize)) - error("Image.PVR.encode: alpha and image size differ\n"); + Pike_error("Image.PVR.encode: alpha and image size differ\n"); res = begin_shared_string(8+(sz=8+2*img->xsize*img->ysize)+(has_gbix? 12:0)); dst = STR0(res); @@ -520,13 +520,13 @@ void img_pvr_decode(INT32 args,int header_only) } if(len < 16 || strncmp(s, "PVRT", 4)) - error("not a PVR texture\n"); + Pike_error("not a PVR texture\n"); else { INT32 l = s[4]|(s[5]<<8)|(s[6]<<16)|(s[7]<<24); if(l+8>len) - error("file is truncated\n"); + Pike_error("file is truncated\n"); else if(l<8) - error("invalid PVRT chunk length\n"); + Pike_error("invalid PVRT chunk length\n"); len = l+8; } @@ -563,7 +563,7 @@ void img_pvr_decode(INT32 args,int header_only) case MODE_TWIDDLE: twiddle = 1; if(w != h || w<8 || w>1024 || (w&(w-1))) - error("invalid size for twiddle texture\n"); + Pike_error("invalid size for twiddle texture\n"); case MODE_RECTANGLE: case MODE_STRIDE: break; @@ -571,18 +571,18 @@ void img_pvr_decode(INT32 args,int header_only) twiddle = 1; if((w<h && (w<8 || w>1024 || (w&(w-1)) || h%w)) || (h>=w && (h<8 || h>1024 || (h&(h-1)) || w%h))) - error("invalid size for twiddle rectangle texture\n"); + Pike_error("invalid size for twiddle rectangle texture\n"); break; case MODE_COMPRESSED: case MODE_COMPRESSED_MIPMAP: - error("compressed PVRs not supported\n"); + Pike_error("compressed PVRs not supported\n"); case MODE_CLUT4: case MODE_CLUT4_MIPMAP: case MODE_CLUT8: case MODE_CLUT8_MIPMAP: - error("palette PVRs not supported\n"); + Pike_error("palette PVRs not supported\n"); default: - error("unknown PVR format\n"); + Pike_error("unknown PVR format\n"); } switch(attr&0xff) { @@ -593,13 +593,13 @@ void img_pvr_decode(INT32 args,int header_only) case MODE_RGB555: bpp=2; break; case MODE_YUV422: - error("YUV mode not supported\n"); + Pike_error("YUV mode not supported\n"); case MODE_ARGB8888: - error("ARGB8888 mode not supported\n"); + Pike_error("ARGB8888 mode not supported\n"); case MODE_BUMPMAP: - error("bumpmap mode not supported\n"); + Pike_error("bumpmap mode not supported\n"); default: - error("unknown PVR color mode\n"); + Pike_error("unknown PVR color mode\n"); } if(mipmap) /* Just skip everything except the largest version */ @@ -607,7 +607,7 @@ void img_pvr_decode(INT32 args,int header_only) mipmap += x*x; if(len < (INT32)(bpp*(h*w+mipmap))) - error("short PVRT chunk\n"); + Pike_error("short PVRT chunk\n"); s += bpp*mipmap; diff --git a/src/modules/Image/encodings/ras.c b/src/modules/Image/encodings/ras.c index 0605aca27ea120d8b1a0530f0ddd7732a88f8a6b..24521fcff78efa67ad1fddfa1b0c50861c77ea9b 100644 --- a/src/modules/Image/encodings/ras.c +++ b/src/modules/Image/encodings/ras.c @@ -1,9 +1,9 @@ -/* $Id: ras.c,v 1.12 2000/09/16 23:53:23 grubba Exp $ */ +/* $Id: ras.c,v 1.13 2000/12/01 08:10:05 hubbe Exp $ */ /* **! module Image **! note -**! $Id: ras.c,v 1.12 2000/09/16 23:53:23 grubba Exp $ +**! $Id: ras.c,v 1.13 2000/12/01 08:10:05 hubbe Exp $ **! submodule RAS **! **! This submodule keep the RAS encode/decode capabilities @@ -14,7 +14,7 @@ #include "global.h" #include "stralloc.h" -RCSID("$Id: ras.c,v 1.12 2000/09/16 23:53:23 grubba Exp $"); +RCSID("$Id: ras.c,v 1.13 2000/12/01 08:10:05 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -22,7 +22,7 @@ RCSID("$Id: ras.c,v 1.12 2000/09/16 23:53:23 grubba Exp $"); #include "svalue.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "builtin_functions.h" #include "module_support.h" @@ -128,33 +128,33 @@ void img_ras_decode(INT32 args) get_all_args("Image.RAS.decode", args, "%S", &str); if(str->len < 32) - error("Image.RAS.decode: header too small\n"); + Pike_error("Image.RAS.decode: header too small\n"); decode_ras_header(&rs, STR0(str)); if(rs.ras_magic != 0x59a66a95) - error("Image.RAS.decode: bad magic\n"); + Pike_error("Image.RAS.decode: bad magic\n"); if(rs.ras_type < 0 || rs.ras_type > RT_BYTE_ENCODED) - error("Image.RAS.decode: unsupported ras_type %d\n", rs.ras_type); + Pike_error("Image.RAS.decode: unsupported ras_type %d\n", rs.ras_type); if(rs.ras_maptype < 0 || rs.ras_maptype > RMT_EQUAL_RGB) - error("Image.RAS.decode: unsupported ras_maptype %d\n", rs.ras_maptype); + Pike_error("Image.RAS.decode: unsupported ras_maptype %d\n", rs.ras_maptype); if(rs.ras_depth != 1 && rs.ras_depth != 8 && rs.ras_depth != 24) - error("Image.RAS.decode: unsupported ras_depth %d\n", rs.ras_depth); + Pike_error("Image.RAS.decode: unsupported ras_depth %d\n", rs.ras_depth); if(rs.ras_width < 0) - error("Image.RAS.decode: negative ras_width\n"); + Pike_error("Image.RAS.decode: negative ras_width\n"); if(rs.ras_height < 0) - error("Image.RAS.decode: negative ras_height\n"); + Pike_error("Image.RAS.decode: negative ras_height\n"); if(rs.ras_length < 0) - error("Image.RAS.decode: negative ras_length\n"); + Pike_error("Image.RAS.decode: negative ras_length\n"); if(rs.ras_maplength < 0) - error("Image.RAS.decode: negative ras_maplength\n"); + Pike_error("Image.RAS.decode: negative ras_maplength\n"); src = (unsigned char *)(STR0(str)+32); len = str->len - 32; @@ -164,7 +164,7 @@ void img_ras_decode(INT32 args) unsigned char *map = src; if(len < rs.ras_maplength) - error("Image.RAS.decode: colormap truncated\n"); + Pike_error("Image.RAS.decode: colormap truncated\n"); src += rs.ras_maplength; len -= rs.ras_maplength; @@ -175,7 +175,7 @@ void img_ras_decode(INT32 args) switch(rs.ras_maptype) { case RMT_NONE: - error("Image.RAS.decode: RMT_NONE colormap has length != 0 ( == %d )\n", rs.ras_maplength); + Pike_error("Image.RAS.decode: RMT_NONE colormap has length != 0 ( == %d )\n", rs.ras_maplength); break; case RMT_EQUAL_RGB: { @@ -202,7 +202,7 @@ void img_ras_decode(INT32 args) /* Better to proceed and make a partly black image? */ if(ctab != NULL) free_object(ctab); - error("Image.RAS.decode: image data truncated\n"); + Pike_error("Image.RAS.decode: image data truncated\n"); } else len = rs.ras_length; } @@ -250,7 +250,7 @@ void img_ras_decode(INT32 args) if(ctab != NULL) free_object(ctab); free_object(o); - error("Image.RAS.decode: image data too short\n"); + Pike_error("Image.RAS.decode: image data too short\n"); } rgb->b = *src++; rgb->g = *src++; @@ -272,7 +272,7 @@ void img_ras_decode(INT32 args) if(ctab != NULL) free_object(ctab); free_object(o); - error("Image.RAS.decode: image data too short\n"); + Pike_error("Image.RAS.decode: image data too short\n"); } if(*src<numcolors) *rgb++ = entries[*src++].color; @@ -299,7 +299,7 @@ void img_ras_decode(INT32 args) if(ctab != NULL) free_object(ctab); free_object(o); - error("Image.RAS.decode: image data too short\n"); + Pike_error("Image.RAS.decode: image data too short\n"); } data = (src[0]<<8)|src[1]; src += 2; @@ -422,7 +422,7 @@ static void image_ras_encode(INT32 args) &imgo, &optm); if((img=(struct image*)get_storage(imgo, image_program))==NULL) - error("Image.RAS.encode: illegal argument 1\n"); + Pike_error("Image.RAS.encode: illegal argument 1\n"); if(optm != NULL) { struct svalue *s; @@ -431,11 +431,11 @@ static void image_ras_encode(INT32 args) if(s->type != T_OBJECT || (ct=(struct neo_colortable*) get_storage(s->u.object, image_colortable_program))==NULL) - error("Image.RAS.encode: option (arg 2) \"palette\" has illegal type\n"); + Pike_error("Image.RAS.encode: option (arg 2) \"palette\" has illegal type\n"); } if (!img->img) - error("Image.RAS.encode: no image\n"); + Pike_error("Image.RAS.encode: no image\n"); rgb = img->img; diff --git a/src/modules/Image/encodings/tga.c b/src/modules/Image/encodings/tga.c index 0831029da2cf5768c97a1c548d018f901acd18bf..96ca3d9e1bbf2a73dc27ed12a30aa9d760b16fab 100644 --- a/src/modules/Image/encodings/tga.c +++ b/src/modules/Image/encodings/tga.c @@ -1,6 +1,6 @@ /* - * $Id: tga.c,v 1.24 2000/08/31 21:26:08 grubba Exp $ + * $Id: tga.c,v 1.25 2000/12/01 08:10:06 hubbe Exp $ * * Targa codec for pike. Based on the tga plugin for gimp. * @@ -48,7 +48,7 @@ #include "object.h" #include "program.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "constants.h" #include "mapping.h" #include "stralloc.h" @@ -81,7 +81,7 @@ #include "module_magic.h" -RCSID("$Id: tga.c,v 1.24 2000/08/31 21:26:08 grubba Exp $"); +RCSID("$Id: tga.c,v 1.25 2000/12/01 08:10:06 hubbe Exp $"); #ifndef MIN # define MIN(X,Y) ((X)<(Y)?(X):(Y)) @@ -186,7 +186,7 @@ static struct image_alpha load_image(struct pike_string *str) buffer.len = str->len; if(buffer.len < ((sizeof(struct tga_footer)+sizeof(struct tga_header)))) - error("Data (%ld bytes) is too short\n", + Pike_error("Data (%ld bytes) is too short\n", DO_NOT_WARN((long)buffer.len)); @@ -200,13 +200,13 @@ static struct image_alpha load_image(struct pike_string *str) buffer.len -= hdr.idLength; if( (hdr.bpp != 8) && (hdr.bpp != 16) && (hdr.bpp != 24) && (hdr.bpp != 32) ) - error("Unsupported TGA file (bpp==%d)\n", hdr.bpp); + Pike_error("Unsupported TGA file (bpp==%d)\n", hdr.bpp); if( hdr.imageType > 11 ) - error("Unsupported TGA image type\n"); + Pike_error("Unsupported TGA image type\n"); if(buffer.len < 3) - error("Not enough data in buffer to decode a TGA image\n"); + Pike_error("Not enough data in buffer to decode a TGA image\n"); return ReadImage (&buffer, &hdr); } @@ -542,7 +542,7 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) if (bpp != 8) /* We can only cope with 8-bit indices. */ - error ("TGA: index sizes other than 8 bits are unimplemented\n"); + Pike_error ("TGA: index sizes other than 8 bits are unimplemented\n"); break; case TGA_TYPE_GRAY_RLE: @@ -558,18 +558,18 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) break; default: - error ("TGA: unrecognized image type %d\n", hdr->imageType); + Pike_error ("TGA: unrecognized image type %d\n", hdr->imageType); } /* Check that we have a color map only when we need it. */ if (itype == INDEXED) { if (hdr->colorMapType != 1) - error ("TGA: indexed image has invalid color map type %d\n", + Pike_error ("TGA: indexed image has invalid color map type %d\n", hdr->colorMapType); } else if (hdr->colorMapType != 0) { - error ("TGA: non-indexed image has invalid color map type %d\n", + Pike_error ("TGA: non-indexed image has invalid color map type %d\n", hdr->colorMapType); } @@ -583,7 +583,7 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) length = (hdr->colorMapLengthHi << 8) | hdr->colorMapLengthLo; if (length == 0) - error ("TGA: invalid color map length %d\n", length); + Pike_error ("TGA: invalid color map length %d\n", length); pelbytes = ROUNDUP_DIVIDE (hdr->colorMapSize, 8); colors = length + index; @@ -596,7 +596,7 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) if (std_fread (cmap + (index * pelbytes), pelbytes, length, fp) != length) { free(cmap); - error ("TGA: error reading colormap\n"); + Pike_error ("TGA: Pike_error reading colormap\n"); } /* Now pretend as if we only have 8 bpp. */ @@ -608,7 +608,7 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) /* Allocate the data. */ data = (guchar *) malloc (ROUNDUP_DIVIDE((width * height * bpp), 8)); if(!data) - error("TGA: malloc failed\n"); + Pike_error("TGA: malloc failed\n"); if (rle) myfread = rle_fread; @@ -759,7 +759,7 @@ static struct buffer save_tga(struct image *img, struct image *alpha, if(alpha && (alpha->xsize != img->xsize || alpha->ysize != img->ysize )) - error("Alpha and image objects are not equally sized.\n"); + Pike_error("Alpha and image objects are not equally sized.\n"); width = img->xsize; height = img->ysize; @@ -808,12 +808,12 @@ static struct buffer save_tga(struct image *img, struct image *alpha, if (std_fwrite((void *)&hdr, sizeof (hdr), 1, fp) != 1) { free(obuf.str); - error("Internal error: Out of space in buffer.\n"); + Pike_error("Internal Pike_error: Out of space in buffer.\n"); } if (std_fwrite ((void *)SAVE_ID_STRING, hdr.idLength, 1, fp) != 1) { free(obuf.str); - error("Internal error: Out of space in buffer.\n"); + Pike_error("Internal Pike_error: Out of space in buffer.\n"); } /* Allocate a new set of pixels. */ @@ -834,7 +834,7 @@ static struct buffer save_tga(struct image *img, struct image *alpha, if(!data) { free(obuf.str); - error("Out of memory while encoding image\n"); + Pike_error("Out of memory while encoding image\n"); } for(y=0; y<height; y++) for(x=0; x<width; x++) @@ -851,7 +851,7 @@ static struct buffer save_tga(struct image *img, struct image *alpha, if(!data) { free(obuf.str); - error("Out of memory while encoding image\n"); + Pike_error("Out of memory while encoding image\n"); } for(y=0; y<height; y++) for(x=0; x<width; x++) @@ -866,7 +866,7 @@ static struct buffer save_tga(struct image *img, struct image *alpha, { free(data); free(obuf.str); - error("Internal error: Out of space in buffer.\n"); + Pike_error("Internal Pike_error: Out of space in buffer.\n"); } free(data); } @@ -887,7 +887,7 @@ static struct buffer save_tga(struct image *img, struct image *alpha, **! ([ "image":img_object, "alpha":alpha_channel ]) **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ void image_tga__decode( INT32 args ) { @@ -919,7 +919,7 @@ void image_tga__decode( INT32 args ) **! Decodes a Targa image. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ void image_tga_decode( INT32 args ) { @@ -964,20 +964,20 @@ void image_tga_encode( INT32 args ) struct buffer buf; int rle = 1; if (!args) - error("Image.TGA.encode: too few arguments\n"); + Pike_error("Image.TGA.encode: too few arguments\n"); if (Pike_sp[-args].type!=PIKE_T_OBJECT || !(img=(struct image*) get_storage(Pike_sp[-args].u.object,image_program))) - error("Image.TGA.encode: illegal argument 1\n"); + Pike_error("Image.TGA.encode: illegal argument 1\n"); if (!img->img) - error("Image.TGA.encode: no image\n"); + Pike_error("Image.TGA.encode: no image\n"); if (args>1) { if (Pike_sp[1-args].type!=PIKE_T_MAPPING) - error("Image.TGA.encode: illegal argument 2\n"); + Pike_error("Image.TGA.encode: illegal argument 2\n"); push_svalue(Pike_sp+1-args); ref_push_string(param_alpha); @@ -987,15 +987,15 @@ void image_tga_encode( INT32 args ) if (Pike_sp[-1].type!=PIKE_T_OBJECT || !(alpha=(struct image*) get_storage(Pike_sp[-1].u.object,image_program))) - error("Image.TGA.encode: option (arg 2) \"alpha\" has illegal type\n"); + Pike_error("Image.TGA.encode: option (arg 2) \"alpha\" has illegal type\n"); pop_stack(); if (alpha && (alpha->xsize!=img->xsize || alpha->ysize!=img->ysize)) - error("Image.TGA.encode option (arg 2) \"alpha\"; images differ in size\n"); + Pike_error("Image.TGA.encode option (arg 2) \"alpha\"; images differ in size\n"); if (alpha && !alpha->img) - error("Image.TGA.encode option (arg 2) \"alpha\"; no image\n"); + Pike_error("Image.TGA.encode option (arg 2) \"alpha\"; no image\n"); push_svalue(Pike_sp+1-args); ref_push_string(param_raw); diff --git a/src/modules/Image/encodings/tim.c b/src/modules/Image/encodings/tim.c index b0e585e4fda9ad7e69aebd7b1b95c25189959e33..77c73296967511c8ca8d00ab007a13d52c98216b 100644 --- a/src/modules/Image/encodings/tim.c +++ b/src/modules/Image/encodings/tim.c @@ -4,7 +4,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: tim.c,v 1.10 2000/09/17 12:51:45 grubba Exp $"); +RCSID("$Id: tim.c,v 1.11 2000/12/01 08:10:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -13,7 +13,7 @@ RCSID("$Id: tim.c,v 1.10 2000/09/17 12:51:45 grubba Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "stralloc.h" #include "builtin_functions.h" @@ -183,9 +183,9 @@ void img_tim_decode(INT32 args, int header_only) pop_n_elems(args-1); if(len < 12 || (s[0] != 0x10 || s[2] != 0 || s[3] != 0)) - error("not a TIM texture\n"); + Pike_error("not a TIM texture\n"); else if(s[2] != 0) - error("unknown version of TIM texture\n"); + Pike_error("unknown version of TIM texture\n"); s += 4; len -= 4; @@ -195,7 +195,7 @@ void img_tim_decode(INT32 args, int header_only) attr = s[0]|(s[1]<<8)|(s[2]<<16)|(s[3]<<24); if(attr&0xfffffff0) - error("unknown flags in TIM texture\n"); + Pike_error("unknown flags in TIM texture\n"); s += 4; len -= 4; @@ -231,7 +231,7 @@ void img_tim_decode(INT32 args, int header_only) #ifdef TIM_DEBUG printf("24bit\n"); #endif - error("24bit TIMs not supported. Please send an example to peter@roxen.com\n"); + Pike_error("24bit TIMs not supported. Please send an example to peter@roxen.com\n"); case MODE_CLUT4: /* dx and dy word ignored */ #ifdef TIM_DEBUG @@ -262,9 +262,9 @@ void img_tim_decode(INT32 args, int header_only) #ifdef TIM_DEBUG printf("Mixed\n"); #endif - error("mixed TIMs not supported\n"); + Pike_error("mixed TIMs not supported\n"); default: - error("unknown TIM format\n"); + Pike_error("unknown TIM format\n"); } push_text("xsize"); @@ -283,7 +283,7 @@ void img_tim_decode(INT32 args, int header_only) struct image *img; if(len < (INT32)(bitpp*(h*w)/8)) - error("short pixel data\n"); + Pike_error("short pixel data\n"); push_text("image"); push_int(w); diff --git a/src/modules/Image/encodings/wbf.c b/src/modules/Image/encodings/wbf.c index fc38326d78f064ea9cb5f6adb8f4caa29c8cb6d2..76cee3d89e96152d844f0f2eddf3a59ba1491e81 100644 --- a/src/modules/Image/encodings/wbf.c +++ b/src/modules/Image/encodings/wbf.c @@ -5,7 +5,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: wbf.c,v 1.6 2000/08/03 21:25:32 grubba Exp $"); +RCSID("$Id: wbf.c,v 1.7 2000/12/01 08:10:06 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "mapping.h" @@ -15,7 +15,7 @@ RCSID("$Id: wbf.c,v 1.6 2000/08/03 21:25:32 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "program.h" @@ -65,7 +65,7 @@ struct wbf_header static void read_string( struct buffer *from, unsigned int len, char *to ) { if( from->len < len ) - error("Invalid data format\n"); + Pike_error("Invalid data format\n"); MEMCPY( from->str, to, len ); from->str += len; from->len -= len; @@ -80,7 +80,7 @@ static unsigned char read_uchar( struct buffer *from ) from->str++; from->len--; } else - error("Invalid data format\n"); + Pike_error("Invalid data format\n"); return res; } @@ -287,7 +287,7 @@ static void low_image_f_wbf_decode( int args, int mode ) free_string( s ); free_wbf_header_contents( &wh ); - error("Unsupported wbf image type.\n"); + Pike_error("Unsupported wbf image type.\n"); } } @@ -359,20 +359,20 @@ static void image_f_wbf_encode( int args ) int num_strings = 0; if( !args ) - error("No image given to encode.\n"); + Pike_error("No image given to encode.\n"); if( args > 2 ) - error("Too many arguments to encode.\n"); + Pike_error("Too many arguments to encode.\n"); if( sp[-args].type != T_OBJECT ) - error("No image given to encode.\n"); + Pike_error("No image given to encode.\n"); o = sp[-args].u.object; i = (struct image*)get_storage(o,image_program); if(!i) - error("Wrong type object argument\n"); + Pike_error("Wrong type object argument\n"); if( args == 2 ) { if( sp[-args+1].type != T_MAPPING ) - error("Wrong type for argument 2.\n"); + Pike_error("Wrong type for argument 2.\n"); options = sp[-args+1].u.mapping; } sp-=args; diff --git a/src/modules/Image/encodings/x.c b/src/modules/Image/encodings/x.c index e425a234d805a0d2905f8db3b1dced1b07775069..d8fdcaaf8209dd8b6b61825795ec6b083fddfe1a 100644 --- a/src/modules/Image/encodings/x.c +++ b/src/modules/Image/encodings/x.c @@ -1,9 +1,9 @@ -/* $Id: x.c,v 1.34 2000/08/23 17:28:22 grubba Exp $ */ +/* $Id: x.c,v 1.35 2000/12/01 08:10:07 hubbe Exp $ */ /* **! module Image **! note -**! $Id: x.c,v 1.34 2000/08/23 17:28:22 grubba Exp $ +**! $Id: x.c,v 1.35 2000/12/01 08:10:07 hubbe Exp $ **! submodule X **! **! This submodule handles encoding and decoding of @@ -29,7 +29,7 @@ #include <winsock.h> #endif -RCSID("$Id: x.c,v 1.34 2000/08/23 17:28:22 grubba Exp $"); +RCSID("$Id: x.c,v 1.35 2000/12/01 08:10:07 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -37,7 +37,7 @@ RCSID("$Id: x.c,v 1.34 2000/08/23 17:28:22 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" @@ -142,61 +142,61 @@ static void image_x_encode_truecolor(INT32 args) int swap_bytes=0; if (args<10) - error("Image.X.encode_truecolor: too few arguments (expected 10 arguments)\n"); + Pike_error("Image.X.encode_truecolor: too few arguments (expected 10 arguments)\n"); if (sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.X.encode_truecolor: illegal argument 1 (expected image object)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 1 (expected image object)\n"); if (args>10) if (sp[10-args].type!=T_OBJECT || !(nct=(struct neo_colortable*) get_storage(sp[10-args].u.object,image_colortable_program))) - error("Image.X.encode_truecolor: illegal argument 10 (expected colortable object)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 10 (expected colortable object)\n"); if (sp[1-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 2 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 2 (expected integer)\n"); else bpp=sp[1-args].u.integer; if (sp[2-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 3 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 3 (expected integer)\n"); else alignbits=sp[2-args].u.integer; if (!alignbits) alignbits=1; if (sp[3-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 4 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 4 (expected integer)\n"); else swap_bytes=sp[3-args].u.integer; if (sp[4-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 5 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 5 (expected integer)\n"); else rbits=sp[4-args].u.integer; if (sp[5-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 6 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 6 (expected integer)\n"); else rshift=sp[5-args].u.integer; if (sp[6-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 7 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 7 (expected integer)\n"); else gbits=sp[6-args].u.integer; if (sp[7-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 8 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 8 (expected integer)\n"); else gshift=sp[7-args].u.integer; if (sp[8-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 9 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 9 (expected integer)\n"); else bbits=sp[8-args].u.integer; if (sp[9-args].type!=T_INT) - error("Image.X.encode_truecolor: illegal argument 10 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor: illegal argument 10 (expected integer)\n"); else bshift=sp[9-args].u.integer; @@ -207,7 +207,7 @@ static void image_x_encode_truecolor(INT32 args) img->xsize*img->ysize,img->xsize)) { free(tmp); - error("Image.X.encode_truecolor(): called colortable is not initiated\n"); + Pike_error("Image.X.encode_truecolor(): called colortable is not initiated\n"); } s=tmp; } @@ -374,7 +374,7 @@ static INLINE void image_x_examine_mask(struct svalue *mask, { unsigned long x; if (mask->type!=T_INT) - error("Image.X.encode_truecolor_masks: illegal %s (expected integer)\n",what); + Pike_error("Image.X.encode_truecolor_masks: illegal %s (expected integer)\n",what); x=(unsigned long)mask->u.integer; x&=(unsigned long)((INT32)-1); /* i hope this works... */ @@ -387,14 +387,14 @@ static INLINE void image_x_examine_mask(struct svalue *mask, while (x&1) x>>=1,(*bits)++; if (x) - error("Image.X.encode_truecolor_masks: illegal %s (nonmassive bitfield)\n",what); + Pike_error("Image.X.encode_truecolor_masks: illegal %s (nonmassive bitfield)\n",what); } static void image_x_call_examine_mask(INT32 args) { int bits,shift; if (args<1 || sp[-args].type!=T_INT) - error("Image.X.examine_mask: illegal argument(s)\n"); + Pike_error("Image.X.examine_mask: illegal argument(s)\n"); image_x_examine_mask(sp-args,"argument 1",&bits,&shift); pop_n_elems(args); @@ -410,23 +410,23 @@ static void image_x_encode_truecolor_masks(INT32 args) int rbits,rshift,gbits,gshift,bbits,bshift; if (args<7) - error("Image.X.encode_truecolor_masks: too few arguments (expected 7 arguments)\n"); + Pike_error("Image.X.encode_truecolor_masks: too few arguments (expected 7 arguments)\n"); if (sp[-args].type!=T_OBJECT || !get_storage(sp[-args].u.object,image_program)) - error("Image.X.encode_truecolor_masks: illegal argument 1 (expected image object)\n"); + Pike_error("Image.X.encode_truecolor_masks: illegal argument 1 (expected image object)\n"); if (args>7) if (sp[7-args].type!=T_OBJECT || !get_storage(ct=sp[7-args].u.object,image_colortable_program)) - error("Image.X.encode_truecolor_masks: illegal argument 8 (expected colortable object)\n"); + Pike_error("Image.X.encode_truecolor_masks: illegal argument 8 (expected colortable object)\n"); if (sp[1-args].type!=T_INT) - error("Image.X.encode_truecolor_masks: illegal argument 2 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor_masks: illegal argument 2 (expected integer)\n"); if (sp[2-args].type!=T_INT) - error("Image.X.encode_truecolor_masks: illegal argument 3 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor_masks: illegal argument 3 (expected integer)\n"); if (sp[3-args].type!=T_INT) - error("Image.X.encode_truecolor_masks: illegal argument 4 (expected integer)\n"); + Pike_error("Image.X.encode_truecolor_masks: illegal argument 4 (expected integer)\n"); image_x_examine_mask(sp+4-args,"argument 3 (red mask)",&rbits,&rshift); image_x_examine_mask(sp+5-args,"argument 4 (blue mask)",&gbits,&gshift); @@ -490,7 +490,7 @@ static void image_x_encode_pseudocolor_1byte_exact(INT32 args, img->xsize*img->ysize,img->xsize)) { free_string(end_shared_string(dest)); - error("Image.x.encode_pseudocolor: colortable not initialised"); + Pike_error("Image.x.encode_pseudocolor: colortable not initialised"); } if (!translate && !linemod) @@ -562,7 +562,7 @@ static void image_x_encode_pseudocolor_1byte(INT32 args, img->xsize*img->ysize,img->xsize)) { free_string(end_shared_string(dest)); - error("Image.x.encode_pseudocolor: colortable not initialised"); + Pike_error("Image.x.encode_pseudocolor: colortable not initialised"); } dest2=begin_shared_string(((img->xsize*bpp+blinemod)*img->ysize+7)/8); @@ -663,7 +663,7 @@ static void image_x_encode_pseudocolor_2byte(INT32 args, img->xsize*img->ysize,img->xsize)) { free_string(end_shared_string(dest)); - error("Image.x.encode_pseudocolor: colortable not initialised"); + Pike_error("Image.x.encode_pseudocolor: colortable not initialised"); } dest2=begin_shared_string(((img->xsize*bpp+blinemod)*img->ysize+7)/8); @@ -733,13 +733,13 @@ void image_x_encode_pseudocolor(INT32 args) char *translate=NULL; if (args<5) - error("Image.X.encode_pseudocolor: too few arguments"); + Pike_error("Image.X.encode_pseudocolor: too few arguments"); if (sp[1-args].type!=T_INT) - error("Image.X.encode_pseudocolor: illegal argument 2 (expected integer)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 2 (expected integer)\n"); if (sp[2-args].type!=T_INT) - error("Image.X.encode_pseudocolor: illegal argument 3 (expected integer)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 3 (expected integer)\n"); if (sp[3-args].type!=T_INT) - error("Image.X.encode_pseudocolor: illegal argument 4 (expected integer)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 4 (expected integer)\n"); bpp=sp[1-args].u.integer; alignbits=sp[2-args].u.integer; vbpp=sp[3-args].u.integer; @@ -747,17 +747,17 @@ void image_x_encode_pseudocolor(INT32 args) if (sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.X.encode_pseudocolor: illegal argument 1 (expected image object)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 1 (expected image object)\n"); if (sp[4-args].type!=T_OBJECT || !(nct=(struct neo_colortable*) get_storage(sp[4-args].u.object,image_colortable_program))) - error("Image.X.encode_pseudocolor: illegal argument 4 (expected colortable object)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 4 (expected colortable object)\n"); if (args>5) { if (sp[5-args].type!=T_STRING) - error("Image.X.encode_pseudocolor: illegal argument 6 (expected string)\n"); + Pike_error("Image.X.encode_pseudocolor: illegal argument 6 (expected string)\n"); else if (sp[5-args].u.string->len!=((vbpp>8)?2:1)<<vbpp) - error("Image.X.encode_pseudocolor: illegal argument 6 " + Pike_error("Image.X.encode_pseudocolor: illegal argument 6 " "(expected translate string of length %d, not %ld)\n", ((vbpp>8)?2:1)<<vbpp, DO_NOT_WARN((long)sp[5-args].u.string->len)); @@ -773,7 +773,7 @@ void image_x_encode_pseudocolor(INT32 args) else if (vbpp<=16) image_x_encode_pseudocolor_2byte(args,img,nct,bpp,vbpp,alignbits, (unsigned short*)translate); - else error("Image.X.encode_pseudocolor: sorry, too many bits (%d>16)\n", + else Pike_error("Image.X.encode_pseudocolor: sorry, too many bits (%d>16)\n", vbpp); } @@ -799,11 +799,11 @@ static void image_x_decode_truecolor(INT32 args) struct neo_colortable *nct=NULL; if (args<12) - error("Image.X.decode_truecolor: too few arguments\n"); - if (sp[-args].type!=T_STRING) error("Image.X.decode_truecolor: illegal argument 1\n"); + Pike_error("Image.X.decode_truecolor: too few arguments\n"); + if (sp[-args].type!=T_STRING) Pike_error("Image.X.decode_truecolor: illegal argument 1\n"); for (i=1; i<12; i++) if (sp[i-args].type!=T_INT) - error("Image.X.decode_truecolor: illegal argument %d\n",i+1); + Pike_error("Image.X.decode_truecolor: illegal argument %d\n",i+1); ps=sp[-args].u.string; s=(unsigned char*)ps->str; @@ -823,21 +823,21 @@ static void image_x_decode_truecolor(INT32 args) if (rshift>=bpp || rshift<0 || gshift>=bpp || gshift<0 || bshift>=bpp || bshift<0) - error("Image.X.decode_truecolor: illegal colorshifts\n"); + Pike_error("Image.X.decode_truecolor: illegal colorshifts\n"); if (args>12) { if (sp[12-args].type!=T_OBJECT || !(nct=(struct neo_colortable*) get_storage(sp[12-args].u.object,image_colortable_program))) - error("Image.X.decode_truecolor: illegal argument 13, expected colortable\n"); + Pike_error("Image.X.decode_truecolor: illegal argument 13, expected colortable\n"); if (nct->type!=NCT_FLAT) - error("Image.X.decode_truecolor: illegal argument 13, expected colortable in flat mode\n"); + Pike_error("Image.X.decode_truecolor: illegal argument 13, expected colortable in flat mode\n"); if (nct->u.flat.numentries<(1<<rbits) || nct->u.flat.numentries<(1<<gbits) || nct->u.flat.numentries<(1<<bbits)) - error("Image.X.decode_truecolor: colortable too small\n"); + Pike_error("Image.X.decode_truecolor: colortable too small\n"); } if (bbits==8 && rbits==8 && gbits==8 && @@ -968,7 +968,7 @@ static void image_x_decode_truecolor(INT32 args) } else { - error("Image.X.decode_truecolor: currently not supported non-byte ranges\n"); + Pike_error("Image.X.decode_truecolor: currently not supported non-byte ranges\n"); } } @@ -978,22 +978,22 @@ void image_x_decode_truecolor_masks(INT32 args) int rbits,rshift,gbits,gshift,bbits,bshift; if (args<9) - error("Image.X.decode_truecolor_masks: too few arguments (expected 7 arguments)\n"); + Pike_error("Image.X.decode_truecolor_masks: too few arguments (expected 7 arguments)\n"); if (sp[-args].type!=T_STRING) - error("Image.X.decode_truecolor_masks: illegal argument 1 (expected image object)\n"); + Pike_error("Image.X.decode_truecolor_masks: illegal argument 1 (expected image object)\n"); if (args>9) if (sp[9-args].type!=T_OBJECT || !get_storage(ct=sp[9-args].u.object,image_colortable_program)) - error("Image.X.decode_truecolor_masks: illegal argument 8 (expected colortable object)\n"); + Pike_error("Image.X.decode_truecolor_masks: illegal argument 8 (expected colortable object)\n"); if (sp[6-args].type!=T_INT) - error("Image.X.decode_truecolor_masks: illegal argument 7 (expected integer)\n"); + Pike_error("Image.X.decode_truecolor_masks: illegal argument 7 (expected integer)\n"); if (sp[7-args].type!=T_INT) - error("Image.X.decode_truecolor_masks: illegal argument 8 (expected integer)\n"); + Pike_error("Image.X.decode_truecolor_masks: illegal argument 8 (expected integer)\n"); if (sp[8-args].type!=T_INT) - error("Image.X.decode_truecolor_masks: illegal argument 9 (expected integer)\n"); + Pike_error("Image.X.decode_truecolor_masks: illegal argument 9 (expected integer)\n"); image_x_examine_mask(sp+6-args,"argument 7 (red mask)",&rbits,&rshift); image_x_examine_mask(sp+7-args,"argument 8 (blue mask)",&gbits,&gshift); @@ -1037,19 +1037,19 @@ void image_x_decode_pseudocolor(INT32 args) struct object *ncto = NULL; if (args<7) - error("Image.X.decode_pseudocolor: too few arguments\n"); - if (sp[-args].type!=T_STRING) error("Image.X.decode_pseudocolor: illegal argument 1\n"); + Pike_error("Image.X.decode_pseudocolor: too few arguments\n"); + if (sp[-args].type!=T_STRING) Pike_error("Image.X.decode_pseudocolor: illegal argument 1\n"); for (i=1; i<6; i++) if (sp[i-args].type!=T_INT) - error("Image.X.decode_pseudocolor: illegal argument %d\n",i+1); + Pike_error("Image.X.decode_pseudocolor: illegal argument %d\n",i+1); if (sp[6-args].type!=T_OBJECT || !(nct=(struct neo_colortable*) get_storage(ncto=sp[6-args].u.object,image_colortable_program))) - error("Image.X.decode_pseudocolor: illegal argument 7\n"); + Pike_error("Image.X.decode_pseudocolor: illegal argument 7\n"); if (nct->type!=NCT_FLAT) /* fix me some other day */ - error("Image.X.decode_pseudocolor: argument 7, colortable, needs to be a flat colortable\n"); + Pike_error("Image.X.decode_pseudocolor: argument 7, colortable, needs to be a flat colortable\n"); add_ref(ps=sp[-args].u.string); s=(unsigned char*)ps->str; @@ -1135,7 +1135,7 @@ void image_x_decode_pseudocolor(INT32 args) { free_object(ncto); free_string(ps); - error("Image.X.decode_pseudocolor: currently not supported non-byte ranges\n"); + Pike_error("Image.X.decode_pseudocolor: currently not supported non-byte ranges\n"); } } diff --git a/src/modules/Image/encodings/xbm.c b/src/modules/Image/encodings/xbm.c index 919bc8e12b0b4fb829c63a32dac316ad3a55f9f3..0b5afc69c5d3f926391865cd928c782922ea7c6c 100644 --- a/src/modules/Image/encodings/xbm.c +++ b/src/modules/Image/encodings/xbm.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: xbm.c,v 1.11 2000/08/03 21:25:32 grubba Exp $"); +RCSID("$Id: xbm.c,v 1.12 2000/12/01 08:10:07 hubbe Exp $"); #define NO_PIKE_SHORTHAND @@ -11,7 +11,7 @@ RCSID("$Id: xbm.c,v 1.11 2000/08/03 21:25:32 grubba Exp $"); #include "object.h" #include "program.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "constants.h" #include "mapping.h" #include "stralloc.h" @@ -115,18 +115,18 @@ static struct object *load_xbm( struct pike_string *data ) buff.len = data->len; if(!buf_search( b, '#' ) || !buf_search( b, ' ' ) || !buf_search( b, ' ' )) - error("This is not a XBM image!\n"); + Pike_error("This is not a XBM image!\n"); width = atoi(b->str); if(width <= 0) - error("This is not a XBM image!\n"); + Pike_error("This is not a XBM image!\n"); if(!buf_search( b, '#' ) || !buf_search( b, ' ' ) || !buf_search( b, ' ' )) - error("This is not a XBM image!\n"); + Pike_error("This is not a XBM image!\n"); height = atoi(b->str); if(height <= 0) - error("This is not a XBM image!\n"); + Pike_error("This is not a XBM image!\n"); if(!buf_search( b, '{' )) - error("This is not a XBM image!\n"); + Pike_error("This is not a XBM image!\n"); push_int( width ); @@ -218,7 +218,7 @@ static struct pike_string *save_xbm( struct image *i, struct pike_string *name ) **! Decodes a XBM image. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ static void image_xbm_decode( INT32 args ) { @@ -246,7 +246,7 @@ static void image_xbm_decode( INT32 args ) **! </pre> **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ @@ -266,7 +266,7 @@ static void image_xbm__decode( INT32 args ) if (args>1) { if (Pike_sp[1-args].type!=PIKE_T_MAPPING) - error("Image.XBM._decode: illegal argument 2\n"); + Pike_error("Image.XBM._decode: illegal argument 2\n"); push_svalue(Pike_sp+1-args); ref_push_string(param_fg); @@ -274,13 +274,13 @@ static void image_xbm__decode( INT32 args ) if(!IS_ZERO(Pike_sp-1)) { if(Pike_sp[-1].type != PIKE_T_ARRAY || Pike_sp[-1].u.array->size != 3) - error("Wrong type for foreground. Should be array(int(0..255))" + Pike_error("Wrong type for foreground. Should be array(int(0..255))" " with 3 elements\n"); for(ele=0; ele<3; ele++) if(Pike_sp[-1].u.array->item[ele].type != PIKE_T_INT ||Pike_sp[-1].u.array->item[ele].u.integer < 0 ||Pike_sp[-1].u.array->item[ele].u.integer > 255) - error("Wrong type for foreground. Should be array(int(0..255))" + Pike_error("Wrong type for foreground. Should be array(int(0..255))" " with 3 elements\n"); fg = Pike_sp[-1].u.array; } @@ -292,13 +292,13 @@ static void image_xbm__decode( INT32 args ) if(!IS_ZERO(Pike_sp-1)) { if(Pike_sp[-1].type != PIKE_T_ARRAY || Pike_sp[-1].u.array->size != 3) - error("Wrong type for background. Should be array(int(0..255))" + Pike_error("Wrong type for background. Should be array(int(0..255))" " with 3 elements\n"); for(ele=0; ele<3; ele++) if(Pike_sp[-1].u.array->item[ele].type != PIKE_T_INT ||Pike_sp[-1].u.array->item[ele].u.integer < 0 ||Pike_sp[-1].u.array->item[ele].u.integer > 255) - error("Wrong type for background. Should be array(int(0..255))" + Pike_error("Wrong type for background. Should be array(int(0..255))" " with 3 elements\n"); bg = Pike_sp[-1].u.array; } @@ -391,20 +391,20 @@ void image_xbm_encode( INT32 args ) struct image *img = NULL; struct pike_string *name = NULL, *buf; if (!args) - error("Image.XBM.encode: too few arguments\n"); + Pike_error("Image.XBM.encode: too few arguments\n"); if (Pike_sp[-args].type!=PIKE_T_OBJECT || !(img=(struct image*) get_storage(Pike_sp[-args].u.object,image_program))) - error("Image.XBM.encode: illegal argument 1\n"); + Pike_error("Image.XBM.encode: illegal argument 1\n"); if (!img->img) - error("Image.XBM.encode: no image\n"); + Pike_error("Image.XBM.encode: no image\n"); if (args>1) { if (Pike_sp[1-args].type!=PIKE_T_MAPPING) - error("Image.XBM.encode: illegal argument 2\n"); + Pike_error("Image.XBM.encode: illegal argument 2\n"); push_svalue(Pike_sp+1-args); ref_push_string(param_name); @@ -412,7 +412,7 @@ void image_xbm_encode( INT32 args ) if(Pike_sp[-1].type == PIKE_T_STRING) { if(Pike_sp[-1].u.string->size_shift) - error("The name of the image must be a normal non-wide string (sorry, not my fault)\n"); + Pike_error("The name of the image must be a normal non-wide string (sorry, not my fault)\n"); name = Pike_sp[-1].u.string; } pop_stack(); diff --git a/src/modules/Image/encodings/xcf.c b/src/modules/Image/encodings/xcf.c index f20e2441b811a5134eafdd5001c29147527d4b39..1419d9a8e290188de36b37c668e6147dea9241fb 100644 --- a/src/modules/Image/encodings/xcf.c +++ b/src/modules/Image/encodings/xcf.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: xcf.c,v 1.33 2000/11/29 21:31:04 hubbe Exp $"); +RCSID("$Id: xcf.c,v 1.34 2000/12/01 08:10:08 hubbe Exp $"); #include "image_machine.h" @@ -15,7 +15,7 @@ RCSID("$Id: xcf.c,v 1.33 2000/11/29 21:31:04 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "builtin_functions.h" #include "operators.h" @@ -83,7 +83,7 @@ static void f_substring_index( INT32 args ) if( i < 0 ) i = s->len + i; if( i >= s->len ) { - error("Index out of bounds, %d > %ld\n", i, + Pike_error("Index out of bounds, %d > %ld\n", i, DO_NOT_WARN((long)s->len-1) ); } push_int( ((unsigned char *)s->s->str)[s->offset+i] ); @@ -129,7 +129,7 @@ static void f_substring_get_int( INT32 args ) unsigned char *p; int x = sp[-1].u.integer; if( x > s->len>>2 ) - error("Index %d out of range", x ); + Pike_error("Index %d out of range", x ); p = s->s->str + s->offset + x*4; res = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]; @@ -144,7 +144,7 @@ static void f_substring_get_uint( INT32 args ) unsigned char *p; int x = sp[-1].u.integer; if( x > s->len>>2 ) - error("Index %d out of range", x ); + Pike_error("Index %d out of range", x ); p = s->s->str + s->offset + x*4; res = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]; @@ -158,7 +158,7 @@ static void f_substring_get_ushort( INT32 args ) unsigned char *p; int x = sp[-1].u.integer; if( x > s->len>>1 ) - error("Index %d out of range", x ); + Pike_error("Index %d out of range", x ); p = s->s->str + s->offset + x*2; res = (p[2]<<8) | p[3]; @@ -172,7 +172,7 @@ static void f_substring_get_short( INT32 args ) unsigned char *p; int x = sp[-1].u.integer; if( x > s->len>>1 ) - error("Index %d out of range", x ); + Pike_error("Index %d out of range", x ); p = s->s->str + s->offset + x*2; res = (p[2]<<8) | p[3]; @@ -301,7 +301,7 @@ static unsigned int read_uint( struct buffer *from ) { unsigned int res; if(from->len < 4) - error("Not enough space for 4 bytes (uint32)\n"); + Pike_error("Not enough space for 4 bytes (uint32)\n"); res = (from->str[0]<<24)|(from->str[1]<<16)|(from->str[2]<<8)|from->str[3]; from->str += 4; from->len -= 4; @@ -317,7 +317,7 @@ static char *read_data( struct buffer *from, size_t len ) { char *res; if( from->len < len ) - error("Not enough space for %lu bytes\n", + Pike_error("Not enough space for %lu bytes\n", DO_NOT_WARN((unsigned long)len)); res = (char *)from->str; from->str += len; @@ -334,7 +334,7 @@ static struct buffer read_string( struct buffer *data ) if(res.len > 0) res.len--; /* len includes ending \0 */ res.base_len = res.len; if(!res.str) - error("String read failed\n"); + Pike_error("String read failed\n"); return res; } @@ -699,7 +699,7 @@ static struct gimp_image read_image( struct buffer * data ) MEMSET(&res, 0, sizeof(res)); initial = *data; if(data->len < 34) - error("This is not an xcf file (to little data)\n"); + Pike_error("This is not an xcf file (to little data)\n"); if(!(data->str[0] == 'g' && data->str[1] == 'i' && data->str[2] == 'm' && @@ -707,9 +707,9 @@ static struct gimp_image read_image( struct buffer * data ) data->str[4] == ' ')) { if(strlen((char *)data->str) == 13) - error("This is not an xcf file (%s)\n", data->str); + Pike_error("This is not an xcf file (%s)\n", data->str); else - error("This is not an xcf file\n"); + Pike_error("This is not an xcf file\n"); } data->str+=14; data->len-=14; @@ -794,7 +794,7 @@ static void push_hierarchy( struct hierarchy * h ) struct svalue *osp = sp, *tsp; if(h->level.width != h->width || h->level.height != h->height) - error("Illegal hierarchy level sizes!\n"); + Pike_error("Illegal hierarchy level sizes!\n"); ref_push_string( s_width ); push_int( h->width ); ref_push_string( s_height ); push_int( h->height ); @@ -900,7 +900,7 @@ static void image_xcf____decode( INT32 args ) ONERROR err; get_all_args( "___decode", args, "%S", &s ); if(args > 1) - error("Too many arguments to Image.XCF.___decode()\n"); + Pike_error("Too many arguments to Image.XCF.___decode()\n"); b.s = s; b.base_offset = 0; @@ -946,7 +946,7 @@ static unsigned char read_char( struct buffer *from ) **! Decodes a XCF image to a single image object. **! **! note -**! Throws upon error in data, you will loose quite a lot of +**! Throws upon Pike_error in data, you will loose quite a lot of **! information by doing this. See Image.XCF._decode and Image.XCF.__decode */ @@ -983,7 +983,7 @@ static unsigned char read_char( struct buffer *from ) **! ])</pre> **! **! note -**! Throws upon error in data. For more information, see Image.XCF.__decode +**! Throws upon Pike_error in data. For more information, see Image.XCF.__decode */ /* @@ -1194,22 +1194,22 @@ void image_xcf_f__decode_tiles( INT32 args ) if( !(i = (struct image *)get_storage( io, image_program ))) - error("Wrong type object argument 1 (image)\n"); + Pike_error("Wrong type object argument 1 (image)\n"); if(ao && !(a = (struct image *)get_storage( ao, image_program ))) - error("Wrong type object argument 2 (image)\n"); + Pike_error("Wrong type object argument 2 (image)\n"); if( cmapo && !(cmap=(struct neo_colortable *)get_storage(cmapo, image_colortable_program))) - error("Wrong type object argument 4 (colortable)\n"); + Pike_error("Wrong type object argument 4 (colortable)\n"); for(l=0; l<(unsigned int)tiles->size; l++) if(tiles->item[l].type != T_OBJECT) - error("Wrong type array argument 3 (tiles)\n"); + Pike_error("Wrong type array argument 3 (tiles)\n"); if(a && ((i->xsize != a->xsize) || (i->ysize != a->ysize))) - error("Image and alpha objects are not identically sized.\n"); + Pike_error("Image and alpha objects are not identically sized.\n"); if(cmap) { diff --git a/src/modules/Image/encodings/xwd.c b/src/modules/Image/encodings/xwd.c index 3142ddcb31721e3b8e4d1dd929c1c5a71677c8e4..8bf076b5e8314aa995bf466b6b1fa3b82468610a 100644 --- a/src/modules/Image/encodings/xwd.c +++ b/src/modules/Image/encodings/xwd.c @@ -1,9 +1,9 @@ -/* $Id: xwd.c,v 1.18 2000/08/12 23:06:54 grubba Exp $ */ +/* $Id: xwd.c,v 1.19 2000/12/01 08:10:08 hubbe Exp $ */ /* **! module Image **! note -**! $Id: xwd.c,v 1.18 2000/08/12 23:06:54 grubba Exp $ +**! $Id: xwd.c,v 1.19 2000/12/01 08:10:08 hubbe Exp $ **! submodule XWD **! **! This submodule keeps the XWD (X Windows Dump) @@ -25,7 +25,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: xwd.c,v 1.18 2000/08/12 23:06:54 grubba Exp $"); +RCSID("$Id: xwd.c,v 1.19 2000/12/01 08:10:08 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -33,7 +33,7 @@ RCSID("$Id: xwd.c,v 1.18 2000/08/12 23:06:54 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "mapping.h" #include "image.h" @@ -134,7 +134,7 @@ void img_xwd__decode(INT32 args,int header_only,int skipcmap) if (args<1 || sp[-args].type!=T_STRING) - error("Image.XWD._decode(): Illegal arguments\n"); + Pike_error("Image.XWD._decode(): Illegal arguments\n"); s=sp[-args].u.string; @@ -142,16 +142,16 @@ void img_xwd__decode(INT32 args,int header_only,int skipcmap) * window name. */ if (s->len<4) - error("Image.XWD._decode: header to small\n"); + Pike_error("Image.XWD._decode: header to small\n"); header.header_size=CARD32n(s,0); if ((size_t)s->len < header.header_size || s->len<100) - error("Image.XWD._decode: header to small\n"); + Pike_error("Image.XWD._decode: header to small\n"); header.file_version=CARD32n(s,1); if (header.file_version!=7) - error("Image.XWD._decode: don't understand any other file format then 7\n"); + Pike_error("Image.XWD._decode: don't understand any other file format then 7\n"); add_ref(s); pop_n_elems(args); @@ -391,7 +391,7 @@ void image_xwd_decode_header(INT32 args) static void image_xwd_decode(INT32 args) { if (!args) - error("Image.XWD.decode: missing argument\n"); + Pike_error("Image.XWD.decode: missing argument\n"); pop_n_elems(args-1); push_int(1); diff --git a/src/modules/Image/font.c b/src/modules/Image/font.c index e9cb802d0472e536f65755d4bc30e99ccd1c1f10..6ab4f5021c0a28d64c14cadf4ff784ced008f823 100644 --- a/src/modules/Image/font.c +++ b/src/modules/Image/font.c @@ -1,4 +1,4 @@ -/* $Id: font.c,v 1.65 2000/08/19 11:16:53 grubba Exp $ */ +/* $Id: font.c,v 1.66 2000/12/01 08:10:00 hubbe Exp $ */ #include "global.h" #define SPACE_CHAR 'i' @@ -9,7 +9,7 @@ extern unsigned char * image_default_font; /* **! module Image **! note -**! $Id: font.c,v 1.65 2000/08/19 11:16:53 grubba Exp $ +**! $Id: font.c,v 1.66 2000/12/01 08:10:00 hubbe Exp $ **! class Font **! **! note @@ -368,7 +368,7 @@ void font_load(INT32 args) } if (sp[-args].type!=T_STRING) - error("font->read: illegal or wrong number of arguments\n"); + Pike_error("font->read: illegal or wrong number of arguments\n"); do { @@ -568,7 +568,7 @@ void font_write(INT32 args) INT32 c; struct font *this = (*(struct font **)(Pike_fp->current_storage)); if (!this) - error("font->write: no font loaded\n"); + Pike_error("font->write: no font loaded\n"); if (args==0) { @@ -767,7 +767,7 @@ void font_text_extents(INT32 args) { INT32 xsize,i,maxwidth2,j; - if (!THIS) error("font->text_extents: no font loaded\n"); + if (!THIS) Pike_error("font->text_extents: no font loaded\n"); maxwidth2=0; @@ -848,10 +848,10 @@ void font_text_extents(INT32 args) void font_set_xspacing_scale(INT32 args) { - if(!THIS) error("font->set_xspacing_scale(FLOAT): No font loaded.\n"); - if(!args) error("font->set_xspacing_scale(FLOAT): No argument!\n"); + if(!THIS) Pike_error("font->set_xspacing_scale(FLOAT): No font loaded.\n"); + if(!args) Pike_error("font->set_xspacing_scale(FLOAT): No argument!\n"); if(sp[-args].type!=T_FLOAT) - error("font->set_xspacing_scale(FLOAT): Wrong type of argument!\n"); + Pike_error("font->set_xspacing_scale(FLOAT): Wrong type of argument!\n"); THIS->xspacing_scale = (double)sp[-args].u.float_number; /*fprintf(stderr, "Setting xspacing to %f\n", THIS->xspacing_scale);*/ @@ -863,10 +863,10 @@ void font_set_xspacing_scale(INT32 args) void font_set_yspacing_scale(INT32 args) { - if(!THIS) error("font->set_yspacing_scale(FLOAT): No font loaded.\n"); - if(!args) error("font->set_yspacing_scale(FLOAT): No argument!\n"); + if(!THIS) Pike_error("font->set_yspacing_scale(FLOAT): No font loaded.\n"); + if(!args) Pike_error("font->set_yspacing_scale(FLOAT): No argument!\n"); if(sp[-args].type!=T_FLOAT) - error("font->set_yspacing_scale(FLOAT): Wrong type of argument!\n"); + Pike_error("font->set_yspacing_scale(FLOAT): Wrong type of argument!\n"); THIS->yspacing_scale = (double)sp[-args].u.float_number; /*fprintf(stderr, "Setting yspacing to %f\n", THIS->yspacing_scale);*/ diff --git a/src/modules/Image/image.c b/src/modules/Image/image.c index 403bc0ff884f149b91aef245c7053dff6311f373..770cf44b30201080471a1f093f7170bf90197728 100644 --- a/src/modules/Image/image.c +++ b/src/modules/Image/image.c @@ -1,9 +1,9 @@ -/* $Id: image.c,v 1.181 2000/11/29 21:47:53 hubbe Exp $ */ +/* $Id: image.c,v 1.182 2000/12/01 08:10:00 hubbe Exp $ */ /* **! module Image **! note -**! $Id: image.c,v 1.181 2000/11/29 21:47:53 hubbe Exp $ +**! $Id: image.c,v 1.182 2000/12/01 08:10:00 hubbe Exp $ **! class Image **! **! The main object of the <ref>Image</ref> module, this object @@ -98,7 +98,7 @@ #include "stralloc.h" #include "global.h" -RCSID("$Id: image.c,v 1.181 2000/11/29 21:47:53 hubbe Exp $"); +RCSID("$Id: image.c,v 1.182 2000/12/01 08:10:00 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -106,7 +106,7 @@ RCSID("$Id: image.c,v 1.181 2000/11/29 21:47:53 hubbe Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "module_support.h" @@ -231,7 +231,7 @@ static INLINE int getrgb(struct image *img, for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); img->rgb.r=(unsigned char)sp[-args+args_start].u.integer; img->rgb.g=(unsigned char)sp[1-args+args_start].u.integer; img->rgb.b=(unsigned char)sp[2-args+args_start].u.integer; @@ -239,7 +239,7 @@ static INLINE int getrgb(struct image *img, if (max > 3 && args-args_start>=4) if (sp[3-args+args_start].type!=T_INT) { - error("Illegal alpha argument to %s\n",name); + Pike_error("Illegal alpha argument to %s\n",name); return 0; /* avoid stupid warning */ } else @@ -260,7 +260,7 @@ static INLINE void getrgbl(rgbl_group *rgb,INT32 args_start,INT32 args,char *nam if (args-args_start<3) return; for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); rgb->r=sp[-args+args_start].u.integer; rgb->g=sp[1-args+args_start].u.integer; rgb->b=sp[2-args+args_start].u.integer; @@ -585,10 +585,10 @@ void img_read_get_channel(int arg,char *name,INT32 args, break; case T_STRING: if (sp[arg-args-1].u.string->size_shift) - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "wide strings are not supported (yet)\n",arg+1,name); if (sp[arg-args-1].u.string->len!=THIS->xsize*THIS->ysize) - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "string is %ld characters, expected %ld\n", arg+1, name, DO_NOT_WARN((long)sp[arg-args-1].u.string->len), @@ -599,13 +599,13 @@ void img_read_get_channel(int arg,char *name,INT32 args, case T_OBJECT: img=(struct image*)get_storage(sp[arg-args-1].u.object,image_program); if (!img) - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "not an image object\n",arg+1,name); if (!img->img) - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "uninitialized image object\n",arg+1,name); if (img->xsize!=THIS->xsize || img->ysize!=THIS->ysize) - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "size is wrong, %dx%d; expected %dx%d\n", arg+1,name,img->xsize,img->ysize, THIS->xsize,THIS->ysize); @@ -613,7 +613,7 @@ void img_read_get_channel(int arg,char *name,INT32 args, *m=sizeof(rgb_group); break; default: - error("create_method: argument %d (%s channel): " + Pike_error("create_method: argument %d (%s channel): " "illegal type\n",arg+1,name); } } @@ -766,7 +766,7 @@ void image_create_method(INT32 args) MAKE_CONSTANT_SHARED_STRING(s_tuned_box,"tuned_box"); if (THIS->xsize<=0 || THIS->ysize<=0) - error("create_method: image size is too small\n"); + Pike_error("create_method: image size is too small\n"); if (sp[-args].u.string==s_grey) { @@ -823,7 +823,7 @@ void image_create_method(INT32 args) image_tuned_box(5); } else - error("create_method: unknown method\n"); + Pike_error("create_method: unknown method\n"); /* on stack: "string" image */ /* want: put that image in this, crap that image */ @@ -850,7 +850,7 @@ void image_create(INT32 args) if (THIS->ysize<0) THIS->ysize=0; if (image_too_big(THIS->xsize,THIS->ysize)) - error("Image.Image->create(): image too large (>2Gpixels)\n"); + Pike_error("Image.Image->create(): image too large (>2Gpixels)\n"); if (args>2 && sp[2-args].type==T_STRING && !image_color_svalue(sp+2-args,&(THIS->rgb))) @@ -925,7 +925,7 @@ void image_clone(INT32 args) { if(sp[-args].u.integer < 0 || sp[1-args].u.integer < 0) - error("Illegal size to Image.Image->clone()\n"); + Pike_error("Illegal size to Image.Image->clone()\n"); img->xsize=sp[-args].u.integer; img->ysize=sp[1-args].u.integer; } @@ -1066,7 +1066,7 @@ void image_copy(INT32 args) bad_arg_error("Image",sp-args,args,0,"",sp-args, "Bad arguments to Image()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; getrgb(THIS,4,args,args,"Image.Image->copy()"); @@ -1109,7 +1109,7 @@ static void image_change_color(INT32 args) struct image *img; int arg; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; to=THIS->rgb; if (!(arg=getrgb(THIS,0,args,3,"Image.Image->change_color()"))) @@ -1265,7 +1265,7 @@ static void image_find_autocrop(INT32 args) } if (!THIS->img) - error("Called Image.Image object is not initialized\n");; + Pike_error("Called Image.Image object is not initialized\n");; img_find_autocrop(THIS,&x1,&y1,&x2,&y2, border,left,right,top,bottom,0,rgb); @@ -1398,7 +1398,7 @@ void image_getpixel(INT32 args) bad_arg_error("Image",sp-args,args,0,"",sp-args, "Bad arguments to Image()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; x=sp[-args].u.integer; y=sp[1-args].u.integer; @@ -1755,7 +1755,7 @@ static void image_tuned_box(INT32 args) SIMPLE_TOO_FEW_ARGS_ERROR("Image.Image->tuned_box",5); if (!THIS->img) - error("Called Image.Image object is not initialized\n");; + Pike_error("Called Image.Image object is not initialized\n");; x1=sp[-args].u.integer; y1=sp[1-args].u.integer; @@ -2244,7 +2244,7 @@ void image_color(INT32 args) struct object *o; struct image *img; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; if (args<3) { if (args>0 && sp[-args].type==T_INT) @@ -2320,7 +2320,7 @@ void image_invert(INT32 args) struct object *o; struct image *img; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -2395,7 +2395,7 @@ void image_threshold(INT32 args) struct image *img; INT_TYPE level=-1; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; if (args==1) get_all_args("threshold",args,"%i",&level),level*=3; @@ -2524,7 +2524,7 @@ void image_hsv_to_rgb(INT32 args) struct object *o; struct image *img; char *err = NULL; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -2588,7 +2588,7 @@ exit_loop: THREADS_DISALLOW(); if (err) { - error("%s\n", err); + Pike_error("%s\n", err); } pop_n_elems(args); @@ -2609,7 +2609,7 @@ void image_rgb_to_hsv(INT32 args) rgb_group *s,*d; struct object *o; struct image *img; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -2703,7 +2703,7 @@ void image_distancesq(INT32 args) struct object *o; struct image *img; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; getrgb(THIS,0,args,args,"Image.Image->distancesq()"); @@ -2874,7 +2874,7 @@ void image_select_from(INT32 args) struct image *img; INT32 low_limit=0; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; if (args<2 || sp[-args].type!=T_INT @@ -2971,10 +2971,10 @@ void image_bitscale( INT32 args ) newx = DOUBLE_TO_INT(oldx * sp[-1].u.float_number); newy = DOUBLE_TO_INT(oldy * sp[-1].u.float_number); } else - error("The scale factor must be an integer less than 2^32, or a float\n"); + Pike_error("The scale factor must be an integer less than 2^32, or a float\n"); } else if( args == 2 ) { if( sp[-1].type != sp[-2].type ) - error("Wrong type of argument\n"); + Pike_error("Wrong type of argument\n"); if( sp[-2].type == T_INT ) (newx = sp[-2].u.integer),(newy = sp[-1].u.integer); else if( sp[-2].type == T_FLOAT ) @@ -2983,13 +2983,13 @@ void image_bitscale( INT32 args ) newy = DOUBLE_TO_INT(oldy*sp[-1].u.float_number); } else - error( "Wrong type of arguments\n"); + Pike_error( "Wrong type of arguments\n"); } /* Not really nessesary if I use floats below.. */ /* FIXME */ if( newx > 65536 || newy > 65536 || oldx > 65536 || oldy > 65536) - error("Image too big.\n"); + Pike_error("Image too big.\n"); if( newx < 1 ) newx = 1; if( newy < 1 ) newy = 1; @@ -3158,7 +3158,7 @@ CHRONO("apply_matrix"); if (sp[1-args].type!=T_INT || sp[2-args].type!=T_INT || sp[3-args].type!=T_INT) - error("Illegal argument(s) (2,3,4) to Image.Image->apply_matrix()\n"); + Pike_error("Illegal argument(s) (2,3,4) to Image.Image->apply_matrix()\n"); else { default_rgb.r=sp[1-args].u.integer; @@ -3192,12 +3192,12 @@ CHRONO("apply_matrix"); { struct svalue s=sp[-args].u.array->item[i]; if (s.type!=T_ARRAY) - error("Illegal contents of (root) array (Image.Image->apply_matrix)\n"); + Pike_error("Illegal contents of (root) array (Image.Image->apply_matrix)\n"); if (width==-1) width=s.u.array->size; else if (width!=s.u.array->size) - error("Arrays has different size (Image.Image->apply_matrix)\n"); + Pike_error("Arrays has different size (Image.Image->apply_matrix)\n"); } if (width==-1) width=0; @@ -3318,7 +3318,7 @@ static void _image_outline(INT32 args,int mask) struct image *img; if (!THIS->img || !THIS->xsize || !THIS->ysize) - error("Called Image.Image object is not initialized\n");; + Pike_error("Called Image.Image object is not initialized\n");; if (args && sp[-args].type==T_ARRAY) { @@ -3329,12 +3329,12 @@ static void _image_outline(INT32 args,int mask) { struct svalue s=sp[-args].u.array->item[i]; if (s.type!=T_ARRAY) - error("Image.Image->outline: Illegal contents of (root) array\n"); + Pike_error("Image.Image->outline: Illegal contents of (root) array\n"); if (width==-1) width=s.u.array->size; else if (width!=s.u.array->size) - error("Image.Image->outline: Arrays has different size\n"); + Pike_error("Image.Image->outline: Arrays has different size\n"); } if (width==-1) width=0; @@ -3526,7 +3526,7 @@ void image_modify_by_intensity(INT32 args) struct image *img; long div; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; if (args<5) SIMPLE_TOO_FEW_ARGS_ERROR("Image",1); @@ -3887,7 +3887,7 @@ void image_gamma(INT32 args) double gammar=0.0, gammab=0.0, gammag=0.0; COLORTYPE newr[256]; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; if (args==1) if (sp[-args].type==T_INT) gammar=gammab=gammag=(double)sp[-args].u.integer; @@ -3911,7 +3911,7 @@ void image_gamma(INT32 args) "Bad arguments to Image.Image->gamma()\n"); } else - error("Image.Image->gamma(): illegal number of arguments\n"); + Pike_error("Image.Image->gamma(): illegal number of arguments\n"); if (gammar==gammab && gammab==gammag) { @@ -4217,7 +4217,7 @@ void image_cast(INT32 args) int i,j; rgb_group *s=THIS->img; - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; pop_n_elems(args); @@ -4236,7 +4236,7 @@ void image_cast(INT32 args) } if (strncmp(sp[-args].u.string->str,"string",6)==0) { - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; pop_n_elems(args); push_string(make_shared_binary_string((char *)THIS->img, @@ -4289,7 +4289,7 @@ void image_tobitmap(INT32 args) rgb_group *s; pop_n_elems(args); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; xs=(THIS->xsize+7)>>3; diff --git a/src/modules/Image/image.h b/src/modules/Image/image.h index 2fc7fb23083139a6c7e1e864b7208d64957531c8..5df978ca3498ce990f3ebceb07684a45f0d565b8 100644 --- a/src/modules/Image/image.h +++ b/src/modules/Image/image.h @@ -1,11 +1,11 @@ /* **! module Image **! note -**! $Id: image.h,v 1.44 2000/09/11 16:04:56 grubba Exp $ +**! $Id: image.h,v 1.45 2000/12/01 08:10:00 hubbe Exp $ */ #ifdef PIKE_IMAGE_IMAGE_H -#error IMAGE.h included twice +#Pike_error IMAGE.h included twice #endif #define PIKE_IMAGE_IMAGE_H diff --git a/src/modules/Image/image_module.c b/src/modules/Image/image_module.c index e4190dee88e7347466c8a2fa47700c2659a74e1e..672571524d339ddc8674215430468021d6a1a1af 100644 --- a/src/modules/Image/image_module.c +++ b/src/modules/Image/image_module.c @@ -1,7 +1,7 @@ #include "global.h" #include "stralloc.h" #include "global.h" -RCSID("$Id: image_module.c,v 1.8 2000/08/16 19:44:20 grubba Exp $"); +RCSID("$Id: image_module.c,v 1.9 2000/12/01 08:10:01 hubbe Exp $"); #include "pike_macros.h" #include "interpret.h" #include "program.h" @@ -107,9 +107,9 @@ static void image_magic_index(INT32 args) int i; if (args!=1) - error("Image.`[]: Too few or too many arguments\n"); + Pike_error("Image.`[]: Too few or too many arguments\n"); if (sp[-1].type!=T_STRING) - error("Image.`[]: Illegal type of argument\n"); + Pike_error("Image.`[]: Illegal type of argument\n"); for (i=0; i<(int)NELEM(submagic); i++) if (sp[-1].u.string==submagic[i].ps) diff --git a/src/modules/Image/layers.c b/src/modules/Image/layers.c index 97fc45dbd93865edca6e14eb1ab70e5dc4e07d08..e9c6aed934aa7eb8ff738a52826fcf58cf72ba44 100644 --- a/src/modules/Image/layers.c +++ b/src/modules/Image/layers.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: layers.c,v 1.57 2000/11/29 21:47:53 hubbe Exp $ +**! $Id: layers.c,v 1.58 2000/12/01 08:10:01 hubbe Exp $ **! class Layer **! see also: layers **! @@ -215,7 +215,7 @@ #include <math.h> /* floor */ -RCSID("$Id: layers.c,v 1.57 2000/11/29 21:47:53 hubbe Exp $"); +RCSID("$Id: layers.c,v 1.58 2000/12/01 08:10:01 hubbe Exp $"); #include "image_machine.h" @@ -531,7 +531,7 @@ struct layer_mode_desc COMBINE_ALPHA_SUM(aS,(aL)*(V)) #else /* unknown COMBINE_METHOD */ -#error unknown COMBINE_METHOD +#Pike_error unknown COMBINE_METHOD #endif /* COMBINE_METHOD_FLOAT */ #endif @@ -797,7 +797,7 @@ static void image_layer_set_image(INT32 args) static void image_layer_get_misc_value( INT32 args ) { if( args != 1 ) - error("Wrong number of arguments to get_misc_value\n"); + Pike_error("Wrong number of arguments to get_misc_value\n"); if( THIS->misc ) { ref_push_mapping( THIS->misc ); @@ -820,7 +820,7 @@ static void image_layer_get_misc_value( INT32 args ) static void image_layer_set_misc_value( INT32 args ) { if( args != 2 ) - error("Wrong number of arguments to set_misc_value\n"); + Pike_error("Wrong number of arguments to set_misc_value\n"); if( !THIS->misc ) THIS->misc = allocate_mapping( 4 ); @@ -2765,9 +2765,9 @@ static void image_layer_crop(INT32 args) f_call_function(8); if (Pike_sp[-1].type!=T_OBJECT || !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) - error("No image returned from image->copy\n"); + Pike_error("No image returned from image->copy\n"); if (img->xsize!=xz || img->ysize!=yz) - error("Image returned from image->copy had " + Pike_error("Image returned from image->copy had " "unexpected size (%d,%d, expected %d,%d)\n", img->xsize,img->ysize,xz,yz); @@ -2793,9 +2793,9 @@ static void image_layer_crop(INT32 args) f_call_function(8); if (Pike_sp[-1].type!=T_OBJECT || !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) - error("No image returned from alpha->copy\n"); + Pike_error("No image returned from alpha->copy\n"); if (img->xsize!=xz || img->ysize!=yz) - error("Image returned from alpha->copy had " + Pike_error("Image returned from alpha->copy had " "unexpected size (%d,%d, expected %d,%d)\n", img->xsize,img->ysize,xz,yz); free_object(l->alpha); diff --git a/src/modules/Image/match.h b/src/modules/Image/match.h index f2ab8e053c6182bccf45ef1d67a701d08a7fa1bd..8ff70fc020e11f92ba5527af6e82e28a4268ade0 100644 --- a/src/modules/Image/match.h +++ b/src/modules/Image/match.h @@ -38,12 +38,12 @@ void INAME(INT32 args) int needle_average=0; int needle_size=0; - if (!THIS->img) { error("no image\n"); return; } + if (!THIS->img) { Pike_error("no image\n"); return; } this=THIS; haystacki=this->img; haystack=this; - if (!args) { error("Missing arguments to image->"NAME"\n"); return; } - else if (args<2) { error("Too few arguments to image->"NAME"\n"); return; } + if (!args) { Pike_error("Missing arguments to image->"NAME"\n"); return; } + else if (args<2) { Pike_error("Too few arguments to image->"NAME"\n"); return; } else { if (sp[-args].type==T_INT) @@ -51,16 +51,16 @@ void INAME(INT32 args) else if (sp[-args].type==T_FLOAT) scale = sp[-args].u.float_number; else - error("Illegal argument 1 to image->"NAME"\n"); + Pike_error("Illegal argument 1 to image->"NAME"\n"); if ((sp[1-args].type!=T_OBJECT) || !(needle= (struct image*)get_storage(sp[1-args].u.object,image_program))) - error("Illegal argument 2 to image->"NAME"()\n"); + Pike_error("Illegal argument 2 to image->"NAME"()\n"); if ((needle->xsize>haystack->xsize)|| (needle->ysize>haystack->ysize)) - error("Haystack must be bigger than needle error in image->"NAME"()\n"); + Pike_error("Haystack must be bigger than needle Pike_error in image->"NAME"()\n"); needlei=needle->img; haystacki=haystack->img; @@ -71,11 +71,11 @@ void INAME(INT32 args) if ((sp[2-args].type!=T_OBJECT)|| !(haystack_cert= (struct image*)get_storage(sp[2-args].u.object,image_program))) - error("Illegal argument 3 to image->"NAME"()\n"); + Pike_error("Illegal argument 3 to image->"NAME"()\n"); else if ((haystack->xsize!=haystack_cert->xsize)|| (haystack->ysize!=haystack_cert->ysize)) - error("Argument 3 must be the same size as haystack error in image->"NAME"()\n"); + Pike_error("Argument 3 must be the same size as haystack Pike_error in image->"NAME"()\n"); if ((sp[3-args].type==T_INT)) { @@ -87,12 +87,12 @@ void INAME(INT32 args) else if ((sp[3-args].type!=T_OBJECT)|| !(needle_cert= (struct image*)get_storage(sp[3-args].u.object,image_program))) - error("Illegal argument 4 to image->"NAME"()\n"); + Pike_error("Illegal argument 4 to image->"NAME"()\n"); else { if ((needle_cert->xsize!=needle->xsize)|| (needle_cert->ysize!=needle->ysize)) - error("Needle_cert must be the same size as needle error in image->"NAME"()\n"); + Pike_error("Needle_cert must be the same size as needle Pike_error in image->"NAME"()\n"); type=2; } if (args>=6) @@ -103,15 +103,15 @@ void INAME(INT32 args) type=4; } else - error("Illegal argument 6 to image->"NAME"()\n"); + Pike_error("Illegal argument 6 to image->"NAME"()\n"); if ((sp[4-args].type!=T_OBJECT)|| !(haystack_avoid= (struct image*)get_storage(sp[4-args].u.object,image_program))) - error("Illegal argument 5 to image->"NAME"()\n"); + Pike_error("Illegal argument 5 to image->"NAME"()\n"); else if ((haystack->xsize!=haystack_avoid->xsize)|| (haystack->ysize!=haystack_avoid->ysize)) - error("Haystack_avoid must be the same size as haystack error in image->"NAME"()\n"); + Pike_error("Haystack_avoid must be the same size as haystack Pike_error in image->"NAME"()\n"); } } push_int(this->xsize); diff --git a/src/modules/Image/matrix.c b/src/modules/Image/matrix.c index 28ef8a59e93b5093b7ed375df6c4104542353dbd..0402a86c8b880b21f53e87cc5468a8ae264f9861 100644 --- a/src/modules/Image/matrix.c +++ b/src/modules/Image/matrix.c @@ -1,9 +1,9 @@ -/* $Id: matrix.c,v 1.29 2000/08/23 18:56:38 grubba Exp $ */ +/* $Id: matrix.c,v 1.30 2000/12/01 08:10:01 hubbe Exp $ */ /* **! module Image **! note -**! $Id: matrix.c,v 1.29 2000/08/23 18:56:38 grubba Exp $ +**! $Id: matrix.c,v 1.30 2000/12/01 08:10:01 hubbe Exp $ **! class Image */ @@ -21,7 +21,7 @@ #include "svalue.h" #include "array.h" #include "threads.h" -#include "error.h" +#include "pike_error.h" #include "image.h" @@ -94,14 +94,14 @@ static INLINE int getrgb(struct image *img, for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); img->rgb.r=(unsigned char)sp[-args+args_start].u.integer; img->rgb.g=(unsigned char)sp[1-args+args_start].u.integer; img->rgb.b=(unsigned char)sp[2-args+args_start].u.integer; if (args-args_start>=4) { if (sp[3-args+args_start].type!=T_INT) { - error("Illegal alpha argument to %s\n",name); + Pike_error("Illegal alpha argument to %s\n",name); } img->alpha=sp[3-args+args_start].u.integer; @@ -119,7 +119,7 @@ static INLINE int getrgbl(rgbl_group *rgb,INT32 args_start,INT32 args,char *name if (args-args_start<3) return 0; for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); rgb->r=sp[-args+args_start].u.integer; rgb->g=sp[1-args+args_start].u.integer; rgb->b=sp[2-args+args_start].u.integer; @@ -411,7 +411,7 @@ void image_ccw(INT32 args) pop_n_elems(args); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -518,7 +518,7 @@ void image_cw(INT32 args) pop_n_elems(args); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -570,7 +570,7 @@ void image_mirrorx(INT32 args) pop_n_elems(args); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -619,7 +619,7 @@ void image_mirrory(INT32 args) pop_n_elems(args); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); img=(struct image*)o->storage; @@ -859,7 +859,7 @@ void image_skewx(INT32 args) bad_arg_error("image->skewx",sp-args,args,0,"",sp-args, "Bad arguments to image->skewx()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); @@ -923,7 +923,7 @@ void image_skewy(INT32 args) bad_arg_error("image->skewx",sp-args,args,0,"",sp-args, "Bad arguments to image->skewx()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); @@ -951,7 +951,7 @@ void image_skewx_expand(INT32 args) bad_arg_error("image->skewx",sp-args,args,0,"",sp-args, "Bad arguments to image->skewx()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); @@ -979,7 +979,7 @@ void image_skewy_expand(INT32 args) bad_arg_error("image->skewx",sp-args,args,0,"",sp-args, "Bad arguments to image->skewx()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; o=clone_object(image_program,0); @@ -1010,7 +1010,7 @@ void img_rotate(INT32 args,int xpn) bad_arg_error("image->rotate",sp-args,args,0,"",sp-args, "Bad arguments to image->rotate()\n"); - if (!THIS->img) error("Called Image.Image object is not initialized\n");; + if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");; dest2.img=d0.img=NULL; @@ -1104,7 +1104,7 @@ void img_translate(INT32 args,int expand) struct image *img; rgb_group *s,*d; - if (args<2) error("illegal number of arguments to image->translate()\n"); + if (args<2) Pike_error("illegal number of arguments to image->translate()\n"); if (sp[-args].type==T_FLOAT) xt=sp[-args].u.float_number; else if (sp[-args].type==T_INT) xt=sp[-args].u.integer; diff --git a/src/modules/Image/operator.c b/src/modules/Image/operator.c index c7964705d1a2245002276a7ee8b201109dcc5954..76022e1bf082dec472bbd4234521925576cfa3e7 100644 --- a/src/modules/Image/operator.c +++ b/src/modules/Image/operator.c @@ -1,9 +1,9 @@ -/* $Id: operator.c,v 1.33 2000/08/15 12:41:59 grubba Exp $ */ +/* $Id: operator.c,v 1.34 2000/12/01 08:10:01 hubbe Exp $ */ /* **! module Image **! note -**! $Id: operator.c,v 1.33 2000/08/15 12:41:59 grubba Exp $ +**! $Id: operator.c,v 1.34 2000/12/01 08:10:01 hubbe Exp $ **! class Image */ @@ -20,7 +20,7 @@ #include "interpret.h" #include "svalue.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "builtin_functions.h" @@ -50,7 +50,7 @@ extern struct program *image_program; rgb_group trgb; \ INT32 i; \ \ - if (!THIS->img) error("no image\n"); \ + if (!THIS->img) Pike_error("no image\n"); \ \ if (args && sp[-args].type==T_INT) \ { \ @@ -79,20 +79,20 @@ extern struct program *image_program; if (args<1 || sp[-args].type!=T_OBJECT \ || !sp[-args].u.object \ || sp[-args].u.object->prog!=image_program) \ - error("illegal arguments to image->"what"()\n"); \ + Pike_error("illegal arguments to image->"what"()\n"); \ \ oper=(struct image*)sp[-args].u.object->storage; \ - if (!oper->img) error("no image (operand)\n"); \ + if (!oper->img) Pike_error("no image (operand)\n"); \ if (oper->xsize!=THIS->xsize \ || oper->ysize!=THIS->ysize) \ - error("operands differ in size (image->"what")"); \ + Pike_error("operands differ in size (image->"what")"); \ } \ \ push_int(THIS->xsize); \ push_int(THIS->ysize); \ o=clone_object(image_program,2); \ img=(struct image*)o->storage; \ - if (!img->img) { free_object(o); error("out of memory\n"); } \ + if (!img->img) { free_object(o); Pike_error("out of memory\n"); } \ \ s1=THIS->img; \ if (oper) s2=oper->img; else s2=NULL; \ @@ -504,7 +504,7 @@ STANDARD_OPERATOR_HEADER("`& 'minimum'") **! **! note: **! `< or `> on empty ("no image") image objects or images -**! with different size will result in an error. +**! with different size will result in an Pike_error. **! `== is always true on two empty image objects and **! always false if one and only one of the image objects **! is empty or the images differs in size. @@ -556,7 +556,7 @@ void image_operator_equal(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !sp[-args].u.object || !(oper=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("`==: illegal argument 2\n"); + Pike_error("`==: illegal argument 2\n"); if (!oper->img || !THIS->img) { @@ -611,7 +611,7 @@ void image_operator_lesser(INT32 args) int res=1; if (!THIS->img) - error("image->`<: operator 1 has no image\n"); + Pike_error("image->`<: operator 1 has no image\n"); if (args && sp[-args].type==T_INT) { @@ -636,13 +636,13 @@ void image_operator_lesser(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !sp[-args].u.object || !(oper=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("`==: illegal argument 2\n"); + Pike_error("`==: illegal argument 2\n"); if (!oper->img) - error("image->`<: operator 2 has no image\n"); + Pike_error("image->`<: operator 2 has no image\n"); if (oper->xsize!=THIS->xsize || oper->ysize!=THIS->ysize) - error("image->`<: operators differ in size\n"); + Pike_error("image->`<: operators differ in size\n"); } s1=THIS->img; @@ -683,7 +683,7 @@ void image_operator_greater(INT32 args) int res=1; if (!THIS->img) - error("image->`>: operator 1 has no image\n"); + Pike_error("image->`>: operator 1 has no image\n"); if (args && sp[-args].type==T_INT) { @@ -708,13 +708,13 @@ void image_operator_greater(INT32 args) if (args<1 || sp[-args].type!=T_OBJECT || !sp[-args].u.object || !(oper=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("`==: illegal argument 2\n"); + Pike_error("`==: illegal argument 2\n"); if (!oper->img) - error("image->`>: operator 2 has no image\n"); + Pike_error("image->`>: operator 2 has no image\n"); if (oper->xsize!=THIS->xsize || oper->ysize!=THIS->ysize) - error("image->`>: operators differ in size\n"); + Pike_error("image->`>: operators differ in size\n"); } s1=THIS->img; @@ -777,9 +777,9 @@ void image_average(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->average(): no image\n"); + Pike_error("Image.Image->average(): no image\n"); if (!THIS->xsize || !THIS->ysize) - error("Image.Image->average(): no pixels in image (division by zero)\n"); + Pike_error("Image.Image->average(): no pixels in image (division by zero)\n"); y=THIS->ysize; xz=THIS->xsize; @@ -818,7 +818,7 @@ void image_sumf(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->sumf(): no image\n"); + Pike_error("Image.Image->sumf(): no image\n"); y=THIS->ysize; xz=THIS->xsize; @@ -856,7 +856,7 @@ void image_sum(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->sum(): no image\n"); + Pike_error("Image.Image->sum(): no image\n"); n=THIS->ysize*THIS->xsize; THREADS_ALLOW(); @@ -885,7 +885,7 @@ void image_min(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->min(): no image\n"); + Pike_error("Image.Image->min(): no image\n"); n=THIS->ysize*THIS->xsize; THREADS_ALLOW(); @@ -914,7 +914,7 @@ void image_max(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->max(): no image\n"); + Pike_error("Image.Image->max(): no image\n"); n=THIS->ysize*THIS->xsize; THREADS_ALLOW(); @@ -957,7 +957,7 @@ static INLINE void getrgbl(rgbl_group *rgb,INT32 args_start,INT32 args, if (args-args_start<3) return; for (i=0; i<3; i++) if (sp[-args+i+args_start].type!=T_INT) - error("Illegal r,g,b argument to %s\n",name); + Pike_error("Illegal r,g,b argument to %s\n",name); rgb->r=sp[-args+args_start].u.integer; rgb->g=sp[1-args+args_start].u.integer; rgb->b=sp[2-args+args_start].u.integer; @@ -986,9 +986,9 @@ void image_find_min(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->find_min(): no image\n"); + Pike_error("Image.Image->find_min(): no image\n"); if (!THIS->xsize || !THIS->ysize) - error("Image.Image->find_min(): no pixels in image (none to find)\n"); + Pike_error("Image.Image->find_min(): no pixels in image (none to find)\n"); yz=THIS->ysize; xz=THIS->xsize; @@ -1034,9 +1034,9 @@ void image_find_max(INT32 args) pop_n_elems(args); if (!THIS->img) - error("Image.Image->find_max(): no image\n"); + Pike_error("Image.Image->find_max(): no image\n"); if (!THIS->xsize || !THIS->ysize) - error("Image.Image->find_max(): no pixels in image (none to find)\n"); + Pike_error("Image.Image->find_max(): no pixels in image (none to find)\n"); yz=THIS->ysize; xz=THIS->xsize; diff --git a/src/modules/Image/orient.c b/src/modules/Image/orient.c index 4ac88ec95919ed779a16bc1fe738ca17a73e2c27..f8000028871e2e80b8177a1afafd2c24211f9b0a 100644 --- a/src/modules/Image/orient.c +++ b/src/modules/Image/orient.c @@ -1,9 +1,9 @@ -/* $Id: orient.c,v 1.17 2000/08/11 19:22:14 grubba Exp $ */ +/* $Id: orient.c,v 1.18 2000/12/01 08:10:02 hubbe Exp $ */ /* **! module Image **! note -**! $Id: orient.c,v 1.17 2000/08/11 19:22:14 grubba Exp $ +**! $Id: orient.c,v 1.18 2000/12/01 08:10:02 hubbe Exp $ **! class Image */ @@ -21,7 +21,7 @@ #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "image.h" @@ -162,7 +162,7 @@ void image_orient(INT32 args) double mag; int i, w, h; - if (!THIS->img) { error("Called Image.Image object is not initialized\n");; return; } + if (!THIS->img) { Pike_error("Called Image.Image object is not initialized\n");; return; } this=THIS; @@ -190,12 +190,12 @@ void image_orient(INT32 args) bad_arg_error("image->orient\\n",sp-args,args,2,"",sp+2-1-args, "Bad argument 2 to image->orient\n()\n"); if (sp[1-args].u.array->size!=4) - error("The array given as argument 2 to image->orient do not have size 4\n"); + Pike_error("The array given as argument 2 to image->orient do not have size 4\n"); for(i=0; i<4; i++) if ((sp[1-args].u.array->item[i].type!=T_OBJECT) || (!(sp[1-args].u.array->item[i].u.object)) || (sp[1-args].u.array->item[i].u.object->prog!=image_program)) - error("The array given as argument 2 to image->orient do not contain images\n"); + Pike_error("The array given as argument 2 to image->orient do not contain images\n"); img1=(struct image*)sp[1-args].u.array->item[0].u.object->storage; w=this->xsize; @@ -206,7 +206,7 @@ void image_orient(INT32 args) img1=(struct image*)sp[1-args].u.array->item[i].u.object->storage; if ((img1->xsize!=w)|| (img1->ysize!=h)) - error("The images in the array given as argument 2 to image->orient have different sizes\n"); + Pike_error("The images in the array given as argument 2 to image->orient have different sizes\n"); } for(i=0; i<4; i++) img[i]=(struct image*)sp[1-args].u.array->item[i].u.object->storage; @@ -281,7 +281,7 @@ void image_orient4(INT32 args) struct object *o[5]; struct image *img[5]; - if (!THIS->img) { error("Called Image.Image object is not initialized\n");; return; } + if (!THIS->img) { Pike_error("Called Image.Image object is not initialized\n");; return; } pop_n_elems(args); _image_orient(THIS,o,img); diff --git a/src/modules/Image/pattern.c b/src/modules/Image/pattern.c index 71d13b12050c9c23abe96a8f2ca3534ed10c56eb..fbc0449308283bfa4fa6d15dedbe5ed88d0bfec9 100644 --- a/src/modules/Image/pattern.c +++ b/src/modules/Image/pattern.c @@ -1,9 +1,9 @@ -/* $Id: pattern.c,v 1.22 2000/08/11 18:49:46 grubba Exp $ */ +/* $Id: pattern.c,v 1.23 2000/12/01 08:10:02 hubbe Exp $ */ /* **! module Image **! note -**! $Id: pattern.c,v 1.22 2000/08/11 18:49:46 grubba Exp $ +**! $Id: pattern.c,v 1.23 2000/12/01 08:10:02 hubbe Exp $ **! class Image */ @@ -20,7 +20,7 @@ #include "interpret.h" #include "svalue.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "builtin_functions.h" @@ -249,9 +249,9 @@ static void init_colorrange(rgb_group *cr,struct svalue *s,char *where) int b; if (s->type!=T_ARRAY) - error("Illegal colorrange to %s\n",where); + Pike_error("Illegal colorrange to %s\n",where); else if (s->u.array->size<2) - error("Colorrange array too small (meaningless) (to %s)\n",where); + Pike_error("Colorrange array too small (meaningless) (to %s)\n",where); vp=v=(void*)xalloc(sizeof(double)*(s->u.array->size/2+1)); rgbp=rgb=(void*)xalloc(sizeof(rgbd_group)*(s->u.array->size/2+1)); @@ -326,13 +326,13 @@ static void init_colorrange(rgb_group *cr,struct svalue *s,char *where) ( (args>n) \ ? ( (sp[n-args].type==T_INT) ? (double)(sp[n-args].u.integer) \ : ( (sp[n-args].type==T_FLOAT) ? sp[n-args].u.float_number \ - : ( error("illegal argument(s) to %s\n", where), 0.0 ) ) ) \ + : ( Pike_error("illegal argument(s) to %s\n", where), 0.0 ) ) ) \ : def ) #define GET_INT_ARG(sp,args,n,def,where) \ ( (args>n) \ ? ( (sp[n-args].type==T_INT) ? sp[n-args].u.integer \ : ( (sp[n-args].type==T_FLOAT) ? DOUBLE_TO_INT(sp[n-args].u.float_number) \ - : ( error("illegal argument(s) to %s\n", where), 0 ) ) ) \ + : ( Pike_error("illegal argument(s) to %s\n", where), 0 ) ) ) \ : def ) /* @@ -368,7 +368,7 @@ void image_noise(INT32 args) struct object *o; struct image *img; - if (args<1) error("too few arguments to image->noise()\n"); + if (args<1) Pike_error("too few arguments to image->noise()\n"); scale=GET_FLOAT_ARG(sp,args,1,0.1,"image->noise"); xdiff=GET_FLOAT_ARG(sp,args,2,0,"image->noise"); @@ -383,7 +383,7 @@ void image_noise(INT32 args) if (!(img->img=malloc(sizeof(rgb_group)*THIS->xsize*THIS->ysize+1))) { free_object(o); - error("Out of memory\n"); + Pike_error("Out of memory\n"); } cscale*=COLORRANGE_LEVELS; @@ -447,7 +447,7 @@ void image_turbulence(INT32 args) struct object *o; struct image *img; - if (args<1) error("too few arguments to image->turbulence()\n"); + if (args<1) Pike_error("too few arguments to image->turbulence()\n"); octaves = GET_INT_ARG(sp,args,1,3,"image->turbulence"); scale = GET_FLOAT_ARG(sp,args,2,0.1,"image->turbulence"); @@ -463,7 +463,7 @@ void image_turbulence(INT32 args) if (!(img->img=malloc(sizeof(rgb_group)*THIS->xsize*THIS->ysize+1))) { free_object(o); - error("Out of memory\n"); + Pike_error("Out of memory\n"); } cscale*=COLORRANGE_LEVELS; diff --git a/src/modules/Image/phase.h b/src/modules/Image/phase.h index fe0eafa03138f68e74477520013b2a07c78c1c9e..150ba3ef64373c862e20a85c7d6f8ac1f5373218 100644 --- a/src/modules/Image/phase.h +++ b/src/modules/Image/phase.h @@ -15,7 +15,7 @@ void IMAGE_PHASE(INT32 args) int yz, xz; /* for this & img */ int ys, xs; /* for this & img */ - if (!THIS->img) { error("no image\n"); return; } + if (!THIS->img) { Pike_error("no image\n"); return; } this=THIS; thisi=this->img; diff --git a/src/modules/Image/poly.c b/src/modules/Image/poly.c index 6997f991894f6364524f44a46d8fb7af71216170..4caf5ae94b5f33c2c4a3a77ed2c8e9e87b388002 100644 --- a/src/modules/Image/poly.c +++ b/src/modules/Image/poly.c @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: poly.c,v 1.10 2000/08/18 21:40:22 grubba Exp $ +**! $Id: poly.c,v 1.11 2000/12/01 08:10:02 hubbe Exp $ **! class Poly **! */ @@ -18,7 +18,7 @@ another? #include "global.h" -RCSID("$Id: poly.c,v 1.10 2000/08/18 21:40:22 grubba Exp $"); +RCSID("$Id: poly.c,v 1.11 2000/12/01 08:10:02 hubbe Exp $"); #include "image_machine.h" @@ -38,7 +38,7 @@ RCSID("$Id: poly.c,v 1.10 2000/08/18 21:40:22 grubba Exp $"); #include "operators.h" #include "module_support.h" #include "opcodes.h" -#include "error.h" +#include "pike_error.h" #include "image.h" #include "colortable.h" @@ -457,7 +457,7 @@ static void mend_crossed_lines(struct poly *p) v=vertex_find_or_insert(p,x,y); if (v-p->vertex<from) - error("internal error: unexpected v-p->vertex<from\n"); + Pike_error("internal Pike_error: unexpected v-p->vertex<from\n"); v1=active[i]->down; v2=active[new]->down; @@ -564,9 +564,9 @@ static void image_poly_create(INT32 args) struct array *a; if (THIS->nvertex || THIS->nline) - error("Poly: create called on initialised object\n"); + Pike_error("Poly: create called on initialised object\n"); - /* this is to get the correct error message */ + /* this is to get the correct Pike_error message */ for (i=0; i<args; i++) if (sp[i-args].type!=T_ARRAY) SIMPLE_BAD_ARG_ERROR("Poly",i+1,"array"); @@ -777,7 +777,7 @@ static void image_poly_cast(INT32 args) free(mark); if (ni!=THIS->nline) - error("Poly: internal error; ni!=nline\n"); + Pike_error("Poly: internal Pike_error; ni!=nline\n"); f_aggregate(na); diff --git a/src/modules/Image/polyfill.c b/src/modules/Image/polyfill.c index 5447bfa18584b956228972f6bdd14e20e6aafdd2..61cdfab6dc99c4b6fd4696d3dc1ba5bf1fdc9d4a 100644 --- a/src/modules/Image/polyfill.c +++ b/src/modules/Image/polyfill.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: polyfill.c,v 1.35 2000/08/18 21:36:36 grubba Exp $"); +RCSID("$Id: polyfill.c,v 1.36 2000/12/01 08:10:02 hubbe Exp $"); /* Prototypes are needed for these */ extern double floor(double); @@ -40,7 +40,7 @@ extern double floor(double); /* **! module Image **! note -**! $Id: polyfill.c,v 1.35 2000/08/18 21:36:36 grubba Exp $ +**! $Id: polyfill.c,v 1.36 2000/12/01 08:10:02 hubbe Exp $ **! class Image */ @@ -701,7 +701,7 @@ static INLINE struct vertex *polyfill_add(struct vertex *top, a->item[n].type!=T_INT) { polyfill_free(top); - error("Illegal argument %d to %s, array index %d is not int nor float\n",arg,what,n); + Pike_error("Illegal argument %d to %s, array index %d is not int nor float\n",arg,what,n); return NULL; } @@ -710,7 +710,7 @@ static INLINE struct vertex *polyfill_add(struct vertex *top, return top; #if 0 polyfill_free(top); - error("Illegal argument %d to %s, too few vertices (min 3)\n", arg, what); + Pike_error("Illegal argument %d to %s, too few vertices (min 3)\n", arg, what); return NULL; /* no polygon with less then tree corners */ #endif } @@ -759,11 +759,11 @@ void image_polyfill(INT32 args) double *buf; if (!THIS->img) - error("Image.Image->polyfill: no image\n"); + Pike_error("Image.Image->polyfill: no image\n"); buf=malloc(sizeof(double)*(THIS->xsize+1)); if (!buf) - error("Image.Image->polyfill: out of memory\n"); + Pike_error("Image.Image->polyfill: out of memory\n"); v=polyfill_begin(); @@ -774,14 +774,14 @@ void image_polyfill(INT32 args) if (sp[-1].type!=T_ARRAY) { polyfill_free(v); - error("Image.Image->polyfill: Illegal argument %d, expected array\n", + Pike_error("Image.Image->polyfill: Illegal argument %d, expected array\n", args); } if ((v_tmp=polyfill_add(v, sp[-1].u.array, args, "Image.Image->polyfill()"))) { v = v_tmp; } else { polyfill_free(v); - error("Image.Image->polyfill: Bad argument %d, bad vertex\n", args); + Pike_error("Image.Image->polyfill: Bad argument %d, bad vertex\n", args); } args--; pop_stack(); diff --git a/src/modules/Image/search.c b/src/modules/Image/search.c index d597a7d19a3efaf09caab3beac19251ec10b1176..ce964742a1cca06aa8bfb4438422843dececb06f 100644 --- a/src/modules/Image/search.c +++ b/src/modules/Image/search.c @@ -19,7 +19,7 @@ #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "image.h" @@ -266,7 +266,7 @@ void image_make_ascii(INT32 args) int i, x, y,xy=0,y2=0, xmax=0,ymax=0,max,sum0,sum1,sum2,sum3; struct pike_string *s; - if (!THIS->img) { error("Called Image.Image object is not initialized\n");; return; } + if (!THIS->img) { Pike_error("Called Image.Image object is not initialized\n");; return; } this=THIS; @@ -646,7 +646,7 @@ void image_apply_max(INT32 args) if (sp[1-args].type!=T_INT || sp[2-args].type!=T_INT || sp[3-args].type!=T_INT) - error("Illegal argument(s) (2,3,4) to Image.Image->apply_max()\n"); + Pike_error("Illegal argument(s) (2,3,4) to Image.Image->apply_max()\n"); else { default_rgb.r=sp[1-args].u.integer; @@ -680,12 +680,12 @@ void image_apply_max(INT32 args) { struct svalue s=sp[-args].u.array->item[i]; if (s.type!=T_ARRAY) - error("Illegal contents of (root) array (Image.Image->apply_max)\n"); + Pike_error("Illegal contents of (root) array (Image.Image->apply_max)\n"); if (width==-1) width=s.u.array->size; else if (width!=s.u.array->size) - error("Arrays has different size (Image.Image->apply_max)\n"); + Pike_error("Arrays has different size (Image.Image->apply_max)\n"); } if (width==-1) width=0; diff --git a/src/modules/Java/jvm.c b/src/modules/Java/jvm.c index c7642cd0b33eec9317662e7c42e1b37cd7aba9b4..69c6e666be4b06393a2cbe4d57b489df249f345e 100644 --- a/src/modules/Java/jvm.c +++ b/src/modules/Java/jvm.c @@ -1,5 +1,5 @@ /* - * $Id: jvm.c,v 1.29 2000/12/01 01:15:04 hubbe Exp $ + * $Id: jvm.c,v 1.30 2000/12/01 08:10:09 hubbe Exp $ * * Pike interface to Java Virtual Machine * @@ -17,14 +17,14 @@ #endif /* HAVE_CONFIG_H */ #include "global.h" -RCSID("$Id: jvm.c,v 1.29 2000/12/01 01:15:04 hubbe Exp $"); +RCSID("$Id: jvm.c,v 1.30 2000/12/01 08:10:09 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" #include "object.h" #include "mapping.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "pike_memory.h" #include "gc.h" @@ -348,9 +348,9 @@ static void f_jobj_cast(INT32 args) jstring jstr; if(args < 1) - error("cast() called without arguments.\n"); + Pike_error("cast() called without arguments.\n"); if(Pike_sp[-args].type != PIKE_T_STRING) - error("Bad argument 1 to cast().\n"); + Pike_error("Bad argument 1 to cast().\n"); if(!strcmp(Pike_sp[-args].u.string->str, "object")) { pop_n_elems(args); @@ -358,7 +358,7 @@ static void f_jobj_cast(INT32 args) } if(strcmp(Pike_sp[-args].u.string->str, "string")) - error("cast() to other type than string.\n"); + Pike_error("cast() to other type than string.\n"); pop_n_elems(args); if((env=jvm_procure_env(jo->jvm))) { @@ -429,7 +429,7 @@ static void f_jobj_instance(INT32 args) get_all_args("Java.obj->is_instance_of()", args, "%o", &cls); if((c = (struct jobj_storage *)get_storage(cls, jclass_program)) == NULL) - error("Bad argument 1 to is_instance_of().\n"); + Pike_error("Bad argument 1 to is_instance_of().\n"); if((env=jvm_procure_env(jo->jvm))) { if((*env)->IsInstanceOf(env, jo->jobj, c->jobj)) @@ -529,7 +529,7 @@ static void f_method_create(INT32 args) get_all_args("Java.method->create()", args, "%S%S%o", &name, &sig, &class); if((c = (struct jobj_storage *)get_storage(class, jclass_program)) == NULL) - error("Bad argument 3 to create().\n"); + Pike_error("Bad argument 3 to create().\n"); if((env = jvm_procure_env(c->jvm))==NULL) { pop_n_elems(args); @@ -579,7 +579,7 @@ static void f_method_create(INT32 args) static void jargs_error(struct object *jvm, JNIEnv *env) { jvm_vacate_env(jvm, env); - error("incompatible types passed to method.\n"); + Pike_error("incompatible types passed to method.\n"); } static void make_jargs(jvalue *jargs, INT32 args, char *sig, @@ -756,7 +756,7 @@ static void f_call_static(INT32 args) jobject jjo; FLOAT_TYPE jjf; INT32 jji; if(args != m->nargs) - error("wrong number of arguments for method.\n"); + Pike_error("wrong number of arguments for method.\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -861,12 +861,12 @@ static void f_call_virtual(INT32 args) struct jobj_storage *jo; if(args != 1+m->nargs) - error("wrong number of arguments for method.\n"); + Pike_error("wrong number of arguments for method.\n"); if(Pike_sp[-args].type != PIKE_T_OBJECT || (jo = (struct jobj_storage *)get_storage(Pike_sp[-args].u.object, jobj_program))==NULL) - error("Bad argument 1 to `().\n"); + Pike_error("Bad argument 1 to `().\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -971,12 +971,12 @@ static void f_call_nonvirtual(INT32 args) struct jobj_storage *jo; if(args != 1+m->nargs) - error("wrong number of arguments for method.\n"); + Pike_error("wrong number of arguments for method.\n"); if(Pike_sp[-args].type != PIKE_T_OBJECT || (jo = (struct jobj_storage *)get_storage(Pike_sp[-args].u.object, jobj_program))==NULL) - error("Bad argument 1 to call_nonvirtual.\n"); + Pike_error("Bad argument 1 to call_nonvirtual.\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -1125,7 +1125,7 @@ static void f_field_create(INT32 args) get_all_args("Java.field->create()", args, "%S%S%o", &name, &sig, &class); if((c = (struct jobj_storage *)get_storage(class, jclass_program)) == NULL) - error("Bad argument 3 to create().\n"); + Pike_error("Bad argument 3 to create().\n"); f->field = 0; @@ -1174,12 +1174,12 @@ static void f_field_set(INT32 args) jvalue v; if(args!=2) - error("Incorrect number of arguments to set.\n"); + Pike_error("Incorrect number of arguments to set.\n"); if(Pike_sp[-args].type != PIKE_T_OBJECT || (jo = (struct jobj_storage *)get_storage(Pike_sp[-args].u.object, jobj_program))==NULL) - error("Bad argument 1 to set.\n"); + Pike_error("Bad argument 1 to set.\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -1237,7 +1237,7 @@ static void f_field_get(INT32 args) if(Pike_sp[-args].type != PIKE_T_OBJECT || (jo = (struct jobj_storage *)get_storage(Pike_sp[-args].u.object, jobj_program))==NULL) - error("Bad argument 1 to get.\n"); + Pike_error("Bad argument 1 to get.\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -1313,7 +1313,7 @@ static void f_static_field_set(INT32 args) jvalue v; if(args!=1) - error("Incorrect number of arguments to set.\n"); + Pike_error("Incorrect number of arguments to set.\n"); if((env = jvm_procure_env(co->jvm))==NULL) { pop_n_elems(args); @@ -1578,7 +1578,7 @@ static void *low_make_stub(struct cpu_context *ctx, void *data, int statc, } #else -#error How did you get here? It should never happen. +#Pike_error How did you get here? It should never happen. #endif /* HAVE_PPC_CPU */ #endif /* HAVE_X86_CPU */ #endif /* HAVE_SPARC_CPU */ @@ -1879,7 +1879,7 @@ static void build_native_entry(JNIEnv *env, jclass cls, statc = 1; else { (*env)->ExceptionClear(env); - error("trying to register nonexistant function\n"); + Pike_error("trying to register nonexistant function\n"); } } @@ -1993,10 +1993,10 @@ static void f_natives_create(INT32 args) get_all_args("Java.natives->create()", args, "%a%o", &arr, &cls); if((c = (struct jobj_storage *)get_storage(cls, jclass_program)) == NULL) - error("Bad argument 2 to create().\n"); + Pike_error("Bad argument 2 to create().\n"); if(n->num_methods) - error("create() called twice in Java.natives object.\n"); + Pike_error("create() called twice in Java.natives object.\n"); if(!arr->size) { pop_n_elems(args); @@ -2013,10 +2013,10 @@ static void f_natives_create(INT32 args) for(i=0; i<arr->size; i++) { struct array *nm; if(ITEM(arr)[i].type != PIKE_T_ARRAY || ITEM(arr)[i].u.array->size != 3) - error("Bad argument 1 to create().\n"); + Pike_error("Bad argument 1 to create().\n"); nm = ITEM(arr)[i].u.array; if(ITEM(nm)[0].type != PIKE_T_STRING || ITEM(nm)[1].type != PIKE_T_STRING) - error("Bad argument 1 to create().\n"); + Pike_error("Bad argument 1 to create().\n"); assign_svalue_no_free(&n->cons[i].callback, &ITEM(nm)[2]); n->cons[i].nat = n; n->num_methods++; @@ -2064,7 +2064,7 @@ static void f_is_assignable_from(INT32 args) if(args<1 || Pike_sp[-args].type != PIKE_T_OBJECT || (jc = (struct jobj_storage *)get_storage(Pike_sp[-args].u.object, jclass_program))==NULL) - error("illegal argument 1 to is_assignable_from\n"); + Pike_error("illegal argument 1 to is_assignable_from\n"); if((env = jvm_procure_env(jo->jvm))) { iaf = (*env)->IsAssignableFrom(env, jo->jobj, jc->jobj); @@ -2090,12 +2090,12 @@ static void f_throw_new(INT32 args) if(!(*env)->IsAssignableFrom(env, jo->jobj, jj->class_throwable)) { jvm_vacate_env(jo->jvm, env); - error("throw_new called in a class that doesn't inherit java.lang.Throwable!\n"); + Pike_error("throw_new called in a class that doesn't inherit java.lang.Throwable!\n"); } if((*env)->ThrowNew(env, jo->jobj, cn)<0) { jvm_vacate_env(jo->jvm, env); - error("throw_new failed!\n"); + Pike_error("throw_new failed!\n"); } jvm_vacate_env(jo->jvm, env); @@ -2244,7 +2244,7 @@ static void f_javathrow(INT32 args) if((env = jvm_procure_env(jo->jvm))) { if((*env)->Throw(env, jo->jobj)<0) { jvm_vacate_env(jo->jvm, env); - error("throw failed!\n"); + Pike_error("throw failed!\n"); } jvm_vacate_env(jo->jvm, env); } @@ -2365,7 +2365,7 @@ static void f_javaarray_getelt(INT32 args) if(args<1 || Pike_sp[-args].type != PIKE_T_INT || (args>1 && Pike_sp[1-args].type != PIKE_T_INT)) - error("Bad args to `[]."); + Pike_error("Bad args to `[]."); n = Pike_sp[-args].u.integer; @@ -2441,7 +2441,7 @@ static void f_javaarray_setelt(INT32 args) char ty2; if(args<2 || Pike_sp[-args].type != PIKE_T_INT) - error("Bad args to `[]=."); + Pike_error("Bad args to `[]=."); if(args>2) pop_n_elems(args-2); @@ -2686,7 +2686,7 @@ static void f_att_create(INT32 args) get_all_args("Java.attachment->create()", args, "%o", &j); if((jvm = (struct jvm_storage *)get_storage(j, jvm_program))==NULL) - error("Bad argument 1 to create().\n"); + Pike_error("Bad argument 1 to create().\n"); att->jvm = j; j->refs++; @@ -2761,7 +2761,7 @@ static void f_monitor_create(INT32 args) get_all_args("Java.monitor->create()", args, "%o", &obj); if(get_storage(obj, jobj_program) == NULL) - error("Bad argument 1 to create().\n"); + Pike_error("Bad argument 1 to create().\n"); #ifdef _REENTRANT m->tid = th_self(); @@ -2844,7 +2844,7 @@ static void f_create(INT32 args) /* load and initialize a Java VM, return a JNI interface * pointer in env */ if(JNI_CreateJavaVM(&j->jvm, (void**)&j->env, &j->vm_args)) - error( "Failed to create virtual machine\n" ); + Pike_error( "Failed to create virtual machine\n" ); cls = (*j->env)->FindClass(j->env, "java/lang/Object"); j->class_object = (*j->env)->NewGlobalRef(j->env, cls); @@ -3016,7 +3016,7 @@ static void f_define_class(INT32 args) get_all_args("define_class", args, "%s%o%S", &name, &obj, &str); if((ldr = THAT_JOBJ(obj))==NULL) - error("Bad argument 2 to define_class().\n"); + Pike_error("Bad argument 2 to define_class().\n"); if((env = jvm_procure_env(Pike_fp->current_object))) { c = (*env)->DefineClass(env, name, ldr->jobj, (jbyte*)str->str, str->len); pop_n_elems(args); diff --git a/src/modules/MIME/mime.c b/src/modules/MIME/mime.c index d9cbc7c9181407667d6ce5560f765854c4eecc9e..629493d4d754a90d9b655dfa172c5603f052cc72 100644 --- a/src/modules/MIME/mime.c +++ b/src/modules/MIME/mime.c @@ -1,5 +1,5 @@ /* - * $Id: mime.c,v 1.26 2000/08/18 21:41:15 grubba Exp $ + * $Id: mime.c,v 1.27 2000/12/01 08:10:10 hubbe Exp $ * * RFC1521 functionality for Pike * @@ -10,14 +10,14 @@ #include "config.h" -RCSID("$Id: mime.c,v 1.26 2000/08/18 21:41:15 grubba Exp $"); +RCSID("$Id: mime.c,v 1.27 2000/12/01 08:10:10 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "interpret.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" #ifdef __CHAR_UNSIGNED__ #define SIGNED signed @@ -143,11 +143,11 @@ void pike_module_exit( void ) static void f_decode_base64( INT32 args ) { if(args != 1) - error( "Wrong number of arguments to MIME.decode_base64()\n" ); + Pike_error( "Wrong number of arguments to MIME.decode_base64()\n" ); else if (sp[-1].type != T_STRING) - error( "Wrong type of argument to MIME.decode_base64()\n" ); + Pike_error( "Wrong type of argument to MIME.decode_base64()\n" ); else if (sp[-1].u.string->size_shift != 0) - error( "Char out of range for MIME.decode_base64()\n" ); + Pike_error( "Char out of range for MIME.decode_base64()\n" ); else { /* Decode the string in sp[-1].u.string. Any whitespace etc @@ -234,11 +234,11 @@ static int do_b64_encode( ptrdiff_t groups, unsigned char **srcp, char **destp, static void f_encode_base64( INT32 args ) { if(args != 1 && args != 2) - error( "Wrong number of arguments to MIME.encode_base64()\n" ); + Pike_error( "Wrong number of arguments to MIME.encode_base64()\n" ); else if(sp[-args].type != T_STRING) - error( "Wrong type of argument to MIME.encode_base64()\n" ); + Pike_error( "Wrong type of argument to MIME.encode_base64()\n" ); else if (sp[-args].u.string->size_shift != 0) - error( "Char out of range for MIME.encode_base64()\n" ); + Pike_error( "Char out of range for MIME.encode_base64()\n" ); else { /* Encode the string in sp[-args].u.string. First, we need to know @@ -294,11 +294,11 @@ static void f_encode_base64( INT32 args ) static void f_decode_qp( INT32 args ) { if(args != 1) - error( "Wrong number of arguments to MIME.decode_qp()\n" ); + Pike_error( "Wrong number of arguments to MIME.decode_qp()\n" ); else if(sp[-1].type != T_STRING) - error( "Wrong type of argument to MIME.decode_qp()\n" ); + Pike_error( "Wrong type of argument to MIME.decode_qp()\n" ); else if (sp[-1].u.string->size_shift != 0) - error( "Char out of range for MIME.decode_qp()\n" ); + Pike_error( "Char out of range for MIME.decode_qp()\n" ); else { /* Decode the string in sp[-1].u.string. We have absolutely no idea @@ -347,11 +347,11 @@ static void f_decode_qp( INT32 args ) static void f_encode_qp( INT32 args ) { if (args != 1 && args != 2) - error( "Wrong number of arguments to MIME.encode_qp()\n" ); + Pike_error( "Wrong number of arguments to MIME.encode_qp()\n" ); else if (sp[-args].type != T_STRING) - error( "Wrong type of argument to MIME.encode_qp()\n" ); + Pike_error( "Wrong type of argument to MIME.encode_qp()\n" ); else if (sp[-args].u.string->size_shift != 0) - error( "Char out of range for MIME.encode_qp()\n" ); + Pike_error( "Char out of range for MIME.encode_qp()\n" ); else { /* Encode the string in sp[-args].u.string. We don't know how @@ -399,11 +399,11 @@ static void f_encode_qp( INT32 args ) static void f_decode_uue( INT32 args ) { if (args != 1) - error( "Wrong number of arguments to MIME.decode_uue()\n" ); + Pike_error( "Wrong number of arguments to MIME.decode_uue()\n" ); else if(sp[-1].type != T_STRING) - error( "Wrong type of argument to MIME.decode_uue()\n" ); + Pike_error( "Wrong type of argument to MIME.decode_uue()\n" ); else if (sp[-1].u.string->size_shift != 0) - error( "Char out of range for MIME.decode_uue()\n" ); + Pike_error( "Char out of range for MIME.decode_uue()\n" ); else { /* Decode string in sp[-1].u.string. This is done much like in @@ -535,15 +535,15 @@ static void do_uue_encode(ptrdiff_t groups, unsigned char **srcp, char **destp, static void f_encode_uue( INT32 args ) { if (args != 1 && args != 2) - error( "Wrong number of arguments to MIME.encode_uue()\n" ); + Pike_error( "Wrong number of arguments to MIME.encode_uue()\n" ); else if (sp[-args].type != T_STRING || (args == 2 && sp[-1].type != T_VOID && sp[-1].type != T_STRING && sp[-1].type != T_INT)) - error( "Wrong type of argument to MIME.encode_uue()\n" ); + Pike_error( "Wrong type of argument to MIME.encode_uue()\n" ); else if (sp[-args].u.string->size_shift != 0 || (args == 2 && sp[-1].type == T_STRING && sp[-1].u.string->size_shift != 0)) - error( "Char out of range for MIME.encode_uue()\n" ); + Pike_error( "Char out of range for MIME.encode_uue()\n" ); else { /* Encode string in sp[-args].u.string. If args == 2, there may be @@ -815,7 +815,7 @@ static void low_tokenize( INT32 args, int mode ) cnt = 0; break; } - error( "Invalid character in header field\n" ); + Pike_error( "Invalid character in header field\n" ); } /* Create the resulting array and push it */ @@ -827,13 +827,13 @@ static void low_tokenize( INT32 args, int mode ) static void f_tokenize( INT32 args ) { if (args != 1) - error( "Wrong number of arguments to MIME.tokenize()\n" ); + Pike_error( "Wrong number of arguments to MIME.tokenize()\n" ); if (sp[-1].type != T_STRING) - error( "Wrong type of argument to MIME.tokenize()\n" ); + Pike_error( "Wrong type of argument to MIME.tokenize()\n" ); if (sp[-1].u.string->size_shift != 0) - error( "Char out of range for MIME.tokenize()\n" ); + Pike_error( "Char out of range for MIME.tokenize()\n" ); low_tokenize( args, 0 ); } @@ -841,13 +841,13 @@ static void f_tokenize( INT32 args ) static void f_tokenize_labled( INT32 args ) { if (args != 1) - error( "Wrong number of arguments to MIME.tokenize_labled()\n" ); + Pike_error( "Wrong number of arguments to MIME.tokenize_labled()\n" ); if (sp[-1].type != T_STRING) - error( "Wrong type of argument to MIME.tokenize_labled()\n" ); + Pike_error( "Wrong type of argument to MIME.tokenize_labled()\n" ); if (sp[-1].u.string->size_shift != 0) - error( "Char out of range for MIME.tokenize_labled()\n" ); + Pike_error( "Char out of range for MIME.tokenize_labled()\n" ); low_tokenize( args, 1 ); } @@ -908,9 +908,9 @@ static void f_quote( INT32 args ) int prev_atom = 0; if (args != 1) - error( "Wrong number of arguments to MIME.quote()\n" ); + Pike_error( "Wrong number of arguments to MIME.quote()\n" ); else if (sp[-1].type != T_ARRAY) - error( "Wrong type of argument to MIME.quote()\n" ); + Pike_error( "Wrong type of argument to MIME.quote()\n" ); /* Quote array in sp[-1].u.array. Once again we'll rely on a string_builder to collect the output string. */ @@ -929,12 +929,12 @@ static void f_quote( INT32 args ) /* Neither int or string. Too bad... */ free_string_builder( &buf ); - error( "Wrong type of argument to MIME.quote()\n" ); + Pike_error( "Wrong type of argument to MIME.quote()\n" ); } else if (item->u.string->size_shift != 0) { free_string_builder( &buf ); - error( "Char out of range for MIME.quote()\n" ); + Pike_error( "Char out of range for MIME.quote()\n" ); } else { @@ -988,9 +988,9 @@ static void f_quote_labled( INT32 args ) int prev_atom = 0; if (args != 1) - error( "Wrong number of arguments to MIME.quote_labled()\n" ); + Pike_error( "Wrong number of arguments to MIME.quote_labled()\n" ); else if (sp[-1].type != T_ARRAY) - error( "Wrong type of argument to MIME.quote_labled()\n" ); + Pike_error( "Wrong type of argument to MIME.quote_labled()\n" ); /* Quote array in sp[-1].u.array. Once again we'll rely on a string_builder to collect the output string. */ @@ -1002,14 +1002,14 @@ static void f_quote_labled( INT32 args ) if (item->type != T_ARRAY || item->u.array->size<2 || item->u.array->item[0].type != T_STRING) { free_string_builder( &buf ); - error( "Wrong type of argument to MIME.quote_labled()\n" ); + Pike_error( "Wrong type of argument to MIME.quote_labled()\n" ); } if (c_compare_string( item->u.array->item[0].u.string, "special", 7 )) { if(item->u.array->item[1].type != T_INT) { free_string_builder( &buf ); - error( "Wrong type of argument to MIME.quote_labled()\n" ); + Pike_error( "Wrong type of argument to MIME.quote_labled()\n" ); } /* Single special character */ @@ -1020,12 +1020,12 @@ static void f_quote_labled( INT32 args ) /* All the remaining lexical items require item[1] to be a string */ free_string_builder( &buf ); - error( "Wrong type of argument to MIME.quote_labled()\n" ); + Pike_error( "Wrong type of argument to MIME.quote_labled()\n" ); } else if (item->u.array->item[1].u.string->size_shift != 0) { free_string_builder( &buf ); - error( "Char out of range for MIME.quote_labled()\n" ); + Pike_error( "Char out of range for MIME.quote_labled()\n" ); } else if (c_compare_string( item->u.array->item[0].u.string, "word", 4 )){ @@ -1103,7 +1103,7 @@ static void f_quote_labled( INT32 args ) if (len<2 || src[0] != '[' || src[len-1] != ']') { free_string_builder( &buf ); - error( "Illegal domain-literal passed to MIME.quote_labled()\n" ); + Pike_error( "Illegal domain-literal passed to MIME.quote_labled()\n" ); } len -= 2; @@ -1124,7 +1124,7 @@ static void f_quote_labled( INT32 args ) /* Unknown label. Too bad... */ free_string_builder( &buf ); - error( "Unknown label passed to MIME.quote_labled()\n" ); + Pike_error( "Unknown label passed to MIME.quote_labled()\n" ); } diff --git a/src/modules/Math/math_matrix.c b/src/modules/Math/math_matrix.c index d73ec2af1cc64ac2758ea69da98178a1265e1237..430f5130dd1994d4a591252676c8ee7ed66531d3 100644 --- a/src/modules/Math/math_matrix.c +++ b/src/modules/Math/math_matrix.c @@ -1,4 +1,4 @@ -/* $Id: math_matrix.c,v 1.18 2000/10/11 10:11:50 mirar Exp $ */ +/* $Id: math_matrix.c,v 1.19 2000/12/01 08:10:10 hubbe Exp $ */ #include "global.h" #include "config.h" @@ -6,7 +6,7 @@ #include <math.h> #include "pike_macros.h" -#include "../../error.h" +#include "../../pike_error.h" #include "object.h" #include "constants.h" #include "interpret.h" @@ -478,7 +478,7 @@ static void matrix_transpose(INT32 args) **! **! m->normv() is equal to m*(1.0/m->norm()), **! with the exception that the zero vector will still be -**! the zero vector (no error). +**! the zero vector (no Pike_error). */ static void matrix_norm(INT32 args) diff --git a/src/modules/Mird/mird_glue.c b/src/modules/Mird/mird_glue.c index 71a9dae00fc4dc63db06fc25f829a0d359850126..83f5aea00c4fd86872c9e57f7f1fc4ea9a12e329 100644 --- a/src/modules/Mird/mird_glue.c +++ b/src/modules/Mird/mird_glue.c @@ -79,22 +79,22 @@ static void pmird_exception(MIRD_RES res) memcpy(d,s,strlen(s)+1); mird_free(s); mird_free_error(res); - error("[mird] %s\n",d); + Pike_error("[mird] %s\n",d); } static void pmird_no_database(char *func) { - error("%s: database is not open\n",func); + Pike_error("%s: database is not open\n",func); } static void pmird_tr_no_database(char *func) { - error("%s: no database connected to the transaction\n",func); + Pike_error("%s: no database connected to the transaction\n",func); } static void pmird_no_transaction(void) { - error("transaction is already closed\n"); + Pike_error("transaction is already closed\n"); } /**** main program *********************************/ @@ -1191,7 +1191,7 @@ UNLOCK(this->pmird); case MIRD_TABLE_HASHKEY: this->type=PMTS_HASHKEY; break; case MIRD_TABLE_STRINGKEY: this->type=PMTS_STRINGKEY; break; default: - error("Scanner: Unknown table %08lx\n",(unsigned long)type); + Pike_error("Scanner: Unknown table %08lx\n",(unsigned long)type); } if (args>2) { @@ -1208,7 +1208,7 @@ UNLOCK(this->pmird); case PMTS_STRINGKEY: TRY(mird_s_scan_continued(key,&(this->mssr))); break; - case PMTS_UNKNOWN: error("illegal scanner type\n"); break; + case PMTS_UNKNOWN: Pike_error("illegal scanner type\n"); break; } } } @@ -1258,7 +1258,7 @@ LOCK(this->pmird); res=mird_s_table_scan(this->pmird->db,this->table_id, (mird_size_t)n,this->mssr,&(this->mssr)); break; - case PMTS_UNKNOWN: error("illegal scanner type\n"); break; + case PMTS_UNKNOWN: Pike_error("illegal scanner type\n"); break; } } else /* pmtr */ @@ -1275,7 +1275,7 @@ LOCK(this->pmird); this->table_id,(mird_size_t)n, this->mssr,&(this->mssr)); break; - case PMTS_UNKNOWN: error("illegal scanner type\n"); break; + case PMTS_UNKNOWN: Pike_error("illegal scanner type\n"); break; } } UNLOCK(this->pmird); @@ -1330,7 +1330,7 @@ static void pmts_next_key(INT32 args) case PMTS_STRINGKEY: TRY(mird_s_scan_continuation(this->mssr,&key)); break; - case PMTS_UNKNOWN: error("illegal scanner type\n"); break; + case PMTS_UNKNOWN: Pike_error("illegal scanner type\n"); break; } pop_n_elems(args); push_int( (INT_TYPE)key ); diff --git a/src/modules/Msql/msqlmod.c b/src/modules/Msql/msqlmod.c index 985e31216fcfffa30c36c0b1234d565f40c85845..6948dfa88fa53eb2473fdde2c8553d801e390804 100644 --- a/src/modules/Msql/msqlmod.c +++ b/src/modules/Msql/msqlmod.c @@ -2,7 +2,7 @@ * This code is (C) Francesco Chemolli, 1997. * You may use, modify and redistribute it freely under the terms * of the GNU General Public License, version 2. - * $Id: msqlmod.c,v 1.14 2000/07/28 07:13:45 hubbe Exp $ + * $Id: msqlmod.c,v 1.15 2000/12/01 08:10:12 hubbe Exp $ * * This version is intended for Pike/0.5 and later. * It won't compile under older versions of the Pike interpreter. @@ -35,7 +35,7 @@ #include "operators.h" #include "multiset.h" -RCSID("$Id: msqlmod.c,v 1.14 2000/07/28 07:13:45 hubbe Exp $"); +RCSID("$Id: msqlmod.c,v 1.15 2000/12/01 08:10:12 hubbe Exp $"); #include "version.h" #ifdef _REENTRANT @@ -131,7 +131,7 @@ static void do_select_db(char * dbname) { THIS->db_selected=0; report_error(); - error("Could not select database.\n"); + Pike_error("Could not select database.\n"); } THIS->db_selected=1; return; @@ -147,7 +147,7 @@ static void do_shutdown (INT32 args) pop_n_elems(args); if (!THIS->connected) - error ("Not connected to any server.\n"); + Pike_error ("Not connected to any server.\n"); THREADS_ALLOW(); MSQL_LOCK(); @@ -158,7 +158,7 @@ static void do_shutdown (INT32 args) THREADS_DISALLOW(); if (status<0) { report_error(); - error ("Error while shutting down the DBserver, connection not closed.\n"); + Pike_error ("Error while shutting down the DBserver, connection not closed.\n"); } THIS->connected=0; THIS->db_selected=0; @@ -172,7 +172,7 @@ static void do_reload_acl (INT32 args) check_all_args("Msql->reload_acl",args,0); pop_n_elems(args); if (!THIS->connected) - error ("Not connected to any server.\n"); + Pike_error ("Not connected to any server.\n"); socket=THIS->socket; THREADS_ALLOW(); @@ -182,7 +182,7 @@ static void do_reload_acl (INT32 args) THREADS_DISALLOW(); if (status<0) { report_error(); - error ("Could not reload ACLs.\n"); + Pike_error ("Could not reload ACLs.\n"); } } @@ -244,7 +244,7 @@ static void msql_mod_create (INT32 args) THIS->db_selected=0; THIS->connected=0; report_error(); - error("Error while connecting to mSQL server.\n"); + Pike_error("Error while connecting to mSQL server.\n"); } THIS->socket=sock; THIS->connected=1; @@ -263,7 +263,7 @@ static void do_list_dbs (INT32 args) check_all_args("Msql->list_dbs",args,BIT_STRING|BIT_VOID,0); if (!THIS->connected) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); if (args>0 && sp[-args].u.string->len) /* We have a glob. We should pop the arg and push it again for a later * call to glob() */ @@ -307,7 +307,7 @@ static void do_list_tables (INT32 args) check_all_args ("Msql->list_tables",args,BIT_STRING|BIT_VOID,0); if (!THIS->db_selected) - error ("No database selected.\n"); + Pike_error ("No database selected.\n"); if (args>0 && sp[-args].u.string->len) /* We have a glob. We should pop the arg and push it again for a later @@ -348,7 +348,7 @@ static void select_db(INT32 args) check_all_args("Msql->select_db",args,BIT_STRING,0); if (!THIS->connected) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); arg=sp[-args].u.string; do_select_db(arg->str); pop_n_elems(args); @@ -367,9 +367,9 @@ static void do_query (INT32 args) check_all_args("Msql->query",args,BIT_STRING,0); if (!THIS->connected) - error("Must connect to database server before querying it.\n"); + Pike_error("Must connect to database server before querying it.\n"); if (!THIS->db_selected) - error("Must select database before querying it.\n"); + Pike_error("Must select database before querying it.\n"); tmp_socket=THIS->socket; query=sp[-args].u.string->str; @@ -386,7 +386,7 @@ static void do_query (INT32 args) if (status==-1) { report_error(); - error("Error in SQL query.\n"); + Pike_error("Error in SQL query.\n"); } #ifdef MSQL_VERSION_2 @@ -411,7 +411,7 @@ static void do_query (INT32 args) duplicate_names_map = malloc (sizeof(int)*num_fields); names = malloc (sizeof(char*)*num_fields); if (!duplicate_names_map || !names) - error ("Memory exhausted.\n"); + Pike_error ("Memory exhausted.\n"); /* initialize support structure for duplicate column names */ for (j=0;j<num_fields;j++) @@ -436,7 +436,7 @@ static void do_query (INT32 args) for (j=0;j<num_fields;j++) { current_field=msqlFetchField(result); if (!current_field) - error ("Huh? Weird! Null field returned at index %d.\n",j); + Pike_error ("Huh? Weird! Null field returned at index %d.\n",j); if (duplicate_names_map[j]) { /* If we have a clashing column name we need to prepend "tablename."*/ push_text (current_field->table); @@ -486,7 +486,7 @@ static void do_info (INT32 args) check_all_args("Msql->info",args,0); pop_n_elems(args); if (!THIS->connected) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); push_text("msql/"); THREADS_ALLOW(); MSQL_LOCK(); @@ -504,17 +504,17 @@ static void do_host_info (INT32 args) check_all_args("Msql->host_info",args,0); pop_n_elems(args); if (!THIS->connected) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); /*it's local to the client library. Not even worth allowing context switches*/ push_text(msqlGetHostInfo()); return; } -/* string error() */ +/* string Pike_error() */ static void do_error (INT32 args) { - check_all_args("Msql->error",args,0); + check_all_args("Msql->Pike_error",args,0); pop_n_elems(args); if (THIS->error_msg) ref_push_string(THIS->error_msg); @@ -533,7 +533,7 @@ static void do_create_db (INT32 args) check_all_args("Msql->create_db",args,BIT_STRING,0); if (!THIS->connected) - error("Not connected.\n"); + Pike_error("Not connected.\n"); dbname = sp[-args].u.string->str; socket=THIS->socket; THREADS_ALLOW(); @@ -543,7 +543,7 @@ static void do_create_db (INT32 args) THREADS_DISALLOW(); if (dbresult==-1) { report_error(); - error ("Could not create database.\n"); + Pike_error ("Could not create database.\n"); } pop_n_elems(args); } @@ -558,7 +558,7 @@ static void do_drop_db (INT32 args) check_all_args("Msql->drop_db",args,BIT_STRING,0); if (!THIS->connected) - error("Not connected.\n"); + Pike_error("Not connected.\n"); dbname = sp[-args].u.string->str; socket=THIS->socket; THREADS_ALLOW(); @@ -568,7 +568,7 @@ static void do_drop_db (INT32 args) THREADS_DISALLOW(); if (dbresult==-1) { report_error(); - error ("Could not drop database.\n"); + Pike_error ("Could not drop database.\n"); } pop_n_elems(args); return; @@ -584,9 +584,9 @@ static void do_list_fields (INT32 args) check_all_args("Msql->list_fields",args,BIT_STRING,0); if (!THIS->connected) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); if (!THIS->db_selected) - error ("Must select a db first.\n"); + Pike_error ("Must select a db first.\n"); table=sp[-args].u.string->str; #ifdef MSQL_DEBUG printf ("list_fields: table=%s(%d)\n",sp[-args].u.string->str,sp[-args].u.string->len); @@ -601,12 +601,12 @@ static void do_list_fields (INT32 args) if (!result) { report_error(); - error ("No fields information.\n"); + Pike_error ("No fields information.\n"); } fields = msqlNumFields(result); if (!fields) - error ("No such table.\n"); + Pike_error ("No such table.\n"); for (j=0;j<fields;j++) { @@ -668,7 +668,7 @@ static void do_list_index (INT32 args) check_all_args("Msql->list_index",args,BIT_STRING,BIT_STRING,0); if (!THIS->db_selected) - error ("No database selected.\n"); + Pike_error ("No database selected.\n"); arg1=sp[-args].u.string->str; arg2=sp[1-args].u.string->str; sock=THIS->socket; @@ -751,9 +751,9 @@ void pike_module_init(void) database */ /* function(void:void|string) */ - ADD_FUNCTION("error",do_error,tFunc(tVoid,tOr(tVoid,tStr)), + ADD_FUNCTION("Pike_error",do_error,tFunc(tVoid,tOr(tVoid,tStr)), OPT_RETURN|OPT_EXTERNAL_DEPEND); - /* return the last error reported by the server. */ + /* return the last Pike_error reported by the server. */ /* function(void:string) */ ADD_FUNCTION("server_info", do_info,tFunc(tVoid,tStr), diff --git a/src/modules/Mysql/mysql.c b/src/modules/Mysql/mysql.c index 6a3114f12262d3348f5fc5e91032ed7dc5e12b17..56503bddbfacb296e188ceb65904995d2c4c0275 100644 --- a/src/modules/Mysql/mysql.c +++ b/src/modules/Mysql/mysql.c @@ -1,5 +1,5 @@ /* - * $Id: mysql.c,v 1.37 2000/08/13 14:55:14 grubba Exp $ + * $Id: mysql.c,v 1.38 2000/12/01 08:10:12 hubbe Exp $ * * SQL database functionality for Pike * @@ -34,7 +34,7 @@ #ifdef HAVE_MYSQL_MYSQL_H #include <mysql/mysql.h> #else -#error Need mysql.h header-file +#Pike_error Need mysql.h header-file #endif /* HAVE_MYSQL_MYSQL_H */ #endif /* HAVE_MYSQL_H */ #ifndef _mysql_h @@ -65,7 +65,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; #include "stralloc.h" #include "interpret.h" #include "port.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "program.h" #include "operators.h" @@ -91,7 +91,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; * Globals */ -RCSID("$Id: mysql.c,v 1.37 2000/08/13 14:55:14 grubba Exp $"); +RCSID("$Id: mysql.c,v 1.38 2000/12/01 08:10:12 hubbe Exp $"); /* **! module Mysql @@ -103,7 +103,7 @@ RCSID("$Id: mysql.c,v 1.37 2000/08/13 14:55:14 grubba Exp $"); **! see also: Mysql.mysql, Mysql.result, Sql.sql **! **! note -**! $Id: mysql.c,v 1.37 2000/08/13 14:55:14 grubba Exp $ +**! $Id: mysql.c,v 1.38 2000/12/01 08:10:12 hubbe Exp $ **! **! class mysql **! @@ -229,7 +229,7 @@ static void pike_mysql_reconnect(void) if (PIKE_MYSQL->host) { hostptr = strdup(PIKE_MYSQL->host->str); if (!hostptr) { - error("Mysql.mysql(): Out of memory!\n"); + Pike_error("Mysql.mysql(): Out of memory!\n"); } if ((portptr = strchr(hostptr, ':')) && (*portptr == ':')) { *portptr = 0; @@ -305,7 +305,7 @@ static void pike_mysql_reconnect(void) } if (!(PIKE_MYSQL->socket = socket)) { - error("Mysql.mysql(): Couldn't reconnect to SQL-server\n" + Pike_error("Mysql.mysql(): Couldn't reconnect to SQL-server\n" "%s\n", mysql_error(PIKE_MYSQL->mysql)); } @@ -332,9 +332,9 @@ static void pike_mysql_reconnect(void) MYSQL_DISALLOW(); if (strlen(database) < 1024) { - error("Mysql.mysql(): Couldn't select database \"%s\"\n", database); + Pike_error("Mysql.mysql(): Couldn't select database \"%s\"\n", database); } else { - error("Mysql.mysql(): Couldn't select database\n"); + Pike_error("Mysql.mysql(): Couldn't select database\n"); } } } @@ -365,7 +365,7 @@ static void f_create(INT32 args) { if (args >= 1) { if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql()\n"); + Pike_error("Bad argument 1 to mysql()\n"); } if (sp[-args].u.string->len) { add_ref(PIKE_MYSQL->host = sp[-args].u.string); @@ -373,7 +373,7 @@ static void f_create(INT32 args) if (args >= 2) { if (sp[1-args].type != T_STRING) { - error("Bad argument 2 to mysql()\n"); + Pike_error("Bad argument 2 to mysql()\n"); } if (sp[1-args].u.string->len) { add_ref(PIKE_MYSQL->database = sp[1-args].u.string); @@ -381,7 +381,7 @@ static void f_create(INT32 args) if (args >= 3) { if (sp[2-args].type != T_STRING) { - error("Bad argument 3 to mysql()\n"); + Pike_error("Bad argument 3 to mysql()\n"); } if (sp[2-args].u.string->len) { add_ref(PIKE_MYSQL->user = sp[2-args].u.string); @@ -389,7 +389,7 @@ static void f_create(INT32 args) if (args >= 4) { if (sp[3-args].type != T_STRING) { - error("Bad argument 4 to mysql()\n"); + Pike_error("Bad argument 4 to mysql()\n"); } if (sp[3-args].u.string->len) { add_ref(PIKE_MYSQL->password = sp[3-args].u.string); @@ -457,12 +457,12 @@ static void f_insert_id(INT32 args) } /* -**! method string error() +**! method string Pike_error() **! -**! Returns a string describing the last error from the Mysql-server. +**! Returns a string describing the last Pike_error from the Mysql-server. **! */ -/* int|string error() */ +/* int|string Pike_error() */ static void f_error(INT32 args) { MYSQL *socket; @@ -506,10 +506,10 @@ static void f_select_db(INT32 args) int tmp = -1; if (!args) { - error("Too few arguments to mysql->select_db()\n"); + Pike_error("Too few arguments to mysql->select_db()\n"); } if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->select_db()\n"); + Pike_error("Bad argument 1 to mysql->select_db()\n"); } database = sp[-args].u.string->str; @@ -541,7 +541,7 @@ static void f_select_db(INT32 args) err = mysql_error(socket); MYSQL_DISALLOW(); - error("mysql->select_db(): Couldn't select database \"%s\" (%s)\n", + Pike_error("mysql->select_db(): Couldn't select database \"%s\" (%s)\n", sp[-args].u.string->str, err); } if (PIKE_MYSQL->database) { @@ -575,10 +575,10 @@ static void f_big_query(INT32 args) int tmp = -1; if (!args) { - error("Too few arguments to mysql->big_query()\n"); + Pike_error("Too few arguments to mysql->big_query()\n"); } if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->big_query()\n"); + Pike_error("Bad argument 1 to mysql->big_query()\n"); } query = sp[-args].u.string->str; @@ -640,10 +640,10 @@ static void f_big_query(INT32 args) MYSQL_DISALLOW(); if (sp[-args].u.string->len <= 512) { - error("mysql->big_query(): Query \"%s\" failed (%s)\n", + Pike_error("mysql->big_query(): Query \"%s\" failed (%s)\n", sp[-args].u.string->str, err); } else { - error("mysql->big_query(): Query failed (%s)\n", err); + Pike_error("mysql->big_query(): Query failed (%s)\n", err); } } @@ -657,7 +657,7 @@ static void f_big_query(INT32 args) MYSQL_DISALLOW(); if (err) { - error("mysql->big_query(): Couldn't create result for query\n"); + Pike_error("mysql->big_query(): Couldn't create result for query\n"); } /* query was INSERT or similar - return 0 */ @@ -690,17 +690,17 @@ static void f_create_db(INT32 args) int tmp = -1; if (!args) { - error("Too few arguments to mysql->create_db()\n"); + Pike_error("Too few arguments to mysql->create_db()\n"); } if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->create_db()\n"); + Pike_error("Bad argument 1 to mysql->create_db()\n"); } if (sp[-args].u.string->len > 127) { if (sp[-args].u.string->len < 1024) { - error("Database name \"%s\" is too long (max 127 characters)\n", + Pike_error("Database name \"%s\" is too long (max 127 characters)\n", sp[-args].u.string->str); } else { - error("Database name (length %d) is too long (max 127 characters)\n", + Pike_error("Database name (length %d) is too long (max 127 characters)\n", sp[-args].u.string->len); } } @@ -727,7 +727,7 @@ static void f_create_db(INT32 args) } if (tmp < 0) { - error("mysql->create_db(): Creation of database \"%s\" failed\n", + Pike_error("mysql->create_db(): Creation of database \"%s\" failed\n", sp[-args].u.string->str); } @@ -753,17 +753,17 @@ static void f_drop_db(INT32 args) int tmp = -1; if (!args) { - error("Too few arguments to mysql->drop_db()\n"); + Pike_error("Too few arguments to mysql->drop_db()\n"); } if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->drop_db()\n"); + Pike_error("Bad argument 1 to mysql->drop_db()\n"); } if (sp[-args].u.string->len > 127) { if (sp[-args].u.string->len < 1024) { - error("Database name \"%s\" is too long (max 127 characters)\n", + Pike_error("Database name \"%s\" is too long (max 127 characters)\n", sp[-args].u.string->str); } else { - error("Database name (length %d) is too long (max 127 characters)\n", + Pike_error("Database name (length %d) is too long (max 127 characters)\n", sp[-args].u.string->len); } } @@ -790,7 +790,7 @@ static void f_drop_db(INT32 args) } if (tmp < 0) { - error("mysql->drop_db(): Drop of database \"%s\" failed\n", + Pike_error("mysql->drop_db(): Drop of database \"%s\" failed\n", sp[-args].u.string->str); } @@ -834,7 +834,7 @@ static void f_shutdown(INT32 args) } if (tmp < 0) { - error("mysql->shutdown(): Shutdown failed\n"); + Pike_error("mysql->shutdown(): Shutdown failed\n"); } pop_n_elems(args); @@ -876,7 +876,7 @@ static void f_reload(INT32 args) } if (tmp < 0) { - error("mysql->reload(): Reload failed\n"); + Pike_error("mysql->reload(): Reload failed\n"); } pop_n_elems(args); @@ -1040,14 +1040,14 @@ static void f_list_dbs(INT32 args) if (args) { if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->list_dbs()\n"); + Pike_error("Bad argument 1 to mysql->list_dbs()\n"); } if (sp[-args].u.string->len > 80) { if (sp[-args].u.string->len < 1024) { - error("Wildcard \"%s\" is too long (max 80 characters)\n", + Pike_error("Wildcard \"%s\" is too long (max 80 characters)\n", sp[-args].u.string->str); } else { - error("Wildcard (length %d) is too long (max 80 characters)\n", + Pike_error("Wildcard (length %d) is too long (max 80 characters)\n", sp[-args].u.string->len); } } @@ -1083,7 +1083,7 @@ static void f_list_dbs(INT32 args) MYSQL_DISALLOW(); - error("mysql->list_dbs(): Cannot list databases: %s\n", err); + Pike_error("mysql->list_dbs(): Cannot list databases: %s\n", err); } pop_n_elems(args); @@ -1116,14 +1116,14 @@ static void f_list_tables(INT32 args) if (args) { if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->list_tables()\n"); + Pike_error("Bad argument 1 to mysql->list_tables()\n"); } if (sp[-args].u.string->len > 80) { if (sp[-args].u.string->len < 1024) { - error("Wildcard \"%s\" is too long (max 80 characters)\n", + Pike_error("Wildcard \"%s\" is too long (max 80 characters)\n", sp[-args].u.string->str); } else { - error("Wildcard (length %d) is too long (max 80 characters)\n", + Pike_error("Wildcard (length %d) is too long (max 80 characters)\n", sp[-args].u.string->len); } } @@ -1159,7 +1159,7 @@ static void f_list_tables(INT32 args) MYSQL_DISALLOW(); - error("mysql->list_tables(): Cannot list databases: %s\n", err); + Pike_error("mysql->list_tables(): Cannot list databases: %s\n", err); } pop_n_elems(args); @@ -1224,34 +1224,34 @@ static void f_list_fields(INT32 args) char *wild = NULL; if (!args) { - error("Too few arguments to mysql->list_fields()\n"); + Pike_error("Too few arguments to mysql->list_fields()\n"); } if (sp[-args].type != T_STRING) { - error("Bad argument 1 to mysql->list_fields()\n"); + Pike_error("Bad argument 1 to mysql->list_fields()\n"); } if (sp[-args].u.string->len > 125) { if (sp[-args].u.string->len < 1024) { - error("Table name \"%s\" is too long (max 125 characters)\n", + Pike_error("Table name \"%s\" is too long (max 125 characters)\n", sp[-args].u.string->str); } else { - error("Table name (length %d) is too long (max 125 characters)\n", + Pike_error("Table name (length %d) is too long (max 125 characters)\n", sp[-args].u.string->len); } } table = sp[-args].u.string->str; if (args > 1) { if (sp[-args+1].type != T_STRING) { - error("Bad argument 2 to mysql->list_fields()\n"); + Pike_error("Bad argument 2 to mysql->list_fields()\n"); } if (sp[-args+1].u.string->len + sp[-args].u.string->len > 125) { /* The length of the table name has already been checked. */ if (sp[-args+1].u.string->len < 1024) { - error("Wildcard \"%s\" + table name \"%s\" is too long " + Pike_error("Wildcard \"%s\" + table name \"%s\" is too long " "(max 125 characters)\n", sp[-args+1].u.string->str, sp[-args].u.string->str); } else { - error("Wildcard (length %d) + table name \"%s\" is too long " + Pike_error("Wildcard (length %d) + table name \"%s\" is too long " "(max 125 characters)\n", sp[-args+1].u.string->len, sp[-args].u.string->str); } @@ -1288,7 +1288,7 @@ static void f_list_fields(INT32 args) MYSQL_DISALLOW(); - error("mysql->list_fields(): Cannot list databases: %s\n", err); + Pike_error("mysql->list_fields(): Cannot list databases: %s\n", err); } pop_n_elems(args); @@ -1349,7 +1349,7 @@ static void f_list_processes(INT32 args) MYSQL_DISALLOW(); - error("mysql->list_processes(): Cannot list databases: %s\n", err); + Pike_error("mysql->list_processes(): Cannot list databases: %s\n", err); } ref_push_object(Pike_fp->current_object); @@ -1413,7 +1413,7 @@ void pike_module_init(void) ADD_STORAGE(struct precompiled_mysql); /* function(void:int|string) */ - ADD_FUNCTION("error", f_error,tFunc(tVoid,tOr(tInt,tStr)), ID_PUBLIC); + ADD_FUNCTION("Pike_error", f_error,tFunc(tVoid,tOr(tInt,tStr)), ID_PUBLIC); /* function(string|void, string|void, string|void, string|void:void) */ ADD_FUNCTION("create", f_create,tFunc(tOr(tStr,tVoid) tOr(tStr,tVoid) tOr(tStr,tVoid) tOr(tStr,tVoid),tVoid), ID_PUBLIC); /* function(void:int) */ diff --git a/src/modules/Mysql/precompiled_mysql.h b/src/modules/Mysql/precompiled_mysql.h index ef6a976db41459978b03660765e84a550569c9e9..446868072c486b3f2a91f419e6eb0d4d1fa56299 100644 --- a/src/modules/Mysql/precompiled_mysql.h +++ b/src/modules/Mysql/precompiled_mysql.h @@ -1,5 +1,5 @@ /* - * $Id: precompiled_mysql.h,v 1.9 2000/08/04 20:14:26 grubba Exp $ + * $Id: precompiled_mysql.h,v 1.10 2000/12/01 08:10:13 hubbe Exp $ * * SQL database connectivity for Pike * @@ -32,7 +32,7 @@ #ifdef HAVE_MYSQL_MYSQL_H #include <mysql/mysql.h> #else -#error Need mysql.h header-file +#Pike_error Need mysql.h header-file #endif /* HAVE_MYSQL_MYSQL_H */ #endif /* HAVE_MYSQL_H */ #ifndef _mysql_h diff --git a/src/modules/Mysql/result.c b/src/modules/Mysql/result.c index 46b05f764ef1ffb75d94bace9010b7152a70048e..748960e888835d2b2f4dbe8ce00875bb9ebcf867 100644 --- a/src/modules/Mysql/result.c +++ b/src/modules/Mysql/result.c @@ -1,5 +1,5 @@ /* - * $Id: result.c,v 1.16 2000/03/22 23:42:39 grubba Exp $ + * $Id: result.c,v 1.17 2000/12/01 08:10:13 hubbe Exp $ * * mysql query result * @@ -32,7 +32,7 @@ #ifdef HAVE_MYSQL_MYSQL_H #include <mysql/mysql.h> #else -#error Need mysql.h header-file +#Pike_error Need mysql.h header-file #endif /* HAVE_MYSQL_MYSQL_H */ #endif /* HAVE_MYSQL_H */ #ifndef _mysql_h @@ -53,7 +53,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; #include "program.h" #include "stralloc.h" #include "interpret.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "las.h" #include "threads.h" @@ -83,7 +83,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; * Globals */ -RCSID("$Id: result.c,v 1.16 2000/03/22 23:42:39 grubba Exp $"); +RCSID("$Id: result.c,v 1.17 2000/12/01 08:10:13 hubbe Exp $"); struct program *mysql_result_program = NULL; @@ -211,7 +211,7 @@ void mysqlmod_parse_field(MYSQL_FIELD *field, int support_default) } } else { /* - * Should this be an error? + * Should this be an Pike_error? */ push_int(0); } @@ -227,12 +227,12 @@ static void f_create(INT32 args) struct precompiled_mysql *mysql; if (!args) { - error("Too few arguments to mysql_result()\n"); + Pike_error("Too few arguments to mysql_result()\n"); } if ((sp[-args].type != T_OBJECT) || (!(mysql = (struct precompiled_mysql *)get_storage(sp[-args].u.object, mysql_program)))) { - error("Bad argument 1 to mysql_result()\n"); + Pike_error("Bad argument 1 to mysql_result()\n"); } add_ref(PIKE_MYSQL_RES->connection = sp[-args].u.object); @@ -242,7 +242,7 @@ static void f_create(INT32 args) pop_n_elems(args); if (!PIKE_MYSQL_RES->result) { - error("mysql_result(): No result to clone\n"); + Pike_error("mysql_result(): No result to clone\n"); } } @@ -266,10 +266,10 @@ static void f_num_fields(INT32 args) static void f_field_seek(INT32 args) { if (!args) { - error("Too few arguments to mysql->field_seek()\n"); + Pike_error("Too few arguments to mysql->field_seek()\n"); } if (sp[-args].type != T_INT) { - error("Bad argument 1 to mysql->field_seek()\n"); + Pike_error("Bad argument 1 to mysql->field_seek()\n"); } mysql_field_seek(PIKE_MYSQL_RES->result, sp[-args].u.integer); pop_n_elems(args); @@ -326,13 +326,13 @@ static void f_fetch_fields(INT32 args) static void f_seek(INT32 args) { if (!args) { - error("Too few arguments to mysql_result->seek()\n"); + Pike_error("Too few arguments to mysql_result->seek()\n"); } if (sp[-args].type != T_INT) { - error("Bad argument 1 to mysql_result->seek()\n"); + Pike_error("Bad argument 1 to mysql_result->seek()\n"); } if (sp[-args].u.integer < 0) { - error("Negative argument 1 to mysql_result->seek()\n"); + Pike_error("Negative argument 1 to mysql_result->seek()\n"); } mysql_data_seek(PIKE_MYSQL_RES->result, sp[-args].u.integer); diff --git a/src/modules/Odbc/odbc.c b/src/modules/Odbc/odbc.c index b82602862fbda23fd8383e09a28a7d42a68870cb..b5a84af843d2aa4b042cc41f9c3541093200c1dd 100644 --- a/src/modules/Odbc/odbc.c +++ b/src/modules/Odbc/odbc.c @@ -1,5 +1,5 @@ /* - * $Id: odbc.c,v 1.22 2000/09/02 09:52:06 grubba Exp $ + * $Id: odbc.c,v 1.23 2000/12/01 08:10:14 hubbe Exp $ * * Pike interface to ODBC compliant databases. * @@ -16,7 +16,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -RCSID("$Id: odbc.c,v 1.22 2000/09/02 09:52:06 grubba Exp $"); +RCSID("$Id: odbc.c,v 1.23 2000/12/01 08:10:14 hubbe Exp $"); #include "interpret.h" #include "object.h" @@ -92,27 +92,27 @@ void odbc_error(const char *fun, const char *msg, switch(_code) { case SQL_SUCCESS: case SQL_SUCCESS_WITH_INFO: - error("%s(): %s:\n" + Pike_error("%s(): %s:\n" "%d:%s:%s\n", fun, msg, code, errcode, errmsg); break; case SQL_ERROR: - error("%s(): %s:\n" + Pike_error("%s(): %s:\n" "SQLError failed (%d:SQL_ERROR)\n", fun, msg, code); break; case SQL_NO_DATA_FOUND: - error("%s(): %s:\n" + Pike_error("%s(): %s:\n" "SQLError failed (%d:SQL_NO_DATA_FOUND)\n", fun, msg, code); break; case SQL_INVALID_HANDLE: - error("%s(): %s:\n" + Pike_error("%s(): %s:\n" "SQLError failed (%d:SQL_INVALID_HANDLE)\n", fun, msg, code); break; default: - error("%s(): %s:\n" + Pike_error("%s(): %s:\n" "SQLError failed (%d:%d)\n", fun, msg, code, _code); break; @@ -295,7 +295,7 @@ static void f_big_query(INT32 args) apply(sp[-2].u.object, "execute", 1); if (sp[-1].type != T_INT) { - error("odbc->big_query(): Unexpected return value from " + Pike_error("odbc->big_query(): Unexpected return value from " "odbc_result->execute().\n"); } @@ -312,7 +312,7 @@ static void f_big_query(INT32 args) } #ifdef PIKE_DEBUG if (sp != save_sp) { - fatal("Stack error in odbc->big_query().\n"); + fatal("Stack Pike_error in odbc->big_query().\n"); } #endif /* PIKE_DEBUG */ } @@ -352,14 +352,14 @@ void pike_module_init(void) if (err != SQL_SUCCESS) { odbc_henv = SQL_NULL_HENV; return; - /* error("odbc_module_init(): SQLAllocEnv() failed with code %08x\n", err); */ + /* Pike_error("odbc_module_init(): SQLAllocEnv() failed with code %08x\n", err); */ } start_new_program(); ADD_STORAGE(struct precompiled_odbc); /* function(void:int|string) */ - ADD_FUNCTION("error", f_error,tFunc(tVoid,tOr(tInt,tStr)), ID_PUBLIC); + ADD_FUNCTION("Pike_error", f_error,tFunc(tVoid,tOr(tInt,tStr)), ID_PUBLIC); /* function(string|void, string|void, string|void, string|void:void) */ ADD_FUNCTION("create", f_create,tFunc(tOr(tStr,tVoid) tOr(tStr,tVoid) tOr(tStr,tVoid) tOr(tStr,tVoid),tVoid), ID_PUBLIC); @@ -428,7 +428,7 @@ void pike_module_exit(void) odbc_henv = SQL_NULL_HENV; if ((err != SQL_SUCCESS) && (err != SQL_SUCCESS_WITH_INFO)) { - error("odbc_module_exit(): SQLFreeEnv() failed with code %08x\n", err); + Pike_error("odbc_module_exit(): SQLFreeEnv() failed with code %08x\n", err); } } #endif /* HAVE_ODBC */ diff --git a/src/modules/Odbc/odbc_result.c b/src/modules/Odbc/odbc_result.c index bb055c9e3b0996e3c58b117195218b7319bbbd4d..b485a421eaf7a7f7bbc733b59ca6ceebfa6ea3b2 100644 --- a/src/modules/Odbc/odbc_result.c +++ b/src/modules/Odbc/odbc_result.c @@ -1,5 +1,5 @@ /* - * $Id: odbc_result.c,v 1.23 2000/09/08 15:57:28 grubba Exp $ + * $Id: odbc_result.c,v 1.24 2000/12/01 08:10:15 hubbe Exp $ * * Pike interface to ODBC compliant databases * @@ -16,7 +16,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -RCSID("$Id: odbc_result.c,v 1.23 2000/09/08 15:57:28 grubba Exp $"); +RCSID("$Id: odbc_result.c,v 1.24 2000/12/01 08:10:15 hubbe Exp $"); #include "interpret.h" #include "object.h" @@ -129,7 +129,7 @@ static void odbc_fix_fields(void) unsigned char *buf = alloca(buf_size); if ((!buf)||(!odbc_field_types)) { - error("odbc_fix_fields(): Out of memory\n"); + Pike_error("odbc_fix_fields(): Out of memory\n"); } /* @@ -158,7 +158,7 @@ static void odbc_fix_fields(void) buf_size *= 2; } while (name_len >= (ptrdiff_t)buf_size); if (!(buf = alloca(buf_size))) { - error("odbc_fix_fields(): Out of memory\n"); + Pike_error("odbc_fix_fields(): Out of memory\n"); } } #ifdef ODBC_DEBUG @@ -283,13 +283,13 @@ static void f_create(INT32 args) HSTMT hstmt = SQL_NULL_HSTMT; if (!args) { - error("Too few arguments to odbc_result()\n"); + Pike_error("Too few arguments to odbc_result()\n"); } if ((sp[-args].type != T_OBJECT) || (!(PIKE_ODBC_RES->odbc = (struct precompiled_odbc *)get_storage(sp[-args].u.object, odbc_program)))) { - error("Bad argument 1 to odbc_result()\n"); + Pike_error("Bad argument 1 to odbc_result()\n"); } add_ref(PIKE_ODBC_RES->obj = sp[-args].u.object); @@ -427,13 +427,13 @@ static void f_fetch_row(INT32 args) /* int eof() */ static void f_eof(INT32 args) { - error("odbc->eof(): Not implemented yet!\n"); + Pike_error("odbc->eof(): Not implemented yet!\n"); } /* void seek() */ static void f_seek(INT32 args) { - error("odbc->seek(): Not implemented yet!\n"); + Pike_error("odbc->seek(): Not implemented yet!\n"); } /* diff --git a/src/modules/Oracle/oracle.c b/src/modules/Oracle/oracle.c index 8db83dc81f905b8f6e87a50a6d69dd9c46753598..aa4c2ef2704f3ccdac762249f8ba451d2aee78a1 100644 --- a/src/modules/Oracle/oracle.c +++ b/src/modules/Oracle/oracle.c @@ -1,5 +1,5 @@ /* - * $Id: oracle.c,v 1.50 2000/11/23 16:32:33 stewa Exp $ + * $Id: oracle.c,v 1.51 2000/12/01 08:10:15 hubbe Exp $ * * Pike interface to Oracle databases. * @@ -53,7 +53,7 @@ #include <math.h> -RCSID("$Id: oracle.c,v 1.50 2000/11/23 16:32:33 stewa Exp $"); +RCSID("$Id: oracle.c,v 1.51 2000/12/01 08:10:15 hubbe Exp $"); #define BLOB_FETCH_CHUNK 16384 @@ -202,7 +202,7 @@ void *parent_storage(int depth) o=Pike_fp->current_object; if(!o) - error("Current object is destructed\n"); + Pike_error("Current object is destructed\n"); while(1) { @@ -314,7 +314,7 @@ static OCIEnv *get_oracle_environment(void) { rc=OCIEnvInit(&oracle_environment, OCI_DEFAULT, 0, 0); if(rc != OCI_SUCCESS) - error("Failed to initialize oracle environment.\n"); + Pike_error("Failed to initialize oracle environment.\n"); } return oracle_environment; } @@ -520,7 +520,7 @@ static void gc_dbresultinfo_struct(struct object *o) static void protect_dbresultinfo(INT32 args) { - error("You may not change variables in dbresultinfo objects.\n"); + Pike_error("You may not change variables in dbresultinfo objects.\n"); } /****** dbdate ******/ @@ -573,9 +573,9 @@ static void ora_error_handler(OCIError *err, sword rc, char *func) OCIErrorGet(err,1,0,&errcode,msgbuf,sizeof(msgbuf),OCI_HTYPE_ERROR); if(func) - error("%s:code=%d:%s",func,rc,msgbuf); + Pike_error("%s:code=%d:%s",func,rc,msgbuf); else - error("Oracle:code=%d:%s",rc,msgbuf); + Pike_error("Oracle:code=%d:%s",rc,msgbuf); } @@ -591,7 +591,7 @@ OCIError *get_global_error_handle(void) 0); if(rc != OCI_SUCCESS) - error("Failed to allocate error handle.\n"); + Pike_error("Failed to allocate Pike_error handle.\n"); return global_error_handle; } @@ -995,7 +995,7 @@ static void push_inout_value(struct inout *inout) break; default: - error("Unknown data type.\n"); + Pike_error("Unknown data type.\n"); break; } return; @@ -1042,7 +1042,7 @@ static void push_inout_value(struct inout *inout) break; default: - error("Unknown data type.\n"); + Pike_error("Unknown data type.\n"); break; } free_inout(inout); @@ -1166,11 +1166,11 @@ static void f_oracle_create(INT32 args) #if 0 if(OCIHandleAlloc(get_oracle_environment(),&THIS_DBCON->srvhp, OCI_HTYPE_SERVER, 0,0)!=OCI_SUCCESS) - error("Failed to allocate server handle.\n"); + Pike_error("Failed to allocate server handle.\n"); if(OCIHandleAlloc(get_oracle_environment(),&THIS_DBCON->srchp, OCI_HTYPE_SVCCTX, 0,0)!=OCI_SUCCESS) - error("Failed to allocate service context.\n"); + Pike_error("Failed to allocate service context.\n"); #endif @@ -1414,7 +1414,7 @@ static void f_big_query_create(INT32 args) } if(bnds && m_sizeof(bnds) > MAX_NUMBER_OF_BINDINGS) - error("Too many variables.\n"); + Pike_error("Too many variables.\n"); destruct_objects_to_destruct(); @@ -1429,7 +1429,7 @@ static void f_big_query_create(INT32 args) PARENTOF(PARENTOF(THISOBJ)) != new_parent) { if(new_parent->prog != PARENTOF(PARENTOF(THISOBJ))->parent->prog) - error("Bad argument 3 to big_query.\n"); + Pike_error("Bad argument 3 to big_query.\n"); /* We might need to check that there are no locks held here * but I don't beleive that could happen, so just go with it... @@ -1488,7 +1488,7 @@ static void f_big_query_create(INT32 args) value=& ((struct dbnull *)STORAGE(value->u.object))->type; goto retry; } - error("Bad value type in argument 2 to " + Pike_error("Bad value type in argument 2 to " "Oracle.oracle->big_query()\n"); break; @@ -1533,7 +1533,7 @@ static void f_big_query_create(INT32 args) } default: - error("Bad value type in argument 2 to " + Pike_error("Bad value type in argument 2 to " "Oracle.oracle->big_query()\n"); } @@ -1581,7 +1581,7 @@ static void f_big_query_create(INT32 args) } else { - error("Bad index type in argument 2 to " + Pike_error("Bad index type in argument 2 to " "Oracle.oracle->big_query()\n"); } if(rc) @@ -1764,12 +1764,12 @@ static void dbdate_cast(INT32 args) dbdate_sprintf(args); return; } - error("Cannot cast Oracle.Date to %s\n",s); + Pike_error("Cannot cast Oracle.Date to %s\n",s); } static void dbnull_create(INT32 args) { - if(args<1) error("Too few arguments to Oracle.NULL->create\n"); + if(args<1) Pike_error("Too few arguments to Oracle.NULL->create\n"); assign_svalue(& THIS_DBNULL->type, Pike_sp-args); } diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index 9387114ed365b86938962c811429511b4523e454..45e65c67bbbd0c31df6fb2b4d3205db37d0eabd2 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -8,7 +8,7 @@ #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "operators.h" #include "builtin_functions.h" #include "module_support.h" @@ -589,7 +589,7 @@ static void save_subparse_state (struct parser_html_storage *this, save->out_ctx = this->out_ctx; if (!this->cond_out) { struct out_piece *ph = malloc (sizeof (struct out_piece)); - if (!ph) error ("Parser.HTML: Out of memory.\n"); + if (!ph) Pike_error ("Parser.HTML: Out of memory.\n"); ph->v.type = T_INT; ph->next = NULL; this->cond_out = this->cond_out_end = ph; @@ -723,7 +723,7 @@ static void unwind_subparse_state (struct subparse_save *save) static void html__set_tag_callback(INT32 args) { - if (!args) error("_set_tag_callback: too few arguments\n"); + if (!args) Pike_error("_set_tag_callback: too few arguments\n"); dmalloc_touch_svalue(sp-args); assign_svalue(&(THIS->callback__tag),sp-args); pop_n_elems(args); @@ -732,7 +732,7 @@ static void html__set_tag_callback(INT32 args) static void html__set_data_callback(INT32 args) { - if (!args) error("_set_data_callback: too few arguments\n"); + if (!args) Pike_error("_set_data_callback: too few arguments\n"); dmalloc_touch_svalue(sp-args); assign_svalue(&(THIS->callback__data),sp-args); pop_n_elems(args); @@ -741,7 +741,7 @@ static void html__set_data_callback(INT32 args) static void html__set_entity_callback(INT32 args) { - if (!args) error("_set_entity_callback: too few arguments\n"); + if (!args) Pike_error("_set_entity_callback: too few arguments\n"); dmalloc_touch_svalue(sp-args); assign_svalue(&(THIS->callback__entity),sp-args); pop_n_elems(args); @@ -1247,7 +1247,7 @@ static void put_out_feed(struct parser_html_storage *this, f=malloc(sizeof(struct out_piece)); if (!f) - error("Parser.HTML(): out of memory\n"); + Pike_error("Parser.HTML(): out of memory\n"); assign_svalue_no_free(&f->v,v); f->next=NULL; @@ -1301,7 +1301,7 @@ static void put_out_feed_range(struct parser_html_storage *this, c_head=0; head=head->next; } - fatal("internal error: tail not found in feed (put_out_feed_range)\n"); + fatal("internal Pike_error: tail not found in feed (put_out_feed_range)\n"); } /* ------------------------ */ @@ -1343,7 +1343,7 @@ static INLINE void push_feed_range(struct piece *head, head=head->next; } if (!head) - fatal("internal error: tail not found in feed (push_feed_range)\n"); + fatal("internal Pike_error: tail not found in feed (push_feed_range)\n"); if (!n) ref_push_string(empty_string); else if (n>1) @@ -1457,7 +1457,7 @@ static INLINE void skip_piece_range(struct location *loc, } break; default: - error("unknown width of string\n"); + Pike_error("unknown width of string\n"); } loc->byteno=b; } @@ -1605,7 +1605,7 @@ static int scan_forward(struct piece *feed, } break; default: - error("unknown width of string\n"); + Pike_error("unknown width of string\n"); } if (!feed->next) break; c=0; @@ -1674,7 +1674,7 @@ static int scan_forward(struct piece *feed, } break; default: - error("unknown width of string\n"); + Pike_error("unknown width of string\n"); } if (!feed->next) break; c=0; @@ -1757,7 +1757,7 @@ static int scan_for_string (struct parser_html_storage *this, case 0: LOOP (p_wchar0); break; case 1: LOOP (p_wchar1); break; case 2: LOOP (p_wchar2); break; - default: error ("Unknown width of string.\n"); + default: Pike_error ("Unknown width of string.\n"); } #undef LOOP @@ -2189,7 +2189,7 @@ static int quote_tag_lookup (struct parser_html_storage *this, case 0: LOOP (p_wchar0); break; case 1: LOOP (p_wchar1); break; case 2: LOOP (p_wchar2); break; - default: error ("Unknown width of string.\n"); + default: Pike_error ("Unknown width of string.\n"); } #undef LOOP @@ -2223,13 +2223,13 @@ static INLINE void add_local_feed (struct parser_html_storage *this, { struct feed_stack *new = malloc(sizeof(struct feed_stack)); if (!new) - error("out of memory\n"); + Pike_error("out of memory\n"); new->local_feed=malloc(sizeof(struct piece)); if (!new->local_feed) { free(new); - error("out of memory\n"); + Pike_error("out of memory\n"); } copy_shared_string(new->local_feed->s,str); @@ -2311,7 +2311,7 @@ static newstate handle_result(struct parser_html_storage *this, pop_stack(); return STATE_REPARSE; } - error("Parser.HTML: illegal result from callback: %d, " + Pike_error("Parser.HTML: illegal result from callback: %d, " "not 0 (skip) or 1 (wait)\n", sp[-1].u.integer); @@ -2321,7 +2321,7 @@ static newstate handle_result(struct parser_html_storage *this, { if (!(THIS->flags & FLAG_MIXED_MODE) && sp[-1].u.array->item[i].type!=T_STRING) - error("Parser.HTML: illegal result from callback: element in array not string\n"); + Pike_error("Parser.HTML: illegal result from callback: element in array not string\n"); push_svalue(sp[-1].u.array->item+i); put_out_feed(this,sp-1,0); pop_stack(); @@ -2333,7 +2333,7 @@ static newstate handle_result(struct parser_html_storage *this, return STATE_DONE; /* continue */ default: - error("Parser.HTML: illegal result from callback: not 0, string or array(string)\n"); + Pike_error("Parser.HTML: illegal result from callback: not 0, string or array(string)\n"); } /* NOT_REACHED */ return STATE_DONE; @@ -2418,7 +2418,7 @@ static newstate entity_callback(struct parser_html_storage *this, break; } default: - error("Parser.HTML: illegal type found " + Pike_error("Parser.HTML: illegal type found " "when trying to call entity callback\n"); } @@ -2485,7 +2485,7 @@ static newstate tag_callback(struct parser_html_storage *this, break; } default: - error("Parser.HTML: illegal type found " + Pike_error("Parser.HTML: illegal type found " "when trying to call tag callback\n"); } @@ -2556,7 +2556,7 @@ static newstate container_callback(struct parser_html_storage *this, break; } default: - error("Parser.HTML: illegal type found " + Pike_error("Parser.HTML: illegal type found " "when trying to call container callback\n"); } @@ -2628,7 +2628,7 @@ static newstate quote_tag_callback(struct parser_html_storage *this, break; } default: - error("Parser.HTML: illegal type found " + Pike_error("Parser.HTML: illegal type found " "when trying to call quote tag callback\n"); } @@ -3711,7 +3711,7 @@ static void try_feed(int finished) case STATE_REREAD: /* reread stack head */ if (THIS->stack_count>THIS->max_stack_depth) - error("Parser.HTML: too deep recursion\n"); + Pike_error("Parser.HTML: too deep recursion\n"); break; } } @@ -3728,7 +3728,7 @@ static void low_feed(struct pike_string *ps) f=malloc(sizeof(struct piece)); if (!f) - error("feed: out of memory\n"); + Pike_error("feed: out of memory\n"); copy_shared_string(f->s,ps); f->next=NULL; @@ -3863,7 +3863,7 @@ static void html_read(INT32 args) if (sp[-args].type==T_INT) n=sp[-args].u.integer; else - error("read: illegal argument\n"); + Pike_error("read: illegal argument\n"); } pop_n_elems(args); @@ -3901,7 +3901,7 @@ static void html_read(INT32 args) struct out_piece *z; if (THIS->out->v.type != T_STRING) - error("Parser.HTML: Got nonstring in parsed data\n"); + Pike_error("Parser.HTML: Got nonstring in parsed data\n"); if (THIS->out->v.u.string->len>n) { @@ -3950,7 +3950,7 @@ void html_write_out(INT32 args) for (i = args; i; i--) { if (!(THIS->flags & FLAG_MIXED_MODE) && sp[-i].type!=T_STRING) - error("write_out: not a string argument\n"); + Pike_error("write_out: not a string argument\n"); put_out_feed(THIS,sp-i,1); } pop_n_elems(args); @@ -4234,7 +4234,7 @@ static void html_tag_name(INT32 args) /* get rid of arguments */ pop_n_elems(args); - if (!THIS->start) error ("Parser.HTML: There's no current range.\n"); + if (!THIS->start) Pike_error ("Parser.HTML: There's no current range.\n"); switch (THIS->type) { case TYPE_TAG: case TYPE_CONT: @@ -4282,7 +4282,7 @@ static void html_tag_args(INT32 args) if (args) assign_svalue_no_free(&def,sp-args); pop_n_elems(args); - if (!THIS->start) error ("Parser.HTML: There's no current range.\n"); + if (!THIS->start) Pike_error ("Parser.HTML: There's no current range.\n"); switch (THIS->type) { case TYPE_TAG: @@ -4306,7 +4306,7 @@ static void html_tag_content(INT32 args) pop_n_elems(args); - if (!THIS->start) error ("Parser.HTML: There's no current range.\n"); + if (!THIS->start) Pike_error ("Parser.HTML: There's no current range.\n"); if (THIS->flags & FLAG_WS_BEFORE_TAG_NAME && !scan_forward (beg, cbeg, &beg, &cbeg, THIS->ws, -THIS->n_ws)) { diff --git a/src/modules/Parser/parser.c b/src/modules/Parser/parser.c index 17ad108b069b9757a4f743c7ac2c5c66ef5f57b6..284f6bab871f6da83b3828c1501c9dcaa54b7263 100644 --- a/src/modules/Parser/parser.c +++ b/src/modules/Parser/parser.c @@ -1,7 +1,7 @@ #include "global.h" #include "stralloc.h" #include "global.h" -RCSID("$Id: parser.c,v 1.10 2000/08/17 18:21:59 grubba Exp $"); +RCSID("$Id: parser.c,v 1.11 2000/12/01 08:10:18 hubbe Exp $"); #include "pike_macros.h" #include "interpret.h" #include "program.h" @@ -99,9 +99,9 @@ static void parser_magic_index(INT32 args) int i; if (args!=1) - error("Parser.`[]: Too few or too many arguments\n"); + Pike_error("Parser.`[]: Too few or too many arguments\n"); if (sp[-1].type!=T_STRING) - error("Parser.`[]: Illegal type of argument\n"); + Pike_error("Parser.`[]: Illegal type of argument\n"); for (i=0; i<(int)NELEM(submagic)-1; i++) if (sp[-1].u.string==submagic[i].ps) diff --git a/src/modules/Perl/perlmod.c b/src/modules/Perl/perlmod.c index 151ca8d020581974d0a84609e90fd74cef47e07d..d3c87ee3d7ed07f2532810c6cd28a15a4181fd31 100644 --- a/src/modules/Perl/perlmod.c +++ b/src/modules/Perl/perlmod.c @@ -1,4 +1,4 @@ -/* $Id: perlmod.c,v 1.21 2000/10/12 10:45:25 grubba Exp $ */ +/* $Id: perlmod.c,v 1.22 2000/12/01 08:10:18 hubbe Exp $ */ #define NO_PIKE_SHORTHAND @@ -24,7 +24,7 @@ #include <perl.h> #ifdef USE_THREADS -/* #error Threaded Perl not supported. */ +/* #Pike_error Threaded Perl not supported. */ #endif #define MY_XS 1 @@ -105,7 +105,7 @@ static SV * _pikev2sv(struct svalue *s) if (s->u.string->size_shift) break; return newSVpv(s->u.string->str, s->u.string->len); break; } - error("Unsupported value type.\n"); + Pike_error("Unsupported value type.\n"); return 0; } @@ -155,11 +155,11 @@ static int _perl_parse(struct perlmod_storage *ps, #endif if (!ps) - error("Internal error: no Perl storage allocated.\n"); + Pike_error("Internal Pike_error: no Perl storage allocated.\n"); if (!ps->perl) - error("Internal error: no Perl interpreter allocated.\n"); + Pike_error("Internal Pike_error: no Perl interpreter allocated.\n"); if (!ps->constructed) - error("Internal error: Perl interpreter not constructed.\n"); + Pike_error("Internal Pike_error: Perl interpreter not constructed.\n"); if (!envp && !ps->env) { /* Copy environment data, since Perl may wish to modify it. */ @@ -228,7 +228,7 @@ static void init_perl_glue(struct object *o) #ifdef PIKE_PERLDEBUG fprintf(stderr,"num_perl_interpreters=%d\n",num_perl_interpreters); #endif - /* error("Perl: There can be only one!\n"); */ + /* Pike_error("Perl: There can be only one!\n"); */ return; } #endif @@ -314,8 +314,8 @@ static void perlmod_create(INT32 args) #endif #endif - if (args != 0) error("Perl->create takes no arguments."); - if (!ps || !ps->perl) error("No perl interpreter available.\n"); + if (args != 0) Pike_error("Perl->create takes no arguments."); + if (!ps || !ps->perl) Pike_error("No perl interpreter available.\n"); MT_PERMIT; if(!ps->constructed) @@ -345,7 +345,7 @@ static void perlmod_parse(INT32 args) #endif check_all_args("Perl->parse",args,BIT_ARRAY, BIT_MAPPING|BIT_VOID, 0); - if(!ps->perl) error("No perl interpreter available.\n"); + if(!ps->perl) Pike_error("No perl interpreter available.\n"); switch(args) { @@ -354,9 +354,9 @@ static void perlmod_parse(INT32 args) mapping_fix_type_field(env_mapping); if(m_ind_types(env_mapping) & ~BIT_STRING) - error("Bad argument 2 to Perl->create().\n"); + Pike_error("Bad argument 2 to Perl->create().\n"); if(m_val_types(env_mapping) & ~BIT_STRING) - error("Bad argument 2 to Perl->create().\n"); + Pike_error("Bad argument 2 to Perl->create().\n"); case 1: if (_THIS->argv_strings || _THIS->env_block) @@ -369,10 +369,10 @@ static void perlmod_parse(INT32 args) array_fix_type_field(ps->argv_strings); if(ps->argv_strings->size<2) - error("Perl: Too few elements in argv array.\n"); + Pike_error("Perl: Too few elements in argv array.\n"); if(ps->argv_strings->type_field & ~BIT_STRING) - error("Bad argument 1 to Perl->parse().\n"); + Pike_error("Bad argument 1 to Perl->parse().\n"); } ps->argv=(char **)xalloc(sizeof(char *)*ps->argv_strings->size); @@ -421,11 +421,11 @@ static void perlmod_run(INT32 args) INT32 i; struct perlmod_storage *ps = _THIS; - if(!ps->perl) error("No perl interpreter available.\n"); + if(!ps->perl) Pike_error("No perl interpreter available.\n"); pop_n_elems(args); if(!_THIS->constructed || !_THIS->parsed) - error("No Perl program loaded (run() called before parse()).\n"); + Pike_error("No Perl program loaded (run() called before parse()).\n"); MT_PERMIT; i=perl_run(ps->perl); @@ -441,7 +441,7 @@ static void _perlmod_eval(INT32 args, int perlflags) // #define sp _perlsp dSP; - if (!ps->perl) error("Perl interpreter not available.\n"); + if (!ps->perl) Pike_error("Perl interpreter not available.\n"); check_all_args("Perl->eval", args, BIT_STRING, 0); firstarg = Pike_sp[-args].u.string; @@ -489,7 +489,7 @@ static void _perlmod_eval(INT32 args, int perlflags) 254-strlen(errtmp)); POPs; PUTBACK; FREETMPS; LEAVE; - error(errtmp); + Pike_error(errtmp); } if (perlflags & G_ARRAY) @@ -524,14 +524,14 @@ static void _perlmod_call(INT32 args, int perlflags) fprintf(stderr, "[perlmod_call: args=%d]\n", args); #endif - if (!ps->perl) error("No perl interpreter available.\n"); + if (!ps->perl) Pike_error("No perl interpreter available.\n"); - if (args < 1) error("Too few arguments.\n"); - if (args > 201) error("Too many arguments.\n"); + if (args < 1) Pike_error("Too few arguments.\n"); + if (args > 201) Pike_error("Too many arguments.\n"); if (Pike_sp[-args].type != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift) - error("bad Perl function name (must be an 8-bit string)"); + Pike_error("bad Perl function name (must be an 8-bit string)"); ENTER; SAVETMPS; @@ -550,7 +550,7 @@ static void _perlmod_call(INT32 args, int perlflags) case PIKE_T_STRING: if (s->u.string->size_shift) { PUTBACK; FREETMPS; LEAVE; - error("widestrings not supported in Pike-to-Perl call interface"); + Pike_error("widestrings not supported in Pike-to-Perl call interface"); return; } XPUSHs(sv_2mortal(newSVpv(s->u.string->str, s->u.string->len))); @@ -566,7 +566,7 @@ static void _perlmod_call(INT32 args, int perlflags) default: msg = "Unsupported argument type.\n"; PUTBACK; FREETMPS; LEAVE; - error(msg); + Pike_error(msg); return; } } @@ -594,12 +594,12 @@ static void _perlmod_call(INT32 args, int perlflags) 254-strlen(errtmp)); POPs; PUTBACK; FREETMPS; LEAVE; - error(errtmp); + Pike_error(errtmp); } if (n < 0) { PUTBACK; FREETMPS; LEAVE; - error("Internal error: perl_call_pv returned a negative number.\n"); + Pike_error("Internal Pike_error: perl_call_pv returned a negative number.\n"); } if (!(perlflags & G_ARRAY) && n > 1) @@ -607,7 +607,7 @@ static void _perlmod_call(INT32 args, int perlflags) if (n > ps->array_size_limit) { PUTBACK; FREETMPS; LEAVE; - error("Perl function returned too many values.\n"); + Pike_error("Perl function returned too many values.\n"); } if (perlflags & G_ARRAY) @@ -639,12 +639,12 @@ static void _perlmod_varop(INT32 args, int op, int type) wanted_args = type == 'S' ? 1 : 2; if (op == 'W') ++wanted_args; - if (!(_THIS->perl)) error("No Perl interpreter available.\n"); + if (!(_THIS->perl)) Pike_error("No Perl interpreter available.\n"); - if (args != wanted_args) error("Wrong number of arguments.\n"); + if (args != wanted_args) Pike_error("Wrong number of arguments.\n"); if (Pike_sp[-args].type != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift != 0) - error("Variable name must be an 8-bit string.\n"); + Pike_error("Variable name must be an 8-bit string.\n"); if (type == 'S') /* scalar */ { SV *sv = perl_get_sv(Pike_sp[-args].u.string->str, TRUE | GV_ADDMULTI); @@ -657,7 +657,7 @@ static void _perlmod_varop(INT32 args, int op, int type) { AV *av = perl_get_av(Pike_sp[-args].u.string->str, TRUE | GV_ADDMULTI); SV **svp; if (Pike_sp[1-args].type != PIKE_T_INT || (i = Pike_sp[1-args].u.integer) < 0) - error("Array subscript must be a non-negative integer.\n"); + Pike_error("Array subscript must be a non-negative integer.\n"); if (op == 'W') av_store(av, i, _sv_2mortal(_pikev2sv(Pike_sp+2-args))); pop_n_elems(args); @@ -675,7 +675,7 @@ static void _perlmod_varop(INT32 args, int op, int type) (hv, key, _sv_2mortal(_pikev2sv(Pike_sp+2-args)), 0))) sv_setsv(HeVAL(he), _sv_2mortal(_pikev2sv(Pike_sp+2-args))); else - error("Internal error: hv_store_ent returned NULL.\n"); + Pike_error("Internal Pike_error: hv_store_ent returned NULL.\n"); } pop_n_elems(args); if (op == 'R') @@ -685,7 +685,7 @@ static void _perlmod_varop(INT32 args, int op, int type) _push_zerotype(); } } - else error("Internal error in _perlmod_varop.\n"); + else Pike_error("Internal Pike_error in _perlmod_varop.\n"); if (op != 'R') push_int(0); } @@ -705,13 +705,13 @@ static void perlmod_set_hash_item(INT32 args) static void perlmod_array_size(INT32 args) { AV *av; - if (args != 1) error("Wrong number of arguments.\n"); + if (args != 1) Pike_error("Wrong number of arguments.\n"); if (Pike_sp[-args].type != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift != 0) - error("Array name must be given as an 8-bit string.\n"); + Pike_error("Array name must be given as an 8-bit string.\n"); av = perl_get_av(Pike_sp[-args].u.string->str, TRUE | GV_ADDMULTI); - if (!av) error("Interal error: perl_get_av() return NULL.\n"); + if (!av) Pike_error("Interal Pike_error: perl_get_av() return NULL.\n"); pop_n_elems(args); /* Return av_len()+1, since av_len() returns the value of the highest * index, which is 1 less than the size. */ @@ -720,17 +720,17 @@ static void perlmod_array_size(INT32 args) static void perlmod_get_whole_array(INT32 args) { AV *av; int i, n; struct array *arr; - if (args != 1) error("Wrong number of arguments.\n"); + if (args != 1) Pike_error("Wrong number of arguments.\n"); if (Pike_sp[-args].type != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift != 0) - error("Array name must be given as an 8-bit string.\n"); + Pike_error("Array name must be given as an 8-bit string.\n"); av = perl_get_av(Pike_sp[-args].u.string->str, TRUE | GV_ADDMULTI); - if (!av) error("Interal error: perl_get_av() returned NULL.\n"); + if (!av) Pike_error("Interal Pike_error: perl_get_av() returned NULL.\n"); n = av_len(av) + 1; if (n > _THIS->array_size_limit) - error("The array is larger than array_size_limit.\n"); + Pike_error("The array is larger than array_size_limit.\n"); arr = allocate_array(n); for(i = 0; i < n; ++i) @@ -743,19 +743,19 @@ static void perlmod_get_whole_array(INT32 args) static void perlmod_get_hash_keys(INT32 args) { HV *hv; HE *he; SV *sv; int i, n; I32 len; struct array *arr; - if (args != 1) error("Wrong number of arguments.\n"); + if (args != 1) Pike_error("Wrong number of arguments.\n"); if (Pike_sp[-args].type != PIKE_T_STRING || Pike_sp[-args].u.string->size_shift != 0) - error("Hash name must be given as an 8-bit string.\n"); + Pike_error("Hash name must be given as an 8-bit string.\n"); hv = perl_get_hv(Pike_sp[-args].u.string->str, TRUE | GV_ADDMULTI); - if (!hv) error("Interal error: perl_get_av() return NULL.\n"); + if (!hv) Pike_error("Interal Pike_error: perl_get_av() return NULL.\n"); /* count number of elements in hash */ for(n = 0, hv_iterinit(hv); (he = hv_iternext(hv)); ++n); if (n > _THIS->array_size_limit) - error("The array is larger than array_size_limit.\n"); + Pike_error("The array is larger than array_size_limit.\n"); arr = allocate_array(n); for(i = 0, hv_iterinit(hv); (he = hv_iternext(hv)); ++i) @@ -772,11 +772,11 @@ static void perlmod_array_size_limit(INT32 args) break; case 1: if (Pike_sp[-args].type != PIKE_T_INT || Pike_sp[-args].u.integer < 1) - error("Argument must be a integer in range 1 to 2147483647."); + Pike_error("Argument must be a integer in range 1 to 2147483647."); _THIS->array_size_limit = Pike_sp[-args].u.integer; break; default: - error("Wrong number of arguments.\n"); + Pike_error("Wrong number of arguments.\n"); } pop_n_elems(args); push_int(_THIS->array_size_limit); @@ -873,7 +873,7 @@ void pike_module_exit(void) #else /* HAVE_PERL */ #ifdef ERROR_IF_NO_PERL -#error "No Perl!" +#Pike_error "No Perl!" #endif void pike_module_init(void) {} diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index 38a53903d8e0ea028c3fb9cc46d06e9c4f0c2f70..ef0dad93f5d974a11261c630f7bcf88c927da797 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -30,7 +30,7 @@ #include <fcntl.h> -RCSID("$Id: pipe.c,v 1.43 2000/08/28 22:13:09 hubbe Exp $"); +RCSID("$Id: pipe.c,v 1.44 2000/12/01 08:10:19 hubbe Exp $"); #include "threads.h" #include "stralloc.h" @@ -39,7 +39,7 @@ RCSID("$Id: pipe.c,v 1.43 2000/08/28 22:13:09 hubbe Exp $"); #include "constants.h" #include "interpret.h" #include "svalue.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "fdlib.h" @@ -253,7 +253,7 @@ static INLINE void free_input(struct input *i) munmap(i->u.mmap,i->len); mmapped -= i->len; #else - error("I_MMAP input when MMAP is diabled!"); + Pike_error("I_MMAP input when MMAP is diabled!"); #endif break; @@ -273,7 +273,7 @@ static INLINE void pipe_done(void) if(!THISOBJ->prog) /* We will not free anything in this case. */ return; - /* error("Pipe done callback destructed pipe.\n"); */ + /* Pike_error("Pipe done callback destructed pipe.\n"); */ } close_and_free_everything(THISOBJ,THIS); } @@ -610,7 +610,7 @@ static INLINE void output_finish(struct object *obj) apply(o->obj,"close",0); pop_stack(); if(!THISOBJ->prog) - error("Pipe done callback destructed pipe.\n"); + Pike_error("Pipe done callback destructed pipe.\n"); destruct(o->obj); } free_object(o->obj); @@ -669,7 +669,7 @@ static INLINE void output_try_write_some(struct object *obj) if(sp[-1].type == T_INT) ret=sp[-1].u.integer; pop_stack(); - if (ret==-1) /* error, byebye */ + if (ret==-1) /* Pike_error, byebye */ { output_finish(obj); return; @@ -694,11 +694,11 @@ static void pipe_input(INT32 args) struct object *obj; if (args<1 || sp[-args].type != T_OBJECT) - error("Bad/missing argument 1 to pipe->input().\n"); + Pike_error("Bad/missing argument 1 to pipe->input().\n"); obj=sp[-args].u.object; if(!obj || !obj->prog) - error("pipe->input() on destructed object.\n"); + Pike_error("pipe->input() on destructed object.\n"); push_int(0); apply(sp[-args-1].u.object,"set_id", 1); @@ -787,7 +787,7 @@ static void pipe_input(INT32 args) i->type=I_NONE; nobjects--; - error("illegal file object%s%s\n", + Pike_error("illegal file object%s%s\n", ((i->set_nonblocking_offset<0)?"; no set_nonblocking":""), ((i->set_blocking_offset<0)?"; no set_blocking":"")); } else { @@ -830,7 +830,7 @@ static void pipe_write(INT32 args) struct input *i; if (args<1 || sp[-args].type!=T_STRING) - error("illegal argument to pipe->write()\n"); + Pike_error("illegal argument to pipe->write()\n"); if (!THIS->firstinput) { @@ -861,11 +861,11 @@ static void pipe_output(INT32 args) sp[-args].type != T_OBJECT || !sp[-args].u.object || !sp[-args].u.object->prog) - error("Bad/missing argument 1 to pipe->output().\n"); + Pike_error("Bad/missing argument 1 to pipe->output().\n"); if (args==2 && sp[1-args].type != T_INT) - error("Bad argument 2 to pipe->output().\n"); + Pike_error("Bad argument 2 to pipe->output().\n"); if (THIS->fd==-1) /* no buffer */ { @@ -935,7 +935,7 @@ static void pipe_output(INT32 args) o->set_blocking_offset<0) { free_object(o->obj); - error("illegal file object%s%s%s\n", + Pike_error("illegal file object%s%s%s\n", ((o->write_offset<0)?"; no write":""), ((o->set_nonblocking_offset<0)?"; no set_nonblocking":""), ((o->set_blocking_offset<0)?"; no set_blocking":"")); @@ -974,7 +974,7 @@ static void pipe_set_done_callback(INT32 args) return; } if (args<1 || (sp[-args].type!=T_FUNCTION && sp[-args].type!=T_ARRAY)) - error("Illegal argument to set_done_callback()\n"); + Pike_error("Illegal argument to set_done_callback()\n"); if (args>1) { @@ -996,7 +996,7 @@ static void pipe_set_output_closed_callback(INT32 args) return; } if (args<1 || (sp[-args].type!=T_FUNCTION && sp[-args].type!=T_ARRAY)) - error("Illegal argument to set_output_closed_callback()\n"); + Pike_error("Illegal argument to set_output_closed_callback()\n"); if (args>1) { @@ -1033,12 +1033,12 @@ static void f_bytes_sent(INT32 args) static void pipe_write_output_callback(INT32 args) { if (args<1 || sp[-args].type!=T_OBJECT) - error("Illegal argument to pipe->write_output_callback\n"); + Pike_error("Illegal argument to pipe->write_output_callback\n"); if(!sp[-args].u.object->prog) return; if(sp[-args].u.object->prog != output_program) - error("Illegal argument to pipe->write_output_callback\n"); + Pike_error("Illegal argument to pipe->write_output_callback\n"); debug_malloc_touch(sp[-args].u.object); output_try_write_some(sp[-args].u.object); @@ -1053,7 +1053,7 @@ static void pipe_close_output_callback(INT32 args) if(!sp[-args].u.object->prog) return; if(sp[-args].u.object->prog != output_program) - error("Illegal argument to pipe->close_output_callback\n"); + Pike_error("Illegal argument to pipe->close_output_callback\n"); o=(struct output *)(sp[-args].u.object->storage); @@ -1075,12 +1075,12 @@ static void pipe_read_input_callback(INT32 args) struct pike_string *s; if (args<2 || sp[1-args].type!=T_STRING) - error("Illegal argument to pipe->read_input_callback\n"); + Pike_error("Illegal argument to pipe->read_input_callback\n"); i=THIS->firstinput; if (!i) - error("Pipe read callback without any inputs left.\n"); + Pike_error("Pipe read callback without any inputs left.\n"); s=sp[1-args].u.string; @@ -1105,10 +1105,10 @@ static void pipe_close_input_callback(INT32 args) i=THIS->firstinput; if(!i) - error("Input close callback without inputs!\n"); + Pike_error("Input close callback without inputs!\n"); if(i->type != I_OBJ) - error("Premature close callback on pipe!.\n"); + Pike_error("Premature close callback on pipe!.\n"); if (i->u.obj->prog) { @@ -1253,7 +1253,7 @@ static void exit_output_struct(struct object *obj) pop_stack(); if(!THISOBJ->prog) - error("Pipe done callback destructed pipe.\n"); + Pike_error("Pipe done callback destructed pipe.\n"); } free_object(o->obj); noutputs--; diff --git a/src/modules/Postgres/pgresult.c b/src/modules/Postgres/pgresult.c index eaaa8c7b0c8af684b476051714743e74d46276bb..1897ca0002b939362ab44642c2c7c0656947c20a 100644 --- a/src/modules/Postgres/pgresult.c +++ b/src/modules/Postgres/pgresult.c @@ -1,5 +1,5 @@ /* - * $Id: pgresult.c,v 1.14 2000/08/06 05:00:55 hubbe Exp $ + * $Id: pgresult.c,v 1.15 2000/12/01 08:10:20 hubbe Exp $ * * Postgres95 support for pike/0.5 and up * @@ -65,7 +65,7 @@ #include "builtin_functions.h" #include "module_support.h" -RCSID("$Id: pgresult.c,v 1.14 2000/08/06 05:00:55 hubbe Exp $"); +RCSID("$Id: pgresult.c,v 1.15 2000/12/01 08:10:20 hubbe Exp $"); #ifdef _REENTRANT PIKE_MUTEX_T pike_postgres_result_mutex STATIC_MUTEX_INIT; @@ -109,14 +109,14 @@ static void f_create (INT32 args) storage=get_storage(Pike_sp[-args].u.object,postgres_program); if (!storage) - error ("I need a Postgres object or an heir of it.\n"); + Pike_error ("I need a Postgres object or an heir of it.\n"); THIS->result=((struct pgres_object_data *)storage)->last_result; ((struct pgres_object_data *) Pike_sp[-args].u.object->storage)->last_result=NULL; /* no fear of memory leaks, we've only moved the pointer from there to here */ pop_n_elems(args); if (!THIS->result) /*this ensures we _DO_ have a result*/ - error ("Bad result.\n"); + Pike_error ("Bad result.\n"); #ifdef PGRESDEBUG pgdebug("Got %d tuples.\n",PQntuples(THIS->result)); #endif @@ -180,9 +180,9 @@ static void f_seek (INT32 args) check_all_args("postgres_result->seek",args,BIT_INT,0); howmuch=Pike_sp[-args].u.integer; if (THIS->cursor+howmuch < 0) - error ("Cannot seek to negative result indexes!\n"); + Pike_error ("Cannot seek to negative result indexes!\n"); if (THIS->cursor+howmuch > PQntuples(THIS->result)) - error ("Cannot seek past result's end!.\n"); + Pike_error ("Cannot seek past result's end!.\n"); pop_n_elems(args); THIS->cursor += howmuch; return; diff --git a/src/modules/Postgres/postgres.c b/src/modules/Postgres/postgres.c index d33fa6eeb2d6fac9c02655c3d46584726254f5c3..a09086f3adf727944735777e9d7c93ff940658ca 100644 --- a/src/modules/Postgres/postgres.c +++ b/src/modules/Postgres/postgres.c @@ -61,7 +61,7 @@ static void pgdebug (char * a, ...) {} struct program * postgres_program; -RCSID("$Id: postgres.c,v 1.19 2000/08/06 05:00:55 hubbe Exp $"); +RCSID("$Id: postgres.c,v 1.20 2000/12/01 08:10:21 hubbe Exp $"); #define THIS ((struct pgres_object_data *) Pike_fp->current_storage) @@ -178,7 +178,7 @@ static void f_create (INT32 args) } } else - error ("You must specify a TCP/IP port number as argument 5 " + Pike_error ("You must specify a TCP/IP port number as argument 5 " "to Sql.postgres->create().\n"); #endif pgdebug("f_create(host=%s, port=%s, db=%s, user=%s, pass=%s).\n", @@ -193,7 +193,7 @@ static void f_create (INT32 args) PQ_UNLOCK(); THREADS_DISALLOW(); if (!conn) - error ("Could not conneect to server\n"); + Pike_error ("Could not conneect to server\n"); if (PQstatus(conn)!=CONNECTION_OK) { set_error(PQerrorMessage(conn)); THREADS_ALLOW(); @@ -201,11 +201,11 @@ static void f_create (INT32 args) PQfinish(conn); PQ_UNLOCK(); THREADS_DISALLOW(); - error("Could not connect to database. Reason: \"%s\".\n",THIS->last_error->str); + Pike_error("Could not connect to database. Reason: \"%s\".\n",THIS->last_error->str); } THIS->dblink=conn; if (!THIS->dblink) - error ("Huh? Weirdness here! Internal error!\n"); + Pike_error ("Huh? Weirdness here! Internal Pike_error!\n"); pop_n_elems(args); } @@ -217,7 +217,7 @@ static void f_select_db (INT32 args) check_all_args("Postgres->select_db",args,BIT_STRING,0); if (!THIS->dblink) - error ("Driver error. How can you possibly not be linked to a " + Pike_error ("Driver Pike_error. How can you possibly not be linked to a " "database already?\n"); conn=THIS->dblink; THREADS_ALLOW(); @@ -256,7 +256,7 @@ static void f_select_db (INT32 args) if (PQstatus(conn)==CONNECTION_BAD) { set_error(PQerrorMessage(conn)); PQfinish(conn); - error("Could not connect to database.\n"); + Pike_error("Could not connect to database.\n"); } THIS->dblink=conn; pop_n_elems(args); @@ -272,7 +272,7 @@ static void f_big_query(INT32 args) check_all_args("Postgres->big_query",args,BIT_STRING,0); if (!conn) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); if (Pike_sp[-args].u.string->len) query=Pike_sp[-args].u.string->str; @@ -315,7 +315,7 @@ static void f_big_query(INT32 args) push_int(1); return; } - error ("Error in query.\n"); + Pike_error ("Error in query.\n"); } switch (PQresultStatus(res)) @@ -337,7 +337,7 @@ static void f_big_query(INT32 args) pgdebug("\tBad.\n"); set_error(PQerrorMessage(conn)); PQclear(res); - error ("Error in frontend-backend communications.\n"); + Pike_error ("Error in frontend-backend communications.\n"); case PGRES_TUPLES_OK: pgdebug("\tResult.\n"); THIS->last_result=res; @@ -345,14 +345,14 @@ static void f_big_query(INT32 args) push_object(clone_object(pgresult_program,1)); return; default: - error ("Unimplemented server feature.\n"); + Pike_error ("Unimplemented server feature.\n"); } - error ("Internal error in postgresmodule.\n"); + Pike_error ("Internal Pike_error in postgresmodule.\n"); } static void f_error (INT32 args) { - check_all_args("Postgres->error",args,0); + check_all_args("Postgres->Pike_error",args,0); if (THIS->last_error) ref_push_string(THIS->last_error); @@ -368,7 +368,7 @@ static void f_reset (INT32 args) check_all_args("Postgres->reset",args,0); if (!THIS->dblink) - error ("Not connected.\n"); + Pike_error ("Not connected.\n"); conn=THIS->dblink; THREADS_ALLOW(); PQ_LOCK(); @@ -377,7 +377,7 @@ static void f_reset (INT32 args) THREADS_DISALLOW(); if (PQstatus(conn)==CONNECTION_BAD) { set_error(PQerrorMessage(conn)); - error("Bad connection.\n"); + Pike_error("Bad connection.\n"); } } @@ -388,12 +388,12 @@ static void f_reset (INT32 args) static void f_trace (INT32 args) { if (args!=1) - error ("Wrong args for trace().\n"); + Pike_error ("Wrong args for trace().\n"); if (Pike_sp[-args].type==PIKE_T_INT) if (Pike_sp[-args].u.integer==0) PQuntrace(THIS->dblink); else - error ("Wrong argument for postgres->trace().\n"); + Pike_error ("Wrong argument for postgres->trace().\n"); else /* I really don't know how to check that the argument is an instance of * /precompiled/file... I guess there's the name stored somewhere.. @@ -436,7 +436,7 @@ static void f_host_info (INT32 args) return; } set_error(PQerrorMessage(THIS->dblink)); - error ("Bad connection.\n"); + Pike_error ("Bad connection.\n"); } void pike_module_init (void) @@ -462,7 +462,7 @@ void pike_module_init (void) ADD_FUNCTION("big_query",f_big_query,tFunc(tStr,tOr(tInt,tObj)), OPT_EXTERNAL_DEPEND|OPT_RETURN); /* function(void:string) */ - ADD_FUNCTION("error",f_error,tFunc(tVoid,tStr), + ADD_FUNCTION("Pike_error",f_error,tFunc(tVoid,tStr), OPT_EXTERNAL_DEPEND|OPT_RETURN); /* function(void:string) */ ADD_FUNCTION("host_info",f_host_info,tFunc(tVoid,tStr), diff --git a/src/modules/Regexp/glue.c b/src/modules/Regexp/glue.c index 450954ed081272fb20273848089b47d59f2d11b8..cec769e8d4491fb236d2feb4506e7c9ce801737d 100644 --- a/src/modules/Regexp/glue.c +++ b/src/modules/Regexp/glue.c @@ -19,7 +19,7 @@ #include "threads.h" #include "module_support.h" -RCSID("$Id: glue.c,v 1.18 2000/07/28 07:14:40 hubbe Exp $"); +RCSID("$Id: glue.c,v 1.19 2000/12/01 08:10:22 hubbe Exp $"); #ifdef USE_SYSTEM_REGEXP #include <regexp.h> @@ -81,7 +81,7 @@ static void regexp_create(INT32 args) char buf[1024]; regerror(err, &(THIS->regexp), buf, 1024); - error("Regexp.regexp->create(): Compilation failed:%s\n", buf); + Pike_error("Regexp.regexp->create(): Compilation failed:%s\n", buf); } for (i=0,paren_ptr=str; paren_ptr = strchr(paren_ptr, '('); i++) { paren_ptr++; diff --git a/src/modules/Regexp/pike_regexp.c b/src/modules/Regexp/pike_regexp.c index 351bfb267f5bc3f2796046e634d9ec6687c0dfb2..6b003370f99ef0fa2443046168f28ec42cc0bd36 100644 --- a/src/modules/Regexp/pike_regexp.c +++ b/src/modules/Regexp/pike_regexp.c @@ -1,5 +1,5 @@ /* - * $Id: pike_regexp.c,v 1.19 2000/09/14 12:08:03 grubba Exp $ + * $Id: pike_regexp.c,v 1.20 2000/12/01 08:10:23 hubbe Exp $ * * regexp.c - regular expression matching * @@ -66,7 +66,7 @@ #endif /* HAVE_STRING_H */ #include "pike_regexp.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" /* must be included last */ #include "module_magic.h" @@ -175,7 +175,7 @@ * Utility definitions. */ -#define regerror(X) error("Regexp: %s\n",X); +#define regerror(X) Pike_error("Regexp: %s\n",X); #define SPECIAL 0x100 #define LBRAC ('('|SPECIAL) #define RBRAC (')'|SPECIAL) diff --git a/src/modules/SANE/sane.c b/src/modules/SANE/sane.c index 9e2475ed6c98c84498c769754a723de71cd0cb32..d2d521a471775f9e70f223e7f6464fbe67c0571e 100644 --- a/src/modules/SANE/sane.c +++ b/src/modules/SANE/sane.c @@ -19,7 +19,7 @@ #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "mapping.h" #include "multiset.h" #include "backend.h" @@ -32,7 +32,7 @@ /* must be included last */ #include "module_magic.h" -RCSID("$Id: sane.c,v 1.7 2000/08/10 09:51:54 per Exp $"); +RCSID("$Id: sane.c,v 1.8 2000/12/01 08:10:23 hubbe Exp $"); /* **! module SANE @@ -41,7 +41,7 @@ RCSID("$Id: sane.c,v 1.7 2000/08/10 09:51:54 per Exp $"); **! library from pike **! **! note -**! $Id: sane.c,v 1.7 2000/08/10 09:51:54 per Exp $ +**! $Id: sane.c,v 1.8 2000/12/01 08:10:23 hubbe Exp $ */ static int sane_is_inited; @@ -54,7 +54,7 @@ struct scanner static void init_sane() { if( sane_init( NULL, NULL ) ) - error( "Sane init failed.\n" ); + Pike_error( "Sane init failed.\n" ); sane_is_inited = 1; } @@ -107,7 +107,7 @@ static void f_list_scanners( INT32 args ) f_aggregate( i ); break; default: - error("Failed to get device list\n"); + Pike_error("Failed to get device list\n"); } } @@ -217,7 +217,7 @@ static void f_scanner_create( INT32 args ) get_all_args( "create", args, "%s", &name ); if( sane_open( name, &THIS->h ) ) - error("Failed to open scanner \"%s\"\n", name ); + Pike_error("Failed to open scanner \"%s\"\n", name ); } /* @@ -244,7 +244,7 @@ static int find_option( char *name, const SANE_Option_Descriptor **p ) *p = d; return i; } - error("No such option: %s\n", name ); + Pike_error("No such option: %s\n", name ); } @@ -417,7 +417,7 @@ static void assert_image_program() sp--;/* Do not free image program.. */ } if( !image_program ) - error("No Image.Image?!\n"); + Pike_error("No Image.Image?!\n"); } /* @@ -434,11 +434,11 @@ static void f_scanner_simple_scan( INT32 args ) assert_image_program(); pop_n_elems( args ); - if( sane_start( THIS->h ) ) error("Start failed\n"); - if( sane_get_parameters( THIS->h, &p ) ) error("Get parameters failed\n"); + if( sane_start( THIS->h ) ) Pike_error("Start failed\n"); + if( sane_get_parameters( THIS->h, &p ) ) Pike_error("Get parameters failed\n"); if( p.depth != 8 ) - error("Sorry, only depth 8 supported right now.\n"); + Pike_error("Sorry, only depth 8 supported right now.\n"); push_int( p.pixels_per_line ); push_int( p.lines ); @@ -487,9 +487,9 @@ static void f_scanner_row_scan( INT32 args ) rgb_group *r, or; int i, nr; - if( sane_start( THIS->h ) ) error("Start failed\n"); - if( sane_get_parameters( THIS->h, &p ) ) error("Get parameters failed\n"); - if( p.depth != 8 ) error("Sorry, only depth 8 supported right now.\n"); + if( sane_start( THIS->h ) ) Pike_error("Start failed\n"); + if( sane_get_parameters( THIS->h, &p ) ) Pike_error("Get parameters failed\n"); + if( p.depth != 8 ) Pike_error("Sorry, only depth 8 supported right now.\n"); assert_image_program(); switch( p.format ) @@ -500,7 +500,7 @@ static void f_scanner_row_scan( INT32 args ) case SANE_FRAME_RED: case SANE_FRAME_GREEN: case SANE_FRAME_BLUE: - error("Composite frame mode not supported for row_scan\n"); + Pike_error("Composite frame mode not supported for row_scan\n"); break; } push_int( p.pixels_per_line ); @@ -631,9 +631,9 @@ static void f_scanner_nonblocking_row_scan( INT32 args ) int fd; struct row_scan_struct *rsp; - if( sane_start( THIS->h ) ) error("Start failed\n"); - if( sane_get_parameters( THIS->h, &p ) ) error("Get parameters failed\n"); - if( p.depth != 8 ) error("Sorry, only depth 8 supported right now.\n"); + if( sane_start( THIS->h ) ) Pike_error("Start failed\n"); + if( sane_get_parameters( THIS->h, &p ) ) Pike_error("Get parameters failed\n"); + if( p.depth != 8 ) Pike_error("Sorry, only depth 8 supported right now.\n"); switch( p.format ) { @@ -643,7 +643,7 @@ static void f_scanner_nonblocking_row_scan( INT32 args ) case SANE_FRAME_RED: case SANE_FRAME_GREEN: case SANE_FRAME_BLUE: - error("Composite frame mode not supported for row_scan\n"); + Pike_error("Composite frame mode not supported for row_scan\n"); break; } @@ -671,7 +671,7 @@ static void f_scanner_nonblocking_row_scan( INT32 args ) free_object( rsp->t ); free( rsp->buffer ); free( rsp ); - error("Failed to get select fd for scanning device!\n"); + Pike_error("Failed to get select fd for scanning device!\n"); } set_read_callback( fd, nonblocking_row_scan_callback, (void*)rsp ); push_int( 0 ); diff --git a/src/modules/Ssleay/ssleay.c b/src/modules/Ssleay/ssleay.c index fc81baf8a8852091284c430dd447375068e4082b..d42dde50a6980cca01b9fb14f9586eb3444954e5 100644 --- a/src/modules/Ssleay/ssleay.c +++ b/src/modules/Ssleay/ssleay.c @@ -8,7 +8,7 @@ #include "config.h" -RCSID("$Id: ssleay.c,v 1.12 2000/07/28 20:35:47 hubbe Exp $"); +RCSID("$Id: ssleay.c,v 1.13 2000/12/01 08:10:24 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "stralloc.h" @@ -66,10 +66,10 @@ static struct program *ssleay_connection_program; void ssleay_connection_create(INT32 args) { if (args < 1) - error("ssleay_connection->create: no context given\n"); + Pike_error("ssleay_connection->create: no context given\n"); if ((sp[-args].type != T_OBJECT) || (sp[-args].u.object->prog != ssleay_program)) - error("ssleay_connection->create: invalid argument\n"); + Pike_error("ssleay_connection->create: invalid argument\n"); if (CON) SSL_free(CON); CON = SSL_new( ( (struct ssleay_context *) sp[-args].u.object->storage) @@ -77,7 +77,7 @@ void ssleay_connection_create(INT32 args) if (!CON) { ERR_print_errors_fp(stderr); - error("ssleay_connection->create: Could not allocate new connection\n"); + Pike_error("ssleay_connection->create: Could not allocate new connection\n"); } SSL_clear(CON); } @@ -85,7 +85,7 @@ void ssleay_connection_create(INT32 args) void ssleay_connection_set_fd(INT32 args) { if ((args < 1) || (sp[-args].type != T_INT)) - error("ssleay_connection->set_fd: wrong type\n"); + Pike_error("ssleay_connection->set_fd: wrong type\n"); SSL_set_fd(CON, sp[-args].u.integer); pop_n_elems(args); } @@ -108,11 +108,11 @@ void ssleay_connection_read(INT32 args) INT32 count; if ((args < 1) || (sp[-args].type != T_INT)) - error("ssleay_connection->read: wrong type\n"); + Pike_error("ssleay_connection->read: wrong type\n"); len = sp[-args].u.integer; if (len < 0) - error("ssleay_connection->read: invalid argument\n"); + Pike_error("ssleay_connection->read: invalid argument\n"); pop_n_elems(args); s = begin_shared_string(len); @@ -139,7 +139,7 @@ void ssleay_connection_write(INT32 args) INT32 res; if ((args < 1) || (sp[-args].type != T_STRING)) - error("ssleay_connection->write: wrong argument\n"); + Pike_error("ssleay_connection->write: wrong argument\n"); THREADS_ALLOW(); res = SSL_write(CON, sp[-args].u.string->str, sp[-args].u.string->len); THREADS_DISALLOW(); @@ -161,18 +161,18 @@ static void ssleay_create(INT32 args) SSL_CTX_free(CTX); CTX = SSL_CTX_new(); if (!CTX) - error("ssleay->create: couldn't allocate new ssl context\n"); + Pike_error("ssleay->create: couldn't allocate new ssl context\n"); pop_n_elems(args); } static void ssleay_use_certificate_file(INT32 args) { if (sp[-args].type != T_STRING) - error("ssleay->use_certificate_file: wrong type"); + Pike_error("ssleay->use_certificate_file: wrong type"); if (SSL_CTX_use_certificate_file(CTX, sp[-args].u.string->str, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); - error("ssleay->use_certificate_file: unable to use certificate"); + Pike_error("ssleay->use_certificate_file: unable to use certificate"); } pop_n_elems(args); } @@ -180,11 +180,11 @@ static void ssleay_use_certificate_file(INT32 args) static void ssleay_use_private_key_file(INT32 args) { if (sp[-args].type != T_STRING) - error("ssleay->use_private_key_file: wrong type"); + Pike_error("ssleay->use_private_key_file: wrong type"); if (SSL_CTX_use_PrivateKey_file(CTX, sp[-args].u.string->str, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); - error("ssleay->use_private_key_file: unable to use private_key\n"); + Pike_error("ssleay->use_private_key_file: unable to use private_key\n"); } pop_n_elems(args); } @@ -201,9 +201,9 @@ static void ssleay_new(INT32 args) else { if (strcmp(sp[-args+1].u.string->str, "c") == 0) - error("ssleay->open: client mode not implemented\n") + Pike_error("ssleay->open: client mode not implemented\n") else - error("ssleay->open: invalid mode\n"); + Pike_error("ssleay->open: invalid mode\n"); } #endif pop_n_elems(args); diff --git a/src/modules/Yp/yp.c b/src/modules/Yp/yp.c index 8c8ee99cfcd57d7b7122581e22fec8541d03f16d..dbda156fc2edf80e6f85a09281ac9e37b32fde0f 100644 --- a/src/modules/Yp/yp.c +++ b/src/modules/Yp/yp.c @@ -18,7 +18,7 @@ #include <rpcsvc/ypclnt.h> #include "stralloc.h" -#include "error.h" +#include "pike_error.h" #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -31,13 +31,13 @@ /* must be included last */ #include "module_magic.h" -RCSID("$Id: yp.c,v 1.19 2000/08/17 18:31:26 grubba Exp $"); +RCSID("$Id: yp.c,v 1.20 2000/12/01 08:10:24 hubbe Exp $"); #ifdef HAVE_YPERR_STRING -#define YPERROR(fun,err) do{ if(err) error("yp->%s(): %s\n", (fun), \ +#define YPERROR(fun,err) do{ if(err) Pike_error("yp->%s(): %s\n", (fun), \ yperr_string(err)); }while(0) #else /* !HAVE_YPERR_STRING */ -#define YPERROR(fun,err) do{ if(err) error("yp->%s(): YP error %d.\n", (fun), \ +#define YPERROR(fun,err) do{ if(err) Pike_error("yp->%s(): YP Pike_error %d.\n", (fun), \ (err)); }while(0) #endif /* HAVE_YPERR_STRING */ diff --git a/src/modules/_Charset/charsetmod.c b/src/modules/_Charset/charsetmod.c index ad0c7e55931e291112a3b6b6c0604ce8d62f1513..019fca6c8383f2f2e3568a3eaa710443199de670 100644 --- a/src/modules/_Charset/charsetmod.c +++ b/src/modules/_Charset/charsetmod.c @@ -3,13 +3,13 @@ #endif /* HAVE_CONFIG_H */ #include "../../global.h" -RCSID("$Id: charsetmod.c,v 1.24 2000/08/15 13:00:00 grubba Exp $"); +RCSID("$Id: charsetmod.c,v 1.25 2000/12/01 08:10:25 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" #include "object.h" #include "module_support.h" -#include "error.h" +#include "pike_error.h" #include "iso2022.h" @@ -120,7 +120,7 @@ static int call_repcb(struct svalue *repcb, p_wchar2 ch) } else if(rep != NULL) \ func(ctx, sb, rep, NULL, NULL); \ else \ - error("Character unsupported by encoding.\n"); + Pike_error("Character unsupported by encoding.\n"); #define MKREPCB(c) ((c).type == T_FUNCTION? &(c):NULL) @@ -188,7 +188,7 @@ static void f_std_feed(INT32 args, ptrdiff_t (*func)(const p_wchar0 *, get_all_args("feed()", args, "%W", &str); if(str->size_shift>0) - error("Can't feed on wide strings!\n"); + Pike_error("Can't feed on wide strings!\n"); if(s->retain != NULL) { tmpstr = add_shared_strings(s->retain, str); @@ -441,7 +441,7 @@ static void f_rfc1345(INT32 args) case MODE_9494: lowtrans=lo=lo2=33; hi=hi2=126; break; case MODE_9696: lowtrans=32; lo=lo2=160; hi=hi2=255; break; default: - fatal("Internal error in rfc1345\n"); + fatal("Internal Pike_error in rfc1345\n"); } if(hi2) { @@ -484,7 +484,7 @@ static void f_rfc1345(INT32 args) case MODE_9494: p = std_9494_program; break; case MODE_9696: p = std_9696_program; break; default: - fatal("Internal error in rfc1345\n"); + fatal("Internal Pike_error in rfc1345\n"); } push_object(clone_object(p, 0)); ((struct std_rfc_stor *)(sp[-1].u.object->storage+std_rfc_stor_offs)) diff --git a/src/modules/_Charset/iso2022.c b/src/modules/_Charset/iso2022.c index 26cc8dd293521820176b2a977b8d208690f016c0..b1d791fa9c00ea88e5424cbe29b6b78520853e38 100644 --- a/src/modules/_Charset/iso2022.c +++ b/src/modules/_Charset/iso2022.c @@ -3,13 +3,13 @@ #endif /* HAVE_CONFIG_H */ #include "global.h" -RCSID("$Id: iso2022.c,v 1.19 2000/08/15 13:00:30 grubba Exp $"); +RCSID("$Id: iso2022.c,v 1.20 2000/12/01 08:10:25 hubbe Exp $"); #include "program.h" #include "interpret.h" #include "stralloc.h" #include "object.h" #include "module_support.h" -#include "error.h" +#include "pike_error.h" #include "iso2022.h" @@ -358,7 +358,7 @@ static int call_repcb(struct svalue *repcb, p_wchar2 ch) } else if(rep != NULL) \ eat_enc_string(rep, s, NULL, NULL); \ else \ - error("Character unsupported by encoding.\n"); + Pike_error("Character unsupported by encoding.\n"); static void eat_enc_string(struct pike_string *str, struct iso2022enc_stor *s, @@ -527,7 +527,7 @@ static void eat_enc_string(struct pike_string *str, struct iso2022enc_stor *s, mode = MODE_96; index = map2[(map1[(c-0x100)>>2]>>((c&3)<<1))&3]; } else { - error("Not implemented.\n"); + Pike_error("Not implemented.\n"); } if(index!=0 && (ttab = transltab[mode][index-0x10])!=NULL) { diff --git a/src/modules/_Crypto/arcfour.c b/src/modules/_Crypto/arcfour.c index d93644345a3dd3fdbb72838616d9b449e6cd8b64..32d22e5f91804b4f274fb73262367525a5104657 100644 --- a/src/modules/_Crypto/arcfour.c +++ b/src/modules/_Crypto/arcfour.c @@ -11,7 +11,7 @@ #include "object.h" #include "interpret.h" #include "program.h" -#include "error.h" +#include "pike_error.h" #include "las.h" #include "arcfour.h" @@ -19,7 +19,7 @@ /* THIS MUST BE INCLUDED LAST */ #include "module_magic.h" -RCSID("$Id: arcfour.c,v 1.12 2000/08/08 19:07:12 grubba Exp $"); +RCSID("$Id: arcfour.c,v 1.13 2000/12/01 08:10:25 hubbe Exp $"); #undef THIS #define THIS ((struct arcfour_ctx *)(fp->current_storage)) @@ -40,7 +40,7 @@ void exit_pike_arcfour(struct object *o) static void f_name(INT32 args) { if (args) { - error("Too many arguments to arcfour->name()\n"); + Pike_error("Too many arguments to arcfour->name()\n"); } push_string(make_shared_string("ARCFOUR")); } @@ -49,7 +49,7 @@ static void f_name(INT32 args) static void f_query_key_length(INT32 args) { if (args) { - error("Too many arguments to arcfour->query_key_length()\n"); + Pike_error("Too many arguments to arcfour->query_key_length()\n"); } push_int(0); } @@ -58,13 +58,13 @@ static void f_query_key_length(INT32 args) static void f_set_key(INT32 args) { if (args != 1) { - error("Wrong number of args to arcfour->set_key()\n"); + Pike_error("Wrong number of args to arcfour->set_key()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to arcfour->set_key()\n"); + Pike_error("Bad argument 1 to arcfour->set_key()\n"); } if (!sp[-1].u.string->len) - error("Empty key to arcfour_set_key()\n"); + Pike_error("Empty key to arcfour_set_key()\n"); arcfour_set_key(THIS, (unsigned INT8 *) sp[-1].u.string->str, DO_NOT_WARN(sp[-1].u.string->len)); @@ -79,10 +79,10 @@ static void f_arcfour_crypt(INT32 args) struct pike_string *s; if (args != 1) { - error("Wrong number of arguments to arcfour->crypt()\n"); + Pike_error("Wrong number of arguments to arcfour->crypt()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to arcfour->crypt()\n"); + Pike_error("Bad argument 1 to arcfour->crypt()\n"); } len = sp[-1].u.string->len; diff --git a/src/modules/_Crypto/cast.c b/src/modules/_Crypto/cast.c index ae4f31c384a47ffd4b7e301c8dcc6075ca0ac688..4139e75860aaade6eaf8fa686d5cefc626fa6572 100644 --- a/src/modules/_Crypto/cast.c +++ b/src/modules/_Crypto/cast.c @@ -1,5 +1,5 @@ /* - * $Id: cast.c,v 1.8 2000/08/08 19:06:07 grubba Exp $ + * $Id: cast.c,v 1.9 2000/12/01 08:10:26 hubbe Exp $ * * CAST crypto module for Pike * @@ -17,7 +17,7 @@ #include "interpret.h" #include "svalue.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "las.h" #include <cast.h> @@ -64,7 +64,7 @@ void exit_pike_crypto_cast(struct object *o) static void f_name(INT32 args) { if (args) { - error("Too many arguments to cast->name()\n"); + Pike_error("Too many arguments to cast->name()\n"); } push_string(make_shared_string("CAST")); } @@ -73,7 +73,7 @@ static void f_name(INT32 args) static void f_query_block_size(INT32 args) { if (args) { - error("Too many arguments to cast->query_block_size()\n"); + Pike_error("Too many arguments to cast->query_block_size()\n"); } push_int(CAST_BLOCKSIZE); } @@ -82,7 +82,7 @@ static void f_query_block_size(INT32 args) static void f_query_key_length(INT32 args) { if (args) { - error("Too many arguments to cast->query_key_length()\n"); + Pike_error("Too many arguments to cast->query_key_length()\n"); } push_int(CAST_MAX_KEYSIZE); } @@ -90,14 +90,14 @@ static void f_query_key_length(INT32 args) static void set_key(INT32 args) { if (args != 1) { - error("Wrong number of arguments to des->set_key()\n"); + Pike_error("Wrong number of arguments to des->set_key()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to des->set_key()\n"); + Pike_error("Bad argument 1 to des->set_key()\n"); } if ( (sp[-1].u.string->len < CAST_MIN_KEYSIZE) || (sp[-1].u.string->len > CAST_MAX_KEYSIZE)) - error("Invalid key length to cast->set_key()\n"); + Pike_error("Invalid key length to cast->set_key()\n"); cast_setkey(&(THIS->key), (unsigned char *)sp[-1].u.string->str, DO_NOT_WARN(sp[-1].u.string->len)); @@ -128,19 +128,19 @@ static void f_crypt_block(INT32 args) INT32 i; if (args != 1) { - error("Wrong number of arguments to cast->crypt_block()\n"); + Pike_error("Wrong number of arguments to cast->crypt_block()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to cast->crypt()\n"); + Pike_error("Bad argument 1 to cast->crypt()\n"); } len = sp[-1].u.string->len; if (len % CAST_BLOCKSIZE) { - error("Bad length of argument 1 to cast->crypt()\n"); + Pike_error("Bad length of argument 1 to cast->crypt()\n"); } if (!THIS->key.rounds) - error("Crypto.cast->crypt_block: Key not set\n"); + Pike_error("Crypto.cast->crypt_block: Key not set\n"); s = begin_shared_string(len); for(i = 0; i < len; i += CAST_BLOCKSIZE) THIS->crypt_fun(&(THIS->key), diff --git a/src/modules/_Crypto/cbc.c b/src/modules/_Crypto/cbc.c index ffc65c0a3927dac666871066cda47ad16537dde3..dd0649de636db124826054d3c0654959ee9808fe 100644 --- a/src/modules/_Crypto/cbc.c +++ b/src/modules/_Crypto/cbc.c @@ -1,5 +1,5 @@ /* - * $Id: cbc.c,v 1.17 2000/08/16 20:09:23 grubba Exp $ + * $Id: cbc.c,v 1.18 2000/12/01 08:10:26 hubbe Exp $ * * CBC (Cipher Block Chaining Mode) crypto module for Pike. * @@ -82,10 +82,10 @@ INLINE static void cbc_encrypt_step(const unsigned INT8 *source, safe_apply(THIS->object, "crypt_block", 1); if (sp[-1].type != T_STRING) { - error("cbc->encrypt(): Expected string from crypt_block()\n"); + Pike_error("cbc->encrypt(): Expected string from crypt_block()\n"); } if (sp[-1].u.string->len != block_size) { - error("cbc->encrypt(): Bad string length %ld returned from crypt_block()\n", + Pike_error("cbc->encrypt(): Bad string length %ld returned from crypt_block()\n", DO_NOT_WARN((long)sp[-1].u.string->len)); } MEMCPY(THIS->iv, sp[-1].u.string->str, block_size); @@ -103,10 +103,10 @@ INLINE static void cbc_decrypt_step(const unsigned INT8 *source, safe_apply(THIS->object, "crypt_block", 1); if (sp[-1].type != T_STRING) { - error("cbc->decrypt(): Expected string from crypt_block()\n"); + Pike_error("cbc->decrypt(): Expected string from crypt_block()\n"); } if (sp[-1].u.string->len != block_size) { - error("cbc->decrypt(): Bad string length %ld returned from crypt_block()\n", + Pike_error("cbc->decrypt(): Bad string length %ld returned from crypt_block()\n", DO_NOT_WARN((long)sp[-1].u.string->len)); } @@ -126,7 +126,7 @@ INLINE static void cbc_decrypt_step(const unsigned INT8 *source, static void f_create(INT32 args) { if (args < 1) { - error("Too few arguments to cbc->create()\n"); + Pike_error("Too few arguments to cbc->create()\n"); } #if 0 fprintf(stderr, "cbc->create: type = %d\n", @@ -143,18 +143,18 @@ static void f_create(INT32 args) /* Check return value */ if (sp[-1].type != T_OBJECT) - error("cbc->create(): Returned value is not an object\n"); + Pike_error("cbc->create(): Returned value is not an object\n"); add_ref(THIS->object = sp[-1].u.object); break; case T_OBJECT: if (args != 1) { - error("Too many arguments to cbc->create()\n"); + Pike_error("Too many arguments to cbc->create()\n"); } add_ref(THIS->object = sp[-1].u.object); break; default: - error("Bad argument 1 to cbc->create()\n"); + Pike_error("Bad argument 1 to cbc->create()\n"); } pop_stack(); /* Just one element left on the stack in both cases */ @@ -164,7 +164,7 @@ static void f_create(INT32 args) safe_apply(THIS->object, "query_block_size", 0); if (sp[-1].type != T_INT) { - error("cbc->create(): query_block_size() didn't return an int\n"); + Pike_error("cbc->create(): query_block_size() didn't return an int\n"); } THIS->block_size = sp[-1].u.integer; @@ -172,7 +172,7 @@ static void f_create(INT32 args) if ((!THIS->block_size) || (THIS->block_size > 4096)) { - error("cbc->create(): Bad block size %d\n", THIS->block_size); + Pike_error("cbc->create(): Bad block size %d\n", THIS->block_size); } THIS->iv = (unsigned INT8 *)xalloc(THIS->block_size); @@ -198,7 +198,7 @@ static void f_set_encrypt_key(INT32 args) if (THIS->block_size) { /* MEMSET(THIS->iv, 0, THIS->block_size); */ } else { - error("cbc->set_encrypt_key(): Object has not been created yet\n"); + Pike_error("cbc->set_encrypt_key(): Object has not been created yet\n"); } THIS->mode = 0; safe_apply(THIS->object, "set_encrypt_key", args); @@ -212,7 +212,7 @@ static void f_set_decrypt_key(INT32 args) if (THIS->block_size) { /* MEMSET(THIS->iv, 0, THIS->block_size); */ } else { - error("cbc->set_decrypt_key(): Object has not been created yet\n"); + Pike_error("cbc->set_decrypt_key(): Object has not been created yet\n"); } THIS->mode = 1; safe_apply(THIS->object, "set_decrypt_key", args); @@ -224,14 +224,14 @@ static void f_set_iv(INT32 args) { if (!THIS->iv) { - error("cbc->set_iv: uninitialized object\n"); + Pike_error("cbc->set_iv: uninitialized object\n"); } if (args != 1) - error("cbc->set_iv: wrong number of arguments\n"); + Pike_error("cbc->set_iv: wrong number of arguments\n"); if (sp[-args].type != T_STRING) - error("cbc->set_iv: non-string argument\n"); + Pike_error("cbc->set_iv: non-string argument\n"); if (sp[-args].u.string->len != THIS->block_size) - error("cbc->set_iv: argument incompatible with cipher blocksize\n"); + Pike_error("cbc->set_iv: argument incompatible with cipher blocksize\n"); MEMCPY(THIS->iv, sp[-args].u.string->str, THIS->block_size); pop_n_elems(args); push_object(this_object()); @@ -244,16 +244,16 @@ static void f_encrypt_block(INT32 args) INT32 offset = 0; if (args != 1) { - error("Wrong number of arguments to cbc->encrypt_block()\n"); + Pike_error("Wrong number of arguments to cbc->encrypt_block()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to cbc->encrypt_block()\n"); + Pike_error("Bad argument 1 to cbc->encrypt_block()\n"); } if (sp[-1].u.string->len % THIS->block_size) { - error("Bad length of argument 1 to cbc->encrypt_block()\n"); + Pike_error("Bad length of argument 1 to cbc->encrypt_block()\n"); } if (!(result = alloca(sp[-1].u.string->len))) { - error("cbc->encrypt_block(): Out of memory\n"); + Pike_error("cbc->encrypt_block(): Out of memory\n"); } while (offset < sp[-1].u.string->len) { @@ -276,16 +276,16 @@ static void f_decrypt_block(INT32 args) INT32 offset = 0; if (args != 1) { - error("Wrong number of arguments to cbc->decrypt_block()\n"); + Pike_error("Wrong number of arguments to cbc->decrypt_block()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to cbc->decrypt_block()\n"); + Pike_error("Bad argument 1 to cbc->decrypt_block()\n"); } if (sp[-1].u.string->len % THIS->block_size) { - error("Bad length of argument 1 to cbc->decrypt_block()\n"); + Pike_error("Bad length of argument 1 to cbc->decrypt_block()\n"); } if (!(result = alloca(sp[-1].u.string->len))) { - error("cbc->cbc_decrypt(): Out of memory\n"); + Pike_error("cbc->cbc_decrypt(): Out of memory\n"); } while (offset < sp[-1].u.string->len) { diff --git a/src/modules/_Crypto/crypto.c b/src/modules/_Crypto/crypto.c index feb2ac32a9e8d6cf59fb2c4ae3556d613a8cc937..d7d10376ce825dce87101d2023f11b4d87f30217 100644 --- a/src/modules/_Crypto/crypto.c +++ b/src/modules/_Crypto/crypto.c @@ -1,5 +1,5 @@ /* - * $Id: crypto.c,v 1.39 2000/10/02 19:35:02 grubba Exp $ + * $Id: crypto.c,v 1.40 2000/12/01 08:10:27 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -91,7 +91,7 @@ static void check_functions(struct object *o, const char **requiered) struct program *p; if (!o) { - error("/precompiled/crypto: internal error -- no object\n"); + Pike_error("/precompiled/crypto: internal Pike_error -- no object\n"); } if (!requiered) { return; @@ -101,7 +101,7 @@ static void check_functions(struct object *o, const char **requiered) while (*requiered) { if (find_identifier( (char *) *requiered, p) < 0) { - error("/precompiled/crypto: Object is missing identifier \"%s\"\n", + Pike_error("/precompiled/crypto: Object is missing identifier \"%s\"\n", *requiered); } requiered++; @@ -124,10 +124,10 @@ static void f_string_to_hex(INT32 args) INT32 i; if (args != 1) { - error("Wrong number of arguments to string_to_hex()\n"); + Pike_error("Wrong number of arguments to string_to_hex()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to string_to_hex()\n"); + Pike_error("Bad argument 1 to string_to_hex()\n"); } s = begin_shared_string(2 * sp[-1].u.string->len); @@ -147,13 +147,13 @@ static void f_hex_to_string(INT32 args) INT32 i; if (args != 1) { - error("Wrong number of arguments to hex_to_string()\n"); + Pike_error("Wrong number of arguments to hex_to_string()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to hex_to_string()\n"); + Pike_error("Bad argument 1 to hex_to_string()\n"); } if (sp[-1].u.string->len & 1) { - error("Bad string length to hex_to_string()\n"); + Pike_error("Bad string length to hex_to_string()\n"); } s = begin_shared_string(sp[-1].u.string->len/2); @@ -171,7 +171,7 @@ static void f_hex_to_string(INT32 args) break; default: free_string(end_shared_string(s)); - error("hex_to_string(): Illegal character (0x%02x) in string\n", + Pike_error("hex_to_string(): Illegal character (0x%02x) in string\n", sp[-1].u.string->str[i*2] & 0xff); } switch (sp[-1].u.string->str[i*2+1]) @@ -186,7 +186,7 @@ static void f_hex_to_string(INT32 args) break; default: free_string(end_shared_string(s)); - error("hex_to_string(): Illegal character (0x%02x) in string\n", + Pike_error("hex_to_string(): Illegal character (0x%02x) in string\n", sp[-1].u.string->str[i*2+1] & 0xff); } } @@ -207,10 +207,10 @@ static void f_des_parity(INT32 args) struct pike_string *s; int i; if (args != 1) { - error("Wrong number of arguments to des_parity()\n"); + Pike_error("Wrong number of arguments to des_parity()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to des_parity()\n"); + Pike_error("Bad argument 1 to des_parity()\n"); } s = begin_shared_string(sp[-1].u.string->len); @@ -230,17 +230,17 @@ static void f_des_parity(INT32 args) static void f_create(INT32 args) { if (args < 1) { - error("Too few arguments to crypto->create()\n"); + Pike_error("Too few arguments to crypto->create()\n"); } if ((sp[-args].type != T_PROGRAM) && (sp[-args].type != T_OBJECT)) { - error("Bad argument 1 to crypto->create()\n"); + Pike_error("Bad argument 1 to crypto->create()\n"); } if (sp[-args].type == T_PROGRAM) { THIS->object = clone_object(sp[-args].u.program, args-1); } else { if (args != 1) { - error("Too many arguments to crypto->create()\n"); + Pike_error("Too many arguments to crypto->create()\n"); } add_ref(THIS->object = sp[-args].u.object); } @@ -251,7 +251,7 @@ static void f_create(INT32 args) safe_apply(THIS->object, "query_block_size", 0); if (sp[-1].type != T_INT) { - error("crypto->create(): query_block_size() didn't return an int\n"); + Pike_error("crypto->create(): query_block_size() didn't return an int\n"); } THIS->block_size = sp[-1].u.integer; @@ -259,7 +259,7 @@ static void f_create(INT32 args) if ((!THIS->block_size) || (THIS->block_size > 4096)) { - error("crypto->create(): Bad block size %ld\n", + Pike_error("crypto->create(): Bad block size %ld\n", DO_NOT_WARN((long)THIS->block_size)); } @@ -288,7 +288,7 @@ static void f_set_encrypt_key(INT32 args) MEMSET(THIS->backlog, 0, THIS->block_size); THIS->backlog_len = 0; } else { - error("crypto->set_encrypt_key(): Object has not been created yet\n"); + Pike_error("crypto->set_encrypt_key(): Object has not been created yet\n"); } safe_apply(THIS->object, "set_encrypt_key", args); pop_stack(); @@ -302,7 +302,7 @@ static void f_set_decrypt_key(INT32 args) MEMSET(THIS->backlog, 0, THIS->block_size); THIS->backlog_len = 0; } else { - error("crypto->set_decrypt_key(): Object has not been created yet\n"); + Pike_error("crypto->set_decrypt_key(): Object has not been created yet\n"); } safe_apply(THIS->object, "set_decrypt_key", args); pop_stack(); @@ -318,13 +318,13 @@ static void f_crypto_crypt(INT32 args) ptrdiff_t len; if (args != 1) { - error("Wrong number of arguments to crypto->crypt()\n"); + Pike_error("Wrong number of arguments to crypto->crypt()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to crypto->crypt()\n"); + Pike_error("Bad argument 1 to crypto->crypt()\n"); } if (!(result = alloca(sp[-1].u.string->len + THIS->block_size))) { - error("crypto->crypt(): Out of memory\n"); + Pike_error("crypto->crypt(): Out of memory\n"); } if (THIS->backlog_len) { if (sp[-1].u.string->len >= @@ -338,10 +338,10 @@ static void f_crypto_crypt(INT32 args) THIS->block_size)); safe_apply(THIS->object, "crypt_block", 1); if (sp[-1].type != T_STRING) { - error("crypto->crypt(): crypt_block() did not return string\n"); + Pike_error("crypto->crypt(): crypt_block() did not return string\n"); } if (sp[-1].u.string->len != THIS->block_size) { - error("crypto->crypt(): Unexpected string length %ld\n", + Pike_error("crypto->crypt(): Unexpected string length %ld\n", DO_NOT_WARN((long)sp[-1].u.string->len)); } @@ -369,10 +369,10 @@ static void f_crypto_crypt(INT32 args) safe_apply(THIS->object, "crypt_block", 1); if (sp[-1].type != T_STRING) { - error("crypto->crypt(): crypt_block() did not return string\n"); + Pike_error("crypto->crypt(): crypt_block() did not return string\n"); } if (sp[-1].u.string->len != len) { - error("crypto->crypt(): Unexpected string length %ld\n", + Pike_error("crypto->crypt(): Unexpected string length %ld\n", DO_NOT_WARN((long)sp[-1].u.string->len)); } @@ -399,7 +399,7 @@ static void f_pad(INT32 args) ptrdiff_t i; if (args) { - error("Too many arguments to crypto->pad()\n"); + Pike_error("Too many arguments to crypto->pad()\n"); } for (i = THIS->backlog_len; i < THIS->block_size - 1; i++) @@ -424,21 +424,21 @@ static void f_unpad(INT32 args) struct pike_string *str; if (args != 1) - error("Wrong number of arguments to crypto->unpad()\n"); + Pike_error("Wrong number of arguments to crypto->unpad()\n"); if (sp[-1].type != T_STRING) - error("Bad argument 1 to crypto->unpad()\n"); + Pike_error("Bad argument 1 to crypto->unpad()\n"); str = sp[-1].u.string; len = str->len; if (str->str[len - 1] > (THIS->block_size - 1)) - error("crypto->unpad(): Invalid padding\n"); + Pike_error("crypto->unpad(): Invalid padding\n"); len -= (str->str[len - 1] + 1); if (len < 0) - error("crypto->unpad(): String to short to unpad\n"); + Pike_error("crypto->unpad(): String to short to unpad\n"); add_ref(str); pop_stack(); diff --git a/src/modules/_Crypto/des.c b/src/modules/_Crypto/des.c index c0ad3e2c3348da3e1f2a0fe03bc19bddc56ffbd3..886b9fcb6f2f164b15aaf0ffadba427e5841fd65 100644 --- a/src/modules/_Crypto/des.c +++ b/src/modules/_Crypto/des.c @@ -1,5 +1,5 @@ /* - * $Id: des.c,v 1.17 2000/08/09 13:15:09 grubba Exp $ + * $Id: des.c,v 1.18 2000/12/01 08:10:27 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -94,25 +94,25 @@ static void f_query_key_length(INT32 args) static void set_key(INT32 args) { if (args != 1) { - error("Wrong number of arguments to des->set_key()\n"); + Pike_error("Wrong number of arguments to des->set_key()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to des->set_key()\n"); + Pike_error("Bad argument 1 to des->set_key()\n"); } if (sp[-1].u.string->len != 8) - error("Invalid key length to des->set_key()\n"); + Pike_error("Invalid key length to des->set_key()\n"); switch (DesMethod(THIS->method, (unsigned INT8 *)sp[-1].u.string->str)) { case -1: - error("des->set_key: parity error\n"); + Pike_error("des->set_key: parity Pike_error\n"); break; case -2: - error("des->set_key: key is weak!\n"); + Pike_error("des->set_key: key is weak!\n"); break; case 0: break; default: - error("des->set_key: invalid return value from desMethod, can't happen\n"); + Pike_error("des->set_key: invalid return value from desMethod, can't happen\n"); } pop_n_elems(args); push_object(this_object()); @@ -140,15 +140,15 @@ static void f_crypt_block(INT32 args) size_t i; if (args != 1) { - error("Wrong number of arguments to des->crypt_block()\n"); + Pike_error("Wrong number of arguments to des->crypt_block()\n"); } if (!THIS->crypt_fun) - error("des->crypt_block: must set key first\n"); + Pike_error("des->crypt_block: must set key first\n"); if (sp[-1].type != T_STRING) { - error("Bad argument 1 to des->crypt_block()\n"); + Pike_error("Bad argument 1 to des->crypt_block()\n"); } if ((len = sp[-1].u.string->len) % DES_BLOCKSIZE) { - error("Bad string length in des->crypt_block()\n"); + Pike_error("Bad string length in des->crypt_block()\n"); } s = begin_shared_string(len); for(i = 0; i < len; i += DES_BLOCKSIZE) diff --git a/src/modules/_Crypto/idea.c b/src/modules/_Crypto/idea.c index 6781bfdbd6884fc9ec1446adc78ef45f0be9bec1..0bd319ebb2bc8e34fa75714b5506c32838585d53 100644 --- a/src/modules/_Crypto/idea.c +++ b/src/modules/_Crypto/idea.c @@ -1,5 +1,5 @@ /* - * $Id: idea.c,v 1.15 2000/08/09 13:14:27 grubba Exp $ + * $Id: idea.c,v 1.16 2000/12/01 08:10:28 hubbe Exp $ * * IDEA crypto module for Pike * @@ -18,7 +18,7 @@ #include "interpret.h" #include "svalue.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "las.h" /* Backend includes */ @@ -59,7 +59,7 @@ void exit_pike_crypto_idea(struct object *o) static void f_name(INT32 args) { if (args) { - error("Too many arguments to idea->name()\n"); + Pike_error("Too many arguments to idea->name()\n"); } push_string(make_shared_string("IDEA")); } @@ -68,7 +68,7 @@ static void f_name(INT32 args) static void f_query_block_size(INT32 args) { if (args) { - error("Too many arguments to idea->query_block_size()\n"); + Pike_error("Too many arguments to idea->query_block_size()\n"); } push_int(IDEA_BLOCKSIZE); } @@ -77,7 +77,7 @@ static void f_query_block_size(INT32 args) static void f_query_key_length(INT32 args) { if (args) { - error("Too many arguments to idea->query_key_length()\n"); + Pike_error("Too many arguments to idea->query_key_length()\n"); } push_int(IDEA_KEYSIZE); } @@ -86,13 +86,13 @@ static void f_query_key_length(INT32 args) static void f_set_encrypt_key(INT32 args) { if (args != 1) { - error("Wrong number of args to idea->set_encrypt_key()\n"); + Pike_error("Wrong number of args to idea->set_encrypt_key()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to idea->set_encrypt_key()\n"); + Pike_error("Bad argument 1 to idea->set_encrypt_key()\n"); } if (sp[-1].u.string->len != IDEA_KEYSIZE) { - error("idea->set_encrypt_key(): Invalid key length\n"); + Pike_error("idea->set_encrypt_key(): Invalid key length\n"); } idea_expand(THIS, (unsigned char *)sp[-1].u.string->str); @@ -115,15 +115,15 @@ static void f_crypt_block(INT32 args) ptrdiff_t i; if (args != 1) { - error("Wrong number of arguemnts to idea->crypt()\n"); + Pike_error("Wrong number of arguemnts to idea->crypt()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to idea->crypt()\n"); + Pike_error("Bad argument 1 to idea->crypt()\n"); } len = sp[-1].u.string->len; if (len % IDEA_BLOCKSIZE) { - error("Bad length of argument 1 to idea->crypt()\n"); + Pike_error("Bad length of argument 1 to idea->crypt()\n"); } s = begin_shared_string(len); diff --git a/src/modules/_Crypto/invert.c b/src/modules/_Crypto/invert.c index 5b6c464791316a26de6cc13e6daa7da6026aeb9f..fe396fccab43a8565474ed1c60482b3b553f6a65 100644 --- a/src/modules/_Crypto/invert.c +++ b/src/modules/_Crypto/invert.c @@ -1,5 +1,5 @@ /* - * $Id: invert.c,v 1.10 2000/08/09 13:18:58 grubba Exp $ + * $Id: invert.c,v 1.11 2000/12/01 08:10:28 hubbe Exp $ * * INVERT crypto module for Pike * @@ -53,7 +53,7 @@ void exit_pike_crypto_invert(struct object *o) static void f_name(INT32 args) { if (args) { - error("Too many arguments to invert->name()\n"); + Pike_error("Too many arguments to invert->name()\n"); } push_string(make_shared_string("INVERT")); } @@ -62,7 +62,7 @@ static void f_name(INT32 args) static void f_query_block_size(INT32 args) { if (args) { - error("Too many arguments to invert->query_block_size()\n"); + Pike_error("Too many arguments to invert->query_block_size()\n"); } push_int(8); } @@ -71,7 +71,7 @@ static void f_query_block_size(INT32 args) static void f_query_key_length(INT32 args) { if (args) { - error("Too many arguments to invert->query_key_length()\n"); + Pike_error("Too many arguments to invert->query_key_length()\n"); } push_int(0); } @@ -80,10 +80,10 @@ static void f_query_key_length(INT32 args) static void f_set_key(INT32 args) { if (args != 1) { - error("Wrong number of args to invert->set_key()\n"); + Pike_error("Wrong number of args to invert->set_key()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to invert->set_key()\n"); + Pike_error("Bad argument 1 to invert->set_key()\n"); } pop_n_elems(args); push_object(this_object()); @@ -97,17 +97,17 @@ static void f_crypt_block(INT32 args) ptrdiff_t len; if (args != 1) { - error("Wrong number of arguments to invert->crypt_block()\n"); + Pike_error("Wrong number of arguments to invert->crypt_block()\n"); } if (sp[-1].type != T_STRING) { - error("Bad argument 1 to invert->crypt_block()\n"); + Pike_error("Bad argument 1 to invert->crypt_block()\n"); } if (sp[-1].u.string->len % 8) { - error("Bad length of argument 1 to invert->crypt_block()\n"); + Pike_error("Bad length of argument 1 to invert->crypt_block()\n"); } if (!(buffer = alloca(len = sp[-1].u.string->len))) { - error("invert->crypt_block(): Out of memory\n"); + Pike_error("invert->crypt_block(): Out of memory\n"); } for (i=0; i<len; i++) { diff --git a/src/modules/_Crypto/md2.c b/src/modules/_Crypto/md2.c index c3c074a1bc1ebca722ec9ecb55f341e2826eb94d..55739c0eca96eedece92e09e6a5b13597b45553e 100644 --- a/src/modules/_Crypto/md2.c +++ b/src/modules/_Crypto/md2.c @@ -1,5 +1,5 @@ /* - * $Id: md2.c,v 1.9 2000/08/09 13:20:46 grubba Exp $ + * $Id: md2.c,v 1.10 2000/12/01 08:10:28 hubbe Exp $ * * A pike module for MD2 hashing. * @@ -17,7 +17,7 @@ #include "object.h" #include "interpret.h" #include "program.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include <md2.h> @@ -37,7 +37,7 @@ static struct program *md2mod_program; static void f_name(INT32 args) { if (args) - error("Too many arguments to md2->name()\n"); + Pike_error("Too many arguments to md2->name()\n"); push_string(make_shared_string("MD2")); } @@ -48,7 +48,7 @@ static void f_create(INT32 args) { if ( ((sp-args)->type != T_OBJECT) || ((sp-args)->u.object->prog != md2mod_program) ) - error("Object not of md2 type.\n"); + Pike_error("Object not of md2 type.\n"); md2_copy(THIS, OBTOCTX((sp-args)->u.object)); } else diff --git a/src/modules/_Crypto/md5.c b/src/modules/_Crypto/md5.c index 38f1fd1951dbfe27e798cdb9012f99ac389c7410..2a16493a626414b10386fd27cc8e5c5ed6186e3e 100644 --- a/src/modules/_Crypto/md5.c +++ b/src/modules/_Crypto/md5.c @@ -1,5 +1,5 @@ /* - * $Id: md5.c,v 1.14 2000/08/09 13:21:24 grubba Exp $ + * $Id: md5.c,v 1.15 2000/12/01 08:10:29 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -19,7 +19,7 @@ #include "object.h" #include "interpret.h" #include "program.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include <md5.h> @@ -39,7 +39,7 @@ static struct program *md5mod_program; static void f_name(INT32 args) { if (args) - error("Too many arguments to md5->name()\n"); + Pike_error("Too many arguments to md5->name()\n"); push_string(make_shared_string("MD5")); } @@ -50,7 +50,7 @@ static void f_create(INT32 args) { if ( ((sp-args)->type != T_OBJECT) || ((sp-args)->u.object->prog != md5mod_program) ) - error("Object not of md5 type.\n"); + Pike_error("Object not of md5 type.\n"); md5_copy(THIS, OBTOCTX((sp-args)->u.object)); } else diff --git a/src/modules/_Crypto/nt.c b/src/modules/_Crypto/nt.c index 93ab7aa98e53f82285e4b0f6e07836242f7beecf..7dae7ca2fe5e7fa413f0eefb5fa950deeda9720c 100644 --- a/src/modules/_Crypto/nt.c +++ b/src/modules/_Crypto/nt.c @@ -1,5 +1,5 @@ /* - * $Id: nt.c,v 1.6 2000/08/10 09:51:55 per Exp $ + * $Id: nt.c,v 1.7 2000/12/01 08:10:29 hubbe Exp $ * * NT crypto stuff for Pike */ @@ -18,7 +18,7 @@ #include "interpret.h" #include "svalue.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "las.h" #include "module_support.h" diff --git a/src/modules/_Crypto/pipe.c b/src/modules/_Crypto/pipe.c index 39e9dddc235092d1c49d8d6d9bd5d9b8c6ac53af..ba290915aad74b00096d8fb017b782386ccd8420 100644 --- a/src/modules/_Crypto/pipe.c +++ b/src/modules/_Crypto/pipe.c @@ -1,5 +1,5 @@ /* - * $Id: pipe.c,v 1.18 2000/08/15 13:02:44 grubba Exp $ + * $Id: pipe.c,v 1.19 2000/12/01 08:10:29 hubbe Exp $ * * PIPE crypto module for Pike. * @@ -83,7 +83,7 @@ static void f_create(INT32 args) int block_size=1; if (!args) { - error("_Crypto.pipe->create(): Too few arguments\n"); + Pike_error("_Crypto.pipe->create(): Too few arguments\n"); } THIS->objects = (struct object **)xalloc(args * sizeof(struct object *)); MEMSET(THIS->objects, 0, args * sizeof(struct object *)); @@ -97,11 +97,11 @@ static void f_create(INT32 args) INT32 n_args; if (!sp[i].u.array->size) { - error("_Crypto.pipe->create(): Argument %d: Empty array\n", + Pike_error("_Crypto.pipe->create(): Argument %d: Empty array\n", 1 + args + i); } if (sp[i].u.array->item[0].type != T_PROGRAM) { - error("_Crypto.pipe->create(): Argument %d: " + Pike_error("_Crypto.pipe->create(): Argument %d: " "First element of array must be a program\n", 1 + args + i); } @@ -115,7 +115,7 @@ static void f_create(INT32 args) assert_is_crypto_module(THIS->objects[args + i]); } else { - error("_Crypto.pipe->create(): Bad argument %d\n", i + args); + Pike_error("_Crypto.pipe->create(): Bad argument %d\n", i + args); } } THIS->num_objs = args; @@ -127,11 +127,11 @@ static void f_create(INT32 args) safe_apply(THIS->objects[i], "query_block_size", 0); if (sp[-1].type != T_INT) { - error("_Crypto.pipe->create(): query_block_size() returned other than int\n" + Pike_error("_Crypto.pipe->create(): query_block_size() returned other than int\n" "for object #%d\n", i+1); } if (!(sub_size = sp[-1].u.integer)) { - error("_Crypto.pipe->create(): query_block_size() returned zero\n" + Pike_error("_Crypto.pipe->create(): query_block_size() returned zero\n" "for object #%d\n", i+1); } pop_stack(); @@ -201,7 +201,7 @@ static void f_set_encrypt_key(INT32 args) int i; if (args != THIS->num_objs) { - error("_Crypto.pipe->set_encrypt_key(): Wrong number of arguments\n"); + Pike_error("_Crypto.pipe->set_encrypt_key(): Wrong number of arguments\n"); } THIS->mode = 0; for (i=-args; i; i++) { @@ -214,7 +214,7 @@ static void f_set_encrypt_key(INT32 args) n_args = sp[i].u.array->size; push_array_items(sp[i].u.array); } else { - error("_Crypto.pipe->set_encrypt_key(): Bad argument %d\n", + Pike_error("_Crypto.pipe->set_encrypt_key(): Bad argument %d\n", 1 + args + i); } safe_apply(THIS->objects[args + i], "set_encrypt_key", n_args); @@ -230,7 +230,7 @@ static void f_set_decrypt_key(INT32 args) int i; if (args != THIS->num_objs) { - error("_Crypto.pipe->set_decrypt_key(): Wrong number of arguments\n"); + Pike_error("_Crypto.pipe->set_decrypt_key(): Wrong number of arguments\n"); } THIS->mode = 1; for (i=-args; i; i++) { @@ -243,7 +243,7 @@ static void f_set_decrypt_key(INT32 args) n_args = sp[i].u.array->size; push_array_items(sp[i].u.array); } else { - error("_Crypto.pipe->set_decrypt_key(): Bad argument %d\n", + Pike_error("_Crypto.pipe->set_decrypt_key(): Bad argument %d\n", 1 + args + i); } safe_apply(THIS->objects[args + i], "set_decrypt_key", n_args); @@ -259,16 +259,16 @@ static void f_crypt_block(INT32 args) int i; if (args < 1) { - error("_Crypto.pipe->crypt_block(): Too few arguments\n"); + Pike_error("_Crypto.pipe->crypt_block(): Too few arguments\n"); } if (args > 1) { pop_n_elems(args-1); } if (sp[-1].type != T_STRING) { - error("_Crypto.pipe->crypt_block(): Bad argument 1\n"); + Pike_error("_Crypto.pipe->crypt_block(): Bad argument 1\n"); } if (sp[-1].u.string->len % THIS->block_size) { - error("_Crypto.pipe->crypt_block(): Bad length of argument 1\n"); + Pike_error("_Crypto.pipe->crypt_block(): Bad length of argument 1\n"); } if (THIS->mode) { /* Decryption -- Reverse the order */ diff --git a/src/modules/_Crypto/rijndael.c b/src/modules/_Crypto/rijndael.c index 47aef626d2063e503d6742f1839d0f7948892e79..4f5e491e60d680b5bd280cb6f7995439554ac696 100644 --- a/src/modules/_Crypto/rijndael.c +++ b/src/modules/_Crypto/rijndael.c @@ -1,5 +1,5 @@ /* - * $Id: rijndael.c,v 1.3 2000/10/10 20:52:56 grubba Exp $ + * $Id: rijndael.c,v 1.4 2000/12/01 08:10:30 hubbe Exp $ * * A pike module for getting access to some common cryptos. * @@ -97,7 +97,7 @@ static void f_set_encrypt_key(INT32 args) get_all_args("rijndael->set_encrypt_key()", args, "%S", &key); if (((key->len - 8) & ~0x18) || (!key->len)) { - error("rijndael->set_encrypt_key(): Bad key length " + Pike_error("rijndael->set_encrypt_key(): Bad key length " "(must be 16, 24 or 32).\n"); } MEMCPY(k, key->str, key->len); @@ -114,7 +114,7 @@ static void f_set_decrypt_key(INT32 args) get_all_args("rijndael->set_encrypt_key()", args, "%S", &key); if (((key->len - 8) & ~0x18) || (key->len != 8)) { - error("rijndael->set_encrypt_key(): Bad key length " + Pike_error("rijndael->set_encrypt_key(): Bad key length " "(must be 16, 24 or 32).\n"); } MEMCPY(k, key->str, key->len); @@ -132,15 +132,15 @@ static void f_crypt_block(INT32 args) size_t i; if (args != 1) { - error("Wrong number of arguments to rijndael->crypt_block()\n"); + Pike_error("Wrong number of arguments to rijndael->crypt_block()\n"); } if (!THIS->crypt_fun) - error("rijndael->crypt_block: must set key first\n"); + Pike_error("rijndael->crypt_block: must set key first\n"); if (sp[-1].type != T_STRING) { - error("Bad argument 1 to rijndael->crypt_block()\n"); + Pike_error("Bad argument 1 to rijndael->crypt_block()\n"); } if ((len = sp[-1].u.string->len) % RIJNDAEL_BLOCK_SIZE) { - error("Bad string length in rijndael->crypt_block()\n"); + Pike_error("Bad string length in rijndael->crypt_block()\n"); } s = begin_shared_string(len); for(i = 0; i < len; i += RIJNDAEL_BLOCK_SIZE) diff --git a/src/modules/_Crypto/rsa.c b/src/modules/_Crypto/rsa.c index aca57543761254198c2c4bbbce8f56fe8ae41151..3b4bd9ca596967e5531abd7e5046c1c9ae3068e8 100644 --- a/src/modules/_Crypto/rsa.c +++ b/src/modules/_Crypto/rsa.c @@ -1,5 +1,5 @@ /* - * $Id: rsa.c,v 1.23 2000/08/10 09:51:55 per Exp $ + * $Id: rsa.c,v 1.24 2000/12/01 08:10:30 hubbe Exp $ * * Glue to RSA BSAFE's RSA implementation. * @@ -12,7 +12,7 @@ #include "program.h" #include "object.h" #include "interpret.h" -#include "error.h" +#include "pike_error.h" #include "port.h" #include "module_support.h" @@ -34,7 +34,7 @@ /* THIS MUST BE INCLUDED LAST */ #include "module_magic.h" -RCSID("$Id: rsa.c,v 1.23 2000/08/10 09:51:55 per Exp $"); +RCSID("$Id: rsa.c,v 1.24 2000/12/01 08:10:30 hubbe Exp $"); struct pike_rsa_data { @@ -133,10 +133,10 @@ static void init_pike_rsa(struct object *o) MEMSET(THIS, 0, sizeof(struct pike_rsa_data)); if ((code = B_CreateAlgorithmObject(&(THIS->cipher)))) { - error("Crypto.rsa(): Failed to create cipher object: %04x\n", code); + Pike_error("Crypto.rsa(): Failed to create cipher object: %04x\n", code); } if ((code = B_SetAlgorithmInfo(THIS->cipher, AI_RSAPublic, NULL_PTR))) { - error("Crypto.rsa(): Failed to initialize RSA algorithm: %04x\n", code); + Pike_error("Crypto.rsa(): Failed to initialize RSA algorithm: %04x\n", code); } } @@ -189,12 +189,12 @@ static void f_set_public_key(INT32 args) if ((sp[-1].type != T_STRING) || (!sp[-1].u.string) || (sp[-1].u.string->size_shift)) { - error("Crypto.rsa.set_public_key(): " + Pike_error("Crypto.rsa.set_public_key(): " "Unexpected return value from modulo->digits().\n"); } if (sp[-1].u.string->len < 12) { - error("Crypto.rsa.set_public_key(): Too small modulo.\n"); + Pike_error("Crypto.rsa.set_public_key(): Too small modulo.\n"); } /* We need to remember the modulus for the private key. */ @@ -207,12 +207,12 @@ static void f_set_public_key(INT32 args) if ((sp[-1].type != T_STRING) || (!sp[-1].u.string) || (sp[-1].u.string->size_shift)) { - error("Crypto.rsa.set_public_key(): " + Pike_error("Crypto.rsa.set_public_key(): " "Unexpected return value from pub->digits().\n"); } if ((code = B_CreateKeyObject(&(THIS->public_key)))) { - error("Crypto.rsa.set_public_key(): " + Pike_error("Crypto.rsa.set_public_key(): " "Failed to create public key object: %04x\n", code); } @@ -223,7 +223,7 @@ static void f_set_public_key(INT32 args) if ((code = B_SetKeyInfo(THIS->public_key, KI_RSAPublic, (POINTER)&rsa_public_key))) { - error("Crypto.rsa.set_public_key(): " + Pike_error("Crypto.rsa.set_public_key(): " "Failed to set public key: %04x\n", code); } @@ -253,7 +253,7 @@ static void f_set_private_key(INT32 args) } if (!THIS->n) { - error("Crypto.rsa.set_private_key(): Public key hasn't been set.\n"); + Pike_error("Crypto.rsa.set_private_key(): Public key hasn't been set.\n"); } push_int(256); @@ -261,12 +261,12 @@ static void f_set_private_key(INT32 args) if ((sp[-1].type != T_STRING) || (!sp[-1].u.string) || (sp[-1].u.string->size_shift)) { - error("Crypto.rsa.set_private_key(): " + Pike_error("Crypto.rsa.set_private_key(): " "Unexpected return value from priv->digits().\n"); } if ((code = B_CreateKeyObject(&(THIS->private_key)))) { - error("Crypto.rsa.set_private_key(): " + Pike_error("Crypto.rsa.set_private_key(): " "Failed to create private key object: %04x\n", code); } @@ -277,7 +277,7 @@ static void f_set_private_key(INT32 args) if ((code = B_SetKeyInfo(THIS->private_key, KI_RSAPublic, (POINTER)&rsa_private_key))) { - error("Crypto.rsa.set_private_key(): " + Pike_error("Crypto.rsa.set_private_key(): " "Failed to set private key: %04x\n", code); } @@ -294,12 +294,12 @@ static void f_cooked_get_n(INT32 args) int code; if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((code = B_GetKeyInfo((POINTER *)&rsa_public_key, THIS->public_key, KI_RSAPublic))) { - error("Crypto rsa.cooked_get_n(): " + Pike_error("Crypto rsa.cooked_get_n(): " "Failed to get public key: %04x\n", code); } @@ -316,12 +316,12 @@ static void f_cooked_get_e(INT32 args) int code; if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((code = B_GetKeyInfo((POINTER *)&rsa_public_key, THIS->public_key, KI_RSAPublic))) { - error("Crypto rsa.cooked_get_n(): " + Pike_error("Crypto rsa.cooked_get_n(): " "Failed to get public key: %04x\n", code); } @@ -338,12 +338,12 @@ static void f_cooked_get_d(INT32 args) int code; if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((code = B_GetKeyInfo((POINTER *)&rsa_private_key, THIS->private_key, KI_RSAPrivate))) { - error("Crypto rsa.cooked_get_d(): " + Pike_error("Crypto rsa.cooked_get_d(): " "Failed to get private key: %04x\n", code); } @@ -360,12 +360,12 @@ static void f_cooked_get_p(INT32 args) int code; if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((code = B_GetKeyInfo((POINTER *)&rsa_private_key, THIS->private_key, KI_PKCS_RSAPrivate))) { - error("Crypto rsa.cooked_get_p(): " + Pike_error("Crypto rsa.cooked_get_p(): " "Failed to get private key: %04x\n", code); } @@ -382,12 +382,12 @@ static void f_cooked_get_q(INT32 args) int code; if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((code = B_GetKeyInfo((POINTER *)&rsa_private_key, THIS->private_key, KI_PKCS_RSAPrivate))) { - error("Crypto rsa.cooked_get_q(): " + Pike_error("Crypto rsa.cooked_get_q(): " "Failed to get private key: %04x\n", code); } @@ -401,7 +401,7 @@ static void f_cooked_get_q(INT32 args) static void f_query_blocksize(INT32 args) { if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } pop_n_elems(args); @@ -411,7 +411,7 @@ static void f_query_blocksize(INT32 args) /* bignum rsa_pad(string message, int type, mixed|void random) */ static void f_rsa_pad(INT32 args) { - error("Not yet implemented.\n"); + Pike_error("Not yet implemented.\n"); pop_n_elems(args); push_int(0); } @@ -427,7 +427,7 @@ static void f_low_unpad(INT32 args) get_all_args("low_unpad", args, "%S%i", &block, &type); if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if ((block->str[0]) || @@ -470,11 +470,11 @@ static void f_rsa_unpad(INT32 args) if ((sp[-1].type != T_STRING) || (!sp[-1].u.string) || (sp[-1].u.string->size_shift)) { - error("Unexpected return value from block->digits().\n"); + Pike_error("Unexpected return value from block->digits().\n"); } if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } if (((i = strlen(sp[-1].u.string->str)) < 9) || @@ -506,20 +506,20 @@ static void f_cooked_sign(INT32 args) /* Digits(Decrypt(Pad(digest, 1))); */ if (!THIS->private_key) { - error("Private key has not been set.\n"); + Pike_error("Private key has not been set.\n"); } get_all_args("cooked_sign", args, "%S", &digest); if ((err = B_DecryptInit(THIS->cipher, THIS->private_key, rsa_chooser, (A_SURRENDER_CTX *)NULL_PTR))) { - error("Failed to initialize decrypter: %04x\n", err); + Pike_error("Failed to initialize decrypter: %04x\n", err); } /* rsa_pad(digest, 1, 0) inlined. */ len = THIS->n->len - 3 - digest->len; if (len < 8) { - error("Too large block.\n"); + Pike_error("Too large block.\n"); } buffer = (unsigned char *)xalloc(THIS->n->len+1); @@ -545,7 +545,7 @@ static void f_cooked_sign(INT32 args) (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); free(buffer); - error("Decrypt failed: %04x\n", err); + Pike_error("Decrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -560,7 +560,7 @@ static void f_cooked_sign(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); - error("Decrypt failed: %04x\n", err); + Pike_error("Decrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -572,7 +572,7 @@ static void f_cooked_sign(INT32 args) #if defined(PIKE_RSA_DEBUG) || defined(PIKE_DEBUG) if (len != (unsigned int)THIS->n->len) { free_string(s); - error("Decrypted string has bad length. Expected %d. Got %d\n", + Pike_error("Decrypted string has bad length. Expected %d. Got %d\n", THIS->n->len, len); } #endif /* PIKE_RSA_DEBUG || PIKE_DEBUG */ @@ -593,14 +593,14 @@ static void f_raw_verify(INT32 args) unsigned int len; if (!THIS->private_key) { - error("Private key has not been set.\n"); + Pike_error("Private key has not been set.\n"); } get_all_args("raw_verify", args, "%S%o", &digest, &o); if ((err = B_EncryptInit(THIS->cipher, THIS->public_key, rsa_chooser, (A_SURRENDER_CTX *)NULL_PTR))) { - error("Failed to initialize encrypter: %04x\n", err); + Pike_error("Failed to initialize encrypter: %04x\n", err); } /* Digest == rsa_unpad(encrypt(digits(s)), 1) */ @@ -610,7 +610,7 @@ static void f_raw_verify(INT32 args) if ((sp[-1].type != T_STRING) || (!sp[-1].u.string) || (sp[-1].u.string->size_shift)) { - error("Crypto.rsa.raw_verify(): " + Pike_error("Crypto.rsa.raw_verify(): " "Unexpected return value from o->digits().\n"); } @@ -624,7 +624,7 @@ static void f_raw_verify(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); - error("Encrypt failed: %04x\n", err); + Pike_error("Encrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -637,7 +637,7 @@ static void f_raw_verify(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); - error("Encrypt failed: %04x\n", err); + Pike_error("Encrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -649,7 +649,7 @@ static void f_raw_verify(INT32 args) #if defined(PIKE_RSA_DEBUG) || defined(PIKE_DEBUG) if (len != (unsigned int)THIS->n->len) { free_string(s); - error("Encrypted string has bad length. Expected %d. Got %d\n", + Pike_error("Encrypted string has bad length. Expected %d. Got %d\n", THIS->n->len, len); } #endif /* PIKE_RSA_DEBUG || PIKE_DEBUG */ @@ -680,20 +680,20 @@ static void f_encrypt(INT32 args) unsigned int i; if (!THIS->private_key) { - error("Private key has not been set.\n"); + Pike_error("Private key has not been set.\n"); } get_all_args("encrypt", args, "%S", &s); if ((err = B_EncryptInit(THIS->cipher, THIS->public_key, rsa_chooser, (A_SURRENDER_CTX *)NULL_PTR))) { - error("Failed to initialize encrypter: %04x\n", err); + Pike_error("Failed to initialize encrypter: %04x\n", err); } /* rsa_pad(s, 2, r) inlined. */ len = THIS->n->len - 3 - s->len; if (len < 8) { - error("Too large block.\n"); + Pike_error("Too large block.\n"); } buffer = (unsigned char *)xalloc(THIS->n->len+1); @@ -711,7 +711,7 @@ static void f_encrypt(INT32 args) apply_svalue(r, 1); if ((sp[-1].type != T_STRING) || (sp[-1].u.string->size_shift) || ((unsigned int)sp[-1].u.string->len != len)) { - error("Unexpected return value from the random function\n"); + Pike_error("Unexpected return value from the random function\n"); } MEMCPY(buffer + 2, sp[-1].u.string->str, len); pop_stack(); @@ -744,7 +744,7 @@ static void f_encrypt(INT32 args) (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); free(buffer); - error("Encrypt failed: %04x\n", err); + Pike_error("Encrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -759,7 +759,7 @@ static void f_encrypt(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free_string(s); - error("Encrypt failed: %04x\n", err); + Pike_error("Encrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -771,7 +771,7 @@ static void f_encrypt(INT32 args) #if defined(PIKE_RSA_DEBUG) || defined(PIKE_DEBUG) if (len != (unsigned int)THIS->n->len) { free_string(s); - error("Encrypted string has bad length. Expected %d. Got %d\n", + Pike_error("Encrypted string has bad length. Expected %d. Got %d\n", THIS->n->len, len); } #endif /* PIKE_RSA_DEBUG || PIKE_DEBUG */ @@ -791,14 +791,14 @@ static void f_decrypt(INT32 args) unsigned int i; if (!THIS->private_key) { - error("Private key has not been set.\n"); + Pike_error("Private key has not been set.\n"); } get_all_args("decrypt", args, "%S", &s); if ((err = B_DecryptInit(THIS->cipher, THIS->private_key, rsa_chooser, (A_SURRENDER_CTX *)NULL_PTR))) { - error("Failed to initialize decrypter: %04x\n", err); + Pike_error("Failed to initialize decrypter: %04x\n", err); } buffer = (unsigned char *)xalloc(s->len+1); @@ -810,7 +810,7 @@ static void f_decrypt(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free(buffer); - error("decrypt failed: %04x\n", err); + Pike_error("decrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -822,7 +822,7 @@ static void f_decrypt(INT32 args) (B_ALGORITHM_OBJ)NULL_PTR, (A_SURRENDER_CTX *)NULL_PTR))) { free(buffer); - error("Decrypt failed: %04x\n", err); + Pike_error("Decrypt failed: %04x\n", err); } #ifdef PIKE_RSA_DEBUG @@ -866,7 +866,7 @@ static void f_decrypt(INT32 args) static void f_rsa_size(INT32 args) { if (!THIS->n) { - error("Public key has not been set.\n"); + Pike_error("Public key has not been set.\n"); } pop_n_elems(args); diff --git a/src/modules/_Crypto/sha.c b/src/modules/_Crypto/sha.c index 4133f7707f937393bfad0fff1b37f0607cc6d40a..de2aa59386449a21a49fd648129e3ed72d663727 100644 --- a/src/modules/_Crypto/sha.c +++ b/src/modules/_Crypto/sha.c @@ -1,4 +1,4 @@ -/* $Id: sha.c,v 1.17 2000/08/09 13:19:44 grubba Exp $ +/* $Id: sha.c,v 1.18 2000/12/01 08:10:31 hubbe Exp $ * * Written by Niels M�ller */ @@ -12,11 +12,11 @@ #include "object.h" #include "interpret.h" #include "program.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "las.h" -RCSID("$Id: sha.c,v 1.17 2000/08/09 13:19:44 grubba Exp $"); +RCSID("$Id: sha.c,v 1.18 2000/12/01 08:10:31 hubbe Exp $"); #include <sha.h> @@ -33,7 +33,7 @@ static struct program *shamod_program; static void f_name(INT32 args) { if (args) - error("Too many arguments to sha->name()\n"); + Pike_error("Too many arguments to sha->name()\n"); push_string(make_shared_string("SHA")); } @@ -44,7 +44,7 @@ static void f_create(INT32 args) { if ( ((sp-args)->type != T_OBJECT) || ((sp-args)->u.object->prog != shamod_program) ) - error("Object not of sha type.\n"); + Pike_error("Object not of sha type.\n"); sha_copy(THIS, OBTOCTX((sp-args)->u.object)); } else diff --git a/src/modules/_Image_GIF/image_gif.c b/src/modules/_Image_GIF/image_gif.c index c6dc55d329b6f6532639b04bd69204f8d968bfe2..6f2b7226aee23093fa4250885ec8a3a20d472578 100644 --- a/src/modules/_Image_GIF/image_gif.c +++ b/src/modules/_Image_GIF/image_gif.c @@ -1,9 +1,9 @@ -/* $Id: image_gif.c,v 1.1 2000/09/11 16:05:04 grubba Exp $ */ +/* $Id: image_gif.c,v 1.2 2000/12/01 08:10:31 hubbe Exp $ */ /* **! module Image **! note -**! $Id: image_gif.c,v 1.1 2000/09/11 16:05:04 grubba Exp $ +**! $Id: image_gif.c,v 1.2 2000/12/01 08:10:31 hubbe Exp $ **! submodule GIF **! **! This submodule keep the GIF encode/decode capabilities @@ -35,7 +35,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: image_gif.c,v 1.1 2000/09/11 16:05:04 grubba Exp $"); +RCSID("$Id: image_gif.c,v 1.2 2000/12/01 08:10:31 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -43,7 +43,7 @@ RCSID("$Id: image_gif.c,v 1.1 2000/09/11 16:05:04 grubba Exp $"); #include "svalue.h" #include "threads.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "threads.h" #include "../Image/image.h" @@ -169,10 +169,10 @@ void image_gif_header_block(INT32 args) int alphaentry=0; if (args<3) - error("Image.GIF.header_block(): too few arguments\n"); + Pike_error("Image.GIF.header_block(): too few arguments\n"); if (sp[-args].type!=T_INT || sp[1-args].type!=T_INT) - error("Image.GIF.header_block(): illegal argument(s) 1..2 (expected int)\n"); + Pike_error("Image.GIF.header_block(): illegal argument(s) 1..2 (expected int)\n"); xs=sp[-args].u.integer; ys=sp[1-args].u.integer; @@ -191,24 +191,24 @@ void image_gif_header_block(INT32 args) globalpalette=1; } else - error("Image.GIF.header_block(): illegal argument 3 (expected int or colortable object)\n"); + Pike_error("Image.GIF.header_block(): illegal argument 3 (expected int or colortable object)\n"); if (args>=4) { if (sp[3-args].type!=T_INT) - error("Image.GIF.header_block(): illegal argument 4 (expected int)\n"); + Pike_error("Image.GIF.header_block(): illegal argument 4 (expected int)\n"); else bkgi=sp[3-args].u.integer; } if (args>=5) { if (sp[4-args].type!=T_INT) - error("Image.GIF.header_block(): illegal argument 4 (expected int)\n"); + Pike_error("Image.GIF.header_block(): illegal argument 4 (expected int)\n"); else gif87a=sp[4-args].u.integer; } if (args>=7) { if (sp[5-args].type!=T_INT || sp[6-args].type!=T_INT) - error("Image.GIF.header_block(): illegal argument(s) 5..6 (expected int)\n"); + Pike_error("Image.GIF.header_block(): illegal argument(s) 5..6 (expected int)\n"); else if (sp[5-args].u.integer && sp[6-args].u.integer) @@ -222,7 +222,7 @@ void image_gif_header_block(INT32 args) if (sp[7-args].type!=T_INT || sp[8-args].type!=T_INT || sp[9-args].type!=T_INT) - error("Image.GIF.header_block(): illegal argument 8..10 (expected int)\n"); + Pike_error("Image.GIF.header_block(): illegal argument 8..10 (expected int)\n"); alphacolor.r=(unsigned char)(sp[7-args].u.integer); alphacolor.g=(unsigned char)(sp[8-args].u.integer); alphacolor.b=(unsigned char)(sp[9-args].u.integer); @@ -230,7 +230,7 @@ void image_gif_header_block(INT32 args) } if (numcolors+alphaentry>256) - error("Image.GIF.header_block(): too many colors (%ld%s)\n", + Pike_error("Image.GIF.header_block(): too many colors (%ld%s)\n", DO_NOT_WARN((long)(numcolors + alphaentry)), alphaentry?" including alpha channel color":""); @@ -339,13 +339,13 @@ static void image_gif__gce_block(INT32 args) { char buf[20]; if (args<5) - error("Image.GIF._gce_block(): too few arguments\n"); + Pike_error("Image.GIF._gce_block(): too few arguments\n"); if (sp[-args].type!=T_INT || sp[1-args].type!=T_INT || sp[2-args].type!=T_INT || sp[3-args].type!=T_INT || sp[4-args].type!=T_INT) - error("Image.GIF._gce_block(): Illegal argument(s)\n"); + Pike_error("Image.GIF._gce_block(): Illegal argument(s)\n"); sprintf(buf,"%c%c%c%c%c%c%c%c", 0x21, /* extension intruder */ 0xf9, /* gce extension */ @@ -409,7 +409,7 @@ static void image_gif__render_block(INT32 args) CHRONO("gif _render_block begun"); if (args<8) - error("Image.GIF._render_block(): Too few arguments\n"); + Pike_error("Image.GIF._render_block(): Too few arguments\n"); if (sp[-args].type!=T_INT || sp[1-args].type!=T_INT || @@ -418,7 +418,7 @@ CHRONO("gif _render_block begun"); sp[4-args].type!=T_INT || sp[5-args].type!=T_STRING || sp[7-args].type!=T_INT) - error("Image.GIF._render_block(): Illegal argument(s)\n"); + Pike_error("Image.GIF._render_block(): Illegal argument(s)\n"); xpos=sp[-args].u.integer; ypos=sp[1-args].u.integer; @@ -440,13 +440,13 @@ CHRONO("gif _render_block begun"); cps=sp[6-args].u.string; localpalette=1; if (cps->len!=3*(1<<bpp)) - error("Image.GIF._render_block(): colortable string has wrong length\n"); + Pike_error("Image.GIF._render_block(): colortable string has wrong length\n"); } else - error("Image.GIF._render_block(): Illegal argument(s)\n"); + Pike_error("Image.GIF._render_block(): Illegal argument(s)\n"); if (xs*ys!=ips->len) - error("Image.GIF._render_block(): indices string has wrong length\n"); + Pike_error("Image.GIF._render_block(): indices string has wrong length\n"); /*** write image rendering header */ @@ -484,7 +484,7 @@ CHRONO("gif _render_block begun"); numstrings++; image_gif_lzw_init(&lzw,(bpp<2)?2:bpp); - if (lzw.broken) error("out of memory\n"); + if (lzw.broken) Pike_error("out of memory\n"); THREADS_ALLOW(); @@ -507,7 +507,7 @@ CHRONO("gif _render_block begun"); THREADS_DISALLOW(); - if (lzw.broken) error("out of memory\n"); + if (lzw.broken) Pike_error("out of memory\n"); CHRONO("gif _render_block push of packed data begin"); @@ -701,23 +701,23 @@ void image_gif_render_block(INT32 args) CHRONO("gif render_block begin"); if (args<2) - error("Image.GIF.render_block(): Too few arguments\n"); + Pike_error("Image.GIF.render_block(): Too few arguments\n"); if (sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(sp[-args].u.object,image_program))) - error("Image.GIF.render_block(): Illegal argument 1 (expected image object)\n"); + Pike_error("Image.GIF.render_block(): Illegal argument 1 (expected image object)\n"); else if (!img->img) - error("Image.GIF.render_block(): given image has no image\n"); + Pike_error("Image.GIF.render_block(): given image has no image\n"); if (sp[1-args].type!=T_OBJECT || !(nct=(struct neo_colortable*) get_storage(sp[1-args].u.object,image_colortable_program))) - error("Image.GIF.render_block(): Illegal argument 2 (expected colortable object)\n"); + Pike_error("Image.GIF.render_block(): Illegal argument 2 (expected colortable object)\n"); if (args>=4) { if (sp[2-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument 3 (expected int)\n"); + Pike_error("Image:GIF.render_block(): Illegal argument 3 (expected int)\n"); if (sp[3-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument 4 (expected int)\n"); + Pike_error("Image:GIF.render_block(): Illegal argument 4 (expected int)\n"); xpos=sp[2-args].u.integer; ypos=sp[3-args].u.integer; } @@ -725,16 +725,16 @@ CHRONO("gif render_block begin"); numcolors=image_colortable_size(nct); if (numcolors==0) - error("Image.GIF.render_block(): no colors in colortable\n"); + Pike_error("Image.GIF.render_block(): no colors in colortable\n"); else if (numcolors>256) - error("Image.GIF.render_block(): too many colors in given colortable: " + Pike_error("Image.GIF.render_block(): too many colors in given colortable: " "%ld (256 is max)\n", DO_NOT_WARN((long)numcolors)); if (args>=5) { if (sp[4-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument 5 (expected int)\n"); + Pike_error("Image:GIF.render_block(): Illegal argument 5 (expected int)\n"); localpalette=sp[4-args].u.integer; } else localpalette=0; @@ -744,10 +744,10 @@ CHRONO("gif render_block begin"); (alpha=(struct image*)get_storage(sp[5-args].u.object,image_program))) { if (!alpha->img) - error("Image.GIF.render_block(): given alpha channel has no image\n"); + Pike_error("Image.GIF.render_block(): given alpha channel has no image\n"); else if (alpha->xsize != img->xsize || alpha->ysize != img->ysize) - error("Image.GIF.render_block(): given alpha channel differ in size from given image\n"); + Pike_error("Image.GIF.render_block(): given alpha channel differ in size from given image\n"); alphaidx=numcolors; n=9; @@ -757,7 +757,7 @@ CHRONO("gif render_block begin"); if (sp[6-args].type!=T_INT || sp[7-args].type!=T_INT || sp[8-args].type!=T_INT) - error("Image.GIF.render_block(): illegal argument 7..9 (expected int)\n"); + Pike_error("Image.GIF.render_block(): illegal argument 7..9 (expected int)\n"); alphacolor.r=(unsigned char)(sp[6-args].u.integer); alphacolor.g=(unsigned char)(sp[7-args].u.integer); alphacolor.b=(unsigned char)(sp[8-args].u.integer); @@ -766,7 +766,7 @@ CHRONO("gif render_block begin"); in image_gif_header_block */ alphaentry=1; if (numcolors>255) - error("Image.GIF.render_block(): too many colors in colortable (255 is max, need one for transparency)\n"); + Pike_error("Image.GIF.render_block(): too many colors in colortable (255 is max, need one for transparency)\n"); } } else if (sp[5-args].type==T_INT) @@ -774,14 +774,14 @@ CHRONO("gif render_block begin"); n=5; } else - error("Image:GIF.render_block(): Illegal argument 6 (expected int or image object)\n"); + Pike_error("Image:GIF.render_block(): Illegal argument 6 (expected int or image object)\n"); if (alphaidx!=-1) transparency=1; else transparency=0; if (args>n) /* interlace and gce arguments */ { if (args>n) { if (sp[n-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); + Pike_error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); else delay=sp[n-args].u.integer; } @@ -790,7 +790,7 @@ CHRONO("gif render_block begin"); { if (args>n) { if (sp[n-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); + Pike_error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); else { alphaidx=sp[n-args].u.integer; @@ -800,7 +800,7 @@ CHRONO("gif render_block begin"); { transparency=1; if (numcolors<=alphaidx || alphaidx<0) - error("Image.GIF.render_block(): illegal index to transparent color\n"); + Pike_error("Image.GIF.render_block(): illegal index to transparent color\n"); } n=6; } @@ -809,21 +809,21 @@ CHRONO("gif render_block begin"); } if (args>n) { if (sp[n-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); + Pike_error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); else interlace=!!sp[n-args].u.integer; } n++; if (args>n) { if (sp[n-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); + Pike_error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); else user_input=!!sp[n-args].u.integer; } n++; if (args>n) { if (sp[n-args].type!=T_INT) - error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); + Pike_error("Image:GIF.render_block(): Illegal argument %d (expected int)\n",n+1); else disposal=sp[n-args].u.integer&7; } @@ -1001,12 +1001,12 @@ void _image_gif_encode(INT32 args,int fs) int arg=2; if (args<1) - error("Image.GIF.encode(): Too few arguments\n"); + Pike_error("Image.GIF.encode(): Too few arguments\n"); if (sp[-args].type!=T_OBJECT || !(img=(struct image*)get_storage(imgobj=sp[-args].u.object, image_program))) - error("Image.GIF.encode(): Illegal argument 1 (expected image object)\n"); + Pike_error("Image.GIF.encode(): Illegal argument 1 (expected image object)\n"); add_ref(imgobj); @@ -1024,13 +1024,13 @@ void _image_gif_encode(INT32 args,int fs) nct=(struct neo_colortable*) get_storage(nctobj,image_colortable_program); if (!nct) - error("Image.GIF.encode(): Internal error; colortable isn't colortable\n"); + Pike_error("Image.GIF.encode(): Internal Pike_error; colortable isn't colortable\n"); arg=2; } else arg=1; } else if (sp[1-args].type!=T_OBJECT) - error("Image.GIF.encode(): Illegal argument 2 (expected image or colortable object or int)\n"); + Pike_error("Image.GIF.encode(): Illegal argument 2 (expected image or colortable object or int)\n"); else if ((nct=(struct neo_colortable*) get_storage(nctobj=sp[1-args].u.object,image_colortable_program))) { @@ -1054,7 +1054,7 @@ void _image_gif_encode(INT32 args,int fs) sp[1+arg-args].type!=T_INT || sp[2+arg-args].type!=T_INT || sp[3+arg-args].type!=T_INT) - error("Image.GIF.encode: Illegal arguments %d..%d (expected int)\n",arg+2,arg+4); + Pike_error("Image.GIF.encode: Illegal arguments %d..%d (expected int)\n",arg+2,arg+4); else { ac.r=sp[1+arg-args].u.integer; @@ -1076,7 +1076,7 @@ void _image_gif_encode(INT32 args,int fs) sp[arg-args].type==T_INT) tridx=sp[arg-args].u.integer; else - error("Image.GIF.encode(): Illegal argument %d or %d..%d\n", + Pike_error("Image.GIF.encode(): Illegal argument %d or %d..%d\n", arg+1,arg+1,arg+3); trans=1; } @@ -1095,7 +1095,7 @@ void _image_gif_encode(INT32 args,int fs) nct=(struct neo_colortable*) get_storage(nctobj,image_colortable_program); if (!nct) - error("Image.GIF.encode(): Internal error; colortable isn't colortable\n"); + Pike_error("Image.GIF.encode(): Internal Pike_error; colortable isn't colortable\n"); } tr.r=(unsigned char)sp[arg-args].u.integer; @@ -1117,7 +1117,7 @@ void _image_gif_encode(INT32 args,int fs) nct=(struct neo_colortable*) get_storage(nctobj,image_colortable_program); if (!nct) - error("Image.GIF.encode(): Internal error; colortable isn't colortable\n"); + Pike_error("Image.GIF.encode(): Internal Pike_error; colortable isn't colortable\n"); } if (fs) image_colortable_internal_floyd_steinberg(nct); @@ -1208,7 +1208,7 @@ void image_gif_netscape_loop_block(INT32 args) char buf[30]; if (args) { if (sp[-args].type!=T_INT) - error("Image.GIF.netscape_loop_block: illegal argument (exected int)\n"); + Pike_error("Image.GIF.netscape_loop_block: illegal argument (exected int)\n"); else loops=sp[-args].u.integer; } else @@ -1404,7 +1404,7 @@ static void image_gif___decode(INT32 args) if (args!=1 || sp[-args].type!=T_STRING) - error("Image.GIF.__decode: illegal or illegal number of arguments\n"); + Pike_error("Image.GIF.__decode: illegal or illegal number of arguments\n"); add_ref(str=sp[-args].u.string); s=(unsigned char *)str->str; @@ -1439,7 +1439,7 @@ static void image_gif___decode(INT32 args) s[0]!='G' || s[1]!='I' || s[2]!='F') - error("Image.GIF.__decode: not a GIF (no GIF header found)\n"); + Pike_error("Image.GIF.__decode: not a GIF (no GIF header found)\n"); xsize=s[6]+(s[7]<<8); ysize=s[8]+(s[9]<<8); @@ -1452,7 +1452,7 @@ static void image_gif___decode(INT32 args) s+=13; len-=13; if (globalpalette && len<(unsigned long)(3<<bpp)) - error("Image.GIF.__decode: premature EOD (in global palette)\n"); + Pike_error("Image.GIF.__decode: premature EOD (in global palette)\n"); push_int(xsize); push_int(ysize); @@ -1761,7 +1761,7 @@ fprintf(stderr,"_gif_decode_lzw(%lx,%lu,%d,%lx,%lx,%lx,%lu,%d)\n", #ifdef GIF_DEBUG fprintf(stderr,"cancel; gif codes=%ld m=%ld\n",maxcode,m); #endif - break; /* error! too much codes */ + break; /* Pike_error! too much codes */ } } } @@ -1814,7 +1814,7 @@ void image_gif__decode(INT32 args) struct image *img,*aimg=NULL; if (!args) - error("Image.GIF._decode: too few argument\n"); + Pike_error("Image.GIF._decode: too few argument\n"); if (sp[-args].type==T_ARRAY) pop_n_elems(args-1); @@ -1822,12 +1822,12 @@ void image_gif__decode(INT32 args) image_gif___decode(args); if (sp[-1].type!=T_ARRAY) - error("Image.GIF._decode: internal error: " + Pike_error("Image.GIF._decode: internal Pike_error: " "illegal result from __decode\n"); a=sp[-1].u.array; if (a->size<5) - error("Image.GIF._decode: given (__decode'd) array " + Pike_error("Image.GIF._decode: given (__decode'd) array " "is too small\n"); push_svalue(a->item+0); /* xsize */ @@ -1853,14 +1853,14 @@ void image_gif__decode(INT32 args) if (a->item[i].type!=T_ARRAY || (b=a->item[i].u.array)->size<1 || b->item[0].type!=T_INT) - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents (position %d)\n",i); else switch (b->item[0].u.integer) { case GIF_RENDER: if (b->size!=9) - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents " "(illegal size of block array in position %d)\n",i); if (b->item[0].type!=T_INT || @@ -1871,7 +1871,7 @@ void image_gif__decode(INT32 args) b->item[5].type!=T_INT || b->item[7].type!=T_INT || b->item[8].type!=T_STRING) - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents " "(illegal type(s) in block array in position %d)\n",i); @@ -1954,11 +1954,11 @@ void image_gif__decode(INT32 args) break; case GIF_EXTENSION: if (b->size!=3) - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents " "(illegal size of block array in position %d)\n",i); if (b->item[2].type!=T_STRING) - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents " "(no data string of block array in position %d)\n",i); switch (b->item[1].u.integer) @@ -1986,7 +1986,7 @@ void image_gif__decode(INT32 args) n++; break; default: - error("Image.GIF._decode: given (__decode'd) " + Pike_error("Image.GIF._decode: given (__decode'd) " "array has illegal contents (illegal type of " "block in position %d)\n",i); } @@ -2021,13 +2021,13 @@ void image_gif_decode(INT32 args) int n; if (!args) - error("Image.GIF._decode: too few argument\n"); + Pike_error("Image.GIF._decode: too few argument\n"); if (sp[-args].type==T_ARRAY) { pop_n_elems(args-1); if (sp[-args].u.array->size<4) - error("Image.GIF.decode: illegal argument\n"); + Pike_error("Image.GIF.decode: illegal argument\n"); if (sp[-args].u.array->item[3].type!=T_ARRAY) image_gif__decode(1); } @@ -2035,12 +2035,12 @@ void image_gif_decode(INT32 args) image_gif__decode(args); if (sp[-1].type!=T_ARRAY) - error("Image.GIF.decode: internal error: " + Pike_error("Image.GIF.decode: internal Pike_error: " "illegal result from _decode\n"); a=sp[-1].u.array; if (a->size<4) - error("Image.GIF.decode: given (_decode'd) array " + Pike_error("Image.GIF.decode: given (_decode'd) array " "is too small\n"); push_svalue(a->item+0); @@ -2114,13 +2114,13 @@ void image_gif_decode_layers(INT32 args) int numlayers=0; if (!args) - error("Image.GIF.decode_layers: too few argument\n"); + Pike_error("Image.GIF.decode_layers: too few argument\n"); if (sp[-args].type==T_ARRAY) { pop_n_elems(args-1); if (sp[-args].u.array->size<4) - error("Image.GIF.decode: illegal argument\n"); + Pike_error("Image.GIF.decode: illegal argument\n"); if (sp[-args].u.array->item[3].type!=T_ARRAY) image_gif__decode(1); } @@ -2128,12 +2128,12 @@ void image_gif_decode_layers(INT32 args) image_gif__decode(args); if (sp[-1].type!=T_ARRAY) - error("Image.GIF.decode: internal error: " + Pike_error("Image.GIF.decode: internal Pike_error: " "illegal result from _decode\n"); a=sp[-1].u.array; if (a->size<4) - error("Image.GIF.decode: given (_decode'd) array " + Pike_error("Image.GIF.decode: given (_decode'd) array " "is too small\n"); for (n=4; n<a->size; n++) @@ -2254,13 +2254,13 @@ void image_gif__encode_render(INT32 args) if (args<2 || sp[-args].type!=T_ARRAY || sp[1-args].type!=T_INT) - error("Image.GIF._encode_render: Illegal argument(s) (expected array, int)\n"); + Pike_error("Image.GIF._encode_render: Illegal argument(s) (expected array, int)\n"); localp=sp[1-args].u.integer; add_ref(a=sp[-args].u.array); if (a->size<11) - error("Image.GIF._encode_render: Illegal size of array\n"); + Pike_error("Image.GIF._encode_render: Illegal size of array\n"); pop_n_elems(args); @@ -2280,13 +2280,13 @@ void image_gif__encode_render(INT32 args) if (!nct) { free_array(a); - error("Image.GIF._encode_render: Passed object is not colortable\n"); + Pike_error("Image.GIF._encode_render: Passed object is not colortable\n"); } if (nct->type!=NCT_FLAT) { free_array(a); - error("Image.GIF._encode_render: Passed colortable is not flat (sorry9\n"); + Pike_error("Image.GIF._encode_render: Passed colortable is not flat (sorry9\n"); } push_svalue(a->item+4); if (a->item[7].type==T_INT @@ -2329,16 +2329,16 @@ void image_gif__encode_extension(INT32 args) if (args<1 || sp[-args].type!=T_ARRAY) - error("Image.GIF._encode_extension: Illegal argument(s) (expected array)\n"); + Pike_error("Image.GIF._encode_extension: Illegal argument(s) (expected array)\n"); add_ref(a=sp[-args].u.array); pop_n_elems(args); if (a->size<3) - error("Image.GIF._encode_extension: Illegal size of array\n"); + Pike_error("Image.GIF._encode_extension: Illegal size of array\n"); if (a->item[1].type!=T_INT || a->item[2].type!=T_STRING) - error("Image.GIF._encode_extension: Illegal type in indices 1 or 2\n"); + Pike_error("Image.GIF._encode_extension: Illegal type in indices 1 or 2\n"); sprintf(buf,"%c%c",0x21,a->item[1].u.integer); push_string(make_shared_binary_string(buf,2)); @@ -2389,7 +2389,7 @@ void image_gif__encode(INT32 args) if (args<1 || sp[-args].type!=T_ARRAY) - error("Image.GIF._encode: Illegal argument (expected array)"); + Pike_error("Image.GIF._encode: Illegal argument (expected array)"); add_ref(a=sp[-args].u.array); pos=0; @@ -2397,7 +2397,7 @@ void image_gif__encode(INT32 args) pop_n_elems(args); if (a->size<4) - error("Image.GIF._encode: Given array too small\n"); + Pike_error("Image.GIF._encode: Given array too small\n"); push_svalue(a->item+0); /* xsize */ push_svalue(a->item+1); /* ysize */ @@ -2407,7 +2407,7 @@ void image_gif__encode(INT32 args) || a->item[3].u.array->size<3) { free_array(a); - error("Image.GIF._encode: Illegal type on array index 3 (expected array)\n"); + Pike_error("Image.GIF._encode: Illegal type on array index 3 (expected array)\n"); } push_svalue(a->item[3].u.array->item+2); /* bkgi */ @@ -2424,7 +2424,7 @@ void image_gif__encode(INT32 args) if (a->item[pos].type!=T_ARRAY) { free_array(a); - error("Image.GIF._encode: Illegal type on array index %d (expected array)\n",pos); + Pike_error("Image.GIF._encode: Illegal type on array index %d (expected array)\n",pos); } b=a->item[pos].u.array; @@ -2432,7 +2432,7 @@ void image_gif__encode(INT32 args) || b->item[0].type!=T_INT) { free_array(a); - error("Image.GIF._encode: Illegal array on array index %d\n",pos); + Pike_error("Image.GIF._encode: Illegal array on array index %d\n",pos); } if (b->item[0].u.integer==GIF_RENDER) @@ -2466,10 +2466,10 @@ static void image_gif_lzw_encode(INT32 args) struct gif_lzw lzw; if (!args || sp[-args].type!=T_STRING) - error("Image.GIF.lzw_encode(): illegal argument\n"); + Pike_error("Image.GIF.lzw_encode(): illegal argument\n"); image_gif_lzw_init(&lzw,8); - if (lzw.broken) error("out of memory\n"); + if (lzw.broken) Pike_error("out of memory\n"); if (args>=2 && !IS_ZERO(sp+1-args)) lzw.earlychange=1; @@ -2483,7 +2483,7 @@ static void image_gif_lzw_encode(INT32 args) image_gif_lzw_finish(&lzw); - if (lzw.broken) error("out of memory\n"); + if (lzw.broken) Pike_error("out of memory\n"); pop_n_elems(args); push_string(make_shared_binary_string((char*)lzw.out,lzw.outpos)); @@ -2504,7 +2504,7 @@ static void image_gif_lzw_decode(INT32 args) int reversebits=0; if (!args || sp[-args].type!=T_STRING) - error("Image.GIF.lzw_encode(): illegal argument\n"); + Pike_error("Image.GIF.lzw_encode(): illegal argument\n"); s=(unsigned char*)sp[-args].u.string->str; len = (ptrdiff_t)sp[-args].u.string->len; @@ -2536,7 +2536,7 @@ static void image_gif_lzw_decode(INT32 args) if (!dest0) { free(c); - error("Image.GIF.lzw_decode: out of memory\n"); + Pike_error("Image.GIF.lzw_decode: out of memory\n"); } dest=dest0; dlen=dlen0; @@ -2680,7 +2680,7 @@ static void image_gif_lzw_decode(INT32 args) #ifdef GIF_DEBUG fprintf(stderr,"cancel; gif codes=%ld m=%ld\n",maxcode,m); #endif - break; /* error! too much codes */ + break; /* Pike_error! too much codes */ } } } diff --git a/src/modules/_Image_JPEG/image_jpeg.c b/src/modules/_Image_JPEG/image_jpeg.c index da67ba0e2bfe94732ed4f1c088b50b65fb37bd3b..25394c9f975bfcf6ef983282cf52565928ab6156 100644 --- a/src/modules/_Image_JPEG/image_jpeg.c +++ b/src/modules/_Image_JPEG/image_jpeg.c @@ -1,5 +1,5 @@ /* - * $Id: image_jpeg.c,v 1.35 2000/09/08 16:05:35 grubba Exp $ + * $Id: image_jpeg.c,v 1.36 2000/12/01 08:10:31 hubbe Exp $ */ #include "global.h" @@ -37,7 +37,7 @@ #ifdef HAVE_STDLIB_H #undef HAVE_STDLIB_H #endif -RCSID("$Id: image_jpeg.c,v 1.35 2000/09/08 16:05:35 grubba Exp $"); +RCSID("$Id: image_jpeg.c,v 1.36 2000/12/01 08:10:31 hubbe Exp $"); /* For some reason EXTERN can be defined here. * This is not good, since it confuses compilation.h. @@ -54,7 +54,7 @@ RCSID("$Id: image_jpeg.c,v 1.35 2000/09/08 16:05:35 grubba Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "threads.h" #include "builtin_functions.h" @@ -116,7 +116,7 @@ static void my_error_exit(struct jpeg_common_struct *cinfo) (*cinfo->err->format_message) (cinfo, buffer); jpeg_destroy(cinfo); - error("Image.JPEG: fatal error in libjpeg; %s\n",buffer); + Pike_error("Image.JPEG: fatal Pike_error in libjpeg; %s\n",buffer); } static void my_emit_message(struct jpeg_common_struct *cinfo,int msg_level) @@ -234,21 +234,21 @@ static int parameter_qt(struct svalue *map,struct pike_string *what, if (!v) return 0; else if (v->type!=T_MAPPING) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping\n"); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping\n"); m=v->u.mapping; MAPPING_LOOP(m) { int z; if (k->ind.type!=T_INT || k->val.type!=T_ARRAY) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int:array)\n"); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int:array)\n"); if (k->ind.u.integer<0 || k->ind.u.integer>=NUM_QUANT_TBLS) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int(0..%d):array)\n",NUM_QUANT_TBLS-1); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int(0..%d):array)\n",NUM_QUANT_TBLS-1); if ((z=store_int_in_table(k->val.u.array,DCTSIZE2,table))!= DCTSIZE2) - error("Image.JPEG.encode: illegal value of option quant_table;" + Pike_error("Image.JPEG.encode: illegal value of option quant_table;" " quant_table %d array is of illegal size (%d), " "expected %d integers\n", k->ind.u.integer,z,DCTSIZE2); @@ -272,21 +272,21 @@ static int parameter_qt_d(struct svalue *map,struct pike_string *what, if (!v) return 0; else if (v->type!=T_MAPPING) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping\n"); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping\n"); m=v->u.mapping; MAPPING_LOOP(m) { int z; if (k->ind.type!=T_INT || k->val.type!=T_ARRAY) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int:array)\n"); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int:array)\n"); if (k->ind.u.integer<0 || k->ind.u.integer>=NUM_QUANT_TBLS) - error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int(0..%d):array)\n",NUM_QUANT_TBLS-1); + Pike_error("Image.JPEG.encode: illegal value of option quant_table; expected mapping(int(0..%d):array)\n",NUM_QUANT_TBLS-1); if ((z=store_int_in_table(k->val.u.array,DCTSIZE2,table))!= DCTSIZE2) - error("Image.JPEG.encode: illegal value of option quant_table;" + Pike_error("Image.JPEG.encode: illegal value of option quant_table;" " quant_table %d array is of illegal size (%d), " "expected %d integers\n", k->ind.u.integer,z,DCTSIZE2); @@ -426,15 +426,15 @@ static void image_jpeg_encode(INT32 args) || !(img=(struct image*) get_storage(sp[-args].u.object,image_program)) || (args>1 && sp[1-args].type!=T_MAPPING)) - error("Image.JPEG.encode: Illegal arguments\n"); + Pike_error("Image.JPEG.encode: Illegal arguments\n"); if (!img->img) - error("Image.JPEG.encode: Given image is empty.\n"); + Pike_error("Image.JPEG.encode: Given image is empty.\n"); tmp=malloc(img->xsize*3*8); if (!tmp) - error("Image.JPEG.encode: out of memory\n"); + Pike_error("Image.JPEG.encode: out of memory\n"); /* init jpeg library objects */ @@ -647,7 +647,7 @@ static void img_jpeg_decode(INT32 args,int mode) if (args<1 || sp[-args].type!=T_STRING || (args>1 && sp[1-args].type!=T_MAPPING)) - error("Image.JPEG.decode: Illegal arguments\n"); + Pike_error("Image.JPEG.decode: Illegal arguments\n"); /* init jpeg library objects */ @@ -777,14 +777,14 @@ static void img_jpeg_decode(INT32 args,int mode) o=clone_object(image_program,0); img=(struct image*)get_storage(o,image_program); - if (!img) error("image no image? foo?\n"); /* should never happen */ + if (!img) Pike_error("image no image? foo?\n"); /* should never happen */ img->img=malloc(sizeof(rgb_group)* cinfo.output_width*cinfo.output_height); if (!img->img) { jpeg_destroy((struct jpeg_common_struct*)&cinfo); free_object(o); - error("Image.JPEG.decode: out of memory\n"); + Pike_error("Image.JPEG.decode: out of memory\n"); } img->xsize=cinfo.output_width; img->ysize=cinfo.output_height; @@ -794,7 +794,7 @@ static void img_jpeg_decode(INT32 args,int mode) { jpeg_destroy((struct jpeg_common_struct*)&cinfo); free_object(o); - error("Image.JPEG.decode: out of memory\n"); + Pike_error("Image.JPEG.decode: out of memory\n"); } y=img->ysize; diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c index a1fb4116163af6105bd835c57d160b4939ebc3fc..6622ff57dc0457ac58ceaf894e786d44065577fe 100644 --- a/src/modules/_Image_TIFF/image_tiff.c +++ b/src/modules/_Image_TIFF/image_tiff.c @@ -7,7 +7,7 @@ */ #ifdef HAVE_LIBTIFF -RCSID("$Id: image_tiff.c,v 1.21 2000/09/07 11:25:38 grubba Exp $"); +RCSID("$Id: image_tiff.c,v 1.22 2000/12/01 08:10:32 hubbe Exp $"); #include "global.h" #include "machine.h" @@ -21,7 +21,7 @@ RCSID("$Id: image_tiff.c,v 1.21 2000/09/07 11:25:38 grubba Exp $"); #include "array.h" #include "mapping.h" #include "module_support.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "operators.h" #include "../Image/image.h" @@ -80,9 +80,9 @@ static void increase_buffer_size( struct buffer * buffer ) TRACE("increase_buffer_size(%p<%d,%d>)\n", buffer,buffer->len, buffer->offset); if(!buffer->extendable) - error("Extending non-extendable buffer!\n"); + Pike_error("Extending non-extendable buffer!\n"); if(buffer->len > 1024*1024*400) - error("Too large buffer (temprary error..)\n"); + Pike_error("Too large buffer (temprary Pike_error..)\n"); if(!buffer->len) buffer->len = INITIAL_WRITE_BUFFER_SIZE; /* FIXME: According to DMALLOC this leaks. @@ -91,7 +91,7 @@ static void increase_buffer_size( struct buffer * buffer ) * in which case realloc() is wrong. */ new_d = realloc( buffer->str, buffer->len*2 ); - if(!new_d) error("Realloc (%ld->%ld) failed!\n", + if(!new_d) Pike_error("Realloc (%ld->%ld) failed!\n", DO_NOT_WARN((long)buffer->len), DO_NOT_WARN((long)buffer->len*2)); MEMSET(new_d+buffer->len, 0, buffer->len); @@ -233,12 +233,12 @@ void low_image_tiff_encode( struct buffer *buf, size_buffer, map_buffer, unmap_buffer ); if(!tif) - error("\"open\" of TIF file failed!\n"); + Pike_error("\"open\" of TIF file failed!\n"); i = ((struct image *)get_storage(img->img,image_program)); if(!i) - error("Image is not an image object.\n"); + Pike_error("Image is not an image object.\n"); is = i->img; @@ -248,10 +248,10 @@ void low_image_tiff_encode( struct buffer *buf, spp++; a = ((struct image *)get_storage(img->alpha,image_program)); if(!a) - error("Alpha is not an image object.\n"); + Pike_error("Alpha is not an image object.\n"); if(i->xsize != a->xsize || i->ysize != a->ysize) - error("Image and alpha objects are not equally sized!\n"); + Pike_error("Image and alpha objects are not equally sized!\n"); } @@ -301,7 +301,7 @@ void low_image_tiff_encode( struct buffer *buf, if(TIFFWriteScanline(tif, buffer, y, 0) < 0) { free(buffer); - error("TIFFWriteScanline returned error on line %d\n", y ); + Pike_error("TIFFWriteScanline returned Pike_error on line %d\n", y ); } } free(buffer); @@ -335,17 +335,17 @@ void low_image_tiff_decode( struct buffer *buf, size_buffer, map_buffer, unmap_buffer); if(!tif) - error("Failed to 'open' tiff image.\n"); + Pike_error("Failed to 'open' tiff image.\n"); TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); s = raster = (uint32 *)_TIFFmalloc(w*h*sizeof(uint32)); if (raster == NULL) - error("Malloc failed to allocate buffer for %ldx%ld image\n", + Pike_error("Malloc failed to allocate buffer for %ldx%ld image\n", (long)w, (long)h); if(!TIFFReadRGBAImage(tif, w, h, raster, 0)) - error("Failed to read TIFF data\n"); + Pike_error("Failed to read TIFF data\n"); push_int(w); @@ -483,7 +483,7 @@ void low_image_tiff_decode( struct buffer *buf, push_text( "halftone or dithered scan" ); break; case THRESHHOLD_ERRORDIFFUSE: - push_text( "error diffused" ); + push_text( "Pike_error diffused" ); break; default: push_text( "unknown" ); @@ -608,10 +608,10 @@ static void image_tiff_decode( INT32 args ) struct buffer buffer; struct imagealpha res; if(!args) - error("Too few arguments to Image.TIFF.decode()\n"); + Pike_error("Too few arguments to Image.TIFF.decode()\n"); if(sp[-args].type != T_STRING) - error("Invalid argument 1 to Image.TIFF.decode()\n"); + Pike_error("Invalid argument 1 to Image.TIFF.decode()\n"); buffer.str = sp[-args].u.string->str; buffer.len = buffer.real_len =sp[-args].u.string->len; @@ -628,7 +628,7 @@ static void image_tiff_decode( INT32 args ) **! Decodes a TIFF image. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ /* @@ -637,7 +637,7 @@ static void image_tiff_decode( INT32 args ) **! image and alpha. **! **! note -**! Throws upon error in data. +**! Throws upon Pike_error in data. */ static void image_tiff__decode( INT32 args ) { @@ -645,9 +645,9 @@ static void image_tiff__decode( INT32 args ) struct imagealpha res; struct svalue *osp=sp; if(!args) - error("Too few arguments to Image.TIFF.decode()\n"); + Pike_error("Too few arguments to Image.TIFF.decode()\n"); if(sp[-args].type != T_STRING) - error("Invalid argument 1 to Image.TIFF.decode()\n"); + Pike_error("Invalid argument 1 to Image.TIFF.decode()\n"); MEMSET(&res, 0, sizeof(res)); buffer.str = sp[-args].u.string->str; @@ -764,7 +764,7 @@ static void image_tiff_encode( INT32 args ) { float dpy; if(sp[-args+1].type != T_MAPPING) - error("Invalid argument 2 to Image.TIFF.encode. Expected mapping.\n"); + Pike_error("Invalid argument 2 to Image.TIFF.encode. Expected mapping.\n"); parameter_int( sp-args+1, opt_compression, &c.compression ); if(parameter_float( sp-args+1, opt_dpy, &dpy )) c.xdpy = c.ydpy = dpy; diff --git a/src/modules/_Image_TTF/image_ttf.c b/src/modules/_Image_TTF/image_ttf.c index b9266b943f6d6b7ac4e0fe16a1b8a6eca47811fb..d4822bed200a53ad46bcb594b0470b14634a7b05 100644 --- a/src/modules/_Image_TTF/image_ttf.c +++ b/src/modules/_Image_TTF/image_ttf.c @@ -1,12 +1,12 @@ /* - * $Id: image_ttf.c,v 1.36 2000/09/11 18:31:57 grubba Exp $ + * $Id: image_ttf.c,v 1.37 2000/12/01 08:10:33 hubbe Exp $ */ #include "config.h" #include "global.h" -RCSID("$Id: image_ttf.c,v 1.36 2000/09/11 18:31:57 grubba Exp $"); +RCSID("$Id: image_ttf.c,v 1.37 2000/12/01 08:10:33 hubbe Exp $"); #ifdef HAVE_LIBTTF #if defined(HAVE_FREETYPE_FREETYPE_H) && defined(HAVE_FREETYPE_FTXKERN_H) @@ -30,7 +30,7 @@ RCSID("$Id: image_ttf.c,v 1.36 2000/09/11 18:31:57 grubba Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "builtin_functions.h" #include "operators.h" @@ -194,7 +194,7 @@ void my_tt_error(char *where,char *extra,int err) errc="TT_Err_Raster_Invalid_Value"; else if (err==TT_Err_Raster_Not_Initialized) errc="TT_Err_Raster_Not_Initialized"; - error("%s: %sFreeType error 0x%03x (%s)\n", + Pike_error("%s: %sFreeType Pike_error 0x%03x (%s)\n", where,extra,err,errc); } @@ -245,7 +245,7 @@ static void image_ttf_make(INT32 args) TT_Face face; if (sp[-args].type!=T_STRING) - error("Image.TTF(): illegal argument 1\n"); + Pike_error("Image.TTF(): illegal argument 1\n"); res=TT_Open_Collection(engine, sp[-args].u.string->str, col, &face); if (res) my_tt_error("Image.TTF()","",res); @@ -514,7 +514,7 @@ static void image_ttf_face__names(INT32 args) pop_n_elems(args); if ((ns=TT_Get_Name_Count(face))==-1) - error("Image.TTF.Face->names(): Illegal face handler\n"); + Pike_error("Image.TTF.Face->names(): Illegal face handler\n"); for (i=0; i<ns; i++) { @@ -552,7 +552,7 @@ static void image_ttf_face_names(INT32 args) image_ttf_face__names(args); if (sp[-1].type!=T_ARRAY) - error("Image.TTF.Face->names(): internal error, wierd _names()\n"); + Pike_error("Image.TTF.Face->names(): internal Pike_error, wierd _names()\n"); a=sp[-1].u.array; @@ -675,12 +675,12 @@ static void image_ttf_faceinstance_create(INT32 args) int res; if (!args) - error("Image.TTF.FaceInstance(): too few arguments\n"); + Pike_error("Image.TTF.FaceInstance(): too few arguments\n"); if (sp[-args].type!=T_OBJECT || !(face_s=(struct image_ttf_face_struct*) get_storage(sp[-args].u.object,image_ttf_face_program))) - error("Image.TTF.FaceInstance(): illegal argument 1\n"); + Pike_error("Image.TTF.FaceInstance(): illegal argument 1\n"); if ((res=TT_New_Instance(face_s->face,&(face_i->instance)))) my_tt_error("Image.TTF.FaceInstance()","TT_New_Instance: ",res); @@ -698,19 +698,19 @@ static void image_ttf_faceinstance_set_height(INT32 args) int h=0; if (!args) - error("Image.TTF.FaceInstance->set_height(): missing arguments\n"); + Pike_error("Image.TTF.FaceInstance->set_height(): missing arguments\n"); if (sp[-args].type==T_INT) h = sp[-args].u.integer*64; else if (sp[-args].type==T_FLOAT) h = DOUBLE_TO_INT(sp[-args].u.float_number*64); else - error("Image.TTF.FaceInstance->set_height(): illegal argument 1\n"); + Pike_error("Image.TTF.FaceInstance->set_height(): illegal argument 1\n"); if (h<1) h=1; if (!(face_s=(struct image_ttf_face_struct*) get_storage(THISi->faceobj,image_ttf_face_program))) - error("Image.TTF.FaceInstance->write(): lost Face\n"); + Pike_error("Image.TTF.FaceInstance->write(): lost Face\n"); ttf_instance_setc(face_s,face_i,h,"Image.TTF.FaceInstance->set_height()"); @@ -757,7 +757,7 @@ static void ttf_get_nice_charmap(TT_Face face, { int n,i,res,got=-1,best=-1; if (-1==(n=TT_Get_CharMap_Count(face))) - error("%s: illegal face handle\n",where); + Pike_error("%s: illegal face handle\n",where); for (i=0; i<n; i++) { @@ -789,7 +789,7 @@ static void ttf_get_nice_charmap(TT_Face face, } } if (got==-1) - error("%s: no charmaps at all\n",where); + Pike_error("%s: no charmaps at all\n",where); if ((res=TT_Get_CharMap(face, (TT_UShort)best, charMap))) my_tt_error(where,"TT_Get_CharMap: ",res); @@ -833,7 +833,7 @@ static void image_ttf_faceinstance_ponder(INT32 args) if (!(face_s=(struct image_ttf_face_struct*) get_storage(THISi->faceobj,image_ttf_face_program))) - error("Image.TTF.FaceInstance->ponder(): lost Face\n"); + Pike_error("Image.TTF.FaceInstance->ponder(): lost Face\n"); if (args && sp[-1].type==T_INT) { @@ -843,7 +843,7 @@ static void image_ttf_faceinstance_ponder(INT32 args) } if (sp[-args].type!=T_STRING) - error("Image.TTF.FaceInstance->ponder(): illegal argument 1\n"); + Pike_error("Image.TTF.FaceInstance->ponder(): illegal argument 1\n"); if(sp[-args].u.string->size_shift == 0) ttf_please_translate_8bit(face_s->face, @@ -854,7 +854,7 @@ static void image_ttf_faceinstance_ponder(INT32 args) sp[-args].u.string,&sstr,&len,base, "Image.TTF.FaceInstance->ponder()"); else - error("Too wide string for truetype\n"); + Pike_error("Too wide string for truetype\n"); pop_n_elems(args); @@ -983,7 +983,7 @@ static void image_ttf_faceinstance_write(INT32 args) if (!(face_s=(struct image_ttf_face_struct*) get_storage(THISi->faceobj,image_ttf_face_program))) - error("Image.TTF.FaceInstance->write(): lost Face\n"); + Pike_error("Image.TTF.FaceInstance->write(): lost Face\n"); if(!TT_Get_Kerning_Directory( face_s->face, &kerning )) { @@ -991,7 +991,7 @@ static void image_ttf_faceinstance_write(INT32 args) /* fprintf(stderr, "has kerning!\n"); */ has_kerning = 1; if(TT_Get_Instance_Metrics( face_i->instance, &metrics )) - error("Nope. No way.\n"); + Pike_error("Nope. No way.\n"); scalefactor = metrics.x_scale; /* fprintf(stderr, "offset=%d\n", (int)metrics.x_scale); */ } @@ -1023,7 +1023,7 @@ static void image_ttf_faceinstance_write(INT32 args) TT_Glyph_Metrics metrics; if (sp[a-args].type!=T_STRING) - error("Image.TTF.FaceInstance->write(): illegal argument %d\n",a+1); + Pike_error("Image.TTF.FaceInstance->write(): illegal argument %d\n",a+1); switch(sp[a-args].u.string->size_shift) { @@ -1042,7 +1042,7 @@ static void image_ttf_faceinstance_write(INT32 args) case 2: free( sstr ); free( slen ); - error("Too wide string for truetype\n"); + Pike_error("Too wide string for truetype\n"); break; } @@ -1214,7 +1214,7 @@ static void image_ttf_faceinstance_write(INT32 args) } else { - error("Image.TTF.FaceInstance->write(): out of memory\n"); + Pike_error("Image.TTF.FaceInstance->write(): out of memory\n"); } for (a=0; a<args; a++) diff --git a/src/modules/_Image_XFace/image_xface.c b/src/modules/_Image_XFace/image_xface.c index 2d413ad3d26e7ee505a12c85c2269ba3faba96f0..6588c5541ba31cdc609142e94b603093d0d366fb 100644 --- a/src/modules/_Image_XFace/image_xface.c +++ b/src/modules/_Image_XFace/image_xface.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: image_xface.c,v 1.13 2000/11/14 19:26:43 marcus Exp $"); +RCSID("$Id: image_xface.c,v 1.14 2000/12/01 08:10:33 hubbe Exp $"); #include "config.h" @@ -20,7 +20,7 @@ RCSID("$Id: image_xface.c,v 1.13 2000/11/14 19:26:43 marcus Exp $"); #include "threads.h" #include "array.h" #include "mapping.h" -#include "error.h" +#include "pike_error.h" #include "stralloc.h" #include "dynamic_buffer.h" #include "operators.h" @@ -394,15 +394,15 @@ static void image_xface_decode(INT32 args) struct image *img; if(args<1 || sp[-args].type!=T_STRING) - error("Image.XFace.decode: Illegal arguments\n"); + Pike_error("Image.XFace.decode: Illegal arguments\n"); o=clone_object(image_program,0); img=(struct image*)get_storage(o,image_program); - if (!img) error("image no image? foo?\n"); /* should never happen */ + if (!img) Pike_error("image no image? foo?\n"); /* should never happen */ img->img=malloc(sizeof(rgb_group)*48*48); if (!img->img) { free_object(o); - error("Image.XFace.decode: out of memory\n"); + Pike_error("Image.XFace.decode: out of memory\n"); } img->xsize=48; img->ysize=48; @@ -435,13 +435,13 @@ static void image_xface_encode(INT32 args) || !(img=(struct image*) get_storage(sp[-args].u.object,image_program)) || (args>1 && sp[1-args].type!=T_MAPPING)) - error("Image.XFace.encode: Illegal arguments\n"); + Pike_error("Image.XFace.encode: Illegal arguments\n"); if (!img->img) - error("Image.XFace.encode: Given image is empty.\n"); + Pike_error("Image.XFace.encode: Given image is empty.\n"); if (img->xsize != 48 || img->ysize != 48) - error("Image.XFace.encode: Wrong image dimensions (must be 48 by 48).\n"); + Pike_error("Image.XFace.encode: Wrong image dimensions (must be 48 by 48).\n"); res = encodeface(img->img); @@ -479,7 +479,7 @@ static void image_xface_encode(INT32 args) static void image_xface_decode_header(INT32 args) { if(args<1 || sp[-args].type!=T_STRING) - error("Image.XFace.decode: Illegal arguments\n"); + Pike_error("Image.XFace.decode: Illegal arguments\n"); pop_n_elems(args); diff --git a/src/modules/_Roxen/roxen.c b/src/modules/_Roxen/roxen.c index 140a5f2d642401030f023ddfde380cdbd461909e..46f5a4dd6970fe7a4027d5943592943689bb75a4 100644 --- a/src/modules/_Roxen/roxen.c +++ b/src/modules/_Roxen/roxen.c @@ -30,6 +30,8 @@ #include "threads.h" #include "operators.h" +/* must be last include! */ +#include "module_magic.h" /**** CLASS HeaderParser */ @@ -52,10 +54,10 @@ static void f_hp_feed( INT32 args ) unsigned char *in; if( Pike_sp[-1].type != PIKE_T_STRING ) - error("Wrong type of argument to feed()\n"); + Pike_error("Wrong type of argument to feed()\n"); if( str->len >= THP->left ) - error("Too many headers\n"); + Pike_error("Too many headers\n"); MEMCPY( THP->pnt, str->str, str->len ); @@ -155,14 +157,14 @@ static void f_make_http_headers( INT32 args ) struct keypair *k; struct pike_string *res; if( Pike_sp[-1].type != PIKE_T_MAPPING ) - error("Wrong argument type to make_http_headers(mapping heads)\n"); + Pike_error("Wrong argument type to make_http_headers(mapping heads)\n"); m = Pike_sp[-1].u.mapping; /* loop to check len */ NEW_MAPPING_LOOP( m->data ) { if( k->ind.type != PIKE_T_STRING || k->ind.u.string->size_shift ) - error("Wrong argument type to make_http_headers(" + Pike_error("Wrong argument type to make_http_headers(" "mapping(string(8bit):string(8bit)|array(string(8bit))) heads)\n"); if( k->val.type == PIKE_T_STRING ) total_len += k->val.u.string->len + 2 + k->ind.u.string->len + 2; @@ -172,13 +174,13 @@ static void f_make_http_headers( INT32 args ) ptrdiff_t i, kl = k->ind.u.string->len + 2 ; for( i = 0; i<a->size; i++ ) if( a->item[i].type != PIKE_T_STRING||a->item[i].u.string->size_shift ) - error("Wrong argument type to make_http_headers(" + Pike_error("Wrong argument type to make_http_headers(" "mapping(string(8bit):string(8bit)|" "array(string(8bit))) heads)\n"); else total_len += kl + a->item[i].u.string->len + 2; } else - error("Wrong argument type to make_http_headers(" + Pike_error("Wrong argument type to make_http_headers(" "mapping(string(8bit):string(8bit)|" "array(string(8bit))) heads)\n"); } @@ -224,7 +226,7 @@ static void f_http_decode_string(INT32 args) struct pike_string *newstr; if (!args || Pike_sp[-args].type != PIKE_T_STRING) - error("Invalid argument to http_decode_string(STRING);\n"); + Pike_error("Invalid argument to http_decode_string(STRING);\n"); foo=bar=Pike_sp[-args].u.string->str; end=foo+Pike_sp[-args].u.string->len; diff --git a/src/modules/_math/math.c b/src/modules/_math/math.c index 915750931101e0ecfb80347c43c59b6e1bae7bb6..4f19f3d77094239c62a7fb3beb395f258b90fd33 100644 --- a/src/modules/_math/math.c +++ b/src/modules/_math/math.c @@ -9,7 +9,7 @@ #include "interpret.h" #include "constants.h" #include "svalue.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "operators.h" #include "bignum.h" @@ -29,7 +29,7 @@ #include <floatingpoint.h> #endif -RCSID("$Id: math.c,v 1.33 2000/08/28 20:56:58 grubba Exp $"); +RCSID("$Id: math.c,v 1.34 2000/12/01 08:10:34 hubbe Exp $"); #ifndef M_PI #define M_PI 3.1415926535897932384626433832795080 @@ -45,24 +45,24 @@ int matherr(struct exception *exc) switch(exc->type) { case OVERFLOW: exc->retval = HUGE_VAL; - return 1; /* No error */ + return 1; /* No Pike_error */ case UNDERFLOW: exc->retval = 0.0; - return 1; /* No error */ + return 1; /* No Pike_error */ #ifdef TLOSS case TLOSS: - return 1; /* No error */ + return 1; /* No Pike_error */ #endif /* TLOSS */ #ifdef PLOSS case PLOSS: - return 1; /* No error */ + return 1; /* No Pike_error */ #endif /* PLOSS */ default: return 0; /* Error */ } } #endif /* HUGE_VAL */ - return 1; /* No error */ + return 1; /* No Pike_error */ } #endif /* HAVE_STRUCT_EXCEPTION */ @@ -70,42 +70,42 @@ int matherr(struct exception *exc) void f_sin(INT32 args) { - if(args<1) error("Too few arguments to sin()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to sin()\n"); + if(args<1) Pike_error("Too few arguments to sin()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to sin()\n"); sp[-args].u.float_number=sin(sp[-args].u.float_number); } void f_asin(INT32 args) { - if(args<1) error("Too few arguments to asin()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to asin()\n"); + if(args<1) Pike_error("Too few arguments to asin()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to asin()\n"); sp[-args].u.float_number=asin(sp[-args].u.float_number); } void f_cos(INT32 args) { - if(args<1) error("Too few arguments to cos()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to cos()\n"); + if(args<1) Pike_error("Too few arguments to cos()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to cos()\n"); sp[-args].u.float_number=cos(sp[-args].u.float_number); } void f_acos(INT32 args) { - if(args<1) error("Too few arguments to acos()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to acos()\n"); + if(args<1) Pike_error("Too few arguments to acos()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to acos()\n"); sp[-args].u.float_number=acos(sp[-args].u.float_number); } void f_tan(INT32 args) { double f; - if(args<1) error("Too few arguments to tan()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to tan()\n"); + if(args<1) Pike_error("Too few arguments to tan()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to tan()\n"); f = (sp[-args].u.float_number-M_PI/2) / M_PI; if(f==floor(f+0.5)) { - error("Impossible tangent.\n"); + Pike_error("Impossible tangent.\n"); return; } sp[-args].u.float_number=tan(sp[-args].u.float_number); @@ -113,16 +113,16 @@ void f_tan(INT32 args) void f_atan(INT32 args) { - if(args<1) error("Too few arguments to atan()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to atan()\n"); + if(args<1) Pike_error("Too few arguments to atan()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to atan()\n"); sp[-args].u.float_number=atan(sp[-args].u.float_number); } void f_atan2(INT32 args) { - if(args<2) error("Too few arguments to atan2()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to atan2()\n"); - if(sp[-args+1].type!=T_FLOAT) error("Bad argument 2 to atan2()\n"); + if(args<2) Pike_error("Too few arguments to atan2()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to atan2()\n"); + if(sp[-args+1].type!=T_FLOAT) Pike_error("Bad argument 2 to atan2()\n"); sp[-args].u.float_number= atan2(sp[-args].u.float_number,sp[-args+1].u.float_number); pop_stack(); @@ -130,7 +130,7 @@ void f_atan2(INT32 args) void f_sqrt(INT32 args) { - if(args<1) error("Too few arguments to sqrt()\n"); + if(args<1) Pike_error("Too few arguments to sqrt()\n"); if(sp[-args].type==T_INT) { @@ -152,7 +152,7 @@ void f_sqrt(INT32 args) { if (sp[-args].u.float_number< 0.0) { - error("math: sqrt(x) with (x < 0.0)\n"); + Pike_error("math: sqrt(x) with (x < 0.0)\n"); return; } sp[-args].u.float_number=sqrt(sp[-args].u.float_number); @@ -165,7 +165,7 @@ void f_sqrt(INT32 args) push_constant_text("_sqrt"); o_index(); if(IS_UNDEFINED(&sp[-1])) - error("Object to to sqrt() does not have _sqrt.\n"); + Pike_error("Object to to sqrt() does not have _sqrt.\n"); pop_stack(); /* Maybe we can use this result instead of throwing it? */ apply(sp[-1].u.object, "_sqrt", 0); stack_swap(); @@ -174,16 +174,16 @@ void f_sqrt(INT32 args) #endif /* AUTO_BIGNUM */ else { - error("Bad argument 1 to sqrt().\n"); + Pike_error("Bad argument 1 to sqrt().\n"); } } void f_log(INT32 args) { - if(args<1) error("Too few arguments to log()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to log()\n"); + if(args<1) Pike_error("Too few arguments to log()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to log()\n"); if(sp[-args].u.float_number <=0.0) - error("Log on number less or equal to zero.\n"); + Pike_error("Log on number less or equal to zero.\n"); sp[-args].u.float_number=log(sp[-args].u.float_number); } @@ -207,29 +207,29 @@ void f_pow(INT32 args) void f_floor(INT32 args) { - if(args<1) error("Too few arguments to floor()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to floor()\n"); + if(args<1) Pike_error("Too few arguments to floor()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to floor()\n"); sp[-args].u.float_number=floor(sp[-args].u.float_number); } void f_ceil(INT32 args) { - if(args<1) error("Too few arguments to ceil()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to ceil()\n"); + if(args<1) Pike_error("Too few arguments to ceil()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to ceil()\n"); sp[-args].u.float_number=ceil(sp[-args].u.float_number); } void f_round(INT32 args) { - if(args<1) error("Too few arguments to round()\n"); - if(sp[-args].type!=T_FLOAT) error("Bad argument 1 to round()\n"); + if(args<1) Pike_error("Too few arguments to round()\n"); + if(sp[-args].type!=T_FLOAT) Pike_error("Bad argument 1 to round()\n"); sp[-args].u.float_number=RINT(sp[-args].u.float_number); } void f_min(INT32 args) { INT32 i; - if(!args) error("Too few arguments to min()\n"); + if(!args) Pike_error("Too few arguments to min()\n"); for(i=args-2;i>=0;i--) if(is_gt(sp-args+i,sp-args+1+i)) assign_svalue(sp-args+i,sp-args+1+i); @@ -239,7 +239,7 @@ void f_min(INT32 args) void f_max(INT32 args) { INT32 i; - if(!args) error("Too few arguments to max()\n"); + if(!args) Pike_error("Too few arguments to max()\n"); for(i=args-2;i>=0;i--) if(is_lt(sp-args+i,sp-args+1+i)) assign_svalue(sp-args+i,sp-args+1+i); diff --git a/src/modules/call_out/call_out.c b/src/modules/call_out/call_out.c index 5b2fa922694ad00526c60fcd2d60782085b93f4a..010109dae2891af00952175028feb61ab2a3fc4a 100644 --- a/src/modules/call_out/call_out.c +++ b/src/modules/call_out/call_out.c @@ -6,12 +6,12 @@ /**/ #include "global.h" #include "config.h" -RCSID("$Id: call_out.c,v 1.39 2000/08/17 18:32:46 grubba Exp $"); +RCSID("$Id: call_out.c,v 1.40 2000/12/01 08:10:34 hubbe Exp $"); #include "array.h" #include "dynamic_buffer.h" #include "object.h" #include "interpret.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include "pike_memory.h" #include "main.h" @@ -286,7 +286,7 @@ static struct array * new_call_out(int num_arg,struct svalue *argp) new_buffer=(call_out **)realloc((char *)call_buffer, sizeof(call_out *)*call_buffer_size*2); if(!new_buffer) - error("Not enough memory for another call_out\n"); + Pike_error("Not enough memory for another call_out\n"); call_buffer_size*=2; call_buffer=new_buffer; @@ -434,10 +434,10 @@ void f_call_out(INT32 args) struct svalue tmp; struct array *v; if(args<2) - error("Too few arguments to call_out.\n"); + Pike_error("Too few arguments to call_out.\n"); if(sp[1-args].type != T_INT && sp[1-args].type!=T_FLOAT) - error("Bad argument 2 to call_out.\n"); + Pike_error("Bad argument 2 to call_out.\n"); /* Swap, for compatibility */ tmp=sp[-args]; diff --git a/src/modules/files/efuns.c b/src/modules/files/efuns.c index 5843d08bb12b33e1ef2f4c3384b9a729b9727a46..4b750ea906bc064980fb580065f33851afc12ea4 100644 --- a/src/modules/files/efuns.c +++ b/src/modules/files/efuns.c @@ -25,7 +25,7 @@ #include "file_machine.h" #include "file.h" -RCSID("$Id: efuns.c,v 1.87 2000/11/29 21:28:37 hubbe Exp $"); +RCSID("$Id: efuns.c,v 1.88 2000/12/01 08:10:35 hubbe Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -116,9 +116,9 @@ void f_file_stat(INT32 args) struct pike_string *str; if(args<1) - error("Too few arguments to file_stat()\n"); + Pike_error("Too few arguments to file_stat()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to file_stat()\n"); + Pike_error("Bad argument 1 to file_stat()\n"); VALID_FILE_IO("file_stat","read"); @@ -162,9 +162,9 @@ void f_file_truncate(INT32 args) int res; if(args<1 || sp[-args].type != T_STRING) - error("Bad argument 1 to file_truncate(string filename,int length).\n"); + Pike_error("Bad argument 1 to file_truncate(string filename,int length).\n"); if(args<2 || sp[1-args].type != T_INT) - error("Bad argument 2 to file_truncate(string filename,int length).\n"); + Pike_error("Bad argument 2 to file_truncate(string filename,int length).\n"); str = sp[-args].u.string; len = sp[1-args].u.integer; @@ -306,7 +306,7 @@ void f_filesystem_stat(INT32 args) struct fs_data st; #else /* !HAVE_STRUCT_FS_DATA */ /* Should not be reached */ -#error No struct to hold statfs() data. +#Pike_error No struct to hold statfs() data. #endif /* HAVE_STRUCT_FS_DATA */ #endif /* HAVE_STRUCT_STATFS */ #else /* !HAVE_STATFS */ @@ -315,7 +315,7 @@ void f_filesystem_stat(INT32 args) struct ustat st; #else /* !HAVE_USTAT */ /* Should not be reached */ -#error No stat function for filesystems. +#Pike_error No stat function for filesystems. #endif /* HAVE_USTAT */ #endif /* HAVE_STATFS */ #endif /* HAVE_STATVFS */ @@ -323,9 +323,9 @@ void f_filesystem_stat(INT32 args) struct pike_string *str; if(args<1) - error("Too few arguments to filesystem_stat()\n"); + Pike_error("Too few arguments to filesystem_stat()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to filesystem_stat()\n"); + Pike_error("Bad argument 1 to filesystem_stat()\n"); str = sp[-args].u.string; @@ -354,7 +354,7 @@ void f_filesystem_stat(INT32 args) } #else /* Should not be reached */ -#error No stat function for filesystems. +#Pike_error No stat function for filesystems. #endif /* HAVE_USTAT */ #endif /* HAVE_STATFS */ #endif /* HAVE_STATVFS */ @@ -417,7 +417,7 @@ void f_filesystem_stat(INT32 args) f_aggregate_mapping(4*2); #else /* !HAVE_STRUCT_FS_DATA */ /* Should not be reached */ -#error No struct to hold statfs() data. +#Pike_error No struct to hold statfs() data. #endif /* HAVE_STRUCT_FS_DATA */ #endif /* HAVE_STRUCT_STATFS */ #else /* !HAVE_STATFS */ @@ -428,7 +428,7 @@ void f_filesystem_stat(INT32 args) f_aggregate_mapping(3*2); #else /* Should not be reached */ -#error No stat function for filesystems. +#Pike_error No stat function for filesystems. #endif /* HAVE_USTAT */ #endif /* HAVE_STATFS */ #endif /* HAVE_STATVFS */ @@ -441,9 +441,9 @@ void f_filesystem_stat(INT32 args) void f_werror(INT32 args) { if(!args) - error("Too few arguments to werror.\n"); + Pike_error("Too few arguments to werror.\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to werror().\n"); + Pike_error("Bad argument 1 to werror().\n"); if(args> 1) { @@ -466,10 +466,10 @@ void f_rm(INT32 args) destruct_objects_to_destruct(); if(!args) - error("Too few arguments to rm()\n"); + Pike_error("Too few arguments to rm()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to rm().\n"); + Pike_error("Bad argument 1 to rm().\n"); VALID_FILE_IO("rm","write"); @@ -511,17 +511,17 @@ void f_mkdir(INT32 args) int i; if(!args) - error("Too few arguments to mkdir()\n"); + Pike_error("Too few arguments to mkdir()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to mkdir().\n"); + Pike_error("Bad argument 1 to mkdir().\n"); mode = 0777; /* &'ed with ~umask anyway. */ if(args > 1) { if(sp[1-args].type != T_INT) - error("Bad argument 2 to mkdir.\n"); + Pike_error("Bad argument 2 to mkdir.\n"); mode = sp[1-args].u.integer; } @@ -644,7 +644,7 @@ void f_get_dir(INT32 args) #endif /* HAVE_SOLARIS_READDIR_R */ )) { closedir(dir); - error("get_dir(): Out of memory\n"); + Pike_error("get_dir(): Out of memory\n"); } while(1) @@ -660,7 +660,7 @@ void f_get_dir(INT32 args) { #if defined(HAVE_SOLARIS_READDIR_R) /* Solaris readdir_r returns the second arg on success, - * and returns NULL on error or at end of dir. + * and returns NULL on Pike_error or at end of dir. */ errno=0; do { @@ -680,7 +680,7 @@ void f_get_dir(INT32 args) /* HPUX's readdir_r returns an int instead: * * 0 - Successfull operation. - * -1 - End of directory or encountered an error (sets errno). + * -1 - End of directory or encountered an Pike_error (sets errno). */ errno=0; if (readdir_r(dir, tmp)) { @@ -725,7 +725,7 @@ void f_get_dir(INT32 args) str->str, d->d_name); #endif /* READDIR_DEBUG */ #else -#error Unknown readdir_r variant +#Pike_error Unknown readdir_r variant #endif if(d->d_name[0]=='.') { @@ -742,7 +742,7 @@ void f_get_dir(INT32 args) } THREADS_DISALLOW(); if ((!d) && err) { - error("get_dir(): readdir_r(\"%s\") failed: %d\n", str->str, err); + Pike_error("get_dir(): readdir_r(\"%s\") failed: %d\n", str->str, err); } for(e=0;e<num_files;e++) { @@ -790,10 +790,10 @@ void f_cd(INT32 args) struct pike_string *str; if(!args) - error("Too few arguments to cd()\n"); + Pike_error("Too few arguments to cd()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to cd()\n"); + Pike_error("Bad argument 1 to cd()\n"); VALID_FILE_IO("cd","status"); @@ -841,7 +841,7 @@ void f_getcwd(INT32 args) if(!e) { if (tmp) free(tmp); - error("Failed to fetch current path.\n"); + Pike_error("Failed to fetch current path.\n"); } pop_n_elems(args); @@ -862,11 +862,11 @@ void f_exece(INT32 args) save_sp=sp-args; if(args < 2) - error("Too few arguments to exece().\n"); + Pike_error("Too few arguments to exece().\n"); #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("exece: permission denied.\n"); + Pike_error("exece: permission denied.\n"); #endif @@ -876,26 +876,26 @@ void f_exece(INT32 args) { default: if(sp[2-args].type != T_MAPPING) - error("Bad argument 3 to exece().\n"); + Pike_error("Bad argument 3 to exece().\n"); en=sp[2-args].u.mapping; mapping_fix_type_field(en); if(m_ind_types(en) & ~BIT_STRING) - error("Bad argument 3 to exece().\n"); + Pike_error("Bad argument 3 to exece().\n"); if(m_val_types(en) & ~BIT_STRING) - error("Bad argument 3 to exece().\n"); + Pike_error("Bad argument 3 to exece().\n"); case 2: if(sp[1-args].type != T_ARRAY) - error("Bad argument 2 to exece().\n"); + Pike_error("Bad argument 2 to exece().\n"); array_fix_type_field(sp[1-args].u.array); if(sp[1-args].u.array->type_field & ~BIT_STRING) - error("Bad argument 2 to exece().\n"); + Pike_error("Bad argument 2 to exece().\n"); case 1: if(sp[0-args].type != T_STRING) - error("Bad argument 1 to exece().\n"); + Pike_error("Bad argument 1 to exece().\n"); } argv=(char **)xalloc((2+sp[1-args].u.array->size) * sizeof(char *)); @@ -969,13 +969,13 @@ void f_mv(INT32 args) struct pike_string *str2; if(args<2) - error("Too few arguments to mv()\n"); + Pike_error("Too few arguments to mv()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to mv().\n"); + Pike_error("Bad argument 1 to mv().\n"); if(sp[-args+1].type != T_STRING) - error("Bad argument 2 to mv().\n"); + Pike_error("Bad argument 2 to mv().\n"); VALID_FILE_IO("mv","write"); @@ -1007,9 +1007,9 @@ void f_strerror(INT32 args) int err; if(!args) - error("Too few arguments to strerror()\n"); + Pike_error("Too few arguments to strerror()\n"); if(sp[-args].type != T_INT) - error("Bad argument 1 to strerror()\n"); + Pike_error("Bad argument 1 to strerror()\n"); err = sp[-args].u.integer; pop_n_elems(args); diff --git a/src/modules/files/file.c b/src/modules/files/file.c index 0555fc911d918bee75f42a77a534263bc6605691..7df8459e59edec5b4e7942c666079193ab6b786a 100644 --- a/src/modules/files/file.c +++ b/src/modules/files/file.c @@ -6,7 +6,7 @@ /**/ #define NO_PIKE_SHORTHAND #include "global.h" -RCSID("$Id: file.c,v 1.203 2000/11/29 21:23:20 hubbe Exp $"); +RCSID("$Id: file.c,v 1.204 2000/12/01 08:10:35 hubbe Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -24,7 +24,7 @@ RCSID("$Id: file.c,v 1.203 2000/11/29 21:23:20 hubbe Exp $"); #include "file_machine.h" #include "file.h" -#include "error.h" +#include "pike_error.h" #include "signal_handler.h" #include "pike_types.h" #include "threads.h" @@ -258,10 +258,10 @@ static void just_close_fd(void) FD=fd; push_int(errno); f_strerror(1); - error("Failed to close file: %s\n", Pike_sp[-1].u.string->str); + Pike_error("Failed to close file: %s\n", Pike_sp[-1].u.string->str); case EBADF: - error("Internal error: Closing a non-active file descriptor %d.\n",fd); + Pike_error("Internal Pike_error: Closing a non-active file descriptor %d.\n",fd); #ifdef SOLARIS // it's actually OK. This is a bug in Solaris 8. case EAGAIN: @@ -649,7 +649,7 @@ static void file_read(INT32 args) INT32 all, len; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if(!args) { @@ -658,10 +658,10 @@ static void file_read(INT32 args) else { if(Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->read().\n"); + Pike_error("Bad argument 1 to file->read().\n"); len=Pike_sp[-args].u.integer; if(len<0) - error("Cannot read negative number of characters.\n"); + Pike_error("Cannot read negative number of characters.\n"); } if(args > 1 && !IS_ZERO(Pike_sp+1-args)) @@ -753,7 +753,7 @@ static void file_read_oob(INT32 args) INT32 all, len; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if(!args) { @@ -762,10 +762,10 @@ static void file_read_oob(INT32 args) else { if(Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->read_oob().\n"); + Pike_error("Bad argument 1 to file->read_oob().\n"); len=Pike_sp[-args].u.integer; if(len<0) - error("Cannot read negative number of characters.\n"); + Pike_error("Cannot read negative number of characters.\n"); } if(args > 1 && !IS_ZERO(Pike_sp+1-args)) @@ -801,9 +801,9 @@ static void PIKE_CONCAT(file_,X) (int fd, void *data) \ static void PIKE_CONCAT(file_set_,X) (INT32 args) \ { \ if(FD<0) \ - error("File is not open.\n"); \ + Pike_error("File is not open.\n"); \ if(!args) \ - error("Too few arguments to file_set_%s\n",#X); \ + Pike_error("Too few arguments to file_set_%s\n",#X); \ assign_svalue(& THIS->X, Pike_sp-args); \ if(IS_ZERO(Pike_sp-args)) \ { \ @@ -831,7 +831,7 @@ CBFUNCS(write_oob_callback) static void file__enable_callbacks(INT32 args) { if(FD<0) - error("File is not open.\n"); + Pike_error("File is not open.\n"); #define DO_TRIGGER(X) \ if(IS_ZERO(& THIS->X )) \ @@ -856,7 +856,7 @@ DO_TRIGGER(write_oob_callback) static void file__disable_callbacks(INT32 args) { if(FD<0) - error("File is not open.\n"); + Pike_error("File is not open.\n"); #define DO_DISABLE(X) \ PIKE_CONCAT(set_,X)(FD, 0, 0); @@ -881,23 +881,23 @@ static void file_write(INT32 args) struct pike_string *str; if(args<1 || ((Pike_sp[-args].type != PIKE_T_STRING) && (Pike_sp[-args].type != PIKE_T_ARRAY))) - error("Bad argument 1 to file->write().\n" + Pike_error("Bad argument 1 to file->write().\n" "Type is %s. Expected string or array(string)\n", get_name_of_type(Pike_sp[-args].type)); if(FD < 0) - error("File not open for write.\n"); + Pike_error("File not open for write.\n"); if (Pike_sp[-args].type == PIKE_T_ARRAY) { struct array *a = Pike_sp[-args].u.array; i = a->size; while(i--) { if (a->item[i].type != PIKE_T_STRING) { - error("Bad argument 1 to file->write().\n" + Pike_error("Bad argument 1 to file->write().\n" "Element %ld is not a string.\n", DO_NOT_WARN((long)i)); } else if (a->item[i].u.string->size_shift) { - error("Bad argument 1 to file->write().\n" + Pike_error("Bad argument 1 to file->write().\n" "Element %ld is a wide string.\n", DO_NOT_WARN((long)i)); } @@ -915,7 +915,7 @@ static void file_write(INT32 args) #ifdef PIKE_DEBUG if (Pike_sp[-args].type != PIKE_T_STRING) { - error("Bad return value from string multiplication."); + Pike_error("Bad return value from string multiplication."); } #endif /* PIKE_DEBUG */ #ifdef HAVE_WRITEV @@ -962,7 +962,7 @@ static void file_write(INT32 args) #ifdef _REENTRANT if (FD<0) { free(iovbase); - error("File destructed while in file->write.\n"); + Pike_error("File destructed while in file->write.\n"); } #endif if(i<0) @@ -1045,7 +1045,7 @@ static void file_write(INT32 args) check_signals(0,0,0); #ifdef _REENTRANT - if(FD<0) error("File destructed while in file->write.\n"); + if(FD<0) Pike_error("File destructed while in file->write.\n"); #endif if(i<0) @@ -1093,7 +1093,7 @@ static void file_write_oob(INT32 args) struct pike_string *str; if(args<1 || Pike_sp[-args].type != PIKE_T_STRING) - error("Bad argument 1 to file->write().\n"); + Pike_error("Bad argument 1 to file->write().\n"); if(args > 1) { @@ -1102,7 +1102,7 @@ static void file_write_oob(INT32 args) } if(FD < 0) - error("File not open for write_oob.\n"); + Pike_error("File not open for write_oob.\n"); written=0; str=Pike_sp[-args].u.string; @@ -1115,7 +1115,7 @@ static void file_write_oob(INT32 args) THREADS_DISALLOW(); #ifdef _REENTRANT - if(FD<0) error("File destructed while in file->write_oob.\n"); + if(FD<0) Pike_error("File destructed while in file->write_oob.\n"); #endif if(i<0) @@ -1221,21 +1221,21 @@ static void file_close(INT32 args) if(args) { if(Pike_sp[-args].type != PIKE_T_STRING) - error("Bad argument 1 to file->close()\n"); + Pike_error("Bad argument 1 to file->close()\n"); flags=parse(Pike_sp[-args].u.string->str); }else{ flags=FILE_READ | FILE_WRITE; } if (THIS->flags & FILE_LOCK_FD) { - error("close() has been temporarily disabled on this file.\n"); + Pike_error("close() has been temporarily disabled on this file.\n"); } if((THIS->open_mode & ~flags & (FILE_READ|FILE_WRITE)) && flags) { if(!(THIS->open_mode & fd_CAN_SHUTDOWN)) { - error("Cannot close one direction on this file.\n"); + Pike_error("Cannot close one direction on this file.\n"); } } @@ -1252,19 +1252,19 @@ static void file_open(INT32 args) close_fd(); if(args < 2) - error("Too few arguments to file->open()\n"); + Pike_error("Too few arguments to file->open()\n"); if(Pike_sp[-args].type != PIKE_T_STRING && Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->open()\n"); + Pike_error("Bad argument 1 to file->open()\n"); if(Pike_sp[1-args].type != PIKE_T_STRING) - error("Bad argument 2 to file->open()\n"); + Pike_error("Bad argument 2 to file->open()\n"); if (args > 2) { if (Pike_sp[2-args].type != PIKE_T_INT) - error("Bad argument 3 to file->open()\n"); + Pike_error("Bad argument 3 to file->open()\n"); access = Pike_sp[2-args].u.integer; } else access = 00666; @@ -1287,7 +1287,7 @@ static void file_open(INT32 args) if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) { if(!CHECK_SECURITY(SECURITY_BIT_CONDITIONAL_IO)) - error("Permission denied.\n"); + Pike_error("Permission denied.\n"); if(flags & (FILE_APPEND | FILE_TRUNC | FILE_CREATE | FILE_WRITE)) { @@ -1323,15 +1323,15 @@ static void file_open(INT32 args) break; case 3: /* permission denied */ - error("Stdio.file->open: permission denied.\n"); + Pike_error("Stdio.file->open: permission denied.\n"); default: - error("Error in user->valid_open, wrong return value.\n"); + Pike_error("Error in user->valid_open, wrong return value.\n"); } break; default: - error("Error in user->valid_open, wrong return type.\n"); + Pike_error("Error in user->valid_open, wrong return type.\n"); case PIKE_T_STRING: str=Pike_sp[-1].u.string; @@ -1341,7 +1341,7 @@ static void file_open(INT32 args) #endif if(!( flags & (FILE_READ | FILE_WRITE))) - error("Must open file for at least one of read and write.\n"); + Pike_error("Must open file for at least one of read and write.\n"); do { THREADS_ALLOW_UID(); @@ -1364,7 +1364,7 @@ static void file_open(INT32 args) #endif if (fd >= 0) fd_close(fd); - error("Object destructed in file->open()\n"); + Pike_error("Object destructed in file->open()\n"); } if(fd < 0) @@ -1383,14 +1383,14 @@ static void file_open(INT32 args) if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) { if(!CHECK_SECURITY(SECURITY_BIT_CONDITIONAL_IO)) - error("Permission denied.\n"); - error("Permission denied.\n"); + Pike_error("Permission denied.\n"); + Pike_error("Permission denied.\n"); /* FIXME!! Insert better security here */ } #endif fd=Pike_sp[-args].u.integer; if (fd<0) - error("Not a valid FD.\n"); + Pike_error("Not a valid FD.\n"); init_fd(fd,flags | fd_query_properties(fd, FILE_CAPABILITIES)); THIS->flags|=FILE_NOT_OPENED; @@ -1417,23 +1417,23 @@ static void file_seek(INT32 args) #endif /* AUTO_BIGNUM */ #endif if(args<1 || Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->seek(int to).\n"); + Pike_error("Bad argument 1 to file->seek(int to).\n"); else to=Pike_sp[-args].u.integer; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if(args>1) { if(Pike_sp[-args+1].type != PIKE_T_INT) - error("Bad argument 2 to file->seek(int unit,int mult).\n"); + Pike_error("Bad argument 2 to file->seek(int unit,int mult).\n"); to *= Pike_sp[-args+1].u.integer; } if(args>2) { if(Pike_sp[-args+2].type != PIKE_T_INT) - error("Bad argument 3 to file->seek(int unit,int mult,int add).\n"); + Pike_error("Bad argument 3 to file->seek(int unit,int mult,int add).\n"); to += Pike_sp[-args+2].u.integer; } @@ -1459,7 +1459,7 @@ static void file_tell(INT32 args) #endif if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); ERRNO=0; #ifdef HAVE_LSEEK64 @@ -1484,10 +1484,10 @@ static void file_truncate(INT32 args) int res; if(args<1 || Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->truncate(int length).\n"); + Pike_error("Bad argument 1 to file->truncate(int length).\n"); if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); len = Pike_sp[-args].u.integer; @@ -1509,7 +1509,7 @@ static void file_stat(INT32 args) int tmp; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); pop_n_elems(args); @@ -1548,15 +1548,15 @@ static void file_mode(INT32 args) static void file_set_nonblocking(INT32 args) { - if(FD < 0) error("File not open.\n"); + if(FD < 0) Pike_error("File not open.\n"); if(!(THIS->open_mode & fd_CAN_NONBLOCK)) - error("That file does not support nonblocking operation.\n"); + Pike_error("That file does not support nonblocking operation.\n"); if(set_nonblocking(FD,1)) { ERRNO=errno; - error("Stdio.File->set_nonbloblocking() failed.\n"); + Pike_error("Stdio.File->set_nonbloblocking() failed.\n"); } THIS->open_mode |= FILE_NONBLOCKING; @@ -1576,9 +1576,9 @@ static void file_set_blocking(INT32 args) static void file_set_close_on_exec(INT32 args) { if(args < 0) - error("Too few arguments to file->set_close_on_exec()\n"); + Pike_error("Too few arguments to file->set_close_on_exec()\n"); if(FD <0) - error("File not open.\n"); + Pike_error("File not open.\n"); if(IS_ZERO(Pike_sp-args)) { @@ -1592,7 +1592,7 @@ static void file_set_close_on_exec(INT32 args) static void file_query_fd(INT32 args) { if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); pop_n_elems(args); push_int(FD); @@ -1613,20 +1613,20 @@ static void file_set_buffer(INT32 args) int flags; if(FD==-1) - error("file->set_buffer() on closed file.\n"); + Pike_error("file->set_buffer() on closed file.\n"); if(!args) - error("Too few arguments to file->set_buffer()\n"); + Pike_error("Too few arguments to file->set_buffer()\n"); if(Pike_sp[-args].type!=PIKE_T_INT) - error("Bad argument 1 to file->set_buffer()\n"); + Pike_error("Bad argument 1 to file->set_buffer()\n"); bufsize=Pike_sp[-args].u.integer; if(bufsize < 0) - error("Bufsize must be larger than zero.\n"); + Pike_error("Bufsize must be larger than zero.\n"); if(args>1) { if(Pike_sp[1-args].type != PIKE_T_STRING) - error("Bad argument 2 to file->set_buffer()\n"); + Pike_error("Bad argument 2 to file->set_buffer()\n"); flags=parse(Pike_sp[1-args].u.string->str); }else{ flags=FILE_READ | FILE_WRITE; @@ -1935,7 +1935,7 @@ static void file_pipe(INT32 args) } if (!i) { - error("Cannot create a pipe matching those parameters.\n"); + Pike_error("Cannot create a pipe matching those parameters.\n"); } }while(0); @@ -2052,27 +2052,27 @@ static void file_dup2(INT32 args) struct my_file *fd; if(args < 1) - error("Too few arguments to file->dup2()\n"); + Pike_error("Too few arguments to file->dup2()\n"); if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if(Pike_sp[-args].type != PIKE_T_OBJECT) - error("Bad argument 1 to file->dup2()\n"); + Pike_error("Bad argument 1 to file->dup2()\n"); o=Pike_sp[-args].u.object; fd=get_file_storage(o); if(!fd) - error("Argument 1 to file->dup2() must be a clone of Stdio.File\n"); + Pike_error("Argument 1 to file->dup2() must be a clone of Stdio.File\n"); if(fd->fd < 0) - error("File given to dup2 not open.\n"); + Pike_error("File given to dup2 not open.\n"); if (fd->flags & FILE_LOCK_FD) { - error("File has been temporarily locked from closing.\n"); + Pike_error("File has been temporarily locked from closing.\n"); } if(fd_dup2(FD,fd->fd) < 0) @@ -2098,7 +2098,7 @@ static void file_dup(INT32 args) pop_n_elems(args); if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if((f=fd_dup(FD)) < 0) @@ -2137,12 +2137,12 @@ static void file_open_socket(INT32 args) if (Pike_sp[-args].type != PIKE_T_INT) { fd_close(fd); - error("Bad argument 1 to open_socket(), expected int\n"); + Pike_error("Bad argument 1 to open_socket(), expected int\n"); } if (args > 1) { if (Pike_sp[1-args].type != PIKE_T_STRING) { fd_close(fd); - error("Bad argument 2 to open_socket(), expected string\n"); + Pike_error("Bad argument 2 to open_socket(), expected string\n"); } get_inet_addr(&addr, Pike_sp[1-args].u.string->str); } else { @@ -2237,7 +2237,7 @@ static void file_connect(INT32 args) file_open_socket(2); } if(IS_ZERO(Pike_sp-1) || FD < 0) - error("file->connect(): Failed to open socket.\n"); + Pike_error("file->connect(): Failed to open socket.\n"); pop_stack(); } @@ -2299,7 +2299,7 @@ static void file_query_address(INT32 args) ACCEPT_SIZE_T len; if(FD <0) - error("file->query_address(): Connection not open.\n"); + Pike_error("file->query_address(): Connection not open.\n"); len=sizeof(addr); if(args > 0 && !IS_ZERO(Pike_sp-args)) @@ -2328,7 +2328,7 @@ static void file_lsh(INT32 args) { ptrdiff_t len; if(args != 1) - error("Too few/many args to file->`<<\n"); + Pike_error("Too few/many args to file->`<<\n"); if(Pike_sp[-1].type != PIKE_T_STRING) { @@ -2339,7 +2339,7 @@ static void file_lsh(INT32 args) len=Pike_sp[-1].u.string->len; file_write(1); - if(len != Pike_sp[-1].u.integer) error("File << failed.\n"); + if(len != Pike_sp[-1].u.integer) Pike_error("File << failed.\n"); pop_stack(); push_object(this_object()); @@ -2350,7 +2350,7 @@ static void file_create(INT32 args) if(!args) return; if(Pike_sp[-args].type != PIKE_T_STRING && Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to file->create()\n"); + Pike_error("Bad argument 1 to file->create()\n"); close_fd(); file_open(args); @@ -2416,20 +2416,20 @@ void file_proxy(INT32 args) check_all_args("Stdio.File->proxy",args, BIT_OBJECT,0); f=get_file_storage(Pike_sp[-args].u.object); if(!f) - error("Bad argument 1 to Stdio.File->proxy, not a Stdio.File object.\n"); + Pike_error("Bad argument 1 to Stdio.File->proxy, not a Stdio.File object.\n"); from=fd_dup(f->fd); if(from<0) { ERRNO=errno; - error("Failed to dup proxy fd. (errno=%d)\n",errno); + Pike_error("Failed to dup proxy fd. (errno=%d)\n",errno); } to=fd_dup(FD); if(from<0) { ERRNO=errno; fd_close(from); - error("Failed to dup proxy fd.\n"); + Pike_error("Failed to dup proxy fd.\n"); } p=ALLOC_STRUCT(new_thread_data); @@ -2440,7 +2440,7 @@ void file_proxy(INT32 args) if(th_create_small(&id,proxy_thread,p)) { free((char *)p); - error("Failed to create thread.\n"); + Pike_error("Failed to create thread.\n"); } th_destroy(& id); @@ -2455,7 +2455,7 @@ void create_proxy_pipe(struct object *o, int for_reading) push_int(fd_INTERPROCESSABLE); apply(n,"pipe",1); if(Pike_sp[-1].type!=PIKE_T_OBJECT) - error("Failed to create proxy pipe (errno=%d)!\n",get_file_storage(n)->my_errno); + Pike_error("Failed to create proxy pipe (errno=%d)!\n",get_file_storage(n)->my_errno); n2=Pike_sp[-1].u.object; /* Stack is now: pipe(read), pipe(write) */ if(for_reading) @@ -2496,7 +2496,7 @@ static void low_file_lock(INT32 args, int flags) struct object *o; if(FD==-1) - error("File->lock(): File is not open.\n"); + Pike_error("File->lock(): File is not open.\n"); if(!args || IS_ZERO(Pike_sp-args)) { @@ -2516,7 +2516,7 @@ static void low_file_lock(INT32 args, int flags) push_int(0); return; } else { - error("Recursive file locks!\n"); + Pike_error("Recursive file locks!\n"); } } } @@ -2698,10 +2698,10 @@ void PIKE_CONCAT(Y,_ref) (INT32 args) { \ if(o) describe(o); \ } \ ); \ - error("Stdio.File(): not open.\n"); \ + Pike_error("Stdio.File(): not open.\n"); \ } \ if(o->prog != file_program) \ - error("Wrong type of object in Stdio.File->_fd\n"); \ + Pike_error("Wrong type of object in Stdio.File->_fd\n"); \ apply_low(o, PIKE_CONCAT(Y,_function_number), args); \ } diff --git a/src/modules/files/sendfile.c b/src/modules/files/sendfile.c index d0353d784d6e71d4514e55989c3fc8ec06bfd6c9..db654bed7fd5fb273e31de9431e24e29c58dd4b2 100644 --- a/src/modules/files/sendfile.c +++ b/src/modules/files/sendfile.c @@ -1,5 +1,5 @@ /* - * $Id: sendfile.c,v 1.49 2000/10/23 19:10:05 grubba Exp $ + * $Id: sendfile.c,v 1.50 2000/12/01 08:10:36 hubbe Exp $ * * Sends headers + from_fd[off..off+len-1] + trailers to to_fd asyncronously. * @@ -240,7 +240,7 @@ static void call_callback_and_free(struct callback *cb, void *this_, void *arg) remove_callback(cb); if (this->self) { - /* Make sure we get freed in case of error */ + /* Make sure we get freed in case of Pike_error */ push_object(this->self); this->self = NULL; } @@ -663,7 +663,7 @@ static void sf_create(INT32 args) struct svalue *cb = NULL; if (THIS->to_file) { - error("sendfile->create(): Called a second time!\n"); + Pike_error("sendfile->create(): Called a second time!\n"); } /* In case the user has succeeded in initializing _callback diff --git a/src/modules/files/socket.c b/src/modules/files/socket.c index e5fb214a052a67f3fac4781343423262000b8c0f..cef495ba31c6e96eff8e74effcf4dd5206c7c2d8 100644 --- a/src/modules/files/socket.c +++ b/src/modules/files/socket.c @@ -21,7 +21,7 @@ #include "file_machine.h" #include "file.h" -RCSID("$Id: socket.c,v 1.51 2000/08/10 07:57:55 grubba Exp $"); +RCSID("$Id: socket.c,v 1.52 2000/12/01 08:10:36 hubbe Exp $"); #ifdef HAVE_SYS_TYPE_H #include <sys/types.h> @@ -96,7 +96,7 @@ static void do_close(struct port *p, struct object *o) static void port_set_id(INT32 args) { if(args < 1) - error("Too few arguments to port->set_id()\n"); + Pike_error("Too few arguments to port->set_id()\n"); assign_svalue(& THIS->id, Pike_sp-args); pop_n_elems(args-1); @@ -137,10 +137,10 @@ static void port_listen_fd(INT32 args) do_close(THIS,Pike_fp->current_object); if(args < 1) - error("Too few arguments to port->bind_fd()\n"); + Pike_error("Too few arguments to port->bind_fd()\n"); if(Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to port->bind_fd()\n"); + Pike_error("Bad argument 1 to port->bind_fd()\n"); fd=Pike_sp[-args].u.integer; @@ -186,10 +186,10 @@ static void port_bind(INT32 args) do_close(THIS,Pike_fp->current_object); if(args < 1) - error("Too few arguments to port->bind()\n"); + Pike_error("Too few arguments to port->bind()\n"); if(Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to port->bind()\n"); + Pike_error("Bad argument 1 to port->bind()\n"); fd=fd_socket(AF_INET, SOCK_STREAM, 0); @@ -267,10 +267,10 @@ static void port_create(INT32 args) return; }else{ if(Pike_sp[-args].type != PIKE_T_STRING) - error("Bad argument 1 to port->create()\n"); + Pike_error("Bad argument 1 to port->create()\n"); if(strcmp("stdin",Pike_sp[-args].u.string->str)) - error("port->create() called with string other than 'stdin'\n"); + Pike_error("port->create() called with string other than 'stdin'\n"); do_close(THIS,Pike_fp->current_object); THIS->fd=0; @@ -306,7 +306,7 @@ static void port_accept(INT32 args) ACCEPT_SIZE_T len=0; if(THIS->fd < 0) - error("port->accept(): Port not open.\n"); + Pike_error("port->accept(): Port not open.\n"); THREADS_ALLOW(); len=sizeof(addr); @@ -336,7 +336,7 @@ static void socket_query_address(INT32 args) ACCEPT_SIZE_T len; if(THIS->fd <0) - error("socket->query_address(): Socket not bound yet.\n"); + Pike_error("socket->query_address(): Socket not bound yet.\n"); len=sizeof(addr); i=fd_getsockname(THIS->fd,(struct sockaddr *)&addr,&len); diff --git a/src/modules/files/stat.c b/src/modules/files/stat.c index fb30b9676ebfd96b9fa8a56655063196de53c845..5fd50761aa477429d74e15bf5c435183443f3605 100644 --- a/src/modules/files/stat.c +++ b/src/modules/files/stat.c @@ -1,9 +1,9 @@ /* - * $Id: stat.c,v 1.14 2000/09/29 14:07:24 grubba Exp $ + * $Id: stat.c,v 1.15 2000/12/01 08:10:36 hubbe Exp $ */ #include "global.h" -RCSID("$Id: stat.c,v 1.14 2000/09/29 14:07:24 grubba Exp $"); +RCSID("$Id: stat.c,v 1.15 2000/12/01 08:10:36 hubbe Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -246,7 +246,7 @@ static void stat_create (INT32 args) else if (ITEM(a)[i].type == T_OBJECT && is_bignum_object (ITEM(a)[i].u.object)) { if (!int64_from_bignum (&val, ITEM(a)[i].u.object)) - error ("Stat create: Too big integer in stat array.\n"); + Pike_error ("Stat create: Too big integer in stat array.\n"); } #endif /* AUTO_BINUM */ else @@ -511,7 +511,7 @@ static void stat_index_set (INT32 args) #if AUTO_BIGNUM else if (sp[-1].type == T_OBJECT && is_bignum_object (sp[-1].u.object)) { if (!int64_from_bignum (&int_val, sp[-1].u.object)) - error ("Stat `[]=: Too big integer as value.\n"); + Pike_error ("Stat `[]=: Too big integer as value.\n"); else got_int_val = 1; } diff --git a/src/modules/files/termios.c b/src/modules/files/termios.c index 2b9ddd3c2eee36ac8d09338937f0e3280920d9f4..b44d59c68965d9b0c36d4294b33e471e919efd3d 100644 --- a/src/modules/files/termios.c +++ b/src/modules/files/termios.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: termios.c,v 1.9 2000/08/10 09:51:55 per Exp $"); +RCSID("$Id: termios.c,v 1.10 2000/12/01 08:10:37 hubbe Exp $"); #include "file_machine.h" #if defined(HAVE_TERMIOS_H) @@ -81,11 +81,11 @@ void file_tcgetattr(INT32 args) int n; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); pop_n_elems(args); - if (tcgetattr(FD,&ti)) /* error */ + if (tcgetattr(FD,&ti)) /* Pike_error */ { ERRNO=errno; push_int(0); @@ -173,16 +173,16 @@ void file_tcsetattr(INT32 args) int optional_actions=TCSANOW; if(FD < 0) - error("File not open.\n"); + Pike_error("File not open.\n"); if (!args) - error("too few arguments to tcsetattr\n"); + Pike_error("too few arguments to tcsetattr\n"); if (args>=2) { if (sp[-1].type!=T_STRING) - error("illegal argument 2 to tcsetattr\n"); + Pike_error("illegal argument 2 to tcsetattr\n"); if (!strcmp(sp[-1].u.string->str,"TCSANOW")) optional_actions=TCSANOW; @@ -191,16 +191,16 @@ void file_tcsetattr(INT32 args) else if (!strcmp(sp[-1].u.string->str,"TCSAFLUSH")) optional_actions=TCSAFLUSH; else - error("illegal argument 2 to tcsetattr\n"); + Pike_error("illegal argument 2 to tcsetattr\n"); pop_n_elems(args-1); } if (sp[-1].type!=T_MAPPING) - error("illegal argument 1 to tcsetattr\n"); + Pike_error("illegal argument 1 to tcsetattr\n"); /* read attr to edit */ - if (tcgetattr(FD,&ti)) /* error */ + if (tcgetattr(FD,&ti)) /* Pike_error */ { ERRNO=errno; push_int(0); @@ -214,7 +214,7 @@ void file_tcsetattr(INT32 args) if (!IS_UNDEFINED(sp-1)) \ { \ if (sp[-1].type!=T_INT) \ - error("illegal argument 1 to tcsetattr: key %s has illegal value",sflag); \ + Pike_error("illegal argument 1 to tcsetattr: key %s has illegal value",sflag); \ if (sp[-1].u.integer) ti.where|=flag; else ti.where&=~flag; \ } \ pop_stack(); @@ -226,7 +226,7 @@ void file_tcsetattr(INT32 args) if (!IS_UNDEFINED(sp-1)) \ { \ if (sp[-1].type!=T_INT) \ - error("illegal argument 1 to tcsetattr: key %s has illegal value",scc); \ + Pike_error("illegal argument 1 to tcsetattr: key %s has illegal value",scc); \ ti.c_cc[cc]=(char)sp[-1].u.integer; \ } \ pop_stack(); @@ -244,7 +244,7 @@ void file_tcsetattr(INT32 args) if (!IS_UNDEFINED(sp-1)) { if (sp[-1].type!=T_INT) - error("illegal argument 1 to tcsetattr: key %s has illegal value","csize"); + Pike_error("illegal argument 1 to tcsetattr: key %s has illegal value","csize"); switch (sp[-1].u.integer) { @@ -261,7 +261,7 @@ void file_tcsetattr(INT32 args) case 5: ti.c_cflag=(ti.c_cflag&~CSIZE)|CS5; break; #endif default: - error("illegal argument 1 to tcsetattr: value of key %s is not a valid char size","csize"); + Pike_error("illegal argument 1 to tcsetattr: value of key %s is not a valid char size","csize"); } } pop_stack(); @@ -275,13 +275,13 @@ void file_tcsetattr(INT32 args) if (!IS_UNDEFINED(sp-1)) { if (sp[-1].type!=T_INT) - error("illegal argument 1 to tcsetattr: key %s has illegal value","ospeed"); + Pike_error("illegal argument 1 to tcsetattr: key %s has illegal value","ospeed"); switch (sp[-1].u.integer) { #define TERMIOS_SPEED(B,V) case V: push_int(B); break; #include "termios_flags.h" default: - error("illegal argument 1 to tcsetattr, value of key %s is not a valid baud rate\n","ospeed"); + Pike_error("illegal argument 1 to tcsetattr, value of key %s is not a valid baud rate\n","ospeed"); } cfsetospeed(&ti,sp[-1].u.integer); pop_stack(); @@ -294,13 +294,13 @@ void file_tcsetattr(INT32 args) if (!IS_UNDEFINED(sp-1)) { if (sp[-1].type!=T_INT) - error("illegal argument 1 to tcsetattr: key %s has illegal value","ispeed"); + Pike_error("illegal argument 1 to tcsetattr: key %s has illegal value","ispeed"); switch (sp[-1].u.integer) { #include "termios_flags.h" #undef TERMIOS_SPEED default: - error("illegal argument 1 to tcsetattr, value of key %s is not a valid baud rate\n","ispeed"); + Pike_error("illegal argument 1 to tcsetattr, value of key %s is not a valid baud rate\n","ispeed"); } cfsetispeed(&ti,sp[-1].u.integer); pop_stack(); diff --git a/src/modules/files/udp.c b/src/modules/files/udp.c index d3851244ccf47a88eb151b9376cd0783a5573e1d..0b63161089867165bac72326cfa4f1e3f47764db 100644 --- a/src/modules/files/udp.c +++ b/src/modules/files/udp.c @@ -1,5 +1,5 @@ /* - * $Id: udp.c,v 1.17 2000/10/24 12:25:27 leif Exp $ + * $Id: udp.c,v 1.18 2000/12/01 08:10:37 hubbe Exp $ */ #define NO_PIKE_SHORTHAND @@ -7,7 +7,7 @@ #include "file_machine.h" -RCSID("$Id: udp.c,v 1.17 2000/10/24 12:25:27 leif Exp $"); +RCSID("$Id: udp.c,v 1.18 2000/12/01 08:10:37 hubbe Exp $"); #include "fdlib.h" #include "interpret.h" #include "svalue.h" @@ -18,7 +18,7 @@ RCSID("$Id: udp.c,v 1.17 2000/10/24 12:25:27 leif Exp $"); #include "backend.h" #include "fd_control.h" -#include "error.h" +#include "pike_error.h" #include "signal_handler.h" #include "pike_types.h" #include "threads.h" @@ -149,10 +149,10 @@ static void udp_bind(INT32 args) int fd,tmp; - if(args < 1) error("Too few arguments to dumudp->bind()\n"); + if(args < 1) Pike_error("Too few arguments to dumudp->bind()\n"); if(Pike_sp[-args].type != PIKE_T_INT) - error("Bad argument 1 to dumudp->bind()\n"); + Pike_error("Bad argument 1 to dumudp->bind()\n"); if(FD != -1) { @@ -166,7 +166,7 @@ static void udp_bind(INT32 args) { pop_n_elems(args); THIS->my_errno=errno; - error("UDP.bind: failed to create socket\n"); + Pike_error("UDP.bind: failed to create socket\n"); } /* Make sure this fd gets closed on exec. */ @@ -177,7 +177,7 @@ static void udp_bind(INT32 args) { fd_close(fd); THIS->my_errno=errno; - error("UDP.bind: setsockopt failed\n"); + Pike_error("UDP.bind: setsockopt failed\n"); } MEMSET((char *)&addr,0,sizeof(struct sockaddr_in)); @@ -201,7 +201,7 @@ static void udp_bind(INT32 args) { fd_close(fd); THIS->my_errno=errno; - error("UDP.bind: failed to bind to port %d\n",Pike_sp[-args].u.integer); + Pike_error("UDP.bind: failed to bind to port %d\n",Pike_sp[-args].u.integer); return; } @@ -246,7 +246,7 @@ void udp_wait(INT32 args) } if (fd < 0) { - error("udp->wait(): Port not bound!\n"); + Pike_error("udp->wait(): Port not bound!\n"); } #ifdef HAVE_POLL @@ -264,7 +264,7 @@ void udp_wait(INT32 args) /* Timeout */ } else if (res < 0) { /* Error */ - error("udp->wait(): poll() failed with errno %d\n", e); + Pike_error("udp->wait(): poll() failed with errno %d\n", e); } else { /* Success? */ if (pollfds->revents) { @@ -288,7 +288,7 @@ void udp_wait(INT32 args) /* Timeout */ } else if (res < 0) { /* Error */ - error("udp->wait(): select() failed with errno %d\n", e); + Pike_error("udp->wait(): select() failed with errno %d\n", e); } else { /* Success? */ if (FD_ISSET(fd, &rset)) { @@ -326,13 +326,13 @@ void udp_read(INT32 args) #endif /* MSG_PEEK */ } if(Pike_sp[-args].u.integer & ~3) { - error("Illegal 'flags' value passed to udp->read([int flags])\n"); + Pike_error("Illegal 'flags' value passed to udp->read([int flags])\n"); } } pop_n_elems(args); fd = FD; if (FD < 0) - error("UDP: not open\n"); + Pike_error("UDP: not open\n"); do { THREADS_ALLOW(); res = fd_recvfrom(fd, buffer, UDP_BUFFSIZE, flags, @@ -354,18 +354,18 @@ void udp_read(INT32 args) #endif case EBADF: set_read_callback( FD, 0, 0 ); - error("Socket closed\n"); + Pike_error("Socket closed\n"); #ifdef ESTALE case ESTALE: #endif case EIO: set_read_callback( FD, 0, 0 ); - error("I/O error\n"); + Pike_error("I/O Pike_error\n"); case ENOMEM: #ifdef ENOSR case ENOSR: #endif /* ENOSR */ - error("Out of memory\n"); + Pike_error("Out of memory\n"); #ifdef ENOTSOCK case ENOTSOCK: fatal("reading from non-socket fd!!!\n"); @@ -375,7 +375,7 @@ void udp_read(INT32 args) return; default: - error("Socket read failed with errno %d.\n", e); + Pike_error("Socket read failed with errno %d.\n", e); } } /* Now comes the interresting part. @@ -401,7 +401,7 @@ void udp_sendto(INT32 args) ptrdiff_t len; if(FD < 0) - error("UDP: not open\n"); + Pike_error("UDP: not open\n"); if(args>3) { @@ -416,18 +416,18 @@ void udp_sendto(INT32 args) #endif /* MSG_DONTROUTE */ } if(Pike_sp[3-args].u.integer & ~3) { - error("Illegal 'flags' value passed to udp->send(string m,string t,int p,[int flags])\n"); + Pike_error("Illegal 'flags' value passed to udp->send(string m,string t,int p,[int flags])\n"); } } if(!args) - error("Illegal number of arguments to udp->sendto(string to" + Pike_error("Illegal number of arguments to udp->sendto(string to" ", string message, int port[, int flags])\n"); if( Pike_sp[-args].type==PIKE_T_STRING ) get_inet_addr(&to, Pike_sp[-args].u.string->str); else - error("Illegal type of argument to sendto, got non-string to-address.\n"); + Pike_error("Illegal type of argument to sendto, got non-string to-address.\n"); to.sin_port = htons( ((u_short)Pike_sp[1-args].u.integer) ); @@ -452,23 +452,23 @@ void udp_sendto(INT32 args) #ifdef EMSGSIZE case EMSGSIZE: #endif - error("Too big message\n"); + Pike_error("Too big message\n"); case EBADF: set_read_callback( FD, 0, 0 ); - error("Socket closed\n"); + Pike_error("Socket closed\n"); case ENOMEM: #ifdef ENOSR case ENOSR: #endif /* ENOSR */ - error("Out of memory\n"); + Pike_error("Out of memory\n"); case EINVAL: #ifdef ENOTSOCK case ENOTSOCK: set_read_callback( FD, 0, 0 ); - error("Not a socket!!!\n"); + Pike_error("Not a socket!!!\n"); #endif case EWOULDBLOCK: - error("Message would block.\n"); + Pike_error("Message would block.\n"); } } pop_n_elems(args); @@ -513,10 +513,10 @@ static void udp_read_callback( int fd, void *data ) static void udp_set_read_callback(INT32 args) { if(FD < 0) - error("File is not open.\n"); + Pike_error("File is not open.\n"); if(args != 1) - error("Wrong number of arguments to file->set_read_callback().\n"); + Pike_error("Wrong number of arguments to file->set_read_callback().\n"); if(IS_ZERO(& THIS->read_callback)) assign_svalue(& THIS->read_callback, Pike_sp-1); @@ -533,7 +533,7 @@ static void udp_set_read_callback(INT32 args) static void udp_set_nonblocking(INT32 args) { - if (FD < 0) error("File not open.\n"); + if (FD < 0) Pike_error("File not open.\n"); if (args) { @@ -546,7 +546,7 @@ static void udp_set_nonblocking(INT32 args) static void udp_set_blocking(INT32 args) { - if (FD < 0) error("File not open.\n"); + if (FD < 0) Pike_error("File not open.\n"); set_nonblocking(FD,0); pop_n_elems(args); ref_push_object(THISOBJ); @@ -570,7 +570,7 @@ static void udp_connect(INT32 args) if(FD < 0) { THIS->my_errno=errno; - error("UDP.connect: failed to create socket\n"); + Pike_error("UDP.connect: failed to create socket\n"); } set_close_on_exec(FD, 1); } @@ -586,7 +586,7 @@ static void udp_connect(INT32 args) if(tmp < 0) { THIS->my_errno=errno; - error("UDP.connect: failed to connect\n"); + Pike_error("UDP.connect: failed to connect\n"); }else{ THIS->my_errno=0; pop_n_elems(args); @@ -603,7 +603,7 @@ static void udp_query_address(INT32 args) ACCEPT_SIZE_T len; if(fd <0) - error("socket->query_address(): Port not bound yet.\n"); + Pike_error("socket->query_address(): Port not bound yet.\n"); THREADS_ALLOW(); diff --git a/src/modules/spider/discdate.c b/src/modules/spider/discdate.c index 47680f9a6da6d110c40eaf86776b10deef46fa94..8258e0bf8417d9c49c952fa912665234cfb77ffd 100644 --- a/src/modules/spider/discdate.c +++ b/src/modules/spider/discdate.c @@ -17,7 +17,7 @@ #include "svalue.h" #include "mapping.h" #include "array.h" -#include "error.h" +#include "pike_error.h" #include "builtin_functions.h" #include <time.h> #include <string.h> @@ -26,7 +26,7 @@ /* This must be included last! */ #include "module_magic.h" -RCSID("$Id: discdate.c,v 1.7 2000/07/28 07:15:49 hubbe Exp $"); +RCSID("$Id: discdate.c,v 1.8 2000/12/01 08:10:37 hubbe Exp $"); struct disc_time { @@ -47,7 +47,7 @@ void f_discdate(INT32 argc) struct disc_time hastur; if (argc != 1) { - error("Error: discdate(time)"); + Pike_error("Error: discdate(time)"); exit(1); } else { struct tm *eris; diff --git a/src/modules/spider/spider.c b/src/modules/spider/spider.c index a337f05e660e4169b2747b9fb31819c6c5919d72..86dc1611ca4c5736231e7966a713b0ff6a8f55fe 100644 --- a/src/modules/spider/spider.c +++ b/src/modules/spider/spider.c @@ -43,7 +43,7 @@ #include "threads.h" #include "operators.h" -RCSID("$Id: spider.c,v 1.100 2000/11/06 20:56:02 per Exp $"); +RCSID("$Id: spider.c,v 1.101 2000/12/01 08:10:37 hubbe Exp $"); #ifdef HAVE_PWD_H #include <pwd.h> @@ -111,11 +111,11 @@ void f_parse_accessed_database(INT32 args) struct mapping *m; if(!args) { - error("Wrong number of arguments to parse_accessed_database(string).\n"); + Pike_error("Wrong number of arguments to parse_accessed_database(string).\n"); } if ((sp[-args].type != T_STRING) || (sp[-args].u.string->size_shift)) { - error("Bad argument 1 to parse_accessed_database(string(8)).\n"); + Pike_error("Bad argument 1 to parse_accessed_database(string(8)).\n"); } /* Pop all but the first argument */ @@ -125,7 +125,7 @@ void f_parse_accessed_database(INT32 args) f_divide(2); if (sp[-1].type != T_ARRAY) { - error("Expected array as result of string-division.\n"); + Pike_error("Expected array as result of string-division.\n"); } /* The initial string is gone, but the array is there now. */ @@ -168,7 +168,7 @@ void f_parse_html(INT32 args) sp[-args].type!=T_STRING|| sp[1-args].type!=T_MAPPING|| sp[2-args].type!=T_MAPPING) - error("Bad argument(s) to parse_html.\n"); + Pike_error("Bad argument(s) to parse_html.\n"); ss=sp[-args].u.string; if(!ss->len) @@ -218,7 +218,7 @@ void f_parse_html_lines(INT32 args) sp[-args].type!=T_STRING|| sp[1-args].type!=T_MAPPING|| sp[2-args].type!=T_MAPPING) - error("Bad argument(s) to parse_html_lines.\n"); + Pike_error("Bad argument(s) to parse_html_lines.\n"); ss=sp[-args].u.string; if(!ss->len) @@ -263,14 +263,14 @@ char end_quote_character = '\000'; void f_set_end_quote(INT32 args) { if(args < 1 || sp[-1].type != T_INT) - error("Wrong argument to set_end_quote(int CHAR)\n"); + Pike_error("Wrong argument to set_end_quote(int CHAR)\n"); end_quote_character = sp[-1].u.integer; } void f_set_start_quote(INT32 args) { if(args < 1 || sp[-1].type != T_INT) - error("Wrong argument to set_start_quote(int CHAR)\n"); + Pike_error("Wrong argument to set_start_quote(int CHAR)\n"); start_quote_character = sp[-1].u.integer; } @@ -948,7 +948,7 @@ void f_fd_info(INT32 args) if (args<1|| sp[-args].type!=T_INT) - error("Illegal argument to fd_info\n"); + Pike_error("Illegal argument to fd_info\n"); i=sp[-args].u.integer; pop_n_elems(args); if (fd_fstat(i,&foo)) diff --git a/src/modules/spider/stardate.c b/src/modules/spider/stardate.c index a5200d2edc97827e8fa38015a7ccc0a77108c9e5..fac2c2c226d8cec0cf970dd33d8ede2c30ed6bf2 100644 --- a/src/modules/spider/stardate.c +++ b/src/modules/spider/stardate.c @@ -1,5 +1,5 @@ /* - * $Id: stardate.c,v 1.10 2000/08/09 12:34:46 grubba Exp $ + * $Id: stardate.c,v 1.11 2000/12/01 08:10:37 hubbe Exp $ */ #include "global.h" @@ -15,9 +15,9 @@ #include "mapping.h" #include "array.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" -RCSID("$Id: stardate.c,v 1.10 2000/08/09 12:34:46 grubba Exp $"); +RCSID("$Id: stardate.c,v 1.11 2000/12/01 08:10:37 hubbe Exp $"); #ifdef HAVE_SYS_TIME_H #include <sys/time.h> @@ -117,7 +117,7 @@ void f_stardate (INT32 args) char fmt[16]; if (args < 2) - error("Wrong number of arguments to stardate(int, int)\n"); + Pike_error("Wrong number of arguments to stardate(int, int)\n"); precis=sp[-args+1].u.integer; t=sp[-args].u.integer; diff --git a/src/modules/spider/xml.c b/src/modules/spider/xml.c index 3965a796af5f0f142192e2260fede15e3c00db39..ce566556485a0620c83b8baf9591a8920874e1dd 100644 --- a/src/modules/spider/xml.c +++ b/src/modules/spider/xml.c @@ -14,7 +14,7 @@ #include "builtin_functions.h" #include "module_support.h" #include "operators.h" -#include "error.h" +#include "pike_error.h" #include "opcodes.h" #include "block_alloc.h" #include "bignum.h" @@ -887,7 +887,7 @@ static int gobble(struct xmldata *data, char *s) #define PARSE_REF(PARSE_RECURSIVELY) do {\ /* Entity reference */ \ /* lookup entry in mapping and parse it recursively */ \ - /* Generate error if entity is not defined */ \ + /* Generate Pike_error if entity is not defined */ \ if(THIS->entities) \ { \ struct pike_string *name=0; \ @@ -1078,7 +1078,7 @@ static void xmlerror(char *desc, struct xmldata *data) { struct svalue * save_sp=sp; - push_constant_text("error"); + push_constant_text("Pike_error"); push_int(0); /* no name */ push_int(0); /* no attributes */ push_text(desc); @@ -1105,7 +1105,7 @@ static int read_smeg_pereference(struct xmldata *data) XMLERROR("Missing ';' after parsed entity reference."); READ(1); /* lookup entry in mapping and parse it recursively */ - /* Generate error if entity is not defined */ + /* Generate Pike_error if entity is not defined */ f_index(2); if(IS_ZERO(sp-1)) { @@ -2562,7 +2562,7 @@ static void parse_xml(INT32 args) s=sp[-args].u.string; if(args<2) - error("Too few arguments to XML->parse()\n"); + Pike_error("Too few arguments to XML->parse()\n"); #if 0 if(!s->size_shift) @@ -2729,11 +2729,11 @@ static void autoconvert(INT32 args) struct pike_string *s; if(!args) - error("Too few arguments to XML->autoconvert.\n"); + Pike_error("Too few arguments to XML->autoconvert.\n"); pop_n_elems(args-1); if(sp[-1].type != T_STRING) - error("Bad argument 1 to XML->autoconvert.\n"); + Pike_error("Bad argument 1 to XML->autoconvert.\n"); s=sp[-1].u.string; if(!s->size_shift) @@ -2807,7 +2807,7 @@ static void autoconvert(INT32 args) case 0x3c003f00: /* UTF-16, little endian, no byte order mark */ IF_XMLDEBUG(fprintf(stderr,"UTF-16, little-endian, no byte order mark detected.\n")); - error("XML: Little endian byte order not supported yet.\n"); + Pike_error("XML: Little endian byte order not supported yet.\n"); case 0x3c3f786d: /* ASCII? UTF-8? ISO-8859? */ IF_XMLDEBUG(fprintf(stderr,"Extended ASCII detected (assuming UTF8).\n")); @@ -2817,7 +2817,7 @@ static void autoconvert(INT32 args) case 0x4c6fa794: /* EBCDIC */ IF_XMLDEBUG(fprintf(stderr,"EBCDIC detected.\n")); - error("XML: EBCDIC not supported yet.\n"); + Pike_error("XML: EBCDIC not supported yet.\n"); } } IF_XMLDEBUG(fprintf(stderr,"No encoding detected.\n")); diff --git a/src/modules/sprintf/sprintf.c b/src/modules/sprintf/sprintf.c index b470e131a3de1fc8bb1a0e8a578b676220841b35..d5518b2279cdbd47c75fb7b2a80a6d3dd22be047 100644 --- a/src/modules/sprintf/sprintf.c +++ b/src/modules/sprintf/sprintf.c @@ -103,8 +103,8 @@ */ #include "global.h" -RCSID("$Id: sprintf.c,v 1.73 2000/08/17 18:41:20 grubba Exp $"); -#include "error.h" +RCSID("$Id: sprintf.c,v 1.74 2000/12/01 08:10:38 hubbe Exp $"); +#include "pike_error.h" #include "array.h" #include "svalue.h" #include "stralloc.h" @@ -1445,14 +1445,14 @@ void f_sprintf(INT32 num_arg) o_cast(string_type_string, PIKE_T_STRING); if (sp[-1].type != T_STRING) { /* We don't accept objects... */ - error("sprintf(): Cast to string failed.\n"); + Pike_error("sprintf(): Cast to string failed.\n"); } /* Replace the original object with the new string. */ assign_svalue(argp, sp-1); /* Clean up the stack. */ pop_stack(); } else { - error("Bad argument 1 to sprintf.\n"); + Pike_error("Bad argument 1 to sprintf.\n"); } } diff --git a/src/modules/sybase/sybase.c b/src/modules/sybase/sybase.c index 29a43817f1b09d6992a95136dc11a18bada5db4c..1ad16c9c3e898bb238de1a99bfde784e9afb49b5 100644 --- a/src/modules/sybase/sybase.c +++ b/src/modules/sybase/sybase.c @@ -24,13 +24,13 @@ #include "sybase_config.h" #include "global.h" -RCSID("$Id: sybase.c,v 1.4 2000/07/28 07:15:57 hubbe Exp $"); +RCSID("$Id: sybase.c,v 1.5 2000/12/01 08:10:39 hubbe Exp $"); #ifdef HAVE_SYBASE #include "stralloc.h" -#include "error.h" +#include "pike_error.h" #include "program.h" #include "las.h" #include "threads.h" @@ -226,11 +226,11 @@ static void flush_results_queue(pike_sybase_connection *this) { } /* - * returns 1 if there's any error + * returns 1 if there's any Pike_error * the same thread-safety rules as flush_results_queue apply * QUESTION: - * Should I explore all messages, and leave in this->error the - * last one with an error-level severity? + * Should I explore all messages, and leave in this->Pike_error the + * last one with an Pike_error-level severity? * or should we maybe only consider server messages? */ static int handle_errors (pike_sybase_connection *this) { @@ -263,7 +263,7 @@ static int handle_errors (pike_sybase_connection *this) { show_severity(severity); } - MEMCPY(this->error,message.sqlerrm.sqlerrmc, + MEMCPY(this->Pike_error,message.sqlerrm.sqlerrmc, message.sqlerrm.sqlerrml+1); this->had_error=1; @@ -394,7 +394,7 @@ static void f_error(INT32 args) { pop_n_elems(args); if (this->had_error) - push_text(this->error); + push_text(this->Pike_error); else push_int(0); } @@ -440,7 +440,7 @@ static void f_connect (INT32 args) { /* It's OK not to lock here. It's just a check that should never happen. * if it happens, we're in deep sh*t already.*/ if (!(context=this->context)) { - err="Internal error: connection attempted, but no context available\n"; + err="Internal Pike_error: connection attempted, but no context available\n"; } if (!err) { @@ -453,16 +453,16 @@ static void f_connect (INT32 args) { } errdebug(err); - if (!err) { /* initialize error-handling code */ + if (!err) { /* initialize Pike_error-handling code */ ret=ct_diag(connection,CS_INIT,CS_UNUSED,CS_UNUSED,NULL); show_status(ret); if (FAILED(ret)) { - err="Can't initialize error-handling code\n"; + err="Can't initialize Pike_error-handling code\n"; } } errdebug(err); - /* if there already was an error, we just locked uselessly. + /* if there already was an Pike_error, we just locked uselessly. * No big deal, it should never happen anyways... */ /* username */ @@ -511,7 +511,7 @@ static void f_connect (INT32 args) { if (err) { handle_errors(this); /* let's centralize */ - error(err); + Pike_error(err); } pop_n_elems(args); @@ -558,11 +558,11 @@ static void f_create (INT32 args) { } } - /* if there was no error, we can try to connect. Since f_connect + /* if there was no Pike_error, we can try to connect. Since f_connect * will do its own threads meddling, we must disable threads first */ - if (err) { /* there was an error. bail out */ + if (err) { /* there was an Pike_error. bail out */ cs_ctx_drop(context); this->context=NULL; } @@ -570,7 +570,7 @@ static void f_create (INT32 args) { SYB_UNLOCK(mainlock); THREADS_DISALLOW(); - if (err) error(err); /* throw the exception if appropriate */ + if (err) Pike_error(err); /* throw the exception if appropriate */ /* now connect */ if (args) @@ -620,7 +620,7 @@ static void f_big_query(INT32 args) { /* verify that we're not busy handing out results */ if (this->busy > 0) - error("Busy\n"); + Pike_error("Busy\n"); THREADS_ALLOW(); SYB_LOCK(this->lock); @@ -885,7 +885,7 @@ static void f_big_query(INT32 args) { if (err) { handle_errors(this); this->busy--; - error(err); + Pike_error(err); } pop_n_elems(args); /* moved from earlier. */ @@ -906,12 +906,12 @@ static void f_big_query(INT32 args) { function_result=NULL; break; default: - fatal("Internal error! Wrong result in big_query\n"); + fatal("Internal Pike_error! Wrong result in big_query\n"); break; } /* extra safety check. Paranoia. */ if (function_result) { - sybdebug((stderr,"Internal error! Function_result!=NULL")); + sybdebug((stderr,"Internal Pike_error! Function_result!=NULL")); free(function_result); } } @@ -935,7 +935,7 @@ static void f_fetch_row(INT32 args) { pop_n_elems(args); if (this->busy<=0) - error("No pending results\n"); + Pike_error("No pending results\n"); THREADS_ALLOW(); SYB_LOCK(this->lock); @@ -971,14 +971,14 @@ static void f_fetch_row(INT32 args) { return; case CS_ROW_FAIL: handle_errors(this); - error("Recoverable error while fetching row\n"); + Pike_error("Recoverable Pike_error while fetching row\n"); break; case CS_FAIL: handle_errors(this); ct_cancel(this->connection,cmd,CS_CANCEL_ALL); this->busy--; sybdebug((stderr,"Busy status: %d\n",this->busy)); - error("Unrecoverable error while fetching row\n"); + Pike_error("Unrecoverable Pike_error while fetching row\n"); break; case CS_CANCELED: sybdebug((stderr,"Canceled\n")); @@ -988,10 +988,10 @@ static void f_fetch_row(INT32 args) { return; case CS_PENDING: case CS_BUSY: - error("Asynchronous operations are not supported\n"); + Pike_error("Asynchronous operations are not supported\n"); break; } - error("Internal error. We shouldn't get here\n"); + Pike_error("Internal Pike_error. We shouldn't get here\n"); } /* int num_fields() */ @@ -1003,7 +1003,7 @@ static void f_num_fields(INT32 args) { pop_n_elems(args); if (this->busy<=0) { - error("Issue a command first!\n"); + Pike_error("Issue a command first!\n"); } THREADS_ALLOW(); @@ -1018,7 +1018,7 @@ static void f_num_fields(INT32 args) { SYB_UNLOCK(this->lock); THREADS_DISALLOW(); - if (err) error(err); + if (err) Pike_error(err); push_int(cols); } @@ -1044,7 +1044,7 @@ static void f_affected_rows(INT32 args) { SYB_UNLOCK(this->lock); THREADS_DISALLOW(); - if (err) error(err); + if (err) Pike_error(err); push_int(rows); } @@ -1059,7 +1059,7 @@ static void f_fetch_fields(INT32 args) { char* err=NULL; if (this->busy<=0) - error("You must issue a command first\n"); + Pike_error("You must issue a command first\n"); pop_n_elems(args); @@ -1202,7 +1202,7 @@ void pike_module_init (void) { tOr(tVoid,tStr) tOr(tVoid,tStr) tOr(tInt,tVoid), tVoid), 0); - ADD_FUNCTION("error",f_error,tFunc(tVoid,tOr(tVoid,tStr)), + ADD_FUNCTION("Pike_error",f_error,tFunc(tVoid,tOr(tVoid,tStr)), OPT_RETURN); ADD_FUNCTION("big_query",f_big_query,tFunc(tString,tOr(tInt,tObj)), @@ -1226,7 +1226,7 @@ void pike_module_init (void) { add_function("connect",f_connect, "function(void|string,void|string,void|string,void|string,int|void:void)", 0); - add_function("error",f_error,"function(void:void|string)",OPT_RETURN); + add_function("Pike_error",f_error,"function(void:void|string)",OPT_RETURN); add_function("big_query",f_big_query,"function(string:void|object)", OPT_RETURN); add_function("fetch_row", f_fetch_row,"function(void:void|array(mixed))", diff --git a/src/modules/sybase/sybase.h b/src/modules/sybase/sybase.h index d80e1201bb2537e01bb2bb4d03c71c4890ac2f23..7ba10f98488fb60498ea9d945ceca7b431ac45db 100644 --- a/src/modules/sybase/sybase.h +++ b/src/modules/sybase/sybase.h @@ -23,8 +23,8 @@ typedef struct { CS_COMMAND *cmd; char busy; /* only one pending command per connection */ - char had_error; /* non-zero if had error */ - char error[256]; /* The last error string. The size is determined by the */ + char had_error; /* non-zero if had Pike_error */ + char Pike_error[256]; /* The last Pike_error string. The size is determined by the */ /* sybase API */ char **results; diff --git a/src/modules/system/nt.c b/src/modules/system/nt.c index f78b69aeefe06cbe72391665a8dfa4292433563d..158f6a6a3cec6619815e153950789c6de54ea57d 100644 --- a/src/modules/system/nt.c +++ b/src/modules/system/nt.c @@ -1,5 +1,5 @@ /* - * $Id: nt.c,v 1.27 2000/09/11 18:45:06 leif Exp $ + * $Id: nt.c,v 1.28 2000/12/01 08:10:39 hubbe Exp $ * * NT system calls for Pike * @@ -32,7 +32,7 @@ static void throw_nt_error(char *funcname, int err) /* - * Give string equivalents to some of the more common NT error codes. + * Give string equivalents to some of the more common NT Pike_error codes. */ { char *msg; @@ -116,14 +116,14 @@ static void throw_nt_error(char *funcname, int err) break; case NERR_Success: - msg = "Strange error (NERR_Success)."; + msg = "Strange Pike_error (NERR_Success)."; break; default: - error("%s: Unknown error 0x%04x (%d)\n", funcname, err, err); + Pike_error("%s: Unknown Pike_error 0x%04x (%d)\n", funcname, err, err); return; } - error("%s: %s\n", funcname, msg); + Pike_error("%s: %s\n", funcname, msg); } @@ -165,7 +165,7 @@ static void push_regvalue(DWORD type, char* buffer, DWORD len) buffer+len, DO_NOT_WARN((DWORD)(sizeof(buffer)-len-1))); if(type>sizeof(buffer)-len-1 || !type) - error("RegGetValue: Failed to expand data.\n"); + Pike_error("RegGetValue: Failed to expand data.\n"); push_string(make_shared_string(buffer+len)); break; @@ -190,7 +190,7 @@ static void push_regvalue(DWORD type, char* buffer, DWORD len) break; default: - error("RegGetValue: cannot handle this data type.\n"); + Pike_error("RegGetValue: cannot handle this data type.\n"); } } @@ -222,7 +222,7 @@ void f_RegGetValue(INT32 args) &hkey_num, &key, &ind); if ((hkey_num < 0) || (hkey_num >= NELEM(hkeys))) { - error("Unknown hkey: %d\n", hkey_num); + Pike_error("Unknown hkey: %d\n", hkey_num); } ret = RegOpenKeyEx(hkeys[hkey_num], (LPCTSTR)key, 0, KEY_READ, &new_key); @@ -257,7 +257,7 @@ void f_RegGetKeyNames(INT32 args) &hkey_num, &key); if ((hkey_num < 0) || (hkey_num >= NELEM(hkeys))) { - error("Unknown hkey: %d\n", hkey_num); + Pike_error("Unknown hkey: %d\n", hkey_num); } ret = RegOpenKeyEx(hkeys[hkey_num], (LPCTSTR)key, 0, KEY_READ, &new_key); @@ -307,7 +307,7 @@ void f_RegGetValues(INT32 args) &hkey_num, &key); if ((hkey_num < 0) || (hkey_num >= NELEM(hkeys))) { - error("Unknown hkey: %d\n", hkey_num); + Pike_error("Unknown hkey: %d\n", hkey_num); } ret = RegOpenKeyEx(hkeys[hkey_num], (LPCTSTR)key, 0, KEY_READ, &new_key); @@ -429,7 +429,7 @@ static void f_sid_account(INT32 args) check_all_args("SID->account",args,BIT_STRING|BIT_VOID, 0); if(args) sys=sp[-1].u.string->str; - if(!THIS_PSID) error("SID->account on uninitialized SID.\n"); + if(!THIS_PSID) Pike_error("SID->account on uninitialized SID.\n"); lookupaccountsid(sys, THIS_PSID, foo, @@ -654,7 +654,7 @@ static void encode_user_info(BYTE *u, int level) case 11:low_encode_user_info_11((USER_INFO_11 *)u);f_aggregate(20);break; case 20:low_encode_user_info_20((USER_INFO_20 *)u);f_aggregate(5); break; default: - error("Unsupported USERINFO level.\n"); + Pike_error("Unsupported USERINFO level.\n"); } } @@ -691,7 +691,7 @@ static void encode_group_info(BYTE *u, int level) case 1: low_encode_group_info_1 ((GROUP_INFO_1 *) u);f_aggregate(2); break; case 2: low_encode_group_info_2 ((GROUP_INFO_2 *) u);f_aggregate(4);break; default: - error("Unsupported GROUPINFO level.\n"); + Pike_error("Unsupported GROUPINFO level.\n"); } } @@ -719,7 +719,7 @@ static void encode_localgroup_info(BYTE *u, int level) case 0: low_encode_localgroup_info_0 ((LOCALGROUP_INFO_0 *) u);break; case 1: low_encode_localgroup_info_1 ((LOCALGROUP_INFO_1 *) u);f_aggregate(2); break; default: - error("Unsupported LOCALGROUPINFO level.\n"); + Pike_error("Unsupported LOCALGROUPINFO level.\n"); } } @@ -747,7 +747,7 @@ static void encode_group_users_info(BYTE *u, int level) case 0: low_encode_group_users_info_0 ((GROUP_USERS_INFO_0 *) u);break; case 1: low_encode_group_users_info_1 ((GROUP_USERS_INFO_1 *) u);f_aggregate(2); break; default: - error("Unsupported GROUPUSERSINFO level.\n"); + Pike_error("Unsupported GROUPUSERSINFO level.\n"); } } @@ -767,7 +767,7 @@ static void encode_localgroup_users_info(BYTE *u, int level) { case 0: low_encode_localgroup_users_info_0 ((LOCALGROUP_USERS_INFO_0 *) u);break; default: - error("Unsupported LOCALGROUPUSERSINFO level.\n"); + Pike_error("Unsupported LOCALGROUPUSERSINFO level.\n"); } } @@ -824,7 +824,7 @@ static void encode_localgroup_members_info(BYTE *u, int level) case 2: low_encode_localgroup_members_info_2 ((LOCALGROUP_MEMBERS_INFO_2 *) u);f_aggregate(3);break; case 3: low_encode_localgroup_members_info_3 ((LOCALGROUP_MEMBERS_INFO_3 *) u);break; default: - error("Unsupported LOCALGROUPMEMBERSINFO level.\n"); + Pike_error("Unsupported LOCALGROUPMEMBERSINFO level.\n"); } } @@ -936,14 +936,14 @@ void f_NetUserGetInfo(INT32 args) case 0: case 1: case 2: case 3: case 10: case 11: case 20: break; default: - error("Unsupported information level in NetUserGetInfo.\n"); + Pike_error("Unsupported information level in NetUserGetInfo.\n"); } if(sp[-args].type==T_STRING) { server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1); if(!server) - error("NetUserGetInfo, server name string is too wide.\n"); + Pike_error("NetUserGetInfo, server name string is too wide.\n"); }else{ server=NULL; } @@ -952,7 +952,7 @@ void f_NetUserGetInfo(INT32 args) if(!user) { if(to_free1) free(to_free1); - error("NetUserGetInfo, user name string is too wide.\n"); + Pike_error("NetUserGetInfo, user name string is too wide.\n"); } THREADS_ALLOW(); @@ -996,7 +996,7 @@ void f_NetUserEnum(INT32 args) case 0: case 1: case 2: case 3: case 10: case 11: case 20: break; default: - error("Unsupported information level in NetUserEnum.\n"); + Pike_error("Unsupported information level in NetUserEnum.\n"); } case 1: @@ -1078,7 +1078,7 @@ void f_NetGroupEnum(INT32 args) case 0: case 1: case 2: break; default: - error("Unsupported information level in NetGroupEnum.\n"); + Pike_error("Unsupported information level in NetGroupEnum.\n"); } } @@ -1149,7 +1149,7 @@ void f_NetLocalGroupEnum(INT32 args) case 0: case 1: break; default: - error("Unsupported information level in NetLocalGroupEnum.\n"); + Pike_error("Unsupported information level in NetLocalGroupEnum.\n"); } } @@ -1224,7 +1224,7 @@ void f_NetUserGetGroups(INT32 args) case 0: case 1: break; default: - error("Unsupported information level in NetUserGetGroups.\n"); + Pike_error("Unsupported information level in NetUserGetGroups.\n"); } } @@ -1296,7 +1296,7 @@ void f_NetUserGetLocalGroups(INT32 args) case 0: break; default: - error("Unsupported information level in NetUserGetLocalGroups.\n"); + Pike_error("Unsupported information level in NetUserGetLocalGroups.\n"); } } @@ -1370,7 +1370,7 @@ void f_NetGroupGetUsers(INT32 args) case 0: case 1: break; default: - error("Unsupported information level in NetGroupGetUsers.\n"); + Pike_error("Unsupported information level in NetGroupGetUsers.\n"); } } @@ -1450,7 +1450,7 @@ void f_NetLocalGroupGetMembers(INT32 args) case 0: case 1: case 2: case 3: break; default: - error("Unsupported information level in NetLocalGroupGetMembers.\n"); + Pike_error("Unsupported information level in NetLocalGroupGetMembers.\n"); } } @@ -1480,7 +1480,7 @@ void f_NetLocalGroupGetMembers(INT32 args) case ERROR_NO_SUCH_ALIAS: if(to_free1) free(to_free1); if(to_free2) free(to_free2); - error("NetLocalGroupGetMembers: No such alias.\n"); + Pike_error("NetLocalGroupGetMembers: No such alias.\n"); break; case NERR_Success: @@ -1526,7 +1526,7 @@ void f_NetGetDCName(INT32 args) { server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1); if(!server) - error("NetGetDCName, server name string is too wide.\n"); + Pike_error("NetGetDCName, server name string is too wide.\n"); }else{ server=NULL; } @@ -1535,7 +1535,7 @@ void f_NetGetDCName(INT32 args) if(!domain) { if(to_free1) free(to_free1); - error("NetGetDCName, domain name string is too wide.\n"); + Pike_error("NetGetDCName, domain name string is too wide.\n"); } THREADS_ALLOW(); @@ -1572,7 +1572,7 @@ void f_NetGetAnyDCName(INT32 args) { server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1); if(!server) - error("NetGetAnyDCName, server name string is too wide.\n"); + Pike_error("NetGetAnyDCName, server name string is too wide.\n"); }else{ server=NULL; } @@ -1581,7 +1581,7 @@ void f_NetGetAnyDCName(INT32 args) if(!domain) { if(to_free1) free(to_free1); - error("NetGetAnyDCName, domain name string is too wide.\n"); + Pike_error("NetGetAnyDCName, domain name string is too wide.\n"); } THREADS_ALLOW(); @@ -1623,7 +1623,7 @@ static LPWSTR get_wstring(struct svalue *s) case 1: return STR1(s->u.string); default: - error("Bad string width.\n"); + Pike_error("Bad string width.\n"); /* we never get here, but the "return (LPWSTR)0" makes the compiler * stop complaining about our not returning a value here. */ @@ -1712,7 +1712,7 @@ static void encode_session_info(BYTE *u, int level) case 10:low_encode_session_info_10((SESSION_INFO_10 *)u); break; case 502:low_encode_session_info_502((SESSION_INFO_502 *)u); break; default: - error("Unsupported SESSIONINFO level.\n"); + Pike_error("Unsupported SESSIONINFO level.\n"); } } @@ -1757,7 +1757,7 @@ static void encode_wkstauser_info(BYTE *p, int level) } else { - error("Unsupported WKSTA_USER_INFO level.\n"); + Pike_error("Unsupported WKSTA_USER_INFO level.\n"); } } @@ -1798,7 +1798,7 @@ static void f_NetSessionEnum(INT32 args) /* valid levels */ break; default: - error("NetSessionEnum: Unsupported level: %d.\n", level); + Pike_error("NetSessionEnum: Unsupported level: %d.\n", level); } @@ -1868,7 +1868,7 @@ static void f_NetWkstaUserEnum(INT32 args) level=sp[1-args].u.integer; if (level != 0 && level != 1) - error("NetWkstaUserEnum: Unsupported level: %d.\n", level); + Pike_error("NetWkstaUserEnum: Unsupported level: %d.\n", level); while(1) { @@ -1951,11 +1951,11 @@ static void f_LookupAccountName(INT32 args) if(sp[-args].type == T_STRING) { if(sp[-args].u.string->size_shift != 0) - error("LookupAccountName: System name is wide string.\n"); + Pike_error("LookupAccountName: System name is wide string.\n"); sys=STR0(sp[-args].u.string); } if(sp[1-args].u.string->size_shift != 0) - error("LookupAccountName: Account name is wide string.\n"); + Pike_error("LookupAccountName: Account name is wide string.\n"); acc=STR0(sp[1-args].u.string); @@ -2063,26 +2063,26 @@ static PACL decode_acl(struct array *arr) for(a=0;a<arr->size;a++) { if(arr->item[a].type != T_ARRAY) - error("Index %d in ACL is not an array.\n",a); + Pike_error("Index %d in ACL is not an array.\n",a); if(arr->item[a].u.array->size != 4) - error("Index %d in ACL is not of size 4.\n",a); + Pike_error("Index %d in ACL is not of size 4.\n",a); if(arr->item[a].u.array->item[0].type != T_STRING) - error("ACE[%d][%d] is not a string.\n",a,0); + Pike_error("ACE[%d][%d] is not a string.\n",a,0); if(arr->item[a].u.array->item[1].type != T_INT) - error("ACE[%d][%d] is not an integer.\n",a,1); + Pike_error("ACE[%d][%d] is not an integer.\n",a,1); if(arr->item[a].u.array->item[2].type != T_INT) - error("ACE[%d][%d] is not an integer.\n",a,2); + Pike_error("ACE[%d][%d] is not an integer.\n",a,2); if(arr->item[a].u.array->item[3].type != T_OBJECT) - error("ACE[%d][%d] is not a SID class.\n",a,3); + Pike_error("ACE[%d][%d] is not a SID class.\n",a,3); sid=(PSID *)get_storage(arr->item[a].u.array->item[3].u.object,sid_program); if(!sid || !*sid) - error("ACE[%d][%d] is not a SID class.\n",a,3); + Pike_error("ACE[%d][%d] is not a SID class.\n",a,3); str=arr->item[a].u.array->item[0].u.string->str; switch( ( str[0] << 8 ) + str[1] ) @@ -2091,7 +2091,7 @@ static PACL decode_acl(struct array *arr) case ( 'd' << 8 ) + 'e': size += sizeof(ACCESS_DENIED_ACE); break; case ( 'a' << 8 ) + 'u': size += sizeof(SYSTEM_AUDIT_ACE); break; default: - error("ACE[%d][0] is not a known ACE type.\n"); + Pike_error("ACE[%d][0] is not a known ACE type.\n"); } size += getlengthsid( *sid ) - sizeof(DWORD); } @@ -2099,7 +2099,7 @@ static PACL decode_acl(struct array *arr) ret=(PACL)xalloc( size ); if(!initializeacl(ret, size, ACL_REVISION)) - error("InitializeAcl failed!\n"); + Pike_error("InitializeAcl failed!\n"); for(a=0;a<arr->size;a++) { @@ -2112,14 +2112,14 @@ static PACL decode_acl(struct array *arr) if(!addaccessallowedace(ret, ACL_REVISION, arr->item[a].u.array->item[2].u.integer, sid)) - error("AddAccessAllowedAce failed!\n"); + Pike_error("AddAccessAllowedAce failed!\n"); break; case ( 'd' << 8 ) + 'e': if(!addaccessdeniedace(ret, ACL_REVISION, arr->item[a].u.array->item[2].u.integer, sid)) - error("AddAccessDeniedAce failed!\n"); + Pike_error("AddAccessDeniedAce failed!\n"); break; case ( 'a' << 8 ) + 'u': @@ -2127,7 +2127,7 @@ static PACL decode_acl(struct array *arr) if(!addauditaccessace(ret, ACL_REVISION, arr->item[a].u.array->item[2].u.integer, sid,1,1)) - error("AddAuditAccessAce failed!\n"); + Pike_error("AddAuditAccessAce failed!\n"); break; } } @@ -2156,7 +2156,7 @@ static void f_SetNamedSecurityInfo(INT32 args) if((sval=simple_mapping_string_lookup(m, "type"))) { if(sval->type != T_INT) - error("Bad 'type' in SetNamedSecurityInfo.\n"); + Pike_error("Bad 'type' in SetNamedSecurityInfo.\n"); type=sval->u.integer; } @@ -2164,7 +2164,7 @@ static void f_SetNamedSecurityInfo(INT32 args) { if(sval->type != T_OBJECT || !get_storage(sval->u.object, sid_program)) - error("Bad 'owner' in SetNamedSecurityInfo.\n"); + Pike_error("Bad 'owner' in SetNamedSecurityInfo.\n"); owner=*(PSID *)get_storage(sval->u.object, sid_program); flags |= OWNER_SECURITY_INFORMATION; } @@ -2173,7 +2173,7 @@ static void f_SetNamedSecurityInfo(INT32 args) { if(sval->type != T_OBJECT || !get_storage(sval->u.object, sid_program)) - error("Bad 'group' in SetNamedSecurityInfo.\n"); + Pike_error("Bad 'group' in SetNamedSecurityInfo.\n"); group=*(PSID *)get_storage(sval->u.object, sid_program); flags |= GROUP_SECURITY_INFORMATION; } @@ -2181,7 +2181,7 @@ static void f_SetNamedSecurityInfo(INT32 args) if((sval=simple_mapping_string_lookup(m,"dacl"))) { if(sval->type != T_ARRAY) - error("Bad 'dacl' in SetNamedSecurityInfo.\n"); + Pike_error("Bad 'dacl' in SetNamedSecurityInfo.\n"); dacl=decode_acl(sval->u.array); flags |= DACL_SECURITY_INFORMATION; } @@ -2189,7 +2189,7 @@ static void f_SetNamedSecurityInfo(INT32 args) if((sval=simple_mapping_string_lookup(m,"sacl"))) { if(sval->type != T_ARRAY) - error("Bad 'sacl' in SetNamedSecurityInfo.\n"); + Pike_error("Bad 'sacl' in SetNamedSecurityInfo.\n"); sacl=decode_acl(sval->u.array); flags |= SACL_SECURITY_INFORMATION; } diff --git a/src/modules/system/syslog.c b/src/modules/system/syslog.c index 8914204cf6e7bf9255926f9c3e993d4a5c014f6b..5f157d4e38ef853cde43dd07b5ded3c029c832d3 100644 --- a/src/modules/system/syslog.c +++ b/src/modules/system/syslog.c @@ -1,5 +1,5 @@ /* - * $Id: syslog.c,v 1.9 2000/08/10 09:51:55 per Exp $ + * $Id: syslog.c,v 1.10 2000/12/01 08:10:39 hubbe Exp $ * * Access to syslog from Pike. * @@ -17,7 +17,7 @@ #ifdef HAVE_SYSLOG -RCSID("$Id: syslog.c,v 1.9 2000/08/10 09:51:55 per Exp $"); +RCSID("$Id: syslog.c,v 1.10 2000/12/01 08:10:39 hubbe Exp $"); #include "interpret.h" #include "svalue.h" @@ -159,10 +159,10 @@ void f_syslog(INT32 args) get_all_args("syslog", args, "%i%S", &i, &s); if(args < 2) - error("Wrong number of arguments to syslog(int, string)\n"); + Pike_error("Wrong number of arguments to syslog(int, string)\n"); if(sp[-args].type != T_INT || sp[-args+1].type != T_STRING) - error("Wrong type of arguments to syslog(int, string)\n"); + Pike_error("Wrong type of arguments to syslog(int, string)\n"); if(i & (1<<0)) pri |= LOG_EMERG; if(i & (1<<1)) pri |= LOG_ALERT; diff --git a/src/modules/system/system.c b/src/modules/system/system.c index 2173e7f302a41a2a56ff19a1c02bb69f5d79b5aa..2f1464d94f05c067551adfe70c1ba2ecd98b779f 100644 --- a/src/modules/system/system.c +++ b/src/modules/system/system.c @@ -1,5 +1,5 @@ /* - * $Id: system.c,v 1.93 2000/09/29 13:46:07 grubba Exp $ + * $Id: system.c,v 1.94 2000/12/01 08:10:40 hubbe Exp $ * * System-call module for Pike * @@ -15,7 +15,7 @@ #include "system_machine.h" #include "system.h" -RCSID("$Id: system.c,v 1.93 2000/09/29 13:46:07 grubba Exp $"); +RCSID("$Id: system.c,v 1.94 2000/12/01 08:10:40 hubbe Exp $"); #ifdef HAVE_WINSOCK_H #include <winsock.h> #endif @@ -142,13 +142,13 @@ static void report_error(const char *function_name) error_msg = "Destination already exists"; break; case EFAULT: - error_msg = "Internal Pike error:Bad Pike string!"; + error_msg = "Internal Pike Pike_error:Bad Pike string!"; break; case EINVAL: error_msg = "Bad argument"; break; case EIO: - error_msg = "I/O error"; + error_msg = "I/O Pike_error"; break; #ifdef ELOOP case ELOOP: @@ -204,7 +204,7 @@ static void report_error(const char *function_name) error_msg = "No such process"; break; } - error("%s(): Failed: %s\n", function_name, error_msg); + Pike_error("%s(): Failed: %s\n", function_name, error_msg); } @@ -280,7 +280,7 @@ void f_readlink(INT32 args) do { buflen *= 2; if (!(buf = alloca(buflen))) { - error("readlink(): Out of memory\n"); + Pike_error("readlink(): Out of memory\n"); } THREADS_ALLOW_UID(); @@ -328,7 +328,7 @@ void f_resolvepath(INT32 args) do { buflen *= 2; if (!(buf = alloca(buflen))) { - error("resolvepath(): Out of memory\n"); + Pike_error("resolvepath(): Out of memory\n"); } THREADS_ALLOW_UID(); @@ -402,7 +402,7 @@ void f_chown(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("chown: permission denied.\n"); + Pike_error("chown: permission denied.\n"); #endif get_all_args("chown", args, "%s%i%i", &path, &uid, &gid); @@ -433,7 +433,7 @@ void f_utime(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("utime: permission denied.\n"); + Pike_error("utime: permission denied.\n"); #endif get_all_args("utime", args, "%s%i%i", &path, &atime, &mtime); @@ -461,7 +461,7 @@ void f_initgroups(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("initgroups: permission denied.\n"); + Pike_error("initgroups: permission denied.\n"); #endif VALID_FILE_IO("initgroups","status"); @@ -483,7 +483,7 @@ void f_cleargroups(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("cleargroups: permission denied.\n"); + Pike_error("cleargroups: permission denied.\n"); #endif pop_n_elems(args); @@ -506,7 +506,7 @@ void f_setgroups(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setgroups: permission denied.\n"); + Pike_error("setgroups: permission denied.\n"); #endif get_all_args("setgroups", args, "%a", &arr); @@ -522,7 +522,7 @@ void f_setgroups(INT32 args) * so we always have an allocated gids here. */ free(gids); - error("setgroups(): Bad element %d in array (expected int)\n", i); + Pike_error("setgroups(): Bad element %d in array (expected int)\n", i); } gids[i] = arr->item[i].u.integer; } @@ -611,7 +611,7 @@ void f_setuid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setuid: permission denied.\n"); + Pike_error("setuid: permission denied.\n"); #endif get_all_args("setuid", args, "%i", &id); @@ -637,7 +637,7 @@ void f_setgid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setgid: permission denied.\n"); + Pike_error("setgid: permission denied.\n"); #endif get_all_args("setgid", args, "%i", &id); @@ -663,7 +663,7 @@ void f_seteuid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("seteuid: permission denied.\n"); + Pike_error("seteuid: permission denied.\n"); #endif get_all_args("seteuid", args, "%i", &id); @@ -695,7 +695,7 @@ void f_setegid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setegid: permission denied.\n"); + Pike_error("setegid: permission denied.\n"); #endif get_all_args("setegid", args, "%i", &id); @@ -728,7 +728,7 @@ void f_getpgrp(INT32 args) if (args) { if (sp[-args].type != T_INT) { - error("Bad argument 1 to getpgrp()\n"); + Pike_error("Bad argument 1 to getpgrp()\n"); } pid = sp[-args].u.integer; } @@ -737,7 +737,7 @@ void f_getpgrp(INT32 args) pgid = getpgid(pid); #elif defined(HAVE_GETPGRP) if (pid && (pid != getpid())) { - error("getpgrp(): Mode not supported on this OS\n"); + Pike_error("getpgrp(): Mode not supported on this OS\n"); } pgid = getpgrp(); #endif @@ -774,7 +774,7 @@ void f_getsid(INT32 args) { int pid = 0; if (args >= 1 && sp[-args].type != T_INT) - error("Bad argument for getsid().\n"); + Pike_error("Bad argument for getsid().\n"); if (args >= 1) pid = sp[-args].u.integer; pop_n_elems(args); @@ -790,7 +790,7 @@ void f_setsid(INT32 args) { int pid; if (args > 0) - error("setsid() takes no arguments.\n"); + Pike_error("setsid() takes no arguments.\n"); pop_n_elems(args); pid = setsid(); if (pid < 0) @@ -807,7 +807,7 @@ void f_setresuid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setresuid: permission denied.\n"); + Pike_error("setresuid: permission denied.\n"); #endif get_all_args("setresuid", args, "%i%i%i", &ruid,&euid,&suid); @@ -826,7 +826,7 @@ void f_setresgid(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("setresgid: permission denied.\n"); + Pike_error("setresgid: permission denied.\n"); #endif get_all_args("setresgid", args, "%i%i%i", &rgid,&egid,&sgid); @@ -868,7 +868,7 @@ void f_chroot(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("chroot: permission denied.\n"); + Pike_error("chroot: permission denied.\n"); #endif #ifdef HAVE_FCHROOT @@ -997,7 +997,7 @@ void f_uname(INT32 args) old_sp = sp; if(uname(&foo) < 0) - error("uname() system call failed.\n"); + Pike_error("uname() system call failed.\n"); push_text("sysname"); push_text(foo.sysname); @@ -1025,7 +1025,7 @@ void f_gethostname(INT32 args) struct utsname foo; pop_n_elems(args); if(uname(&foo) < 0) - error("uname() system call failed.\n"); + Pike_error("uname() system call failed.\n"); push_text(foo.nodename); } #elif defined(HAVE_GETHOSTNAME) @@ -1042,7 +1042,7 @@ void f_gethostname(INT32 args) char name[1024]; pop_n_elems(args); if (sysinfo(SI_HOSTNAME, name, sizeof(name)) < 0) { - error("sysinfo() system call failed.\n"); + Pike_error("sysinfo() system call failed.\n"); } push_text(name); } @@ -1276,7 +1276,7 @@ void get_inet_addr(struct sockaddr_in *addr,char *name) else if(my_isipnr(name)) /* I do not entirely trust inet_addr */ { if (((IN_ADDR_T)inet_addr(name)) == ((IN_ADDR_T)-1)) - error("Malformed ip number.\n"); + Pike_error("Malformed ip number.\n"); addr->sin_addr.s_addr = inet_addr(name); } @@ -1288,9 +1288,9 @@ void get_inet_addr(struct sockaddr_in *addr,char *name) if(!ret) { if (strlen(name) < 1024) { - error("Invalid address '%s'\n",name); + Pike_error("Invalid address '%s'\n",name); } else { - error("Invalid address\n"); + Pike_error("Invalid address\n"); } } @@ -1305,9 +1305,9 @@ void get_inet_addr(struct sockaddr_in *addr,char *name) #endif #else if (strlen(name) < 1024) { - error("Invalid address '%s'\n",name); + Pike_error("Invalid address '%s'\n",name); } else { - error("Invalid address\n"); + Pike_error("Invalid address\n"); } #endif } @@ -1363,7 +1363,7 @@ void f_gethostbyaddr(INT32 args) get_all_args("gethostbyaddr", args, "%s", &name); if ((int)(addr = inet_addr(name)) == -1) { - error("gethostbyaddr(): IP-address must be of the form a.b.c.d\n"); + Pike_error("gethostbyaddr(): IP-address must be of the form a.b.c.d\n"); } pop_n_elems(args); diff --git a/src/multiset.c b/src/multiset.c index e0510d29eed27034f7579f3552c0f29b5f30cd40..b594d478c03c89764de2f2e4902e9e15fb9dd198 100644 --- a/src/multiset.c +++ b/src/multiset.c @@ -10,14 +10,14 @@ #include "svalue.h" #include "pike_macros.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" #include "dynamic_buffer.h" #include "interpret.h" #include "builtin_functions.h" #include "gc.h" #include "security.h" -RCSID("$Id: multiset.c,v 1.29 2000/11/08 20:03:46 hubbe Exp $"); +RCSID("$Id: multiset.c,v 1.30 2000/12/01 08:09:50 hubbe Exp $"); struct multiset *first_multiset; diff --git a/src/object.c b/src/object.c index b018bec42d86bed75d55d328413f653a3842e9b9..4e0b2edc4e2400e843cea0a504a321bfe0651f3d 100644 --- a/src/object.c +++ b/src/object.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: object.c,v 1.153 2000/12/01 01:15:00 hubbe Exp $"); +RCSID("$Id: object.c,v 1.154 2000/12/01 08:09:51 hubbe Exp $"); #include "object.h" #include "dynamic_buffer.h" #include "interpret.h" @@ -14,7 +14,7 @@ RCSID("$Id: object.c,v 1.153 2000/12/01 01:15:00 hubbe Exp $"); #include "svalue.h" #include "pike_macros.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" #include "main.h" #include "array.h" #include "gc.h" @@ -95,7 +95,7 @@ PMOD_EXPORT struct object *low_clone(struct program *p) struct object *o; if(!(p->flags & PROGRAM_FINISHED)) - error("Attempting to clone an unfinished program\n"); + Pike_error("Attempting to clone an unfinished program\n"); #ifdef PROFILING p->num_clones++; @@ -267,7 +267,7 @@ PMOD_EXPORT struct object *debug_clone_object(struct program *p, int args) ONERROR tmp; struct object *o; if(p->flags & PROGRAM_USES_PARENT) - error("Parent lost, cannot clone program.\n"); + Pike_error("Parent lost, cannot clone program.\n"); o=low_clone(p); SET_ONERROR(tmp, do_free_object, o); @@ -445,7 +445,7 @@ PMOD_EXPORT struct object *get_master(void) sp--; dmalloc_touch_svalue(sp); }else{ - error("Couldn't load master program. (%s)\n",master_file); + Pike_error("Couldn't load master program. (%s)\n",master_file); } } master_object=low_clone(master_program); @@ -778,7 +778,7 @@ PMOD_EXPORT void low_object_index_no_free(struct svalue *to, struct program *p=o->prog; if(!p) - error("Cannot access global variables in destructed object.\n"); + Pike_error("Cannot access global variables in destructed object.\n"); debug_malloc_touch(o); debug_malloc_touch(o->storage); @@ -846,7 +846,7 @@ PMOD_EXPORT void object_index_no_free2(struct svalue *to, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return; /* make gcc happy */ } @@ -861,7 +861,7 @@ PMOD_EXPORT void object_index_no_free2(struct svalue *to, break; default: - error("Lookup on non-string value.\n"); + Pike_error("Lookup on non-string value.\n"); } if(f < 0) @@ -885,7 +885,7 @@ PMOD_EXPORT void object_index_no_free(struct svalue *to, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return; /* make gcc happy */ } lfun=ARROW_INDEX_P(index) ? LFUN_ARROW : LFUN_INDEX; @@ -912,7 +912,7 @@ PMOD_EXPORT void object_low_set_index(struct object *o, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return; /* make gcc happy */ } @@ -924,7 +924,7 @@ PMOD_EXPORT void object_low_set_index(struct object *o, if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) { - error("Cannot assign functions or constants.\n"); + Pike_error("Cannot assign functions or constants.\n"); } else if(i->run_time_type == T_MIXED) { @@ -948,7 +948,7 @@ PMOD_EXPORT void object_set_index2(struct object *o, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return; /* make gcc happy */ } @@ -958,9 +958,9 @@ PMOD_EXPORT void object_set_index2(struct object *o, f=find_shared_string_identifier(index->u.string, p); if(f<0) { if (index->u.string->len < 1024) { - error("No such variable (%s) in object.\n", index->u.string->str); + Pike_error("No such variable (%s) in object.\n", index->u.string->str); } else { - error("No such variable in object.\n"); + Pike_error("No such variable in object.\n"); } } break; @@ -970,15 +970,15 @@ PMOD_EXPORT void object_set_index2(struct object *o, break; default: - error("Lookup on non-string value.\n"); + Pike_error("Lookup on non-string value.\n"); } if(f < 0) { if (index->u.string->len < 1024) { - error("No such variable (%s) in object.\n", index->u.string->str); + Pike_error("No such variable (%s) in object.\n", index->u.string->str); } else { - error("No such variable in object.\n"); + Pike_error("No such variable in object.\n"); } }else{ object_low_set_index(o, f, from); @@ -994,7 +994,7 @@ PMOD_EXPORT void object_set_index(struct object *o, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return; /* make gcc happy */ } @@ -1020,7 +1020,7 @@ static union anything *object_low_get_item_ptr(struct object *o, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return 0; /* make gcc happy */ } @@ -1028,7 +1028,7 @@ static union anything *object_low_get_item_ptr(struct object *o, if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) { - error("Cannot assign functions or constants.\n"); + Pike_error("Cannot assign functions or constants.\n"); } else if(i->run_time_type == T_MIXED) { @@ -1054,7 +1054,7 @@ union anything *object_get_item_ptr(struct object *o, if(!o || !(p=o->prog)) { - error("Lookup in destructed object.\n"); + Pike_error("Lookup in destructed object.\n"); return 0; /* make gcc happy */ } @@ -1068,7 +1068,7 @@ union anything *object_get_item_ptr(struct object *o, { return 0; - /* error("Cannot do incremental operations on overloaded index (yet).\n"); + /* Pike_error("Cannot do incremental operations on overloaded index (yet).\n"); */ } @@ -1080,13 +1080,13 @@ union anything *object_get_item_ptr(struct object *o, break; default: -/* error("Lookup on non-string value.\n"); */ +/* Pike_error("Lookup on non-string value.\n"); */ return 0; } if(f < 0) { - error("No such variable in object.\n"); + Pike_error("No such variable in object.\n"); }else{ return object_low_get_item_ptr(o, f, type); } @@ -1176,7 +1176,7 @@ PMOD_EXPORT struct array *object_indices(struct object *o) p=o->prog; if(!p) - error("indices() on destructed object.\n"); + Pike_error("indices() on destructed object.\n"); if(FIND_LFUN(p,LFUN__INDICES) == -1) { @@ -1190,7 +1190,7 @@ PMOD_EXPORT struct array *object_indices(struct object *o) }else{ apply_lfun(o, LFUN__INDICES, 0); if(sp[-1].type != T_ARRAY) - error("Bad return type from o->_indices()\n"); + Pike_error("Bad return type from o->_indices()\n"); a=sp[-1].u.array; sp--; dmalloc_touch_svalue(sp); @@ -1206,7 +1206,7 @@ PMOD_EXPORT struct array *object_values(struct object *o) p=o->prog; if(!p) - error("values() on destructed object.\n"); + Pike_error("values() on destructed object.\n"); if(FIND_LFUN(p,LFUN__VALUES)==-1) { @@ -1218,7 +1218,7 @@ PMOD_EXPORT struct array *object_values(struct object *o) }else{ apply_lfun(o, LFUN__VALUES, 0); if(sp[-1].type != T_ARRAY) - error("Bad return type from o->_values()\n"); + Pike_error("Bad return type from o->_values()\n"); a=sp[-1].u.array; sp--; dmalloc_touch_svalue(sp); @@ -1524,7 +1524,7 @@ void push_magic_index(struct program *type, int inherit_no, int parent_level) struct object *magic; loc.o=Pike_fp->current_object; - if(!loc.o) error("Illegal magic index call.\n"); + if(!loc.o) Pike_error("Illegal magic index call.\n"); loc.parent_identifier=Pike_fp->fun; loc.inherit=INHERIT_FROM_INT(Pike_fp->current_object->prog, Pike_fp->fun); @@ -1551,10 +1551,10 @@ static void f_magic_index(INT32 args) get_all_args("::`->",args,"%S",&s); if(!(o=MAGIC_THIS->o)) - error("Magic index error\n"); + Pike_error("Magic index Pike_error\n"); if(!o->prog) - error("Magic index on destructed object!\n"); + Pike_error("Magic index on destructed object!\n"); inherit=MAGIC_THIS->inherit; @@ -1586,10 +1586,10 @@ static void f_magic_set_index(INT32 args) get_all_args("::`->=",args,"%S%*",&s,&val); if(!(o=MAGIC_THIS->o)) - error("Magic index error\n"); + Pike_error("Magic index Pike_error\n"); if(!o->prog) - error("Magic index on destructed object!\n"); + Pike_error("Magic index on destructed object!\n"); inherit=MAGIC_THIS->inherit; @@ -1597,7 +1597,7 @@ static void f_magic_set_index(INT32 args) if(f<0) { - error("No such variable in object.\n"); + Pike_error("No such variable in object.\n"); }else{ object_low_set_index(o, f+inherit->identifier_level, val); diff --git a/src/opcodes.c b/src/opcodes.c index be3698f7fac30e2f3fe0c1190e6befd55becc8a5..d0678056f2c5abecb4131b8b59243f36d6ead908 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -15,7 +15,7 @@ #include "multiset.h" #include "opcodes.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "pike_types.h" #include "pike_memory.h" #include "fd_control.h" @@ -26,7 +26,7 @@ #include "bignum.h" #include "operators.h" -RCSID("$Id: opcodes.c,v 1.94 2000/11/29 13:14:18 mirar Exp $"); +RCSID("$Id: opcodes.c,v 1.95 2000/12/01 08:09:51 hubbe Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -35,7 +35,7 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) #ifdef PIKE_SECURITY if(what->type <= MAX_COMPLEX) if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX)) - error("Index permission denied.\n"); + Pike_error("Index permission denied.\n"); #endif switch(what->type) @@ -49,12 +49,12 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) index_no_free(to, what, ind); if(IS_UNDEFINED(to)) { if (val) { - error("Indexing the integer %d with an unknown method.\n", val); + Pike_error("Indexing the integer %d with an unknown method.\n", val); } else { if(ind->type == T_STRING) - error("Indexing the NULL value with \"%s\".\n", ind->u.string->str); + Pike_error("Indexing the NULL value with \"%s\".\n", ind->u.string->str); else - error("Indexing the NULL value.\n"); + Pike_error("Indexing the NULL value.\n"); } } } @@ -89,9 +89,9 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) if(i<0 || i>=what->u.string->len) { if(what->u.string->len == 0) - error("Attempt to index the empty string with %d.\n", i); + Pike_error("Attempt to index the empty string with %d.\n", i); else - error("Index %d is out of string range 0 - %ld.\n", + Pike_error("Index %d is out of string range 0 - %ld.\n", i, PTRDIFF_T_TO_LONG(what->u.string->len - 1)); } else i=index_shared_string(what->u.string,i); @@ -100,7 +100,7 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) to->u.integer=i; break; }else{ - error("Index is not an integer.\n"); + Pike_error("Index is not an integer.\n"); } case T_PROGRAM: @@ -118,7 +118,7 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) /* FALL THROUGH */ default: - error("Indexing a basic type.\n"); + Pike_error("Indexing a basic type.\n"); } } @@ -147,9 +147,9 @@ void o_cast(struct pike_string *type, INT32 run_time_type) s=describe_type(type); push_string(s); if(!sp[-2].u.object->prog) - error("Cast called on destructed object.\n"); + Pike_error("Cast called on destructed object.\n"); if(FIND_LFUN(sp[-2].u.object->prog,LFUN_CAST) == -1) - error("No cast method in object.\n"); + Pike_error("No cast method in object.\n"); apply_lfun(sp[-2].u.object, LFUN_CAST, 1); free_svalue(sp-2); sp[-2]=sp[-1]; @@ -160,7 +160,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) switch(run_time_type) { default: - error("Cannot perform cast to that type.\n"); + Pike_error("Cannot perform cast to that type.\n"); case T_MIXED: return; @@ -176,7 +176,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) } default: - error("Cannot cast %s to multiset.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to multiset.\n",get_name_of_type(sp[-1].type)); } break; @@ -194,11 +194,11 @@ void o_cast(struct pike_string *type, INT32 run_time_type) for (i=0; i<a->size; i++) { if (ITEM(a)[i].type!=T_ARRAY) - error("Cast array to mapping: " + Pike_error("Cast array to mapping: " "element %d is not an array\n", i); b=ITEM(a)[i].u.array; if (b->size!=2) - error("Cast array to mapping: " + Pike_error("Cast array to mapping: " "element %d is not an array of size 2\n", i); mapping_insert(m,ITEM(b)+0,ITEM(b)+1); } @@ -208,7 +208,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) } default: - error("Cannot cast %s to mapping.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to mapping.\n",get_name_of_type(sp[-1].type)); } break; @@ -232,7 +232,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) break; default: - error("Cannot cast %s to array.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to array.\n",get_name_of_type(sp[-1].type)); } break; @@ -282,7 +282,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) break; default: - error("Cannot cast %s to int.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to int.\n",get_name_of_type(sp[-1].type)); } break; @@ -304,7 +304,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) break; default: - error("Cannot cast %s to float.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to float.\n",get_name_of_type(sp[-1].type)); } sp[-1].type=T_FLOAT; @@ -335,7 +335,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) for(i = a->size; i--; ) { unsigned INT32 val; if (a->item[i].type != T_INT) { - error("cast: Item %d is not an integer.\n", i); + Pike_error("cast: Item %d is not an integer.\n", i); } val = (unsigned INT32)a->item[i].u.integer; if (val > 0xff) { @@ -344,19 +344,19 @@ void o_cast(struct pike_string *type, INT32 run_time_type) shift = 2; while(i--) if (a->item[i].type != T_INT) - error("cast: Item %d is not an integer.\n", i); + Pike_error("cast: Item %d is not an integer.\n", i); break; } while(i--) { if (a->item[i].type != T_INT) { - error("cast: Item %d is not an integer.\n", i); + Pike_error("cast: Item %d is not an integer.\n", i); } val = (unsigned INT32)a->item[i].u.integer; if (val > 0xffff) { shift = 2; while(i--) if (a->item[i].type != T_INT) - error("cast: Item %d is not an integer.\n", i); + Pike_error("cast: Item %d is not an integer.\n", i); break; } } @@ -399,7 +399,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) break; default: - error("Cannot cast %s to string.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to string.\n",get_name_of_type(sp[-1].type)); } sp[-1].type=T_STRING; @@ -426,7 +426,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) break; default: - error("Cannot cast %s to object.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to object.\n",get_name_of_type(sp[-1].type)); } break; @@ -460,7 +460,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) return; default: - error("Cannot cast %s to a program.\n",get_name_of_type(sp[-1].type)); + Pike_error("Cannot cast %s to a program.\n",get_name_of_type(sp[-1].type)); } } } @@ -479,7 +479,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type) if(f) goto emulated_type_ok; } } - error("Cast failed, wanted %s, got %s\n", + Pike_error("Cast failed, wanted %s, got %s\n", get_name_of_type(run_time_type), get_name_of_type(sp[-1].type)); } @@ -650,7 +650,7 @@ PMOD_EXPORT void f_cast(void) compile_type_to_runtime_type(sp[-2].u.string)); #ifdef PIKE_DEBUG if(save_sp != sp) - fatal("Internal error: o_cast() left droppings on stack.\n"); + fatal("Internal Pike_error: o_cast() left droppings on stack.\n"); #endif free_svalue(sp-2); sp[-2]=sp[-1]; @@ -699,7 +699,7 @@ static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \ CHAROPT( int set_size=0; ) \ \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ \ MEMSET(set->c, 0, sizeof(set->c)); \ set->a=0; \ @@ -709,7 +709,7 @@ static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \ set->neg=1; \ cnt++; \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ }else{ \ set->neg=0; \ } \ @@ -719,7 +719,7 @@ static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \ set->c[last=match[cnt]]=1; \ cnt++; \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ } \ \ for(;match[cnt]!=']';cnt++) \ @@ -728,7 +728,7 @@ static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \ { \ cnt++; \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ \ if(match[cnt]==']') \ { \ @@ -737,7 +737,7 @@ static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \ } \ \ if(last >= match[cnt]) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ \ CHAROPT( \ if(last < (size_t)sizeof(set->c)) \ @@ -796,7 +796,7 @@ CHAROPT( \ free_array(set->a); \ set->a=0; \ free((char *)order); \ - error("Overlapping ranges in sscanf not supported.\n"); \ + Pike_error("Overlapping ranges in sscanf not supported.\n"); \ } \ } \ \ @@ -1068,7 +1068,7 @@ static INT32 PIKE_CONCAT4(very_low_sscanf_,INPUT_SHIFT,_,MATCH_SHIFT)( \ \ cnt++; \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ \ while(1) \ { \ @@ -1078,7 +1078,7 @@ static INT32 PIKE_CONCAT4(very_low_sscanf_,INPUT_SHIFT,_,MATCH_SHIFT)( \ no_assign=1; \ cnt++; \ if(cnt>=match_len) \ - error("Error in sscanf format string.\n"); \ + Pike_error("Error in sscanf format string.\n"); \ continue; \ \ case '0': case '1': case '2': case '3': case '4': \ @@ -1104,7 +1104,7 @@ static INT32 PIKE_CONCAT4(very_low_sscanf_,INPUT_SHIFT,_,MATCH_SHIFT)( \ { \ if(e>=match_len) \ { \ - error("Missing %%} in format string.\n"); \ + Pike_error("Missing %%} in format string.\n"); \ break; /* UNREACHED */ \ } \ if(match[e]=='%') \ @@ -1307,7 +1307,7 @@ CHAROPT2( \ case 'F': \ if(field_length == -1) field_length = 4; \ if(field_length != 4 && field_length != 8) \ - error("Invalid IEEE width %ld in sscanf format string.\n", \ + Pike_error("Invalid IEEE width %ld in sscanf format string.\n", \ PTRDIFF_T_TO_LONG(field_length)); \ if(eye+field_length > input_len) \ { \ @@ -1380,7 +1380,7 @@ CHAROPT2( \ goto test_again; \ \ case 's': \ - error("Illegal to have two adjecent %%s.\n"); \ + Pike_error("Illegal to have two adjecent %%s.\n"); \ return 0; /* make gcc happy */ \ \ /* sscanf("foo-bar","%s%d",a,b) might not work as expected */ \ @@ -1534,7 +1534,7 @@ CHAROPT2( \ break; \ \ default: \ - error("Unknown sscanf token %%%c(0x%02x)\n", \ + Pike_error("Unknown sscanf token %%%c(0x%02x)\n", \ match[cnt], match[cnt]); \ } \ break; \ @@ -1604,10 +1604,10 @@ void o_sscanf(INT32 args) struct svalue *save_sp=sp; if(sp[-args].type != T_STRING) - error("Bad argument 1 to sscanf().\n"); + Pike_error("Bad argument 1 to sscanf().\n"); if(sp[1-args].type != T_STRING) - error("Bad argument 1 to sscanf().\n"); + Pike_error("Bad argument 1 to sscanf().\n"); switch(sp[-args].u.string->size_shift*3 + sp[1-args].u.string->size_shift) { /* input_shift : match_shift */ @@ -1693,13 +1693,13 @@ void o_sscanf(INT32 args) &x); break; default: - error("Unsupported shift-combination to sscanf(): %d:%d\n", + Pike_error("Unsupported shift-combination to sscanf(): %d:%d\n", sp[-args].u.string->size_shift, sp[1-args].u.string->size_shift); break; } if(sp-save_sp > args/2-1) - error("Too few arguments for sscanf format.\n"); + Pike_error("Too few arguments for sscanf format.\n"); for(x=0;x<sp-save_sp;x++) assign_lvalue(save_sp-args+2+x*2,save_sp+x); @@ -1817,7 +1817,7 @@ PMOD_EXPORT void f_sscanf(INT32 args) &x); break; default: - error("Unsupported shift-combination to sscanf(): %d:%d\n", + Pike_error("Unsupported shift-combination to sscanf(): %d:%d\n", sp[-args].u.string->size_shift, sp[1-args].u.string->size_shift); break; } diff --git a/src/operators.c b/src/operators.c index cc9a80143307ed6f76c9d903db0e4878f7d3a75f..f57317eda35db6fd544a086d3450a0b8f73b50e4 100644 --- a/src/operators.c +++ b/src/operators.c @@ -6,7 +6,7 @@ /**/ #include "global.h" #include <math.h> -RCSID("$Id: operators.c,v 1.112 2000/11/12 04:02:43 hubbe Exp $"); +RCSID("$Id: operators.c,v 1.113 2000/12/01 08:09:51 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "multiset.h" @@ -17,7 +17,7 @@ RCSID("$Id: operators.c,v 1.112 2000/11/12 04:02:43 hubbe Exp $"); #include "operators.h" #include "language.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" #include "docode.h" #include "constants.h" #include "peep.h" @@ -2620,7 +2620,7 @@ static void f_string_assignment_index(INT32 args) if(i<0) i+=THIS->s->len; if(i<0 || i>=THIS->s->len) - error("Index %d is out of range 0 - %ld.\n", + Pike_error("Index %d is out of range 0 - %ld.\n", i, PTRDIFF_T_TO_LONG(THIS->s->len - 1)); else i=index_shared_string(THIS->s,i); @@ -2638,16 +2638,16 @@ static void f_string_assignment_assign_index(INT32 args) free_string(THIS->s); if(i<0) i+=u->string->len; if(i<0 || i>=u->string->len) - error("String index out of range %ld\n",(long)i); + Pike_error("String index out of range %ld\n",(long)i); u->string=modify_shared_string(u->string,i,j); copy_shared_string(THIS->s, u->string); }else{ lvalue_to_svalue_no_free(sp,THIS->lval); sp++; - if(sp[-1].type != T_STRING) error("string[]= failed.\n"); + if(sp[-1].type != T_STRING) Pike_error("string[]= failed.\n"); if(i<0) i+=sp[-1].u.string->len; if(i<0 || i>=sp[-1].u.string->len) - error("String index out of range %ld\n",(long)i); + Pike_error("String index out of range %ld\n",(long)i); sp[-1].u.string=modify_shared_string(sp[-1].u.string,i,j); assign_lvalue(THIS->lval, sp-1); pop_stack(); diff --git a/src/peep.c b/src/peep.c index 606b4112aa03ea1ea4aee15ae7a6b3bdc97dd696..cb4d7427719bd99a20134e44d75cba75eeb6b1de 100644 --- a/src/peep.c +++ b/src/peep.c @@ -6,7 +6,7 @@ #include "las.h" #include "docode.h" #include "main.h" -#include "error.h" +#include "pike_error.h" #include "lex.h" #include "pike_memory.h" #include "peep.h" @@ -15,7 +15,7 @@ #include "bignum.h" #include "opcodes.h" -RCSID("$Id: peep.c,v 1.41 2000/12/01 01:13:45 hubbe Exp $"); +RCSID("$Id: peep.c,v 1.42 2000/12/01 08:09:52 hubbe Exp $"); static void asm_opt(void); @@ -143,7 +143,7 @@ void ins_f_byte(unsigned int b) b-=F_OFFSET; #ifdef PIKE_DEBUG if(b>255) - error("Instruction too big %d\n",b); + Pike_error("Instruction too big %d\n",b); #endif add_to_program((unsigned char)b); } @@ -411,7 +411,7 @@ void assemble(void) { #ifdef PIKE_DEBUG if(labels[e]==-1) - fatal("Hyperspace error: unknown jump point %ld at %d (pc=%x).\n", + fatal("Hyperspace Pike_error: unknown jump point %ld at %d (pc=%x).\n", PTRDIFF_T_TO_LONG(e), labels[e], jumps[e]); #endif tmp=read_int(jumps[e]); diff --git a/src/pike_memory.c b/src/pike_memory.c index 74a01018a817804b715a96ca924ccc65710dbfe2..73c5e852b21e58aff1f98937d5007a31d48ff728 100644 --- a/src/pike_memory.c +++ b/src/pike_memory.c @@ -6,11 +6,11 @@ /**/ #include "global.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" #include "pike_macros.h" #include "gc.h" -RCSID("$Id: pike_memory.c,v 1.92 2000/10/19 14:05:48 grubba Exp $"); +RCSID("$Id: pike_memory.c,v 1.93 2000/12/01 08:09:52 hubbe Exp $"); /* strdup() is used by several modules, so let's provide it */ #ifndef HAVE_STRDUP @@ -627,7 +627,7 @@ PMOD_EXPORT char *debug_xalloc(size_t size) { char *ret; if(!size) - error("Allocating zero bytes.\n"); + Pike_error("Allocating zero bytes.\n"); #ifdef SOFTLIM if(softlim_should_be) @@ -640,7 +640,7 @@ PMOD_EXPORT char *debug_xalloc(size_t size) ret=(char *)malloc(size); if(ret) return ret; - error("Out of memory.\n"); + Pike_error("Out of memory.\n"); return 0; } diff --git a/src/pike_search.c b/src/pike_search.c index 9fa21c1261189f8b94d363f65981bfc00cff9a50..ca8b03bf1c347cc60ddef5e0506eb1f689310813 100644 --- a/src/pike_search.c +++ b/src/pike_search.c @@ -7,7 +7,7 @@ #include "block_alloc.h" #include "pike_memory.h" #include "stralloc.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "interpret.h" #include "pike_macros.h" diff --git a/src/pike_types.c b/src/pike_types.c index 388389d049afe9fadb5ff36f6f71cc6f750dcb67..bda31782b66a228ff470df46af971ab73bbe0753 100644 --- a/src/pike_types.c +++ b/src/pike_types.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: pike_types.c,v 1.142 2000/11/25 16:55:27 grubba Exp $"); +RCSID("$Id: pike_types.c,v 1.143 2000/12/01 08:09:52 hubbe Exp $"); #include <ctype.h> #include "svalue.h" #include "pike_types.h" @@ -18,7 +18,7 @@ RCSID("$Id: pike_types.c,v 1.142 2000/11/25 16:55:27 grubba Exp $"); #include "multiset.h" #include "mapping.h" #include "pike_macros.h" -#include "error.h" +#include "pike_error.h" #include "las.h" #include "language.h" #include "lex.h" @@ -148,7 +148,7 @@ one_more_type: switch(EXTRACT_UCHAR(t++)) { default: - fatal("error in type string %d.\n",EXTRACT_UCHAR(t-1)); + fatal("Pike_error in type string %d.\n",EXTRACT_UCHAR(t-1)); /*NOTREACHED*/ break; @@ -389,7 +389,7 @@ static void internal_parse_typeA(char **_s) len=0; for(len=0;isidchar(EXTRACT_UCHAR(s[0]+len));len++) { - if(len>=sizeof(buf)) error("Buffer overflow in parse_type\n"); + if(len>=sizeof(buf)) Pike_error("Buffer overflow in parse_type\n"); buf[len] = s[0][len]; } buf[len]=0; @@ -415,13 +415,13 @@ static void internal_parse_typeA(char **_s) if(s[0][0]=='.' && s[0][1]=='.') s[0]+=2; else - error("Missing .. in integer type.\n"); + Pike_error("Missing .. in integer type.\n"); while(ISSPACE(**s)) ++*s; max=STRTOL((char *)*s,(char **)s,0); while(ISSPACE(**s)) ++*s; - if(**s != ')') error("Missing ')' in integer range.\n"); + if(**s != ')') Pike_error("Missing ')' in integer range.\n"); ++*s; push_type_int(max); push_type_int(min); @@ -469,7 +469,7 @@ static void internal_parse_typeA(char **_s) type_stack_reverse(); *s+=3; while(ISSPACE(**s)) ++*s; - if(**s != ':') error("Missing ':' after ... in function type.\n"); + if(**s != ':') Pike_error("Missing ':' after ... in function type.\n"); break; } pop_stack_mark(); @@ -479,7 +479,7 @@ static void internal_parse_typeA(char **_s) type_stack_mark(); internal_parse_type(_s); /* return type */ type_stack_reverse(); - if(**s != ')') error("Missing ')' in function type.\n"); + if(**s != ')') Pike_error("Missing ')' in function type.\n"); ++*s; type_stack_reverse(); }else{ @@ -532,12 +532,12 @@ static void internal_parse_typeA(char **_s) type_stack_mark(); internal_parse_type(_s); type_stack_reverse(); - if(**s != ',') error("Expecting ','.\n"); + if(**s != ',') Pike_error("Expecting ','.\n"); ++*s; type_stack_mark(); internal_parse_type(_s); type_stack_reverse(); - if(**s != ')') error("Expecting ')'.\n"); + if(**s != ')') Pike_error("Expecting ')'.\n"); ++*s; type_stack_reverse(); }else{ @@ -562,12 +562,12 @@ static void internal_parse_typeA(char **_s) type_stack_mark(); internal_parse_type(_s); type_stack_reverse(); - if(**s != ':') error("Expecting ':'.\n"); + if(**s != ':') Pike_error("Expecting ':'.\n"); ++*s; type_stack_mark(); internal_parse_type(_s); type_stack_reverse(); - if(**s != ')') error("Expecting ')'.\n"); + if(**s != ')') Pike_error("Expecting ')'.\n"); ++*s; type_stack_reverse(); }else{ @@ -584,7 +584,7 @@ static void internal_parse_typeA(char **_s) { ++*s; internal_parse_type(_s); - if(**s != ')') error("Expecting ')'.\n"); + if(**s != ')') Pike_error("Expecting ')'.\n"); ++*s; }else{ push_type(T_MIXED); @@ -606,7 +606,7 @@ static void internal_parse_typeA(char **_s) { ++*s; internal_parse_type(_s); - if(**s != ')') error("Expecting ')'.\n"); + if(**s != ')') Pike_error("Expecting ')'.\n"); ++*s; }else{ push_type(T_MIXED); @@ -643,7 +643,7 @@ static void internal_parse_typeA(char **_s) default: bad_type: - error("Couldn't parse type. (%s)\n",buf); + Pike_error("Couldn't parse type. (%s)\n",buf); } while(ISSPACE(**s)) ++*s; @@ -665,7 +665,7 @@ static void internal_parse_typeB(char **s) ++*s; internal_parse_type(s); while(ISSPACE(**((unsigned char **)s))) ++*s; - if(**s != ')') error("Expecting ')'.\n"); + if(**s != ')') Pike_error("Expecting ')'.\n"); ++*s; break; @@ -1950,7 +1950,7 @@ static char *low_match_types2(char *a,char *b, int flags) break; default: - fatal("error in type string.\n"); + fatal("Pike_error in type string.\n"); } return ret; } @@ -2467,7 +2467,7 @@ static int low_pike_types_le2(char *a, char *b, break; default: - fatal("error in type string.\n"); + fatal("Pike_error in type string.\n"); } return 1; } @@ -3173,7 +3173,7 @@ struct pike_string *zzap_function_return(char *a, INT32 id) /* I wonder when this occurrs, but apparently it does... */ return zzap_function_return(tFuncV(tVoid,tOr(tMix,tVoid),tObj), id); } -/* This error is bogus /Hubbe +/* This Pike_error is bogus /Hubbe fatal("zzap_function_return() called with unexpected value: %d\n", EXTRACT_UCHAR(a)); */ diff --git a/src/port.c b/src/port.c index d1f91cf87363a3f2442e0d8314322164e515e3a6..bb7289b552975c735855dd41fdaa6c4c26f10a96 100644 --- a/src/port.c +++ b/src/port.c @@ -7,7 +7,7 @@ #include "global.h" #include "pike_macros.h" #include "time_stuff.h" -#include "error.h" +#include "pike_error.h" #include <ctype.h> #include <math.h> @@ -18,7 +18,7 @@ #include <float.h> #include <string.h> -RCSID("$Id: port.c,v 1.33 2000/08/29 18:24:53 hubbe Exp $"); +RCSID("$Id: port.c,v 1.34 2000/12/01 08:09:53 hubbe Exp $"); #ifdef sun time_t time PROT((time_t *)); @@ -133,7 +133,7 @@ long STRTOL(char *str,char **ptr,int base) if (ptr != (char **)0) *ptr = str; /* in case no number is formed */ if (base < 0 || base > MBASE) - return (0); /* base is invalid -- should be a fatal error */ + return (0); /* base is invalid -- should be a fatal Pike_error */ if (!isalnum(c = *str)) { while (ISSPACE(c)) c = *++str; @@ -509,12 +509,12 @@ PMOD_EXPORT double STRTOD(char * nptr, char **endptr) return num * sign; overflow: - /* Return an overflow error. */ + /* Return an overflow Pike_error. */ errno = ERANGE; return HUGE * sign; underflow: - /* Return an underflow error. */ + /* Return an underflow Pike_error. */ if (endptr != NULL) *endptr = (char *) nptr; errno = ERANGE; diff --git a/src/post_modules/GL/auto.c.in b/src/post_modules/GL/auto.c.in index 6d4a09505fd1fdb9b5062b260690e4a17aaf9213..e041d6668efb237369f01e35bb35702d5e27ca14 100644 --- a/src/post_modules/GL/auto.c.in +++ b/src/post_modules/GL/auto.c.in @@ -1,6 +1,6 @@ /* -*- C -*- * - * $Id: auto.c.in,v 1.15 2000/08/11 11:05:41 grubba Exp $ + * $Id: auto.c.in,v 1.16 2000/12/01 08:10:40 hubbe Exp $ * */ @@ -8,14 +8,14 @@ #include "config.h" -RCSID("$Id: auto.c.in,v 1.15 2000/08/11 11:05:41 grubba Exp $"); +RCSID("$Id: auto.c.in,v 1.16 2000/12/01 08:10:40 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "interpret.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "operators.h" #include "mapping.h" @@ -69,11 +69,11 @@ static int check_234_args(char *func, INT32 args, int mn, int mx, int ty, struct array *a = sp[-1].u.array; args = a->size; if(args<mn || args>mx) - error("%s: expected array of size %d-%d.\n", func, mn, mx); + Pike_error("%s: expected array of size %d-%d.\n", func, mn, mx); s = ITEM(a); } else { if(args<mn || args>mx) - error("%s: too %s arguments.\n", func, (args<mn? "few":"many")); + Pike_error("%s: too %s arguments.\n", func, (args<mn? "few":"many")); s = sp-args; } for(i=0; i<args; i++) @@ -88,7 +88,7 @@ static int check_234_args(char *func, INT32 args, int mn, int mx, int ty, strcat(buf, " or "); strcat(buf, get_name_of_type(tt)); } - error("%s: got %s, expected %s.\n", func, + Pike_error("%s: got %s, expected %s.\n", func, get_name_of_type(s[i].type), buf); } else tr|=tt; @@ -97,7 +97,7 @@ static int check_234_args(char *func, INT32 args, int mn, int mx, int ty, else if(tr==BIT_FLOAT) tt=((rty&ZT_FLOAT)? ZT_FLOAT:ZT_DOUBLE); else if(tr!=BIT_INT) - error("Internal error in check_234_args for %s!\n", func); + Pike_error("Internal Pike_error in check_234_args for %s!\n", func); else if(rty&ZT_INT) tt=ZT_INT; else @@ -163,7 +163,7 @@ static void check_img_arg(struct svalue *a, struct zimage *img, pop_stack(); } if(image_program == NULL) - error("%s: Can't resolve Image.image!\n", func); + Pike_error("%s: Can't resolve Image.image!\n", func); } img->alloc = 0; @@ -175,7 +175,7 @@ static void check_img_arg(struct svalue *a, struct zimage *img, rgbstor->img != NULL) ; else - error("Bad argument %d to %s.\n", arg, func); + Pike_error("Bad argument %d to %s.\n", arg, func); } if((v=simple_mapping_string_lookup(a->u.mapping, "luminance"))) { if(v->type == T_OBJECT && @@ -183,7 +183,7 @@ static void check_img_arg(struct svalue *a, struct zimage *img, lumstor->img != NULL) ; else - error("Bad argument %d to %s.\n", arg, func); + Pike_error("Bad argument %d to %s.\n", arg, func); } if((v=simple_mapping_string_lookup(a->u.mapping, "alpha"))) { if(v->type == T_OBJECT && @@ -191,26 +191,26 @@ static void check_img_arg(struct svalue *a, struct zimage *img, astor->img != NULL) ; else - error("Bad argument %d to %s.\n", arg, func); + Pike_error("Bad argument %d to %s.\n", arg, func); } } else if(a->type == T_OBJECT && (rgbstor = (void *)get_storage(a->u.object, image_program)) != NULL && rgbstor->img != NULL) ; else - error("Bad argument %d to %s.\n", arg, func); + Pike_error("Bad argument %d to %s.\n", arg, func); if(rgbstor==NULL && lumstor==NULL && astor==NULL) - error("Too few images specified.\n"); + Pike_error("Too few images specified.\n"); if(rgbstor!=NULL && lumstor!=NULL) - error("Can't have both rgb and luminance data.\n"); + Pike_error("Can't have both rgb and luminance data.\n"); if((rgbstor != NULL && astor != NULL && (rgbstor->w != astor->w || rgbstor->h != astor->h)) || (lumstor != NULL && astor != NULL && (lumstor->w != astor->w || lumstor->h != astor->h))) - error("Alpha channel must have same size as image!\n"); + Pike_error("Alpha channel must have same size as image!\n"); if(lumstor==NULL && astor==NULL) { /* RGB */ @@ -289,13 +289,13 @@ static int check_1n_args(char *func, INT32 args, int ty, int rty, struct svalue *s; if(args!=1) - error("%s: too %s arguments.\n", func, (args<1? "few":"many")); + Pike_error("%s: too %s arguments.\n", func, (args<1? "few":"many")); if(sp[-1].type==T_ARRAY) { struct array *a = sp[-1].u.array; args = a->size; if(args>16) - error("%s: array too large.\n", func); + Pike_error("%s: array too large.\n", func); arr++; s = ITEM(a); } else @@ -313,7 +313,7 @@ static int check_1n_args(char *func, INT32 args, int ty, int rty, strcat(buf, " or "); strcat(buf, get_name_of_type(tt)); } - error("%s: got %s, expected %s.\n", func, + Pike_error("%s: got %s, expected %s.\n", func, get_name_of_type(s[i].type), buf); } else tr|=tt; @@ -322,7 +322,7 @@ static int check_1n_args(char *func, INT32 args, int ty, int rty, else if(tr==BIT_FLOAT) tt=((rty&ZT_FLOAT)? ZT_FLOAT:ZT_DOUBLE); else if(tr!=BIT_INT) - error("Internal error in check_1n_args for %s!\n", func); + Pike_error("Internal Pike_error in check_1n_args for %s!\n", func); else if(rty&ZT_INT) tt=ZT_INT; else diff --git a/src/post_modules/GL/top.c b/src/post_modules/GL/top.c index 5062f746a29f464994fbd016f3c0c4fef1904f20..a47e9c0e06816581449d4a4b8f9cd3794aeb4847 100644 --- a/src/post_modules/GL/top.c +++ b/src/post_modules/GL/top.c @@ -1,5 +1,5 @@ /* - * $Id: top.c,v 1.12 2000/07/28 07:16:09 hubbe Exp $ + * $Id: top.c,v 1.13 2000/12/01 08:10:40 hubbe Exp $ * */ @@ -26,7 +26,7 @@ #include "global.h" -RCSID("$Id: top.c,v 1.12 2000/07/28 07:16:09 hubbe Exp $"); +RCSID("$Id: top.c,v 1.13 2000/12/01 08:10:40 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" @@ -34,7 +34,7 @@ RCSID("$Id: top.c,v 1.12 2000/07/28 07:16:09 hubbe Exp $"); #include "interpret.h" #include "builtin_functions.h" #include "module_support.h" -#include "error.h" +#include "pike_error.h" #ifdef HAVE_GL @@ -363,7 +363,7 @@ static void f_glGet(INT32 args) break; default: - error("glGet: Unsupported parameter name\n"); + Pike_error("glGet: Unsupported parameter name\n"); } } diff --git a/src/post_modules/GLUT/auto.c.in b/src/post_modules/GLUT/auto.c.in index af1dd1055a113ba1c138826ac1588ca09b24dd8c..c91f295b69d2d41808967b884f0db121afe81daa 100644 --- a/src/post_modules/GLUT/auto.c.in +++ b/src/post_modules/GLUT/auto.c.in @@ -1,5 +1,5 @@ /* - * $Id: auto.c.in,v 1.2 2000/07/28 07:16:16 hubbe Exp $ + * $Id: auto.c.in,v 1.3 2000/12/01 08:10:40 hubbe Exp $ * */ @@ -7,14 +7,14 @@ #include "config.h" -RCSID("$Id: auto.c.in,v 1.2 2000/07/28 07:16:16 hubbe Exp $"); +RCSID("$Id: auto.c.in,v 1.3 2000/12/01 08:10:40 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "interpret.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" #include "module_support.h" #include "operators.h" diff --git a/src/post_modules/GLUT/top.c b/src/post_modules/GLUT/top.c index a72892e50038903038e6e5a325c4be71df5184b5..81cec1d0864cf36bc624c05d80439585612b1ffd 100644 --- a/src/post_modules/GLUT/top.c +++ b/src/post_modules/GLUT/top.c @@ -1,5 +1,5 @@ /* - * $Id: top.c,v 1.3 2000/07/28 07:16:16 hubbe Exp $ + * $Id: top.c,v 1.4 2000/12/01 08:10:40 hubbe Exp $ * */ @@ -7,14 +7,14 @@ #include "config.h" -RCSID("$Id: top.c,v 1.3 2000/07/28 07:16:16 hubbe Exp $"); +RCSID("$Id: top.c,v 1.4 2000/12/01 08:10:40 hubbe Exp $"); #include "stralloc.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "interpret.h" #include "builtin_functions.h" -#include "error.h" +#include "pike_error.h" #include "module_magic.h" diff --git a/src/post_modules/GTK/source/encode_truecolor.c b/src/post_modules/GTK/source/encode_truecolor.c index 517b74f55475e7ac34216ce83c8c872f12674eaa..6c520c052f450b0e6e6a6b993af98133e4a46ac8 100644 --- a/src/post_modules/GTK/source/encode_truecolor.c +++ b/src/post_modules/GTK/source/encode_truecolor.c @@ -388,7 +388,7 @@ void pgtk_encode_grey(struct image *i, unsigned char *dest, int bpp, int bpl ) } return; default: - error("This greyscale is to wide for me!\n"); + Pike_error("This greyscale is to wide for me!\n"); } } diff --git a/src/post_modules/GTK/source/support.c b/src/post_modules/GTK/source/support.c index 16b17abacf57e3a8ab7767da1b30bd0a6f8d9272..44bf4e5b4165e1e7463df6251045ecab33391ee9 100644 --- a/src/post_modules/GTK/source/support.c +++ b/src/post_modules/GTK/source/support.c @@ -6,26 +6,26 @@ void pgtk_encode_grey(struct image *i, unsigned char *dest, int bpp, int bpl ); void pgtk_verify_setup() { if( !pigtk_is_setup ) - error("You must call GTK.setup_gtk( argv ) first\n"); + Pike_error("You must call GTK.setup_gtk( argv ) first\n"); } void pgtk_verify_gnome_setup() { extern int gnome_is_setup; if( !gnome_is_setup ) - error("You must call Gnome.init( app,version,argv[,do_corba] ) first\n"); + Pike_error("You must call Gnome.init( app,version,argv[,do_corba] ) first\n"); } void pgtk_verify_inited( ) { if(! THIS->obj ) - error( "Calling function in unitialized object\n" ); + Pike_error( "Calling function in unitialized object\n" ); } void pgtk_verify_not_inited( ) { if( THIS->obj ) - error( "Tried to initialize object twice\n" ); + Pike_error( "Tried to initialize object twice\n" ); } void my_pop_n_elems( int n ) /* anti-inline */ @@ -50,7 +50,7 @@ void pgtk_get_image_module() push_int(0); SAFE_APPLY_MASTER("resolv", 2); if (Pike_sp[-1].type!=PIKE_T_OBJECT) - error("No Image module.\n"); + Pike_error("No Image module.\n"); } void pgtk_index_stack( char *what ) @@ -59,7 +59,7 @@ void pgtk_index_stack( char *what ) f_index(2); #ifdef DEBUG if (Pike_sp[-1].type==PIKE_T_INT) - error("Internal indexing error.\n"); + Pike_error("Internal indexing Pike_error.\n"); #endif } @@ -148,7 +148,7 @@ GdkImage *gdkimage_from_pikeimage( struct object *img, int fast, GdkImage *i ) if( x==0 || y==0 ) - error("Size of image must be > 0x0\n"); + Pike_error("Size of image must be > 0x0\n"); if(i) { if((i->width != x) || (i->height != y)) @@ -165,7 +165,7 @@ GdkImage *gdkimage_from_pikeimage( struct object *img, int fast, GdkImage *i ) } if(!i) - error("Failed to create gdkimage\n"); + Pike_error("Failed to create gdkimage\n"); /* 1b: do the work.. */ @@ -297,7 +297,7 @@ GdkImage *gdkimage_from_pikeimage( struct object *img, int fast, GdkImage *i ) if(Pike_sp[-1].type != PIKE_T_STRING) { gdk_image_destroy((void *)i); - error("Failed to convert image\n"); + Pike_error("Failed to convert image\n"); } PFTIME("Converting image"); MEMCPY(i->mem, Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); @@ -464,7 +464,7 @@ GdkAtom get_gdkatom( struct object *o ) pop_stack(); return r; } - error("Got non GDK.Atom object to get_gdkatom()\n"); + Pike_error("Got non GDK.Atom object to get_gdkatom()\n"); } diff --git a/src/preprocessor.h b/src/preprocessor.h index 5b566e1bc1fa1f0baaf2eff083feefc75d8e2a71..801539f6fd95e095a9a1c3b8aad14889fc603464 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -1,5 +1,5 @@ /* - * $Id: preprocessor.h,v 1.34 2000/09/26 00:17:46 hubbe Exp $ + * $Id: preprocessor.h,v 1.35 2000/12/01 08:09:53 hubbe Exp $ * * Preprocessor template. * Based on cpp.c 1.45 @@ -8,7 +8,7 @@ */ #ifndef SHIFT -#error Internal error: SHIFT not defined +#Pike_error Internal Pike_error: SHIFT not defined #endif /* @@ -120,7 +120,7 @@ static struct pike_string *WC_BINARY_FINDSTRING(WCHAR *str, ptrdiff_t len) #if (SHIFT == 2) s = make_shared_binary_string2(str, len); #else /* SHIFT != 2 */ -#error Bad SHIFT +#Pike_error Bad SHIFT #endif /* SHIFT == 2 */ #endif /* SHIFT == 1 */ @@ -380,10 +380,10 @@ static ptrdiff_t calcC(struct cpp *this, WCHAR *data, ptrdiff_t len, fprintf(stderr, "Bad char %c (%d)\n", data[pos], data[pos]); #ifdef PIKE_DEBUG if(WC_ISIDCHAR(data[pos])) - cpp_error(this, "Syntax error in #if (should not happen)."); + cpp_error(this, "Syntax Pike_error in #if (should not happen)."); #endif - cpp_error(this, "Syntax error in #if."); + cpp_error(this, "Syntax Pike_error in #if."); } @@ -755,10 +755,10 @@ static ptrdiff_t calc(struct cpp *this, WCHAR *data, ptrdiff_t len, { cpp_error(this, a->string->str); }else{ - cpp_error(this, "Nonstandard error format."); + cpp_error(this, "Nonstandard Pike_error format."); } }else{ - cpp_error(this, "Nonstandard error format."); + cpp_error(this, "Nonstandard Pike_error format."); } FIND_EOL(); push_int(0); @@ -1523,7 +1523,7 @@ static ptrdiff_t lower_cpp(struct cpp *this, goto unknown_preprocessor_directive; } - case 'e': /* endif, else, elif, error */ + case 'e': /* endif, else, elif, Pike_error */ { static WCHAR endif_[] = { 'e', 'n', 'd', 'i', 'f' }; static WCHAR else_[] = { 'e', 'l', 's', 'e' }; @@ -1763,7 +1763,7 @@ static ptrdiff_t lower_cpp(struct cpp *this, { #ifdef PIKE_DEBUG if(Pike_sp[-1].type != PIKE_T_INT) - fatal("Internal error in CPP\n"); + fatal("Internal Pike_error in CPP\n"); #endif Pike_sp[-1].u.integer|=DEF_ARG_NOPOSTSPACE; } @@ -1866,10 +1866,10 @@ static ptrdiff_t lower_cpp(struct cpp *this, { #if 1 if(partbase[e*2+1].type != PIKE_T_INT) - fatal("Cpp internal error, expected integer!\n"); + fatal("Cpp internal Pike_error, expected integer!\n"); if(partbase[e*2+2].type != PIKE_T_STRING) - fatal("Cpp internal error, expected string!\n"); + fatal("Cpp internal Pike_error, expected string!\n"); #endif def->parts[e].argument=partbase[e*2+1].u.integer; copy_shared_string(def->parts[e].postfix, @@ -1879,7 +1879,7 @@ static ptrdiff_t lower_cpp(struct cpp *this, #ifdef PIKE_DEBUG if(def->num_parts==1 && (def->parts[0].argument & DEF_ARG_MASK) > MAX_ARGS) - fatal("Internal error in define\n"); + fatal("Internal Pike_error in define\n"); #endif this->defines=hash_insert(this->defines, & def->link); diff --git a/src/program.c b/src/program.c index b1d4f72e6d84a4d6f9ebe25922d4b11461f12218..b466a08e405065fb099a6608dc44f900e8d9225d 100644 --- a/src/program.c +++ b/src/program.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: program.c,v 1.282 2000/11/20 01:20:25 mast Exp $"); +RCSID("$Id: program.c,v 1.283 2000/12/01 08:09:53 hubbe Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -16,7 +16,7 @@ RCSID("$Id: program.c,v 1.282 2000/11/20 01:20:25 mast Exp $"); #include "lex.h" #include "pike_macros.h" #include "fsort.h" -#include "error.h" +#include "pike_error.h" #include "docode.h" #include "interpret.h" #include "hashtable.h" @@ -2110,7 +2110,7 @@ int low_define_variable(struct pike_string *name, fatal("Attempting to add variable to fixed program\n"); if(Pike_compiler->compiler_pass==2) - fatal("Internal error: Not allowed to add more identifiers during second compiler pass.\n" + fatal("Internal Pike_error: Not allowed to add more identifiers during second compiler pass.\n" "Added identifier: \"%s\"\n", name->str); #endif @@ -2399,7 +2399,7 @@ PMOD_EXPORT int add_constant(struct pike_string *name, fatal("Attempting to add constant to fixed program\n"); if(Pike_compiler->compiler_pass==2) - fatal("Internal error: Not allowed to add more identifiers during second compiler pass.\n"); + fatal("Internal Pike_error: Not allowed to add more identifiers during second compiler pass.\n"); #endif copy_shared_string(dummy.name, name); @@ -2763,7 +2763,7 @@ make_a_new_def: #ifdef PIKE_DEBUG if(Pike_compiler->compiler_pass==2) - fatal("Internal error: Not allowed to add more identifiers during second compiler pass.\n"); + fatal("Internal Pike_error: Not allowed to add more identifiers during second compiler pass.\n"); #endif /* define a new function */ @@ -2957,9 +2957,9 @@ PMOD_EXPORT int find_identifier(char *name,struct program *prog) struct pike_string *n; if(!prog) { if (strlen(name) < 1024) { - error("Lookup of identifier %s in destructed object.\n", name); + Pike_error("Lookup of identifier %s in destructed object.\n", name); } else { - error("Lookup of long identifier in destructed object.\n"); + Pike_error("Lookup of long identifier in destructed object.\n"); } } n=findstring(name); @@ -3081,7 +3081,7 @@ void program_index_no_free(struct svalue *to, struct program *p, struct pike_string *s; if (ind->type != T_STRING) { - error("Can't index a program with a %s (expected string)\n", + Pike_error("Can't index a program with a %s (expected string)\n", get_name_of_type(ind->type)); } s = ind->u.string; @@ -3096,9 +3096,9 @@ void program_index_no_free(struct svalue *to, struct program *p, return; } else { if (s->len < 1024) { - error("Index \"%s\" is not constant.\n", s->str); + Pike_error("Index \"%s\" is not constant.\n", s->str); } else { - error("Index is not constant.\n"); + Pike_error("Index is not constant.\n"); } } } @@ -3109,9 +3109,9 @@ void program_index_no_free(struct svalue *to, struct program *p, to->u.integer=0; #else if (s->len < 1024) { - error("No such index \"%s\".\n", s->str); + Pike_error("No such index \"%s\".\n", s->str); } else { - error("No such index.\n"); + Pike_error("No such index.\n"); } #endif } @@ -3298,7 +3298,7 @@ void my_yyerror(char *fmt,...) ATTRIBUTE((format(printf,1,2))) } struct program *compile(struct pike_string *prog, - struct object *handler,/* error handler */ + struct object *handler,/* Pike_error handler */ int major, int minor) { #ifdef PIKE_DEBUG @@ -3477,7 +3477,7 @@ struct program *compile(struct pike_string *prog, #endif pop_stack(); /* pop the 'default' module */ - if(!p) error("Compilation failed.\n"); + if(!p) Pike_error("Compilation failed.\n"); return p; } @@ -3585,7 +3585,7 @@ struct program *pike_trampoline_program=0; static void apply_trampoline(INT32 args) { - error("Internal error: Trampoline magic failed!\n"); + Pike_error("Internal Pike_error: Trampoline magic failed!\n"); } static void init_trampoline(struct object *o) @@ -4182,7 +4182,7 @@ void yywarning(char *fmt, ...) ATTRIBUTE((format(printf,1,2))) /* If we have parse errors we might get erroneous warnings, * so don't print them. * This has the additional benefit of making it easier to - * visually locate the actual error message. + * visually locate the actual Pike_error message. */ if (Pike_compiler->num_parse_error) return; @@ -4430,12 +4430,12 @@ PMOD_EXPORT void *parent_storage(int depth) p=get_program_for_object_being_destructed(loc.o); if(!p) { - error("Cannot access parent of destructed object.\n"); + Pike_error("Cannot access parent of destructed object.\n"); } } if((Pike_fp->fun & 0xffff) == 0xffff) - error("Cannot access parent storage!\n"); + Pike_error("Cannot access parent storage!\n"); loc.parent_identifier=Pike_fp->fun; loc.inherit=INHERIT_FROM_INT(p, Pike_fp->fun); diff --git a/src/queue.c b/src/queue.c index dc4d4c03c045c0c57d002953ae018cf04eed19e3..6be42e5f4a9c25b43c49cb77cecdac67eeba4d2d 100644 --- a/src/queue.c +++ b/src/queue.c @@ -1,7 +1,7 @@ #include "global.h" #include "pike_macros.h" #include "queue.h" -#include "error.h" +#include "pike_error.h" struct queue_entry { diff --git a/src/security.c b/src/security.c index 02b394d78305a140d97852d457caf5db5573f774..891a6c11ea90617cd07376be05dafd34d5b40cb9 100644 --- a/src/security.c +++ b/src/security.c @@ -101,16 +101,16 @@ static void f_call_with_creds(INT32 args) if(!CHECK_SECURITY(SECURITY_BIT_SECURITY) && !(Pike_fp->current_object->prot && (OBJ2CREDS(Pike_fp->current_object->prot)->may_always & SECURITY_BIT_SECURITY))) - error("call_with_creds: permission denied.\n"); + Pike_error("call_with_creds: permission denied.\n"); break; default: - error("Bad argument 1 to call_with_creds.\n"); + Pike_error("Bad argument 1 to call_with_creds.\n"); } if(!valid_creds_object(o)) - error("call_with_creds: Not a valid creds object.\n"); + Pike_error("call_with_creds: Not a valid creds object.\n"); SET_CURRENT_CREDS(o); /* NOTE: This only works on objects that have no credentials, or have @@ -218,7 +218,7 @@ static void creds_create(INT32 args) get_all_args("init_creds",args,"%o%i%i",&o,&may,&data); if(THIS->user) - error("You may only call creds_create once.\n"); + Pike_error("You may only call creds_create once.\n"); add_ref(THIS->user=o); THIS->may_always=may; @@ -287,7 +287,7 @@ static void creds_get_data_bits(INT32 args) static void creds_apply(INT32 args) { if(args < 0 || sp[-args].type > MAX_COMPLEX) - error("Bad argument 1 to creds->apply()\n"); + Pike_error("Bad argument 1 to creds->apply()\n"); if( CHECK_SECURITY(SECURITY_BIT_SECURITY) || (sp[-args].u.array->prot && @@ -298,7 +298,7 @@ static void creds_apply(INT32 args) free_object(sp[-args].u.array->prot); add_ref( sp[-args].u.array->prot=Pike_fp->current_object ); }else{ - error("creds->apply(): permission denied.\n"); + Pike_error("creds->apply(): permission denied.\n"); } pop_n_elems(args); } @@ -321,7 +321,7 @@ static void f_get_object_creds(INT32 args) { struct object *o; if(args < 0 || sp[-args].type > MAX_COMPLEX) - error("Bad argument 1 to get_object_creds\n"); + Pike_error("Bad argument 1 to get_object_creds\n"); if((o=sp[-args].u.array->prot)) { add_ref(o); diff --git a/src/security.h b/src/security.h index f957696ccc62f03f0e7890342a902f006d6ec47f..0e5928c6b66e16ef92e5640829fed618071f9e4e 100644 --- a/src/security.h +++ b/src/security.h @@ -41,12 +41,12 @@ struct pike_creds #define CHECK_DATA_SECURITY_OR_ERROR(DATA,BIT,ERR) do { \ if(!CHECK_DATA_SECURITY(DATA,BIT)) \ - error ERR; \ + Pike_error ERR; \ }while(0) #define CHECK_SECURITY_OR_ERROR(BIT,ERR) do { \ if(!CHECK_SECURITY(BIT)) \ - error ERR; \ + Pike_error ERR; \ }while(0) #define SET_CURRENT_CREDS(O) do { \ @@ -66,7 +66,7 @@ struct pike_creds struct svalue *base_sp=Pike_sp-args; \ \ if(!CHECK_SECURITY(SECURITY_BIT_CONDITIONAL_IO)) \ - error(name ": Permission denied.\n"); \ + Pike_error(name ": Permission denied.\n"); \ \ push_constant_text(name); \ push_constant_text(access_type); \ @@ -103,15 +103,15 @@ struct pike_creds break; \ \ case 3: /* permission denied */ \ - error(name ": permission denied.\n"); \ + Pike_error(name ": permission denied.\n"); \ \ default: \ - error("Error in user->valid_io, wrong return value.\n"); \ + Pike_error("Error in user->valid_io, wrong return value.\n"); \ } \ break; \ \ default: \ - error("Error in user->valid_io, wrong return type.\n"); \ + Pike_error("Error in user->valid_io, wrong return type.\n"); \ \ case PIKE_T_STRING: \ assign_svalue(Pike_sp-args-1,Pike_sp-1); \ diff --git a/src/signal_handler.c b/src/signal_handler.c index 7ef4eda77a124c630865d4ac87350209bdeec15b..ac137d627c327b369e82347d1546c525390f7c00 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -13,7 +13,7 @@ #include "constants.h" #include "pike_macros.h" #include "backend.h" -#include "error.h" +#include "pike_error.h" #include "callback.h" #include "mapping.h" #include "threads.h" @@ -25,7 +25,7 @@ #include "main.h" #include <signal.h> -RCSID("$Id: signal_handler.c,v 1.184 2000/10/18 15:43:55 grubba Exp $"); +RCSID("$Id: signal_handler.c,v 1.185 2000/12/01 08:09:54 hubbe Exp $"); #ifdef HAVE_PASSWD_H # include <passwd.h> @@ -729,17 +729,17 @@ static void f_signal(int args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("signal: permission denied.\n"); + Pike_error("signal: permission denied.\n"); #endif check_signals(0,0,0); if(args < 1) - error("Too few arguments to signal()\n"); + Pike_error("Too few arguments to signal()\n"); if(sp[-args].type != T_INT) { - error("Bad argument 1 to signal()\n"); + Pike_error("Bad argument 1 to signal()\n"); } signum=sp[-args].u.integer; @@ -751,7 +751,7 @@ static void f_signal(int args) #endif ) { - error("Signal out of range.\n"); + Pike_error("Signal out of range.\n"); } if(!signal_evaluator_callback) @@ -821,10 +821,10 @@ static void f_signum(int args) { int i; if(args < 1) - error("Too few arguments to signum()\n"); + Pike_error("Too few arguments to signum()\n"); if(sp[-args].type != T_STRING) - error("Bad argument 1 to signum()\n"); + Pike_error("Bad argument 1 to signum()\n"); i=signum(sp[-args].u.string->str); pop_n_elems(args); @@ -835,10 +835,10 @@ static void f_signame(int args) { char *n; if(args < 1) - error("Too few arguments to signame()\n"); + Pike_error("Too few arguments to signame()\n"); if(sp[-args].type != T_INT) - error("Bad argument 1 to signame()\n"); + Pike_error("Bad argument 1 to signame()\n"); n=signame(sp[-args].u.integer); pop_n_elems(args); @@ -1102,7 +1102,7 @@ static TH_RETURN_TYPE wait_thread(void *data) break; default: - fprintf(stderr,"Wait thread: waitpid returned error: %d\n",errno); + fprintf(stderr,"Wait thread: waitpid returned Pike_error: %d\n",errno); } } } @@ -1114,7 +1114,7 @@ static void f_pid_status_wait(INT32 args) { pop_n_elems(args); if(THIS->pid == -1) - error("This process object has no process associated with it.\n"); + Pike_error("This process object has no process associated with it.\n"); #ifdef __NT__ { int err=0; @@ -1138,7 +1138,7 @@ static void f_pid_status_wait(INT32 args) } THREADS_DISALLOW(); if(err) - error("Failed to get status of process.\n"); + Pike_error("Failed to get status of process.\n"); push_int(xcode); } #else @@ -1176,7 +1176,7 @@ static void f_pid_status_wait(INT32 args) } else - error("Pike lost track of a child, pid=%d, errno=%d.\n",pid,err); + Pike_error("Pike lost track of a child, pid=%d, errno=%d.\n",pid,err); } THREADS_ALLOW(); @@ -1244,7 +1244,7 @@ static void f_pid_status_set_priority(INT32 args) int r; #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("pid_status_wait: permission denied.\n"); + Pike_error("pid_status_wait: permission denied.\n"); #endif get_all_args("set_priority", args, "%s", &to); r = set_priority( THIS->pid, to ); @@ -1269,18 +1269,18 @@ static BPTR get_amigados_handle(struct mapping *optional, char *name, int fd) fd = fd_from_object(tmp->u.object); if(fd == -1) - error("File for %s is not open.\n",name); + Pike_error("File for %s is not open.\n",name); } } if((ext = fcntl(fd, F_EXTERNALIZE, 0)) < 0) - error("File for %s can not be externalized.\n", name); + Pike_error("File for %s can not be externalized.\n", name); sprintf(buf, "IXPIPE:%lx", ext); /* It's a kind of magic... */ if((b = Open(buf, 0x4242)) == 0) - error("File for %s can not be internalized.\n", name); + Pike_error("File for %s can not be internalized.\n", name); return b; } @@ -1322,7 +1322,7 @@ static HANDLE get_inheritable_handle(struct mapping *optional, INT32 fd=fd_from_object(tmp->u.object); if(fd == -1) - error("File for %s is not open.\n",name); + Pike_error("File for %s is not open.\n",name); #if 0 { @@ -1353,7 +1353,7 @@ static HANDLE get_inheritable_handle(struct mapping *optional, fd=fd_from_object(sp[-1].u.object); if(fd == -1) - error("Proxy thread creation failed for %s.\n",name); + Pike_error("Proxy thread creation failed for %s.\n",name); } @@ -1365,7 +1365,7 @@ static HANDLE get_inheritable_handle(struct mapping *optional, 1, DUPLICATE_SAME_ACCESS)) /* This could cause handle-leaks */ - error("Failed to duplicate handle %d.\n", GetLastError()); + Pike_error("Failed to duplicate handle %d.\n", GetLastError()); } } pop_n_elems(sp-save_stack); @@ -1622,7 +1622,7 @@ void f_set_priority( INT32 args ) char *plevel; #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("set_priority: permission denied.\n"); + Pike_error("set_priority: permission denied.\n"); #endif if(args == 1) { @@ -1768,7 +1768,7 @@ void f_create_process(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("Process.create_process: permission denied.\n"); + Pike_error("Process.create_process: permission denied.\n"); #endif check_all_args("create_process",args, BIT_ARRAY, BIT_MAPPING | BIT_VOID, 0); @@ -1780,20 +1780,20 @@ void f_create_process(INT32 args) mapping_fix_type_field(optional); if(m_ind_types(optional) & ~BIT_STRING) - error("Bad index type in argument 2 to Process->create()\n"); + Pike_error("Bad index type in argument 2 to Process->create()\n"); case 1: cmd=sp[-args].u.array; if(cmd->size < 1) - error("Too few elements in argument array.\n"); + Pike_error("Too few elements in argument array.\n"); for(e=0;e<cmd->size;e++) if(ITEM(cmd)[e].type!=T_STRING) - error("Argument is not a string.\n"); + Pike_error("Argument is not a string.\n"); array_fix_type_field(cmd); if(cmd->type_field & ~BIT_STRING) - error("Bad argument 1 to Process().\n"); + Pike_error("Bad argument 1 to Process().\n"); } @@ -1958,7 +1958,7 @@ void f_create_process(INT32 args) THIS->pid=proc.dwProcessId; }else{ - error("Failed to start process (%d).\n",err); + Pike_error("Failed to start process (%d).\n",err); } } #else /* !__NT__ */ @@ -2002,7 +2002,7 @@ void f_create_process(INT32 args) if((tmp=simple_mapping_string_lookup(optional, "cwd"))) if(tmp->type == T_STRING) if((storage.cwd_lock=Lock((char *)STR0(tmp->u.string), ACCESS_READ))==0) - error("Failed to lock cwd \"%s\".\n", STR0(tmp->u.string)); + Pike_error("Failed to lock cwd \"%s\".\n", STR0(tmp->u.string)); storage.stdin_b = get_amigados_handle(optional, "stdin", 0); storage.stdout_b = get_amigados_handle(optional, "stdout", 1); @@ -2020,7 +2020,7 @@ void f_create_process(INT32 args) NP_Error, storage.stderr_b, (storage.cwd_lock!=0? NP_CurrentDir:TAG_IGNORE), storage.cwd_lock, TAG_END)) - error("Failed to start process (%ld).\n", IoErr()); + Pike_error("Failed to start process (%ld).\n", IoErr()); UNSET_ONERROR(err); @@ -2115,9 +2115,9 @@ void f_create_process(INT32 args) push_svalue(tmp); f_getgrnam(1); if(!sp[-1].type != T_ARRAY) - error("No such group.\n"); + Pike_error("No such group.\n"); if(sp[-1].u.array->item[2].type != T_INT) - error("Getgrnam failed!\n"); + Pike_error("Getgrnam failed!\n"); wanted_gid = sp[-1].u.array->item[2].u.integer; pop_stack(); gid_request=1; @@ -2126,7 +2126,7 @@ void f_create_process(INT32 args) #endif default: - error("Invalid argument for gid.\n"); + Pike_error("Invalid argument for gid.\n"); } } @@ -2163,7 +2163,7 @@ void f_create_process(INT32 args) { fds[0] = fd_from_object( tmp->u.object ); if(fds[0] == -1) - error("Invalid stdin file\n"); + Pike_error("Invalid stdin file\n"); } if((tmp = simple_mapping_string_lookup( optional, "stdout" )) && @@ -2171,7 +2171,7 @@ void f_create_process(INT32 args) { fds[1] = fd_from_object( tmp->u.object ); if(fds[1] == -1) - error("Invalid stdout file\n"); + Pike_error("Invalid stdout file\n"); } if((tmp = simple_mapping_string_lookup( optional, "stderr" )) && @@ -2179,7 +2179,7 @@ void f_create_process(INT32 args) { fds[2] = fd_from_object( tmp->u.object ); if(fds[2] == -1) - error("Invalid stderr file\n"); + Pike_error("Invalid stderr file\n"); } if((tmp = simple_mapping_string_lookup( optional, "nice")) @@ -2192,7 +2192,7 @@ void f_create_process(INT32 args) { struct svalue *tmp2; if(tmp->type != T_MAPPING) - error("Wrong type of argument for the 'rusage' option. " + Pike_error("Wrong type of argument for the 'rusage' option. " "Should be mapping.\n"); #define ADD_LIMIT(X,Y,Z) internal_add_limit(&storage,X,Y,Z); @@ -2252,7 +2252,7 @@ void f_create_process(INT32 args) if(sp[-1].type==T_ARRAY) { if(sp[-1].u.array->item[3].type!=T_INT) - error("Getpwuid failed!\n"); + Pike_error("Getpwuid failed!\n"); wanted_gid = sp[-1].u.array->item[3].u.integer; } pop_stack(); @@ -2267,10 +2267,10 @@ void f_create_process(INT32 args) push_svalue(tmp); f_getpwnam(1); if(sp[-1].type != T_ARRAY) - error("No such user.\n"); + Pike_error("No such user.\n"); if(sp[-1].u.array->item[2].type!=T_INT || sp[-1].u.array->item[3].type!=T_INT) - error("Getpwnam failed!\n"); + Pike_error("Getpwnam failed!\n"); wanted_uid=sp[-1].u.array->item[2].u.integer; if(!gid_request) wanted_gid=sp[-1].u.array->item[3].u.integer; @@ -2280,7 +2280,7 @@ void f_create_process(INT32 args) #endif default: - error("Invalid argument for uid.\n"); + Pike_error("Invalid argument for uid.\n"); } } @@ -2293,13 +2293,13 @@ void f_create_process(INT32 args) add_ref(storage.wanted_gids_array); for(e=0;e<storage.wanted_gids_array->size;e++) if(storage.wanted_gids_array->item[e].type != T_INT) - error("Invalid type for setgroups.\n"); + Pike_error("Invalid type for setgroups.\n"); do_initgroups=0; }else{ - error("Invalid type for setgroups.\n"); + Pike_error("Invalid type for setgroups.\n"); } #else - error("Setgroups is not available.\n"); + Pike_error("Setgroups is not available.\n"); #endif } @@ -2381,7 +2381,7 @@ void f_create_process(INT32 args) ref_push_string(storage.wanted_gids_array->item[e].u.string); f_getgrnam(2); if(sp[-1].type != T_ARRAY) - error("No such group.\n"); + Pike_error("No such group.\n"); storage.wanted_gids[e]=sp[-1].u.array->item[2].u.integer; pop_stack(); @@ -2390,7 +2390,7 @@ void f_create_process(INT32 args) #endif default: - error("Gids must be integers or strings only.\n"); + Pike_error("Gids must be integers or strings only.\n"); } } storage.num_wanted_gids=storage.wanted_gids_array->size; @@ -2403,7 +2403,7 @@ void f_create_process(INT32 args) storage.argv=(char **)xalloc((1+cmd->size) * sizeof(char *)); if (pike_make_pipe(control_pipe) < 0) { - error("Failed to create child communication pipe.\n"); + Pike_error("Failed to create child communication pipe.\n"); } #if 0 /* Changed to 0 by hubbe 990306 - why do we need it? */ @@ -2479,16 +2479,16 @@ void f_create_process(INT32 args) free_perishables(&storage); if (e == EAGAIN) { - error("Process.create_process(): fork() failed with EAGAIN.\n" + Pike_error("Process.create_process(): fork() failed with EAGAIN.\n" "Process table full?\n"); } #ifdef ENOMEM if (e == ENOMEM) { - error("Process.create_process(): fork() failed with ENOMEM.\n" + Pike_error("Process.create_process(): fork() failed with ENOMEM.\n" "Out of memory?\n"); } #endif /* ENOMEM */ - error("Process.create_process(): fork() failed. errno:%d\n", + Pike_error("Process.create_process(): fork() failed. errno:%d\n", e); } else if(pid) { int olderrno; @@ -2507,7 +2507,7 @@ void f_create_process(INT32 args) #ifdef USE_SIGCHILD - /* FIXME: Can anything of the following throw an error? */ + /* FIXME: Can anything of the following throw an Pike_error? */ if(!signal_evaluator_callback) { signal_evaluator_callback=add_to_callback(&evaluator_callbacks, @@ -2545,7 +2545,7 @@ void f_create_process(INT32 args) while(close(control_pipe[0]) < 0 && errno==EINTR); gnapp=1; } else { - /* Wait for exec or error */ + /* Wait for exec or Pike_error */ while (((e = read(control_pipe[0], buf, 3)) < 0) && (errno == EINTR)) ; /* Paranoia in case close() sets errno. */ @@ -2555,7 +2555,7 @@ void f_create_process(INT32 args) } THREADS_DISALLOW(); if(gnapp) - error("Child process died prematurely. (e=%d errno=%d)\n", + Pike_error("Child process died prematurely. (e=%d errno=%d)\n", e ,olderrno); } #else @@ -2565,11 +2565,11 @@ void f_create_process(INT32 args) /* Paranoia in case close() sets errno. */ olderrno = errno; while(close(control_pipe[0]) < 0 && errno==EINTR); - error("Child process died prematurely. (e=%d errno=%d)\n", + Pike_error("Child process died prematurely. (e=%d errno=%d)\n", e ,olderrno); } - /* Wait for exec or error */ + /* Wait for exec or Pike_error */ while (((e = read(control_pipe[0], buf, 3)) < 0) && (errno == EINTR)) ; /* Paranoia in case close() sets errno. */ @@ -2588,72 +2588,72 @@ void f_create_process(INT32 args) /* Something went wrong. */ switch(buf[0]) { case PROCE_CHDIR: - error("Process.create_process(): chdir() failed. errno:%d\n", + Pike_error("Process.create_process(): chdir() failed. errno:%d\n", buf[1]); break; case PROCE_DUP: - error("Process.create_process(): dup() failed. errno:%d\n", + Pike_error("Process.create_process(): dup() failed. errno:%d\n", buf[1]); break; case PROCE_DUP2: if (buf[1] == EINVAL) { - error("Process.create_process(): dup2() failed with EINVAL.\n"); + Pike_error("Process.create_process(): dup2() failed with EINVAL.\n"); } - error("Process.create_process(): dup2() failed. errno:%d\n", + Pike_error("Process.create_process(): dup2() failed. errno:%d\n", buf[1]); break; case PROCE_SETGID: - error("Process.create_process(): setgid(%d) failed. errno:%d\n", + Pike_error("Process.create_process(): setgid(%d) failed. errno:%d\n", buf[2], buf[1]); break; #ifdef HAVE_SETGROUPS case PROCE_SETGROUPS: if (buf[1] == EINVAL) { - error("Process.create_process(): setgroups() failed with EINVAL.\n" + Pike_error("Process.create_process(): setgroups() failed with EINVAL.\n" "Too many supplementary groups (%d)?\n", storage.num_wanted_gids); } - error("Process.create_process(): setgroups() failed. errno:%d\n", + Pike_error("Process.create_process(): setgroups() failed. errno:%d\n", buf[1]); break; #endif case PROCE_GETPWUID: - error("Process.create_process(): getpwuid(%d) failed. errno:%d\n", + Pike_error("Process.create_process(): getpwuid(%d) failed. errno:%d\n", buf[2], buf[1]); break; case PROCE_INITGROUPS: - error("Process.create_process(): initgroups() failed. errno:%d\n", + Pike_error("Process.create_process(): initgroups() failed. errno:%d\n", buf[1]); break; case PROCE_SETUID: if (buf[1] == EINVAL) { - error("Process.create_process(): Invalid uid: %d.\n", + Pike_error("Process.create_process(): Invalid uid: %d.\n", (int)wanted_uid); } - error("Process.create_process(): setuid(%d) failed. errno:%d\n", + Pike_error("Process.create_process(): setuid(%d) failed. errno:%d\n", buf[2], buf[1]); break; case PROCE_SETSID: - error("Process.create_process(): setsid() failed.\n"); + Pike_error("Process.create_process(): setsid() failed.\n"); break; case PROCE_EXEC: if (buf[1] == ENOENT) { - error("Process.create_process(): Executable file not found.\n"); + Pike_error("Process.create_process(): Executable file not found.\n"); } if (buf[1] == EACCES) { - error("Process.create_process(): Access denied.\n"); + Pike_error("Process.create_process(): Access denied.\n"); } - error("Process.create_process(): exec() failed. errno:%d\n" + Pike_error("Process.create_process(): exec() failed. errno:%d\n" "File not found?\n", buf[1]); break; case PROCE_CLOEXEC: - error("Process.create_process(): set_close_on_exec() failed. errno:%d\n", + Pike_error("Process.create_process(): set_close_on_exec() failed. errno:%d\n", buf[1]); break; case 0: /* read() probably failed. */ default: - error("Process.create_process(): " + Pike_error("Process.create_process(): " "Child failed: %d, %d, %d, %d, %d!\n", buf[0], buf[1], buf[2], e, olderrno); break; @@ -2796,7 +2796,7 @@ void f_create_process(INT32 args) if (setsid_request) if (setsid()==-1) PROCERROR(PROCE_SETSID,0); -/* fixme: else... what? error or ignore? */ +/* fixme: else... what? Pike_error or ignore? */ #endif #ifdef HAVE_SETGID @@ -2914,11 +2914,11 @@ void Pike_f_fork(INT32 args) #ifdef _REENTRANT if(num_threads >1) - error("You cannot use fork in a multithreaded application.\n"); + Pike_error("You cannot use fork in a multithreaded application.\n"); #endif #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("fork: permission denied.\n"); + Pike_error("fork: permission denied.\n"); #endif th_atfork_prepare(); @@ -2943,7 +2943,7 @@ void Pike_f_fork(INT32 args) } if(pid==-1) { - error("Fork failed\n" + Pike_error("Fork failed\n" "errno: %d\n", errno); } @@ -2991,11 +2991,11 @@ static void f_kill(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("kill: permission denied.\n"); + Pike_error("kill: permission denied.\n"); #endif if(args < 2) - error("Too few arguments to kill().\n"); + Pike_error("Too few arguments to kill().\n"); switch(sp[-args].type) { @@ -3006,11 +3006,11 @@ static void f_kill(INT32 args) /* FIXME: What about if it's an object? */ default: - error("Bad argument 1 to kill().\n"); + Pike_error("Bad argument 1 to kill().\n"); } if(sp[1-args].type != T_INT) - error("Bad argument 2 to kill().\n"); + Pike_error("Bad argument 2 to kill().\n"); signum = sp[1-args].u.integer; @@ -3035,13 +3035,13 @@ static void f_pid_status_kill(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("pid->kill: permission denied.\n"); + Pike_error("pid->kill: permission denied.\n"); #endif get_all_args("pid->kill", args, "%i", &signum); if (pid < 0) { - error("pid->kill(): No process\n"); + Pike_error("pid->kill(): No process\n"); } #ifdef PROC_DEBUG @@ -3068,11 +3068,11 @@ static void f_kill(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("kill: permission denied.\n"); + Pike_error("kill: permission denied.\n"); #endif if(args < 2) - error("Too few arguments to kill().\n"); + Pike_error("Too few arguments to kill().\n"); switch(sp[-args].type) { @@ -3103,11 +3103,11 @@ static void f_kill(INT32 args) } default: - error("Bad argument 1 to kill().\n"); + Pike_error("Bad argument 1 to kill().\n"); } if(sp[1-args].type != T_INT) - error("Bad argument 1 to kill().\n"); + Pike_error("Bad argument 1 to kill().\n"); switch(sp[1-args].u.integer) { @@ -3141,7 +3141,7 @@ static void f_pid_status_kill(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("kill: permission denied.\n"); + Pike_error("kill: permission denied.\n"); #endif get_all_args("pid->kill", args, "%i", &signum); @@ -3172,14 +3172,14 @@ static void f_alarm(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("alarm: permission denied.\n"); + Pike_error("alarm: permission denied.\n"); #endif if(args < 1) - error("Too few arguments to signame()\n"); + Pike_error("Too few arguments to signame()\n"); if(sp[-args].type != T_INT) - error("Bad argument 1 to signame()\n"); + Pike_error("Bad argument 1 to signame()\n"); seconds=sp[-args].u.integer; @@ -3198,14 +3198,14 @@ static void f_ualarm(INT32 args) #ifdef PIKE_SECURITY if(!CHECK_SECURITY(SECURITY_BIT_SECURITY)) - error("ualarm: permission denied.\n"); + Pike_error("ualarm: permission denied.\n"); #endif if(args < 1) - error("Too few arguments to ualarm()\n"); + Pike_error("Too few arguments to ualarm()\n"); if(sp[-args].type != T_INT) - error("Bad argument 1 to ualarm()\n"); + Pike_error("Bad argument 1 to ualarm()\n"); useconds=sp[-args].u.integer; diff --git a/src/smartlink.c b/src/smartlink.c index 0045e006929edb31b463b180d870118acba52b87..b67f4fd5165894b9f759e687981431571e963e92 100644 --- a/src/smartlink.c +++ b/src/smartlink.c @@ -1,5 +1,5 @@ /* - * $Id: smartlink.c,v 1.10 2000/10/28 15:48:18 grubba Exp $ + * $Id: smartlink.c,v 1.11 2000/12/01 08:09:55 hubbe Exp $ * * smartlink - A smarter linker. * Based on the /bin/sh script smartlink 1.23. @@ -87,7 +87,7 @@ int main(int argc, char **argv) if (!strcmp(argv[1], "-v")) { fprintf(stdout, - "$Id: smartlink.c,v 1.10 2000/10/28 15:48:18 grubba Exp $\n" + "$Id: smartlink.c,v 1.11 2000/12/01 08:09:55 hubbe Exp $\n" "Usage:\n" "\t%s binary [args]\n", argv[0]); @@ -295,7 +295,7 @@ int main(int argc, char **argv) fatal("Out of memory (7)!"); } #else -#error Unknown method +#Pike_error Unknown method #endif } diff --git a/src/stralloc.c b/src/stralloc.c index c43983f84926fc71e4ce7c5bea069b3739c26b8a..ec58840bdd32e301a55cce37c4cb89e88d8aa21b 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -10,7 +10,7 @@ #include "dynamic_buffer.h" #include "pike_macros.h" #include "pike_memory.h" -#include "error.h" +#include "pike_error.h" #include "gc.h" #include "stuff.h" #include "bignum.h" @@ -26,7 +26,7 @@ #define HUGE HUGE_VAL #endif /*!HUGE*/ -RCSID("$Id: stralloc.c,v 1.108 2000/11/29 21:23:18 hubbe Exp $"); +RCSID("$Id: stralloc.c,v 1.109 2000/12/01 08:09:55 hubbe Exp $"); #define BEGIN_HASH_SIZE 997 #define MAX_AVG_LINK_LENGTH 3 @@ -2197,7 +2197,7 @@ PMOD_EXPORT int convert_stack_top_string_to_inumber(int base) int i; if(sp[-1].type != T_STRING) - error("Cannot convert stack top to integer number.\n"); + Pike_error("Cannot convert stack top to integer number.\n"); i=pcharp_to_svalue_inumber(&r, MKPCHARP_STR(sp[-1].u.string), 0, base, 0); @@ -2338,12 +2338,12 @@ PMOD_EXPORT double STRTOD_PCHARP(PCHARP nptr, PCHARP *endptr) return num * sign; overflow: - /* Return an overflow error. */ + /* Return an overflow Pike_error. */ errno = ERANGE; return HUGE * sign; underflow: - /* Return an underflow error. */ + /* Return an underflow Pike_error. */ if (endptr != NULL) *endptr = nptr; errno = ERANGE; diff --git a/src/svalue.c b/src/svalue.c index c36f4207aeb9f495417589670ac4d9f403fd9dad..9f57c3550d3480828167272583e8e060b7b9c757 100644 --- a/src/svalue.c +++ b/src/svalue.c @@ -14,7 +14,7 @@ #include "object.h" #include "program.h" #include "constants.h" -#include "error.h" +#include "pike_error.h" #include "dynamic_buffer.h" #include "interpret.h" #include "gc.h" @@ -24,7 +24,7 @@ #include "queue.h" #include "bignum.h" -RCSID("$Id: svalue.c,v 1.88 2000/12/01 01:15:01 hubbe Exp $"); +RCSID("$Id: svalue.c,v 1.89 2000/12/01 08:09:55 hubbe Exp $"); struct svalue dest_ob_zero = { T_INT, 0 }; @@ -316,7 +316,7 @@ PMOD_EXPORT void assign_to_short_svalue(union anything *u, if(u->refs && --*(u->refs) <= 0) really_free_short_svalue(u,type); u->refs=0; }else{ - error("Wrong type in assignment, expected %s, got %s.\n", + Pike_error("Wrong type in assignment, expected %s, got %s.\n", get_name_of_type(type), get_name_of_type(s->type)); } @@ -343,7 +343,7 @@ PMOD_EXPORT void assign_to_short_svalue_no_free(union anything *u, }else if(type<=MAX_REF_TYPE && IS_ZERO(s)){ u->refs=0; }else{ - error("Wrong type in assignment, expected %s, got %s.\n", + Pike_error("Wrong type in assignment, expected %s, got %s.\n", get_name_of_type(type), get_name_of_type(s->type)); } @@ -780,7 +780,7 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) int res; aa.u.program = program_from_svalue(a); if (!aa.u.program) { - error("Bad argument to comparison."); + Pike_error("Bad argument to comparison."); } type_stack_mark(); push_type_int(aa.u.program->id); @@ -798,7 +798,7 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) int res; bb.u.program = program_from_svalue(b); if (!bb.u.program) { - error("Bad argument to comparison."); + Pike_error("Bad argument to comparison."); } type_stack_mark(); push_type_int(bb.u.program->id); @@ -832,9 +832,9 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) { a_is_object: if(!a->u.object->prog) - error("Comparison on destructed object.\n"); + Pike_error("Comparison on destructed object.\n"); if(FIND_LFUN(a->u.object->prog,LFUN_LT) == -1) - error("Object lacks `<\n"); + Pike_error("Object lacks `<\n"); assign_svalue_no_free(sp, b); sp++; apply_lfun(a->u.object, LFUN_LT, 1); @@ -851,9 +851,9 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) if(b->type == T_OBJECT) { if(!b->u.object->prog) - error("Comparison on destructed object.\n"); + Pike_error("Comparison on destructed object.\n"); if(FIND_LFUN(b->u.object->prog,LFUN_GT) == -1) - error("Object lacks `>\n"); + Pike_error("Object lacks `>\n"); assign_svalue_no_free(sp, a); sp++; apply_lfun(b->u.object, LFUN_GT, 1); @@ -867,7 +867,7 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) } } - error("Cannot compare different types.\n"); + Pike_error("Cannot compare different types.\n"); } switch(a->type) { @@ -875,7 +875,7 @@ PMOD_EXPORT int is_lt(struct svalue *a,struct svalue *b) goto a_is_object; default: - error("Bad type to comparison.\n"); + Pike_error("Bad type to comparison.\n"); case T_INT: return a->u.integer < b->u.integer; @@ -1591,19 +1591,19 @@ PMOD_EXPORT INT32 pike_sizeof(struct svalue *s) case T_MULTISET: return l_sizeof(s->u.multiset); case T_OBJECT: if(!s->u.object->prog) - error("sizeof() on destructed object.\n"); + Pike_error("sizeof() on destructed object.\n"); if(FIND_LFUN(s->u.object->prog,LFUN__SIZEOF) == -1) { return s->u.object->prog->num_identifier_index; }else{ apply_lfun(s->u.object, LFUN__SIZEOF, 0); if(sp[-1].type != T_INT) - error("Bad return type from o->_sizeof() (not int)\n"); + Pike_error("Bad return type from o->_sizeof() (not int)\n"); sp--; return sp->u.integer; } default: - error("Bad argument 1 to sizeof().\n"); + Pike_error("Bad argument 1 to sizeof().\n"); return 0; /* make apcc happy */ } } diff --git a/src/svalue.h b/src/svalue.h index 065df64cd33b3d81048479fed241a8ba247327e6..c54e22f56cbb39a276a80a4a54cacfae3b164286 100644 --- a/src/svalue.h +++ b/src/svalue.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: svalue.h,v 1.70 2000/10/04 05:12:14 hubbe Exp $ + * $Id: svalue.h,v 1.71 2000/12/01 08:09:55 hubbe Exp $ */ #ifndef SVALUE_H #define SVALUE_H @@ -263,7 +263,7 @@ do{ \ #ifdef PIKE_DEBUG extern void describe(void *); /* defined in gc.c */ -#define check_type(T) if(T > MAX_TYPE && T!=T_LVALUE && T!=T_SHORT_LVALUE && T!=T_VOID && T!=T_DELETED && T!=T_ARRAY_LVALUE) fatal("Type error: %d\n",T) +#define check_type(T) if(T > MAX_TYPE && T!=T_LVALUE && T!=T_SHORT_LVALUE && T!=T_VOID && T!=T_DELETED && T!=T_ARRAY_LVALUE) fatal("Type Pike_error: %d\n",T) #define check_svalue(S) debug_check_svalue(dmalloc_check_svalue(S,DMALLOC_LOCATION())) diff --git a/src/threads.c b/src/threads.c index ae027a1dde84056ea03a9ac80b4b8d59feba4865..c17d317bb6e26eba001b77c9ef07456ded2e4816 100644 --- a/src/threads.c +++ b/src/threads.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: threads.c,v 1.146 2000/12/01 01:15:02 hubbe Exp $"); +RCSID("$Id: threads.c,v 1.147 2000/12/01 08:09:55 hubbe Exp $"); PMOD_EXPORT int num_threads = 1; PMOD_EXPORT int threads_disabled = 0; @@ -718,7 +718,7 @@ void f_thread_create(INT32 args) free_object(arg->id); free_array(arg->args); free((char *)arg); - error("Failed to create thread (errno = %d).\n",tmp); + Pike_error("Failed to create thread (errno = %d).\n",tmp); } } @@ -727,7 +727,7 @@ void f_thread_set_concurrency(INT32 args) { int c=1; if(args) c=Pike_sp[-args].u.integer; - else error("No argument to thread_set_concurrency(int concurrency);\n"); + else Pike_error("No argument to thread_set_concurrency(int concurrency);\n"); pop_n_elems(args); num_lwps=c; th_setconcurrency(c); @@ -794,7 +794,7 @@ void f_mutex_lock(INT32 args) (unsigned int)OB2KEY(m->key)->mut, (unsigned int) Pike_interpreter.thread_id)); - if(type==0) error("Recursive mutex locks!\n"); + if(type==0) Pike_error("Recursive mutex locks!\n"); pop_n_elems(args); push_int(0); @@ -817,7 +817,7 @@ void f_mutex_lock(INT32 args) if(threads_disabled) { free_object(o); - error("Cannot wait for mutexes when threads are disabled!\n"); + Pike_error("Cannot wait for mutexes when threads are disabled!\n"); } SWAP_OUT_CURRENT_THREAD(); do @@ -869,7 +869,7 @@ void f_mutex_trylock(INT32 args) case 0: if(m->key && OB2KEY(m->key)->owner == Pike_interpreter.thread_id) { - error("Recursive mutex locks!\n"); + Pike_error("Recursive mutex locks!\n"); } case 2: @@ -954,7 +954,7 @@ void f_cond_wait(INT32 args) COND_T *c; if(threads_disabled) - error("Cannot wait for conditions when threads are disabled!\n"); + Pike_error("Cannot wait for conditions when threads are disabled!\n"); if(args > 1) { pop_n_elems(args - 1); @@ -969,18 +969,18 @@ void f_cond_wait(INT32 args) struct mutex_storage *mut; if(Pike_sp[-1].type != T_OBJECT) - error("Bad argument 1 to condition->wait()\n"); + Pike_error("Bad argument 1 to condition->wait()\n"); key=Pike_sp[-1].u.object; if(key->prog != mutex_key) - error("Bad argument 1 to condition->wait()\n"); + Pike_error("Bad argument 1 to condition->wait()\n"); if (OB2KEY(key)->initialized) { mut = OB2KEY(key)->mut; if(!mut) - error("Bad argument 1 to condition->wait()\n"); + Pike_error("Bad argument 1 to condition->wait()\n"); /* Unlock mutex */ mut->key=0; @@ -1161,10 +1161,10 @@ void f_thread_local_set(INT32 args) if(args>1) pop_n_elems(args-1); else if(args<1) - error("Too few arguments to thread_local->set()\n"); + Pike_error("Too few arguments to thread_local->set()\n"); if(Pike_interpreter.thread_id == NULL) - error("Trying to set thread_local without thread!\n"); + Pike_error("Trying to set thread_local without thread!\n"); if((m = OBJ2THREAD(Pike_interpreter.thread_id)->thread_local) == NULL) m = OBJ2THREAD(Pike_interpreter.thread_id)->thread_local = @@ -1297,7 +1297,7 @@ PMOD_EXPORT void th_farm(void (*fun)(void *), void *here) void low_th_init(void) { #ifdef SGI_SPROC_THREADS -#error /* Need to specify a filename */ +#Pike_error /* Need to specify a filename */ us_cookie = usinit(""); #endif /* SGI_SPROC_THREADS */ diff --git a/src/threads.h b/src/threads.h index 9cfc06729b0911ceb1603425d9d811b875e29bb1..57a0d873efd0b06392199bb5eae952506d0a3985 100644 --- a/src/threads.h +++ b/src/threads.h @@ -1,12 +1,12 @@ /* - * $Id: threads.h,v 1.106 2000/12/01 01:15:03 hubbe Exp $ + * $Id: threads.h,v 1.107 2000/12/01 08:09:56 hubbe Exp $ */ #ifndef THREADS_H #define THREADS_H #include "machine.h" #include "object.h" -#include "error.h" +#include "pike_error.h" #include "interpret.h" /* Needed for the sigset_t typedef, which is needed for @@ -167,7 +167,7 @@ extern pthread_attr_t small_pattr; #define co_broadcast(X) pthread_cond_broadcast(X) #define co_destroy(X) pthread_cond_destroy(X) #else -#error No way to make cond-vars +#Pike_error No way to make cond-vars #endif /* HAVE_PTHREAD_COND_INIT */ #endif /* POSIX_THREADS */ @@ -538,7 +538,7 @@ extern int Pike_in_gc; thread_for_id(th_self()),Pike_interpreter.thread_id); \ } \ if ((Pike_in_gc > 50) && (Pike_in_gc < 300)) { \ - fprintf(stderr, __FILE__ ":" DEFINETOSTR(__LINE__) ": Fatal error:\n"); \ + fprintf(stderr, __FILE__ ":" DEFINETOSTR(__LINE__) ": Fatal Pike_error:\n"); \ debug_fatal("Threads allowed during garbage collection (%d).\n", \ Pike_in_gc); \ } \