/* Generated from "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod" by precompile.pike running Pike v8.0 release 1737
 *
 * Do NOT edit this file.
 */

#undef PRECOMPILE_API_VERSION
#define PRECOMPILE_API_VERSION 6

#undef PRECOMPILE_SUB_PIKEVARS
#define PRECOMPILE_SUB_PIKEVARS 1

#undef PRECOMPILE_DYNAMIC_TYPES
#define PRECOMPILE_DYNAMIC_TYPES 1



#undef cmod___CMOD__
#define cmod___CMOD__ 1
#line 1 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#line 1 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#line 1 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#line 3003 "/home/hww3/pike-git/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"







#line 3010 "/home/hww3/pike-git/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"
#line 1 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#line 1 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
/* -*- c -*-
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
*/

#include "global.h"

#include "object.h"
#include "svalue.h"
#include "array.h"
#include "pike_error.h"
#include "interpret.h"
#include "stralloc.h"
#include "program.h"
#include "operators.h"
#include "pike_types.h"

#include "program_id.h"

#include "module_support.h"
#include "sequence.h"


/*! @module ADT
 */




#ifndef PIKE_UNUSED_ATTRIBUTE
#define PIKE_UNUSED_ATTRIBUTE
#endif
#define CMOD_MAP_PROGRAM_IDS_DEFINED 1
static int ___cmod_map_program_ids(int id) PIKE_UNUSED_ATTRIBUTE;
#ifndef TYPEOF
/* Compat with older Pikes. */
#define TYPEOF(SVAL)	((SVAL).type)
#define SUBTYPEOF(SVAL)	((SVAL).subtype)
#define SET_SVAL_TYPE(SVAL, TYPE)	(TYPEOF(SVAL) = TYPE)
#define SET_SVAL_SUBTYPE(SVAL, TYPE)	(SUBTYPEOF(SVAL) = TYPE)
#define SET_SVAL(SVAL, TYPE, SUBTYPE, FIELD, EXPR) do {	\
    /* Set the type afterwards to avoid a clobbered	\
     * svalue in case EXPR throws. */			\
    (SVAL).u.FIELD = (EXPR);				\
    SET_SVAL_TYPE((SVAL), (TYPE));			\
    SET_SVAL_SUBTYPE((SVAL), (SUBTYPE));		\
  } while(0)
#endif /* !TYPEOF */
#ifndef PIKE_UNUSED
/* Compat with Pike 7.8 and earlier. */
/* NB: Not strictly correct; PIKE_UNUSED was added the
 *     day after set_program_id_to_id(), but good enough.
 */
#ifndef UNUSED
#define UNUSED(X)	X
#endif
#ifndef set_program_id_to_id
/* NB: Recent Pike 7.8 has a #define that conflicts with
 *     the following declaration.
 */
static void set_program_id_to_id(void*UNUSED(id)){}
#endif
#else /* */
PMOD_EXPORT void set_program_id_to_id( int (*to)(int) );
#endif /* !PIKE_UNUSED */


#ifndef DEFAULT_CMOD_STORAGE
#define CMOD_COND_USED
#define DEFAULT_CMOD_STORAGE static
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__equal_fun_num_used 1
#else
#undef f_Sequence_cq__equal_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__indices_fun_num_used 1
#else
#undef f_Sequence_cq__indices_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__search_fun_num_used 1
#else
#undef f_Sequence_cq__search_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__sizeof_fun_num_used 1
#else
#undef f_Sequence_cq__sizeof_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__values_fun_num_used 1
#else
#undef f_Sequence_cq__values_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_add_fun_num_used 1
#else
#undef f_Sequence_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cast_fun_num_used 1
#else
#undef f_Sequence_cast_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_clear_fun_num_used 1
#else
#undef f_Sequence_clear_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_delete_value_fun_num_used 1
#else
#undef f_Sequence_delete_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_is_empty_fun_num_used 1
#else
#undef f_Sequence_is_empty_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_max_size_fun_num_used 1
#else
#undef f_Sequence_max_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_create_fun_num_used 1
#else
#undef f_Sequence_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_first_fun_num_used 1
#else
#undef f_Sequence_first_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_last_fun_num_used 1
#else
#undef f_Sequence_last_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Sequence_program_fun_num_used 1
#else
#undef Sequence_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_index_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_index_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_create_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Sequence_SequenceIterator_program_fun_num_used 1
#else
#undef Sequence_SequenceIterator_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_set_value_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_set_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__equal_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__equal_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_distance_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_distance_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_has_next_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_has_next_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_value_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_has_previous_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_has_previous_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_SequenceIterator_get_collection_fun_num_used 1
#else
#undef f_Sequence_SequenceIterator_get_collection_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_2D_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_2D_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_5B_5D_eq_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_5B_5D_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_add_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_5B_5D_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_5B_5D_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__insert_element_fun_num_used 1
#else
#undef f_Sequence_cq__insert_element_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__remove_element_fun_num_used 1
#else
#undef f_Sequence_cq__remove_element_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_5E_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_5E_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_7C_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_7C_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__backtick_26_fun_num_used 1
#else
#undef f_Sequence_cq__backtick_26_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Sequence_cq__get_iterator_fun_num_used 1
#else
#undef f_Sequence_cq__get_iterator_fun_num_used
#endif
/*! @class Sequence
 *! The sequence work similar to an array but has the possibilities to 
 *! insert and remove elements. It also has a more powerful iterator.
 */


#undef class_Sequence_defined
#define class_Sequence_defined
DEFAULT_CMOD_STORAGE struct program *Sequence_program=NULL;

#ifdef Sequence_program_fun_num_used
DEFAULT_CMOD_STORAGE int Sequence_program_fun_num=-1;
#endif /* Sequence_program_fun_num_used */

#undef var_pos_Sequence_defined
#define var_pos_Sequence_defined

#undef var_a_Sequence_defined
#define var_a_Sequence_defined

#undef THIS
#define THIS ((struct Sequence_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_SEQUENCE
#define THIS_SEQUENCE ((struct Sequence_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_SEQUENCE
#define OBJ2_SEQUENCE(o) ((struct Sequence_struct *)(o->storage+Sequence_storage_offset))

#undef GET_SEQUENCE_STORAGE
#define GET_SEQUENCE_STORAGE(o) ((struct Sequence_struct *)(o->storage+Sequence_storage_offset)
static ptrdiff_t Sequence_storage_offset;
struct Sequence_struct {

#ifdef var_pos_Sequence_defined
#line 39 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
int pos;
#endif /* var_pos_Sequence_defined */

#ifdef var_a_Sequence_defined
#line 40 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct array *a;
#endif /* var_a_Sequence_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Sequence_struct *Sequence_gdb_dummy_ptr;
#endif
/*if there is more than one reference to this array copy it. */

#line 45 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
static inline void should_copy(void)
{
if (THIS->a->refs > 1)
{
struct array *b = copy_array(THIS->a);
free_array(THIS->a);
THIS->a = b;
}
} 


/*! @decl mixed `[](int index)
 *! Index operator.
 *! 
 *! @param index
 *!   The index to get the value for, could be negative to index from the end.
 *!
 *! @returns
 *!   The value at the index @[index].
 *!
 *! @throws 
 *!   An error if the index is out of range.
 */

#define f_Sequence_cq__backtick_5B_5D_defined

#ifdef f_Sequence_cq__backtick_5B_5D_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_5B_5D_fun_num = 0;

#endif /* f_Sequence_cq__backtick_5B_5D_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_5B_5D(INT32 args) {
#line 69 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * index;
#line 69 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`[]",args,1);
#line 69 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
index=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
#line 69 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{

simple_array_index_no_free(Pike_sp, THIS->a, index);
Pike_sp++;
}


}
/*! @decl mixed `[]=(int index, mixed value)
 *! Index assign operator.
 *! Set the value at the index @[index] to be @[value].
 *! 
 *! @param index 
 *!   The index to set.
 *!
 *! @param value
 *!   The new value.
 *!
 *! @returns
 *!   The new value at the index @[index].
 *!
 */

