pike.git / src / modules / Image / encodings / wbf.c

version» Context lines:

pike.git/src/modules/Image/encodings/wbf.c:1:   #include "global.h"      #include <math.h>   #include <stdio.h>   #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"   #include "constants.h"   #include "interpret.h"   #include "operators.h"   #include "svalue.h"   #include "threads.h"   #include "array.h" - #include "error.h" + #include "pike_error.h"   #include "builtin_functions.h"   #include "program.h"         #include "image.h"   #include "builtin_functions.h"   #include "module_support.h"      /* MUST BE INCLUDED LAST */   #include "module_magic.h"
pike.git/src/modules/Image/encodings/wbf.c:58:    int type;    int header;    int fix_header_field;    int ext_header_field;    struct ext_header *first_ext_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;   }      static unsigned char read_uchar( struct buffer *from )   {    unsigned char res = 0;    if(from->len)    {    res = from->str[0];    from->str++;    from->len--;    } else -  error("Invalid data format\n"); +  Pike_error("Invalid data format\n");    return res;   }      static int wbf_read_int( struct buffer *from )   {    int res = 0;    while( 1 )    {    int i = read_uchar( from );    res <<= 7;
pike.git/src/modules/Image/encodings/wbf.c:280:    f_aggregate_mapping( map_num_elems * 2 );    }    free_string( s );    free_wbf_header_contents( &wh );    break;       default:    free_string( s );    free_wbf_header_contents( &wh );    -  error("Unsupported wbf image type.\n"); +  Pike_error("Unsupported wbf image type.\n");    }   }      static void image_f_wbf_decode( int args )   {    low_image_f_wbf_decode( args, 2 );   }      static void image_f_wbf__decode( int args )   {
pike.git/src/modules/Image/encodings/wbf.c:352:   }      static void image_f_wbf_encode( int args )   {    struct object *o;    struct image *i;    struct mapping *options = NULL;    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;       num_strings=0;    push_wap_integer( 0 ); num_strings++; /* type */    push_wap_integer( 0 ); num_strings++; /* extra header */    push_wap_integer( i->xsize ); num_strings++;    push_wap_integer( i->ysize ); num_strings++;    push_wap_type0_image_data( i ); num_strings++;