#define f_Sequence_cq__backtick_5B_5D_eq_defined

#ifdef f_Sequence_cq__backtick_5B_5D_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_5B_5D_eq_fun_num = 0;

#endif /* f_Sequence_cq__backtick_5B_5D_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_5B_5D_eq(INT32 args) {
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * index;
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * value;
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 2) wrong_number_of_args_error("`[]=",args,2);
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
index=Pike_sp+0-2; dmalloc_touch_svalue(Pike_sp+0-2);
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
value=Pike_sp+1-2; dmalloc_touch_svalue(Pike_sp+1-2);
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
should_copy(); 
simple_set_index(THIS->a, index, value);
} 


}
/*! @decl Sequence `+(Sequence ... coll)
 *! Addition operator
 *!
 *! Append the content of @@@[coll] to this sequence and return the results 
 *! as a new @[Sequence].
 *! 
 *! @param coll 
 *!   The sequences to append to this sequence.
 *!
 *! @returns
 *!   The result of the append as a new @[Sequence]. 
 */

#define f_Sequence_cq__backtick_add_defined

#ifdef f_Sequence_cq__backtick_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_add_fun_num = 0;

#endif /* f_Sequence_cq__backtick_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_add(INT32 args) {
#line 110 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * coll;
#line 110 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if (args > 0) {
  INT32 argcnt = 0;
  do {
    dmalloc_touch_svalue(Pike_sp+0+argcnt-args);
#line 110 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0+argcnt-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`+",1+argcnt,"object");
#line 110 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  } while (++argcnt < args-0);
  coll=Pike_sp+0-args;
} else coll = NULL;
#line 111 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
int i;

ref_push_array(THIS->a);

for(i=0; i < args; i++) {
/*FIXME: Ought to work on collection classes too */
if (coll[i].u.object->prog == Sequence_program)
{
ref_push_array(OBJ2_SEQUENCE(coll[i].u.object)->a);
}
else
{
SIMPLE_BAD_ARG_ERROR("`+",i+1,"ADT.Sequence");
}
}
f_add(args+1);
push_object(clone_object(Sequence_program, 1));
stack_pop_n_elems_keep_top(args);
}


}
/*! @decl Sequence `-(Sequence ... coll)
 *! Subtraction operator
 *!
 *! Removes those values in this sequence that also are present in @@@[coll] 
 *! and return the results as a new @[Sequence].
 *! 
 *! @param coll 
 *!   The sequence to subtract from this sequence.
 *!
 *! @returns
 *!   The result of the subtraction as a new @[Sequence]. 
 */

#define f_Sequence_cq__backtick_2D_defined

#ifdef f_Sequence_cq__backtick_2D_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_2D_fun_num = 0;

#endif /* f_Sequence_cq__backtick_2D_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_2D(INT32 args) {
#line 146 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * coll;
#line 146 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if (args > 0) {
  INT32 argcnt = 0;
  do {
    dmalloc_touch_svalue(Pike_sp+0+argcnt-args);
#line 146 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0+argcnt-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`-",1+argcnt,"object");
#line 146 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  } while (++argcnt < args-0);
  coll=Pike_sp+0-args;
} else coll = NULL;
#line 147 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
int i;

ref_push_array(THIS->a);

for (i = 0; i < args; i++) {
/*FIXME: Ought to work on collection classes too */
if (coll[i].u.object->prog == Sequence_program)
{
ref_push_array(OBJ2_SEQUENCE(coll[i].u.object)->a);
}
else
{
SIMPLE_BAD_ARG_ERROR("`-",i+1,"ADT.Sequence");
}
}
f_minus(args+1);
push_object(clone_object(Sequence_program, 1));
stack_pop_n_elems_keep_top(args);
}


}
/*! @decl Sequence `&(Sequence coll)
 *! And operator
 *! Perform an and on this sequence and the @[coll] sequence by only returning 
 *! those values that is present in both sequences as a new @[Sequence].
 *! The remaining values is in the same order as they are in this sequence and
 *! the values are compared using `==.
 *!
 *! @param coll 
 *!   The sequence to and to this sequence.
 *!
 *! @returns
 *!   The result of the and as a new @[Sequence]. 
 */

#define f_Sequence_cq__backtick_26_defined

#ifdef f_Sequence_cq__backtick_26_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_26_fun_num = 0;

#endif /* f_Sequence_cq__backtick_26_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_26(INT32 args) {
#line 183 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object * coll;
#line 183 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`&",args,1);
#line 183 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`&",1,"object");
#line 183 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(coll=Pike_sp[0-1].u.object);
{
/*Should work on collection classes too */
if (coll->prog == Sequence_program)
{
push_array(and_arrays(THIS->a,
OBJ2_SEQUENCE(coll)->a));

push_object(clone_object(Sequence_program, 1));
}
else
{
SIMPLE_BAD_ARG_ERROR("`&",1,"ADT.Sequence");
}
}


}
/*! @decl Sequence `|(Sequence coll)
 *! Or operator
 *! Perform an or on this sequence and the @[coll] sequence by returning 
 *! those values that is present in both sequences as a new @[Sequence].
 *! The values are compared using `==.
 *!
 *! @param coll 
 *!   The sequence to or with this sequence.
 *!
 *! @returns
 *!   The result of the or as a new @[Sequence]. 
 */

#define f_Sequence_cq__backtick_7C_defined

#ifdef f_Sequence_cq__backtick_7C_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_7C_fun_num = 0;

#endif /* f_Sequence_cq__backtick_7C_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_7C(INT32 args) {
#line 213 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object * coll;
#line 213 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`|",args,1);
#line 213 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`|",1,"object");
#line 213 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(coll=Pike_sp[0-1].u.object);
{
/*Should work on collection classes too */
if (coll->prog == Sequence_program)
{
push_array(merge_array_with_order(THIS->a, 
OBJ2_SEQUENCE(coll)->a,
PIKE_ARRAY_OP_OR));

push_object(clone_object(Sequence_program, 1));
}
else
{
SIMPLE_BAD_ARG_ERROR("`|",1,"ADT.Sequence");
}
}


}
/*! @decl Sequence `^(Sequence coll)
 *! Xor operator
 *! Perform a xor on this sequence and the @[coll] sequence by returning 
 *! those values that is present in one of the sequences but not in both 
 *! adapters as a new @[Sequence].
 *! The values are compared using `==.
 *!
 *! @param coll 
 *!   The sequence to xor with this sequence.
 *!
 *! @returns
 *!   The result of the xor as a new @[Sequence]. 
 */

#define f_Sequence_cq__backtick_5E_defined

#ifdef f_Sequence_cq__backtick_5E_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__backtick_5E_fun_num = 0;

#endif /* f_Sequence_cq__backtick_5E_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__backtick_5E(INT32 args) {
#line 245 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object * coll;
#line 245 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`^",args,1);
#line 245 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`^",1,"object");
#line 245 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(coll=Pike_sp[0-1].u.object);
{
/*Should work on collection classes too */
if (coll->prog == Sequence_program)
{
push_array(merge_array_with_order(THIS->a, 
OBJ2_SEQUENCE(coll)->a,
PIKE_ARRAY_OP_XOR));

push_object(clone_object(Sequence_program, 1));
}
else
{
SIMPLE_BAD_ARG_ERROR("`^",1,"ADT.Sequence");
}
}


}
/*! @decl int(0..1) _equal(mixed coll)
   *!
   *! @returns
   *!   Returns @tt{true@} if the object @[coll] is a @[Sequence]
   *!   and contains the same values in the same order.
   */

#define f_Sequence_cq__equal_defined

#ifdef f_Sequence_cq__equal_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__equal_fun_num = 0;

#endif /* f_Sequence_cq__equal_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__equal(INT32 args) {
#line 270 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * coll;
#line 270 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("_equal",args,1);
#line 270 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
coll=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*coll) == T_OBJECT &&
coll->u.object->prog == Sequence_program)
{
struct Sequence_struct *adapter = OBJ2_SEQUENCE(coll->u.object);
do { INT_TYPE ret_=((array_equal_p(THIS->a, adapter->a, 0))); pop_stack(); push_int(ret_); return; }while(0);
#line 277 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 279 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}

}
/*! @decl array _indices()
   *!
   *! @returns
   *!   The indices in this adapter as an array.
   */

#define f_Sequence_cq__indices_defined

#ifdef f_Sequence_cq__indices_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__indices_fun_num = 0;

#endif /* f_Sequence_cq__indices_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__indices(INT32 args) {
#line 287 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("_indices",args,0);
{
ptrdiff_t size = THIS->a->size;
struct array *a;

a=allocate_array_no_init(size,0);
while(--size>=0)
{
ITEM(a)[size].u.integer = DO_NOT_WARN((INT_TYPE)size);
}
a->type_field = BIT_INT;
do { struct array * ret_=(a);  push_array(ret_); return; }while(0);
#line 299 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}

}
/*! @decl void _insert_element(int index, mixed value)
 *! Insert an element in the sequence at the position @[index], the value
 *! at the position @[index] and all above will have their index increased 
 *! by one.
 *! 
 *! @param index 
 *!   The index to insert the value at.
 *!
 *! @param value
 *!   The new value.
 *!
 */

#define f_Sequence_cq__insert_element_defined

#ifdef f_Sequence_cq__insert_element_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__insert_element_fun_num = 0;

#endif /* f_Sequence_cq__insert_element_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__insert_element(INT32 args) {
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
INT_TYPE index;
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * value;
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 2) wrong_number_of_args_error("_insert_element",args,2);
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_insert_element",1,"int");
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
index=Pike_sp[0-2].u.integer;
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
value=Pike_sp+1-2; dmalloc_touch_svalue(Pike_sp+1-2);
{
FIX_AND_CHECK_INDEX(index, THIS->a->size, 1);
should_copy();
THIS->a = array_insert(THIS->a, value, index);

}

}
/*! @decl mixed _remove_element(int index)
 *!  Remove the values at index @[index] from the sequence.
 *! 
 *! @param index 
 *!   The index to remove.
 *!
 *! @returns
 *!   The removed value.
 */

#define f_Sequence_cq__remove_element_defined

#ifdef f_Sequence_cq__remove_element_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__remove_element_fun_num = 0;

#endif /* f_Sequence_cq__remove_element_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__remove_element(INT32 args) {
#line 332 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
INT_TYPE index;
#line 332 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("_remove_element",args,1);
#line 332 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_remove_element",1,"int");
#line 332 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
index=Pike_sp[0-1].u.integer;
{
struct svalue s;

FIX_AND_CHECK_INDEX(index, THIS->a->size, 0);

s = *(THIS->a->item + index); 
should_copy();
THIS->a = array_remove(THIS->a, index);
push_svalue(&s);
}


}
/*! @decl int _search(mixed value, void|int start)
 *!   Search the sequence for a specific value. Return the index of the first 
 *!   value that is equal to @[value]. If no value was found @expr{UNDEFINED@} 
 *!   is returned instead.
 *! 
 *! @param value
 *!   The value to find.
 *!
 *! @param start
 *!   If a start value is supplied it will start searching at the index 
 *!   @[start].
 *!
 *! @returns
 *!   Returns the index of the found value or @expr{UNDEFINED@}.
 */

#define f_Sequence_cq__search_defined

#ifdef f_Sequence_cq__search_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__search_fun_num = 0;

#endif /* f_Sequence_cq__search_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__search(INT32 args) {
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * value;
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * start;
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args < 1) wrong_number_of_args_error("_search",args,1);
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args > 2) wrong_number_of_args_error("_search",args,2);
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
value=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if ((args > 1) &&
    ((TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[1-args]) != NUMBER_UNDEFINED))) {
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_search",2,"void|int");
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
start=Pike_sp+1-args; dmalloc_touch_svalue(Pike_sp+1-args);
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} else start = NULL;
{
if(start)
{ 
if (TYPEOF(*start) != PIKE_T_INT)
{ 
SIMPLE_BAD_ARG_ERROR("_search",2,"int");
}
do { INT_TYPE ret_=(array_search(THIS->a, value, start->u.integer)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 370 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else 
{
do { INT_TYPE ret_=(array_search(THIS->a,value,0)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 374 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
}

}
/*! @decl int _sizeof()
 *!
 *! @returns
 *!   The number of elements in this adapter.
 */

#define f_Sequence_cq__sizeof_defined

#ifdef f_Sequence_cq__sizeof_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__sizeof_fun_num = 0;

#endif /* f_Sequence_cq__sizeof_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__sizeof(INT32 args) {
#line 383 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("_sizeof",args,0);
{
do { INT_TYPE ret_=(THIS->a->size);  push_int(ret_); return; }while(0);
#line 386 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}

}
/*! @decl array _values()
   *!
   *! @returns
   *!   The values in this adapter as an array.
   */

#define f_Sequence_cq__values_defined

#ifdef f_Sequence_cq__values_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__values_fun_num = 0;

#endif /* f_Sequence_cq__values_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__values(INT32 args) {
#line 394 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("_values",args,0);
{
struct array *a;
a=copy_array(THIS->a);
do { struct array * ret_=(a);  push_array(ret_); return; }while(0);
#line 399 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl void add(mixed value)
 *!   Add a value at the end of the sequence.
 *!
 *! @param value
 *!   The value to add.
 */

#define f_Sequence_add_defined

#ifdef f_Sequence_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_add_fun_num = 0;

#endif /* f_Sequence_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_add(INT32 args) {
#line 409 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * value;
#line 409 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("add",args,1);
#line 409 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
should_copy();
THIS->a=append_array(THIS->a, value);
}


}
/*! @decl array cast(string type)
 *! Cast operator.
 *!
 *! @param type
 *!   Casts to this type.
 *!
 *!   Casts to the following types are supported:
 *!   @string
 *!     @value "array"
 *!       Cast the content of this sequence to an array.
 *!   @endstring
 *!
 *! @returns
 *!   An array with the contents of this sequence.
 */

#define f_Sequence_cast_defined

#ifdef f_Sequence_cast_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cast_fun_num = 0;

#endif /* f_Sequence_cast_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cast(INT32 args) {
#line 432 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct pike_string * type;
#line 432 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("cast",args,1);
#line 432 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("cast",1,"string");
#line 432 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(type=Pike_sp[0-1].u.string);
#line 434 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
pop_n_elems(args); /* type as at least one more reference. */
if (type == literal_array_string)
push_array(copy_array(THIS->a));
else
push_undefined();
}

}
/*! @decl void clear()
   *!   Clear the contents of the sequence.
   *!
   */

#define f_Sequence_clear_defined

#ifdef f_Sequence_clear_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_clear_fun_num = 0;

#endif /* f_Sequence_clear_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_clear(INT32 args) {
#line 447 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("clear",args,0);
{
should_copy();
THIS->a=resize_array(THIS->a, 0);
} 

}
/*! @decl int delete_value(mixed value)
   *!   Remove the first occurrence of the value @[value] from the sequence.
   *!
   *! @param value
   *!   The value to remove from the sequence.
   *!
   *! @returns
   *!   The index of the removed element or -1 if there was no value to 
   *!   remove.
   */

#define f_Sequence_delete_value_defined

#ifdef f_Sequence_delete_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_delete_value_fun_num = 0;

#endif /* f_Sequence_delete_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_delete_value(INT32 args) {
#line 464 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * value;
#line 464 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("delete_value",args,1);
#line 464 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
INT32 index = array_search(THIS->a, value, 0);
if (index > -1)
{
should_copy();
THIS->a = array_remove(THIS->a, index);
}
do { INT_TYPE ret_=(index); pop_stack(); push_int(ret_); return; }while(0);
#line 473 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}

}
/*! @decl int(0..1) is_empty()
   *!
   *! @returns
   *!   Returns @expr{1@} if the sequence is empty otherwise @expr{0@}. 
   */

#define f_Sequence_is_empty_defined

#ifdef f_Sequence_is_empty_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_is_empty_fun_num = 0;

#endif /* f_Sequence_is_empty_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_is_empty(INT32 args) {
#line 481 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("is_empty",args,0);
{
do { INT_TYPE ret_=(!(THIS->a->size));  push_int(ret_); return; }while(0);
#line 484 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}

}
/*! @decl int max_size()
   *!
   *! @returns
   *!   Returns -1.
   */

#define f_Sequence_max_size_defined

#ifdef f_Sequence_max_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_max_size_fun_num = 0;

#endif /* f_Sequence_max_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_max_size(INT32 args) {
#line 492 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("max_size",args,0);
{
do { INT_TYPE ret_=(-1);  push_int(ret_); return; }while(0);
#line 495 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl void create(array|int arg)
   *!   Creates a new @[Sequence] around the array arg or a new
   *!   @[Sequence] with the size of arg.
   */

#define f_Sequence_create_defined

#ifdef f_Sequence_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_create_fun_num = 0;

#endif /* f_Sequence_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_create(INT32 args) {
#line 503 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * arg;
#line 503 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 503 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
arg=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*arg) == T_INT)
{
struct array *b = allocate_array_no_init(arg->u.integer, 0);
free_array(THIS->a);
THIS->a = b;
THIS->a->type_field = BIT_INT;
}
else if (TYPEOF(*arg) == T_ARRAY)
{
free_array(THIS->a);
add_ref(THIS->a=arg->u.array);
} 
pop_n_elems(args);
}



}
/*! @decl SequenceIterator _get_iterator(void|int ind)
   *!   Create and initiate a new SequenceIterator that could be used
   *!   to iterate over this sequence.
   *!
   *! @param ind
   *!   If an @[ind] value is supplied the iterator will be positioned at
   *!   that index.
   *!
   *! @returns
   *!   An iterator.
   */



/*! @decl SequenceIterator first()
   *!   Create and initiate a new SequenceIterator that could be used
   *!   to iterate over this sequence.
   *!
   *! @returns
   *!   An iterator positioned at the first element in the sequence.
   */


/*! @decl SequenceIterator last()
   *!   Create and initiate a new SequenceIterator that could be used
   *!   to iterate over this sequence.
   *!
   *! @returns
   *!   An iterator positioned after the last element in the sequence.
   */



#undef internal_init_Sequence_defined
#define internal_init_Sequence_defined

#undef Sequence_event_handler_defined
#define Sequence_event_handler_defined
static void init_Sequence_struct(void)
#line 555 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
add_ref(THIS->a = &empty_array);
THIS->pos=0;
}


#undef internal_exit_Sequence_defined
#define internal_exit_Sequence_defined

#undef Sequence_event_handler_defined
#define Sequence_event_handler_defined
static void exit_Sequence_struct(void)
#line 562 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
free_array(THIS->a);
}

/*! @class SequenceIterator
   *!    This is the iterator for the Sequence. It implements the 
   *!    IndexIterator and the OutputIterator
   */ 


#undef class_Sequence_SequenceIterator_defined
#define class_Sequence_SequenceIterator_defined
DEFAULT_CMOD_STORAGE struct program *Sequence_SequenceIterator_program=NULL;

#ifdef Sequence_SequenceIterator_program_fun_num_used
DEFAULT_CMOD_STORAGE int Sequence_SequenceIterator_program_fun_num=-1;
#endif /* Sequence_SequenceIterator_program_fun_num_used */

#undef var_pos_Sequence_SequenceIterator_defined
#define var_pos_Sequence_SequenceIterator_defined

#undef var_sequence_Sequence_SequenceIterator_defined
#define var_sequence_Sequence_SequenceIterator_defined

#undef var_obj_Sequence_SequenceIterator_defined
#define var_obj_Sequence_SequenceIterator_defined

#undef THIS
#define THIS ((struct Sequence_SequenceIterator_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_SEQUENCE_SEQUENCEITERATOR
#define THIS_SEQUENCE_SEQUENCEITERATOR ((struct Sequence_SequenceIterator_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_SEQUENCE_SEQUENCEITERATOR
#define OBJ2_SEQUENCE_SEQUENCEITERATOR(o) ((struct Sequence_SequenceIterator_struct *)(o->storage+Sequence_SequenceIterator_storage_offset))

#undef GET_SEQUENCE_SEQUENCEITERATOR_STORAGE
#define GET_SEQUENCE_SEQUENCEITERATOR_STORAGE(o) ((struct Sequence_SequenceIterator_struct *)(o->storage+Sequence_SequenceIterator_storage_offset)
static ptrdiff_t Sequence_SequenceIterator_storage_offset;
struct Sequence_SequenceIterator_struct {

#ifdef var_pos_Sequence_SequenceIterator_defined
#line 573 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
int pos;
#endif /* var_pos_Sequence_SequenceIterator_defined */

#ifdef var_sequence_Sequence_SequenceIterator_defined
#line 574 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct Sequence_struct *sequence;
#endif /* var_sequence_Sequence_SequenceIterator_defined */

#ifdef var_obj_Sequence_SequenceIterator_defined
#line 575 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object *obj;
#endif /* var_obj_Sequence_SequenceIterator_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Sequence_SequenceIterator_struct *Sequence_SequenceIterator_gdb_dummy_ptr;
#endif
/*! @decl void create(object sequence, void|int start)
   *!   Creates a new iterator for the sequence @[sequence]. If start is
   *!   supplied it will try to position the iterator at @[start].
   *! 
   */

#define f_Sequence_SequenceIterator_create_defined

#ifdef f_Sequence_SequenceIterator_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_create_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_create(INT32 args) {
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object * sequence;
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * start;
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args < 1) wrong_number_of_args_error("create",args,1);
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args > 2) wrong_number_of_args_error("create",args,2);
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("create",1,"object");
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(sequence=Pike_sp[0-args].u.object);
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if ((args > 1) &&
    ((TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[1-args]) != NUMBER_UNDEFINED))) {
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",2,"void|int");
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
start=Pike_sp+1-args; dmalloc_touch_svalue(Pike_sp+1-args);
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} else start = NULL;
{

if (sequence->prog != Sequence_program)
{
SIMPLE_BAD_ARG_ERROR("create",1,"ADT.Sequence");

}
else
{
THIS->sequence = OBJ2_SEQUENCE(sequence);
add_ref(THIS->obj = sequence);
if (start) /* if there was an start index supplied */
{
THIS->pos=start->u.integer;
if (THIS->sequence->a && ((THIS->pos > THIS->sequence->a->size) 
|| (THIS->pos < 0)))
{
Pike_error("Index %d is out of array range 0 - %d.\n", 
THIS->pos, 
THIS->sequence->a->size);
}
}
else
{
THIS->pos = 0;
}
}

}

}
/*! @decl int index()
     *!   
     *! @returns
     *!    The index at the current position.
     */

#define f_Sequence_SequenceIterator_index_defined

#ifdef f_Sequence_SequenceIterator_index_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_index_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_index_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_index(INT32 args) {
#line 621 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("index",args,0);
{
if(!THIS->sequence || 
!THIS->sequence->a || 
THIS->pos >= THIS->sequence->a->size) 
{
push_undefined();
}
else
{
do { INT_TYPE ret_=(THIS->pos);  push_int(ret_); return; }while(0);
#line 632 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
}


}
/*! @decl mixed value()
     *!   
     *! @returns
     *!    The value at the current position.
     */

#define f_Sequence_SequenceIterator_value_defined

#ifdef f_Sequence_SequenceIterator_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_value_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_value(INT32 args) {
#line 642 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("value",args,0);
{
if(!THIS->sequence || 
!THIS->sequence->a || 
THIS->pos >= THIS->sequence->a->size) 
{
push_undefined();
}
else
{
push_svalue(THIS->sequence->a->item + THIS->pos);
}
}


}
/*! @decl SequenceIterator `+(int steps)
     *!   Move the iterator @[steps] steps forward (negative value on @[steps]
     *!   will cause the iterator to move backwards) and return the result
     *!   as a new iterator.
     *! @returns
     *!    A new iterator positioned @[steps] steps forward.
     */ 

#define f_Sequence_SequenceIterator_cq__backtick_add_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_add_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_add(INT32 args) {
#line 665 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
INT_TYPE steps;
#line 665 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`+",args,1);
#line 665 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`+",1,"int");
#line 665 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
steps=Pike_sp[0-1].u.integer;
{
struct object *o=low_clone(Sequence_SequenceIterator_program);
struct Sequence_SequenceIterator_struct *new;
new = OBJ2_SEQUENCE_SEQUENCEITERATOR(o);
new[0]=*THIS;
add_ref(THIS->obj);
new->pos+=steps;
if (new->pos < 0) 
{ 
new->pos = 0;
}
else if (new->pos > new->sequence->a->size) 
{ 
new->pos = new->sequence->a->size; 
}
do { struct object * ret_=(o); pop_stack(); push_object(ret_); return; }while(0);
#line 682 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} 

}
/*! @decl SequenceIterator `+=(int steps)
     *!   Move this iterator @[steps] steps forward (negative value on @[steps]
     *!   will cause the iterator to move backwards) and return the result.
     *!
     *! @returns
     *!    This iterator positioned @[steps] steps forward.
     */ 


#define f_Sequence_SequenceIterator_cq__backtick_add_eq_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_add_eq(INT32 args) {
#line 693 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
INT_TYPE steps;
#line 693 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`+=",args,1);
#line 693 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`+=",1,"int");
#line 693 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
steps=Pike_sp[0-1].u.integer;
{
THIS->pos+=steps;
if (THIS->pos < 0) 
{ 
THIS->pos = 0;
}
else if (THIS->pos > THIS->sequence->a->size) 
{ 
THIS->pos = THIS->sequence->a->size; 
}

do { struct object * ret_=(Pike_fp->current_object); add_ref(ret_); pop_stack(); push_object(ret_); return; }while(0);
#line 706 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl SequenceIterator `-(int steps)
     *!   Move the iterator @[steps] steps backwards (negative value on 
     *!   @[steps] will cause the iterator to move forwards) and return 
     *!   the result as a new iterator.
     *! @returns
     *!    A new iterator positioned @[steps] steps backwards.
     */ 

#define f_Sequence_SequenceIterator_cq__backtick_2D_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_2D_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_2D(INT32 args) {
#line 717 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
INT_TYPE steps;
#line 717 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`-",args,1);
#line 717 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`-",1,"int");
#line 717 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
steps=Pike_sp[0-1].u.integer;
{
struct object *o=low_clone(Sequence_SequenceIterator_program);
struct Sequence_SequenceIterator_struct *new;
new = OBJ2_SEQUENCE_SEQUENCEITERATOR(o);
new[0]=*THIS;
add_ref(THIS->obj);
new->pos-=steps;
if (new->pos < 0) 
{ 
new->pos = 0;
}
else if (new->pos > new->sequence->a->size) 
{ 
new->pos = new->sequence->a->size; 
}
do { struct object * ret_=(o); pop_stack(); push_object(ret_); return; }while(0);
#line 734 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl int(0..1) has_next(void|int steps)
     *! @returns
     *!    Returns @tt{true@} if it is possible to move @[steps] steps
     *!    forwards, if @[steps] weren't supplied it check if it is
     *!    possible to move one step forward.
     */ 

#define f_Sequence_SequenceIterator_has_next_defined

#ifdef f_Sequence_SequenceIterator_has_next_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_has_next_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_has_next_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_has_next(INT32 args) {
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * steps;
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args > 1) wrong_number_of_args_error("has_next",args,1);
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("has_next",1,"void|int");
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
steps=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} else steps = NULL;
{
if (!steps)
{
do { INT_TYPE ret_=((THIS->sequence && THIS->sequence->a && 
(THIS->pos + 1) <= THIS->sequence->a->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 750 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{ 
do { INT_TYPE ret_=((THIS->sequence && THIS->sequence->a && 
(THIS->pos + steps->u.integer) >= 0 &&
(THIS->pos + steps->u.integer) <= THIS->sequence->a->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 756 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
}


}
/*! @decl int(0..1) has_previous(void|int steps)
     *! @returns
     *!    Returns @tt{true@} if it is possible to move @[steps] steps
     *!    backwards, if @[steps] weren't supplied it check if it is
     *!    possible to move one step backward.
     */ 

#define f_Sequence_SequenceIterator_has_previous_defined

#ifdef f_Sequence_SequenceIterator_has_previous_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_has_previous_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_has_previous_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_has_previous(INT32 args) {
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * steps;
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args > 1) wrong_number_of_args_error("has_previous",args,1);
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("has_previous",1,"void|int");
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
steps=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} else steps = NULL;
{
if (!steps)
{
do { INT_TYPE ret_=((THIS->sequence && THIS->sequence->a &&
(THIS->pos) > 0)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 773 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{
do { INT_TYPE ret_=((THIS->sequence && THIS->sequence->a &&
(THIS->pos - steps->u.integer) >= 0 &&
(THIS->pos - steps->u.integer) <= THIS->sequence->a->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 779 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
}


}
/*! @decl int(0..1) `!()
     *! @returns
     *!    Returns @tt{false@} if the iterator has reached the end.
     */ 

#define f_Sequence_SequenceIterator_cq__backtick_21_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_21_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_21(INT32 args) {
#line 788 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("`!",args,0);
{
do { INT_TYPE ret_=((THIS->sequence && THIS->sequence->a &&
THIS->pos == THIS->sequence->a->size));  push_int(ret_); return; }while(0);
#line 792 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl int(0..1) _equal(mixed iter)
     *!    Compare this iterator with another iterator.
     *! 
     *! @param iter
     *!    The iterator to compare with.
     *! @returns
     *!    Returns @tt{true@} if both iterators iterates over the same
     *!    objects and are positioned at the same spot.
     */ 

#define f_Sequence_SequenceIterator_cq__equal_defined

#ifdef f_Sequence_SequenceIterator_cq__equal_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__equal_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__equal_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__equal(INT32 args) {
#line 805 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * iter;
#line 805 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("_equal",args,1);
#line 805 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == Sequence_SequenceIterator_program)
{
/*to do: Check so that it is an SequenceIterator */
struct Sequence_SequenceIterator_struct *i = 
OBJ2_SEQUENCE_SEQUENCEITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->sequence == i->sequence && THIS->pos == i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 814 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 818 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
}


}
/*! @decl int(0..1) `<(mixed iter)
     *!    Less then operator.
     *!
     *! @returns
     *!    Returns @tt{true@} if this iterator has a lower index
     *!    then @[iter].
     */ 

#define f_Sequence_SequenceIterator_cq__backtick_3C_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_3C_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_3C(INT32 args) {
#line 830 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * iter;
#line 830 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`<",args,1);
#line 830 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == Sequence_SequenceIterator_program)
{
/*to do: Check so that it is an SequenceIterator */
struct Sequence_SequenceIterator_struct *i = 
OBJ2_SEQUENCE_SEQUENCEITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->pos < i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 839 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("`<",1,"ADT.Sequence.SequenceIterator");
}
}


}
/*! @decl int(0..1) `>(mixed iter)
     *!    Greater then operator.
     *!
     *! @returns
     *!    Returns @tt{true@} if this iterator has a higher index
     *!    then @[iter].
     */


#define f_Sequence_SequenceIterator_cq__backtick_3E_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_cq__backtick_3E_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_cq__backtick_3E(INT32 args) {
#line 856 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * iter;
#line 856 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("`>",args,1);
#line 856 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == Sequence_SequenceIterator_program)
{
/*to do: Check so that it is an SequenceIterator */
struct Sequence_SequenceIterator_struct *i = 
OBJ2_SEQUENCE_SEQUENCEITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->pos > i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 865 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("`>",1,"ADT.Sequence.SequenceIterator");
}
}


}
/*! @decl int distance(object iter)
     *!
     *! @param iter
     *!    The iterator to measure the distance to.
     *! @returns
     *!    Returns distance between this iterator and @[iter].
     *! @throws
     *!    An error if the two iterator could not be compared.
     */ 

#define f_Sequence_SequenceIterator_distance_defined

#ifdef f_Sequence_SequenceIterator_distance_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_distance_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_distance_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_distance(INT32 args) {
#line 883 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct object * iter;
#line 883 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("distance",args,1);
#line 883 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("distance",1,"object");
#line 883 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
debug_malloc_pass(iter=Pike_sp[0-1].u.object);
{
if (iter->prog == Sequence_SequenceIterator_program)
{

struct Sequence_SequenceIterator_struct *i = 
OBJ2_SEQUENCE_SEQUENCEITERATOR(iter);
do { INT_TYPE ret_=((i->pos - THIS->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 891 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("distance",1,"ADT.Sequence.SequenceIterator");
}
}

}
/*! @decl Sequence get_collection()
     *!
     *! @returns
     *!    Returns the Sequence this iterator currently iterates over.
     */ 


#define f_Sequence_SequenceIterator_get_collection_defined

#ifdef f_Sequence_SequenceIterator_get_collection_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_get_collection_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_get_collection_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_get_collection(INT32 args) {
#line 905 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("get_collection",args,0);
{
do { struct object * ret_=(THIS->obj); add_ref(ret_);  push_object(ret_); return; }while(0);
#line 908 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
}


}
/*! @decl mixed set_value(mixed val)
     *!    Set the value at the current position.
     *!
     *! @param val
     *!    The new value.
     *! @returns
     *!    Returns the old value.
     */ 


#define f_Sequence_SequenceIterator_set_value_defined

#ifdef f_Sequence_SequenceIterator_set_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_SequenceIterator_set_value_fun_num = 0;

#endif /* f_Sequence_SequenceIterator_set_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_SequenceIterator_set_value(INT32 args) {
#line 921 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * val;
#line 921 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 1) wrong_number_of_args_error("set_value",args,1);
#line 921 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
val=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (THIS->sequence && THIS->sequence->a &&
THIS->pos < THIS->sequence->a->size)
{
struct svalue ind;
struct svalue retval;

/*if there is someone else using the array but the adapter */
if (THIS->sequence->a->refs > 1)
{
/*copy it */
free_array(THIS->sequence->a);
THIS->sequence->a = copy_array(THIS->sequence->a);
}

SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS->pos);
simple_array_index_no_free(&retval, THIS->sequence->a, &ind);
simple_set_index(THIS->sequence->a, &ind, val);
push_svalue(&retval);
}
else
{
push_undefined();
}
}

}

#undef internal_init_Sequence_SequenceIterator_defined
#define internal_init_Sequence_SequenceIterator_defined

#undef Sequence_SequenceIterator_event_handler_defined
#define Sequence_SequenceIterator_event_handler_defined
static void init_Sequence_SequenceIterator_struct(void)
#line 949 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
THIS->sequence=0;
THIS->pos=0;
THIS->obj = NULL;
}


#undef internal_exit_Sequence_SequenceIterator_defined
#define internal_exit_Sequence_SequenceIterator_defined

#undef Sequence_SequenceIterator_event_handler_defined
#define Sequence_SequenceIterator_event_handler_defined
static void exit_Sequence_SequenceIterator_struct(void)
#line 957 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
{
if( THIS->obj )
{
free_object(THIS->obj);
THIS->obj = NULL;
}
}


#ifdef Sequence_SequenceIterator_event_handler_defined
static void Sequence_SequenceIterator_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Sequence_SequenceIterator_defined
  case PROG_EVENT_INIT: init_Sequence_SequenceIterator_struct(); break;

#endif /* internal_init_Sequence_SequenceIterator_defined */

#ifdef internal_exit_Sequence_SequenceIterator_defined
  case PROG_EVENT_EXIT: exit_Sequence_SequenceIterator_struct(); break;

#endif /* internal_exit_Sequence_SequenceIterator_defined */
  default: break; 
  }
}

#endif /* Sequence_SequenceIterator_event_handler_defined */
/*End SequenceIterator */
/*! @endclass
  */

#define f_Sequence_cq__get_iterator_defined

#ifdef f_Sequence_cq__get_iterator_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_cq__get_iterator_fun_num = 0;

#endif /* f_Sequence_cq__get_iterator_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_cq__get_iterator(INT32 args) {
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
struct svalue * ind;
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args > 1) wrong_number_of_args_error("_get_iterator",args,1);
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_get_iterator",1,"void|int");
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
ind=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} else ind = NULL;
{
ref_push_object(Pike_fp->current_object);
if (ind)
{
push_svalue(ind);
}
push_object(clone_object(Sequence_SequenceIterator_program, args+1));
}



}
#define f_Sequence_first_defined

#ifdef f_Sequence_first_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_first_fun_num = 0;

#endif /* f_Sequence_first_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_first(INT32 args) {
#line 983 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("first",args,0);
{
ref_push_object(Pike_fp->current_object);
push_object(clone_object(Sequence_SequenceIterator_program, 1));
}



}
#define f_Sequence_last_defined

#ifdef f_Sequence_last_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Sequence_last_fun_num = 0;

#endif /* f_Sequence_last_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Sequence_last(INT32 args) {
#line 991 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
if(args != 0) wrong_number_of_args_error("last",args,0);
{
struct svalue ind;
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS_SEQUENCE->a->size);
ref_push_object(Pike_fp->current_object);
push_svalue(&ind);
push_object(clone_object(Sequence_SequenceIterator_program, 2));
}


}

#ifdef Sequence_event_handler_defined
static void Sequence_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Sequence_defined
  case PROG_EVENT_INIT: init_Sequence_struct(); break;

#endif /* internal_init_Sequence_defined */

#ifdef internal_exit_Sequence_defined
  case PROG_EVENT_EXIT: exit_Sequence_struct(); break;

#endif /* internal_exit_Sequence_defined */
  default: break; 
  }
}

#endif /* Sequence_event_handler_defined */
/*End of Sequence */
/*! @endclass    
  */

/*! @endmodule
 */


#line 1012 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
void pike_init_Sequence_module(void)
{

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( ___cmod_map_program_ids );

#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */

#ifdef class_Sequence_defined

#ifdef PROG_SEQUENCE_ID
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  START_NEW_PROGRAM_ID(SEQUENCE);
#else
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  start_new_program();

#endif /* PROG_SEQUENCE_ID */
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  Sequence_program = Pike_compiler->new_program;

#ifndef tObjImpl_SEQUENCE

#undef tObjIs_SEQUENCE
#define tObjIs_SEQUENCE "\3\1\177\0\0\2"

#undef tObjImpl_SEQUENCE
#define tObjImpl_SEQUENCE "\3\0\177\0\0\2"

#endif /* tObjImpl_SEQUENCE */

#ifdef THIS_SEQUENCE
  Sequence_storage_offset = ADD_STORAGE(struct Sequence_struct);
#endif /* THIS_SEQUENCE */

#ifdef class_Sequence_SequenceIterator_defined

#ifdef PROG_SEQUENCE_SEQUENCEITERATOR_ID
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  START_NEW_PROGRAM_ID(SEQUENCE_SEQUENCEITERATOR);
#else
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  start_new_program();

#endif /* PROG_SEQUENCE_SEQUENCEITERATOR_ID */
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  Sequence_SequenceIterator_program = Pike_compiler->new_program;

#ifndef tObjImpl_SEQUENCE_SEQUENCEITERATOR

#undef tObjIs_SEQUENCE_SEQUENCEITERATOR
#define tObjIs_SEQUENCE_SEQUENCEITERATOR "\3\1\177\0\0\3"

#undef tObjImpl_SEQUENCE_SEQUENCEITERATOR
#define tObjImpl_SEQUENCE_SEQUENCEITERATOR "\3\0\177\0\0\3"

#endif /* tObjImpl_SEQUENCE_SEQUENCEITERATOR */

#ifdef THIS_SEQUENCE_SEQUENCEITERATOR
  Sequence_SequenceIterator_storage_offset = ADD_STORAGE(struct Sequence_SequenceIterator_struct);
#endif /* THIS_SEQUENCE_SEQUENCEITERATOR */

#ifdef Sequence_SequenceIterator_event_handler_defined
  pike_set_prog_event_callback(Sequence_SequenceIterator_event_handler);

#ifndef Sequence_SequenceIterator_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Sequence_SequenceIterator_gc_live_obj */

#endif /* Sequence_SequenceIterator_event_handler_defined */

#ifdef f_Sequence_SequenceIterator_create_defined

#ifdef f_Sequence_SequenceIterator_create_fun_num_used
  f_Sequence_SequenceIterator_create_fun_num =
#endif /* f_Sequence_SequenceIterator_create_fun_num_used */
#line 584 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("create", f_Sequence_SequenceIterator_create, tFunc(tObj tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_create_defined */

#ifdef f_Sequence_SequenceIterator_index_defined

#ifdef f_Sequence_SequenceIterator_index_fun_num_used
  f_Sequence_SequenceIterator_index_fun_num =
#endif /* f_Sequence_SequenceIterator_index_fun_num_used */
#line 621 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("index", f_Sequence_SequenceIterator_index, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_index_defined */

#ifdef f_Sequence_SequenceIterator_value_defined

#ifdef f_Sequence_SequenceIterator_value_fun_num_used
  f_Sequence_SequenceIterator_value_fun_num =
#endif /* f_Sequence_SequenceIterator_value_fun_num_used */
#line 642 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("value", f_Sequence_SequenceIterator_value, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_value_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_add_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_add_fun_num_used */
#line 665 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`+", f_Sequence_SequenceIterator_cq__backtick_add, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_add_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_eq_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_add_eq_fun_num_used */
#line 693 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`+=", f_Sequence_SequenceIterator_cq__backtick_add_eq, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_add_eq_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_2D_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_2D_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_2D_fun_num_used */
#line 717 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`-", f_Sequence_SequenceIterator_cq__backtick_2D, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_2D_defined */

#ifdef f_Sequence_SequenceIterator_has_next_defined

#ifdef f_Sequence_SequenceIterator_has_next_fun_num_used
  f_Sequence_SequenceIterator_has_next_fun_num =
#endif /* f_Sequence_SequenceIterator_has_next_fun_num_used */
#line 744 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("has_next", f_Sequence_SequenceIterator_has_next, tFunc(tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_has_next_defined */

#ifdef f_Sequence_SequenceIterator_has_previous_defined

#ifdef f_Sequence_SequenceIterator_has_previous_fun_num_used
  f_Sequence_SequenceIterator_has_previous_fun_num =
#endif /* f_Sequence_SequenceIterator_has_previous_fun_num_used */
#line 767 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("has_previous", f_Sequence_SequenceIterator_has_previous, tFunc(tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_has_previous_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_21_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_21_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_21_fun_num_used */
#line 788 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`!", f_Sequence_SequenceIterator_cq__backtick_21, tFunc(tNone,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_21_defined */

#ifdef f_Sequence_SequenceIterator_cq__equal_defined

#ifdef f_Sequence_SequenceIterator_cq__equal_fun_num_used
  f_Sequence_SequenceIterator_cq__equal_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__equal_fun_num_used */
#line 805 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_equal", f_Sequence_SequenceIterator_cq__equal, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__equal_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_3C_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_3C_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_3C_fun_num_used */
#line 830 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`<", f_Sequence_SequenceIterator_cq__backtick_3C, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_3C_defined */

#ifdef f_Sequence_SequenceIterator_cq__backtick_3E_defined

#ifdef f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used
  f_Sequence_SequenceIterator_cq__backtick_3E_fun_num =
#endif /* f_Sequence_SequenceIterator_cq__backtick_3E_fun_num_used */
#line 856 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`>", f_Sequence_SequenceIterator_cq__backtick_3E, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_cq__backtick_3E_defined */

#ifdef f_Sequence_SequenceIterator_distance_defined

#ifdef f_Sequence_SequenceIterator_distance_fun_num_used
  f_Sequence_SequenceIterator_distance_fun_num =
#endif /* f_Sequence_SequenceIterator_distance_fun_num_used */
#line 883 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("distance", f_Sequence_SequenceIterator_distance, tFunc(tObj,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_distance_defined */

#ifdef f_Sequence_SequenceIterator_get_collection_defined

#ifdef f_Sequence_SequenceIterator_get_collection_fun_num_used
  f_Sequence_SequenceIterator_get_collection_fun_num =
#endif /* f_Sequence_SequenceIterator_get_collection_fun_num_used */
#line 905 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("get_collection", f_Sequence_SequenceIterator_get_collection, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_get_collection_defined */

#ifdef f_Sequence_SequenceIterator_set_value_defined

#ifdef f_Sequence_SequenceIterator_set_value_fun_num_used
  f_Sequence_SequenceIterator_set_value_fun_num =
#endif /* f_Sequence_SequenceIterator_set_value_fun_num_used */
#line 921 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("set_value", f_Sequence_SequenceIterator_set_value, tFunc(tMix,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_SequenceIterator_set_value_defined */
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  Sequence_SequenceIterator_program=end_program();
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#ifdef Sequence_SequenceIterator_program_fun_num_used
Sequence_SequenceIterator_program_fun_num=
#endif
 add_program_constant("SequenceIterator",Sequence_SequenceIterator_program,0);

#endif /* class_Sequence_SequenceIterator_defined */

#ifdef Sequence_event_handler_defined
  pike_set_prog_event_callback(Sequence_event_handler);

#ifndef Sequence_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Sequence_gc_live_obj */

#endif /* Sequence_event_handler_defined */

#ifdef f_Sequence_cq__backtick_5B_5D_defined

#ifdef f_Sequence_cq__backtick_5B_5D_fun_num_used
  f_Sequence_cq__backtick_5B_5D_fun_num =
#endif /* f_Sequence_cq__backtick_5B_5D_fun_num_used */
#line 69 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`[]", f_Sequence_cq__backtick_5B_5D, tFunc(tMix,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_5B_5D_defined */

#ifdef f_Sequence_cq__backtick_5B_5D_eq_defined

#ifdef f_Sequence_cq__backtick_5B_5D_eq_fun_num_used
  f_Sequence_cq__backtick_5B_5D_eq_fun_num =
#endif /* f_Sequence_cq__backtick_5B_5D_eq_fun_num_used */
#line 91 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`[]=", f_Sequence_cq__backtick_5B_5D_eq, tFunc(tMix tMix,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_5B_5D_eq_defined */

#ifdef f_Sequence_cq__backtick_add_defined

#ifdef f_Sequence_cq__backtick_add_fun_num_used
  f_Sequence_cq__backtick_add_fun_num =
#endif /* f_Sequence_cq__backtick_add_fun_num_used */
#line 110 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`+", f_Sequence_cq__backtick_add, tFuncV(tNone,tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_add_defined */

#ifdef f_Sequence_cq__backtick_2D_defined

#ifdef f_Sequence_cq__backtick_2D_fun_num_used
  f_Sequence_cq__backtick_2D_fun_num =
#endif /* f_Sequence_cq__backtick_2D_fun_num_used */
#line 146 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`-", f_Sequence_cq__backtick_2D, tFuncV(tNone,tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_2D_defined */

#ifdef f_Sequence_cq__backtick_26_defined

#ifdef f_Sequence_cq__backtick_26_fun_num_used
  f_Sequence_cq__backtick_26_fun_num =
#endif /* f_Sequence_cq__backtick_26_fun_num_used */
#line 183 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`&", f_Sequence_cq__backtick_26, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_26_defined */

#ifdef f_Sequence_cq__backtick_7C_defined

#ifdef f_Sequence_cq__backtick_7C_fun_num_used
  f_Sequence_cq__backtick_7C_fun_num =
#endif /* f_Sequence_cq__backtick_7C_fun_num_used */
#line 213 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`|", f_Sequence_cq__backtick_7C, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_7C_defined */

#ifdef f_Sequence_cq__backtick_5E_defined

#ifdef f_Sequence_cq__backtick_5E_fun_num_used
  f_Sequence_cq__backtick_5E_fun_num =
#endif /* f_Sequence_cq__backtick_5E_fun_num_used */
#line 245 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("`^", f_Sequence_cq__backtick_5E, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__backtick_5E_defined */

#ifdef f_Sequence_cq__equal_defined

#ifdef f_Sequence_cq__equal_fun_num_used
  f_Sequence_cq__equal_fun_num =
#endif /* f_Sequence_cq__equal_fun_num_used */
#line 270 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_equal", f_Sequence_cq__equal, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__equal_defined */

#ifdef f_Sequence_cq__indices_defined

#ifdef f_Sequence_cq__indices_fun_num_used
  f_Sequence_cq__indices_fun_num =
#endif /* f_Sequence_cq__indices_fun_num_used */
#line 287 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_indices", f_Sequence_cq__indices, tFunc(tNone,tArray), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__indices_defined */

#ifdef f_Sequence_cq__insert_element_defined

#ifdef f_Sequence_cq__insert_element_fun_num_used
  f_Sequence_cq__insert_element_fun_num =
#endif /* f_Sequence_cq__insert_element_fun_num_used */
#line 314 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_insert_element", f_Sequence_cq__insert_element, tFunc("\10\200\0\0\0\177\377\377\377" tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__insert_element_defined */

#ifdef f_Sequence_cq__remove_element_defined

#ifdef f_Sequence_cq__remove_element_fun_num_used
  f_Sequence_cq__remove_element_fun_num =
#endif /* f_Sequence_cq__remove_element_fun_num_used */
#line 332 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_remove_element", f_Sequence_cq__remove_element, tFunc("\10\200\0\0\0\177\377\377\377",tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__remove_element_defined */

#ifdef f_Sequence_cq__search_defined

#ifdef f_Sequence_cq__search_fun_num_used
  f_Sequence_cq__search_fun_num =
#endif /* f_Sequence_cq__search_fun_num_used */
#line 361 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_search", f_Sequence_cq__search, tFunc(tMix tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__search_defined */

#ifdef f_Sequence_cq__sizeof_defined

#ifdef f_Sequence_cq__sizeof_fun_num_used
  f_Sequence_cq__sizeof_fun_num =
#endif /* f_Sequence_cq__sizeof_fun_num_used */
#line 383 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_sizeof", f_Sequence_cq__sizeof, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__sizeof_defined */

#ifdef f_Sequence_cq__values_defined

#ifdef f_Sequence_cq__values_fun_num_used
  f_Sequence_cq__values_fun_num =
#endif /* f_Sequence_cq__values_fun_num_used */
#line 394 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_values", f_Sequence_cq__values, tFunc(tNone,tArray), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__values_defined */

#ifdef f_Sequence_add_defined

#ifdef f_Sequence_add_fun_num_used
  f_Sequence_add_fun_num =
#endif /* f_Sequence_add_fun_num_used */
#line 409 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("add", f_Sequence_add, tFunc(tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_add_defined */

#ifdef f_Sequence_cast_defined

#ifdef f_Sequence_cast_fun_num_used
  f_Sequence_cast_fun_num =
#endif /* f_Sequence_cast_fun_num_used */
#line 432 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("cast", f_Sequence_cast, tFunc(tStr,tArray), ID_PROTECTED, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cast_defined */

#ifdef f_Sequence_clear_defined

#ifdef f_Sequence_clear_fun_num_used
  f_Sequence_clear_fun_num =
#endif /* f_Sequence_clear_fun_num_used */
#line 447 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("clear", f_Sequence_clear, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_clear_defined */

#ifdef f_Sequence_delete_value_defined

#ifdef f_Sequence_delete_value_fun_num_used
  f_Sequence_delete_value_fun_num =
#endif /* f_Sequence_delete_value_fun_num_used */
#line 464 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("delete_value", f_Sequence_delete_value, tFunc(tMix,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_delete_value_defined */

#ifdef f_Sequence_is_empty_defined

#ifdef f_Sequence_is_empty_fun_num_used
  f_Sequence_is_empty_fun_num =
#endif /* f_Sequence_is_empty_fun_num_used */
#line 481 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("is_empty", f_Sequence_is_empty, tFunc(tNone,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_is_empty_defined */

#ifdef f_Sequence_max_size_defined

#ifdef f_Sequence_max_size_fun_num_used
  f_Sequence_max_size_fun_num =
#endif /* f_Sequence_max_size_fun_num_used */
#line 492 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("max_size", f_Sequence_max_size, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_max_size_defined */

#ifdef f_Sequence_create_defined

#ifdef f_Sequence_create_fun_num_used
  f_Sequence_create_fun_num =
#endif /* f_Sequence_create_fun_num_used */
#line 503 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("create", f_Sequence_create, tFunc(tOr(tArray,"\10\200\0\0\0\177\377\377\377"),tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_create_defined */

#ifdef f_Sequence_cq__get_iterator_defined

#ifdef f_Sequence_cq__get_iterator_fun_num_used
  f_Sequence_cq__get_iterator_fun_num =
#endif /* f_Sequence_cq__get_iterator_fun_num_used */
#line 971 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("_get_iterator", f_Sequence_cq__get_iterator, tFunc(tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_cq__get_iterator_defined */

#ifdef f_Sequence_first_defined

#ifdef f_Sequence_first_fun_num_used
  f_Sequence_first_fun_num =
#endif /* f_Sequence_first_fun_num_used */
#line 983 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("first", f_Sequence_first, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_first_defined */

#ifdef f_Sequence_last_defined

#ifdef f_Sequence_last_fun_num_used
  f_Sequence_last_fun_num =
#endif /* f_Sequence_last_fun_num_used */
#line 991 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    ADD_FUNCTION2("last", f_Sequence_last, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Sequence_last_defined */
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
  Sequence_program=end_program();
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
#ifdef Sequence_program_fun_num_used
Sequence_program_fun_num=
#endif
 add_program_constant("Sequence",Sequence_program,0);

#endif /* class_Sequence_defined */

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( 0 );
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
#line 1014 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
;
}

void pike_exit_Sequence_module(void)
{

#ifdef class_Sequence_defined

#ifdef class_Sequence_SequenceIterator_defined
  if(Sequence_SequenceIterator_program) {
#line 571 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    free_program(Sequence_SequenceIterator_program);
    Sequence_SequenceIterator_program=0;
  }

#endif /* class_Sequence_SequenceIterator_defined */
  if(Sequence_program) {
#line 36 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
    free_program(Sequence_program);
    Sequence_program=0;
  }

#endif /* class_Sequence_defined */
#line 1020 "/home/hww3/pike-git/src/post_modules/_ADT/sequence.cmod"
} 




#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
static int ___cmod_map_program_ids(int id)
{
  int i = 0;
  if( (id&0x7f000000) != 0x7f000000 ) return id;
  id = id&0x00ffffff;
#ifdef class_Sequence_defined
if(id==2) return Sequence_program->id;
#endif
#ifdef class_Sequence_SequenceIterator_defined
if(id==3) return Sequence_SequenceIterator_program->id;
#endif
  return 0;
}
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
