/* Generated from "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod" by precompile.pike running Pike v8.0 release 709
 *
 * 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 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#line 3003 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"







#line 3010 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"
#line 1 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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 "pike_types.h"

#include "program_id.h"

#include "module_support.h"
#include "sequence.h"
#include "circular_list.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_CircularList_add_fun_num_used 1
#else
#undef f_CircularList_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_allocate_fun_num_used 1
#else
#undef f_CircularList_allocate_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cast_fun_num_used 1
#else
#undef f_CircularList_cast_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_clear_fun_num_used 1
#else
#undef f_CircularList_clear_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_is_empty_fun_num_used 1
#else
#undef f_CircularList_is_empty_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_max_size_fun_num_used 1
#else
#undef f_CircularList_max_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_pop_back_fun_num_used 1
#else
#undef f_CircularList_pop_back_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_create_fun_num_used 1
#else
#undef f_CircularList_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_first_fun_num_used 1
#else
#undef f_CircularList_first_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_last_fun_num_used 1
#else
#undef f_CircularList_last_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define CircularList_program_fun_num_used 1
#else
#undef CircularList_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_push_front_fun_num_used 1
#else
#undef f_CircularList_push_front_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__get_iterator_fun_num_used 1
#else
#undef f_CircularList_cq__get_iterator_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_peek_front_fun_num_used 1
#else
#undef f_CircularList_peek_front_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_delete_value_fun_num_used 1
#else
#undef f_CircularList_delete_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_peek_back_fun_num_used 1
#else
#undef f_CircularList_peek_back_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_pop_front_fun_num_used 1
#else
#undef f_CircularList_pop_front_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_push_back_fun_num_used 1
#else
#undef f_CircularList_push_back_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_get_collection_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_get_collection_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_set_value_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_set_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_create_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_has_previous_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_has_previous_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_distance_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_distance_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define CircularList_CircularListIterator_program_fun_num_used 1
#else
#undef CircularList_CircularListIterator_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__equal_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__equal_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_index_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_index_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_has_next_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_has_next_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_CircularListIterator_value_fun_num_used 1
#else
#undef f_CircularList_CircularListIterator_value_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__backtick_5B_5D_fun_num_used 1
#else
#undef f_CircularList_cq__backtick_5B_5D_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__values_fun_num_used 1
#else
#undef f_CircularList_cq__values_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__insert_element_fun_num_used 1
#else
#undef f_CircularList_cq__insert_element_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__indices_fun_num_used 1
#else
#undef f_CircularList_cq__indices_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__backtick_5B_5D_eq_fun_num_used 1
#else
#undef f_CircularList_cq__backtick_5B_5D_eq_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__backtick_add_fun_num_used 1
#else
#undef f_CircularList_cq__backtick_add_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__search_fun_num_used 1
#else
#undef f_CircularList_cq__search_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__equal_fun_num_used 1
#else
#undef f_CircularList_cq__equal_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__remove_element_fun_num_used 1
#else
#undef f_CircularList_cq__remove_element_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_CircularList_cq__sizeof_fun_num_used 1
#else
#undef f_CircularList_cq__sizeof_fun_num_used
#endif
/*! @class CircularList
 *! This is an circular list implemented by an array. It has a constant time 
 *! complexity for pop and push. It has a limited max size but it can be 
 *! increased with the method allocate.
 *! 
 */


#undef class_CircularList_defined
#define class_CircularList_defined
DEFAULT_CMOD_STORAGE struct program *CircularList_program=NULL;

#ifdef CircularList_program_fun_num_used
DEFAULT_CMOD_STORAGE int CircularList_program_fun_num=-1;
#endif /* CircularList_program_fun_num_used */

#undef var_pos_CircularList_defined
#define var_pos_CircularList_defined

#undef var_a_CircularList_defined
#define var_a_CircularList_defined

#undef var_size_CircularList_defined
#define var_size_CircularList_defined

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

#undef THIS_CIRCULARLIST
#define THIS_CIRCULARLIST ((struct CircularList_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_CIRCULARLIST
#define OBJ2_CIRCULARLIST(o) ((struct CircularList_struct *)(o->storage+CircularList_storage_offset))

#undef GET_CIRCULARLIST_STORAGE
#define GET_CIRCULARLIST_STORAGE(o) ((struct CircularList_struct *)(o->storage+CircularList_storage_offset)
static ptrdiff_t CircularList_storage_offset;
struct CircularList_struct {

#ifdef var_pos_CircularList_defined
#line 43 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
int pos;
#endif /* var_pos_CircularList_defined */

#ifdef var_a_CircularList_defined
#line 44 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct array *a;
#endif /* var_a_CircularList_defined */

#ifdef var_size_CircularList_defined
#line 45 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
int size;
#endif /* var_size_CircularList_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct CircularList_struct *CircularList_gdb_dummy_ptr;
#endif
/*if there is more than one reference to this array copy it. */

#line 50 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
static inline void should_copy(void)
{
if (THIS->a->refs > 1)
{
free_array(THIS->a);
THIS->a = copy_array(THIS->a);
}
} 


/*convert an index in the circular list to the index in the underlaying array */
/*add the pos and take modulo of the size */
static inline int circ2array(int index)
{
return (index+THIS->pos)%THIS->a->size;
}

/*convert an index in the underlaying array to the array in the circular list */
static inline int array2circ(int index)
{
return (index-THIS->pos)%THIS->a->size;
}



/*! @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_CircularList_cq__backtick_5B_5D_defined

#ifdef f_CircularList_cq__backtick_5B_5D_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__backtick_5B_5D_fun_num = 0;

#endif /* f_CircularList_cq__backtick_5B_5D_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__backtick_5B_5D(INT32 args) {
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE index;
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`[]",args,1);
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`[]",1,"int");
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
index=Pike_sp[0-1].u.integer;
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
struct svalue ind;
FIX_AND_CHECK_INDEX(index, THIS->size, 0);
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, circ2array(index));
simple_array_index_no_free(Pike_sp, THIS->a, &ind);
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]
 *!
 *! @throws 
 *!   An error if the index is out of range.
 */

#define f_CircularList_cq__backtick_5B_5D_eq_defined

#ifdef f_CircularList_cq__backtick_5B_5D_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__backtick_5B_5D_eq_fun_num = 0;

#endif /* f_CircularList_cq__backtick_5B_5D_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__backtick_5B_5D_eq(INT32 args) {
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE index;
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 2) wrong_number_of_args_error("`[]=",args,2);
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-2]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`[]=",1,"int");
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
index=Pike_sp[0-2].u.integer;
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+1-2; dmalloc_touch_svalue(Pike_sp+1-2);
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
struct svalue ind;
FIX_AND_CHECK_INDEX(index, THIS->size, 0);
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, circ2array(index));
should_copy();
simple_set_index(THIS->a, &ind, value);
pop_n_elems(args);
} 


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


#define f_CircularList_cq__backtick_add_defined

#ifdef f_CircularList_cq__backtick_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__backtick_add_fun_num = 0;

#endif /* f_CircularList_cq__backtick_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__backtick_add(INT32 args) {
#line 138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * coll;
#line 138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if (args > 0) {
  INT32 argcnt = 0;
  do {
    dmalloc_touch_svalue(Pike_sp+0+argcnt-args);
#line 138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0+argcnt-args]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("`+",1+argcnt,"object");
#line 138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  } while (++argcnt < args-0);
  coll=Pike_sp+0-args;
} else coll = NULL;
#line 139 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
struct array *a;
struct CircularList_struct *tmpList;
int start=0;
int i;
ptrdiff_t sz = THIS->size;

for (i=0; i < args; i++) {
/* FIXME: Ought to work on collection classes too */
if (coll[i].u.object->prog == CircularList_program)
{
tmpList = OBJ2_CIRCULARLIST(coll[i].u.object);
sz += tmpList->size;
}
else
{
SIMPLE_BAD_ARG_ERROR("`+",i+1,"ADT.CircularList");
}
}

/* Allocate double the space, so that we can grow. */
push_array(a = allocate_array_no_init(sz*2, 0));

a->type_field = 0;

for (i = -1; i < args; i++) {
if (i >= 0) {
tmpList = OBJ2_CIRCULARLIST(coll[i].u.object);
} else {
tmpList = THIS;
}
a->type_field |= tmpList->a->type_field;

if (tmpList->pos + tmpList->size > tmpList->a->size) {
/*if the list pass the end of the array do it in two parts */
int tmp = tmpList->a->size - tmpList->pos;

assign_svalues_no_free(ITEM(a)+start, 
ITEM(tmpList->a) + tmpList->pos, 
tmp, 
tmpList->a->type_field);

assign_svalues_no_free(ITEM(a)+(tmp+start), 
ITEM(tmpList->a), 
tmpList->size-tmp, 
tmpList->a->type_field);
} else {
/*just do it direct */

assign_svalues_no_free(ITEM(a)+start, 
ITEM(tmpList->a) + tmpList->pos, 
tmpList->size, 
tmpList->a->type_field);
}
start += tmpList->size;
}

/*put the added array in a CircularList and return it */
{
struct object *o=clone_object(CircularList_program, 1);
OBJ2_CIRCULARLIST(o)->size = sz;

push_object(o);
}
}


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


#define f_CircularList_cq__equal_defined

#ifdef f_CircularList_cq__equal_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__equal_fun_num = 0;

#endif /* f_CircularList_cq__equal_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__equal(INT32 args) {
#line 214 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * coll;
#line 214 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("_equal",args,1);
#line 214 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
coll=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*coll) == T_OBJECT &&
coll->u.object->prog == CircularList_program)
{
struct CircularList_struct *list = OBJ2_CIRCULARLIST(coll->u.object);
struct processing curr;
INT32 e;
INT32 a_pos = THIS->pos;
INT32 b_pos = list->pos;
struct array *a = THIS->a;
struct array *b = list->a;

if(a == b) do { INT_TYPE ret_=(1); pop_stack(); push_int(ret_); return; }while(0);
#line 228 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(THIS->size != list->size) do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 229 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(!THIS->size) do { INT_TYPE ret_=(1); pop_stack(); push_int(ret_); return; }while(0);
#line 231 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#ifdef PIKE_DEBUG
 if(d_flag > 1)
{
array_check_type_field(a);
array_check_type_field(b);
}
#endif
 
/* This could be done much better if I KNEW that
       * the type fields didn't contain types that
       * really aren't in the array
       */
if(!(a->type_field & b->type_field) &&
!( (a->type_field | b->type_field) & BIT_OBJECT ))
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 247 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
curr.pointer_a = a;
curr.pointer_b = b;
curr.next = 0;


for(e=0; e<THIS->size; e++)
{
if (a_pos >= a->size)
{
a_pos=0;
}
if (b_pos >= b->size)
{
b_pos=0;
}
if(!low_is_equal(ITEM(a)+a_pos, ITEM(b)+b_pos, &curr))
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 264 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
a_pos++;
b_pos++;
}
do { INT_TYPE ret_=(1); pop_stack(); push_int(ret_); return; }while(0);
#line 268 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 270 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

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

#define f_CircularList_cq__indices_defined

#ifdef f_CircularList_cq__indices_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__indices_fun_num = 0;

#endif /* f_CircularList_cq__indices_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__indices(INT32 args) {
#line 278 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("_indices",args,0);
{
ptrdiff_t size = THIS->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 290 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

}
/*! @decl void _insert_element(int index, mixed value)
 *! Insert an element in the list 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.
 *!
 *! @throws 
 *!   An error if the index is out of range.
 *!
 */

#define f_CircularList_cq__insert_element_defined

#ifdef f_CircularList_cq__insert_element_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__insert_element_fun_num = 0;

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

}

}
/*! @decl mixed _remove_element(int index)
 *!  Remove the values at index @[index] from the list.
 *! 
 *! @param index 
 *!   The index to remove.
 *!
 *! @returns
 *!   The removed value.
 *!
 *! @throws 
 *!   An error if the index is out of range.
 */

#define f_CircularList_cq__remove_element_defined

#ifdef f_CircularList_cq__remove_element_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__remove_element_fun_num = 0;

#endif /* f_CircularList_cq__remove_element_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__remove_element(INT32 args) {
#line 331 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE index;
#line 331 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("_remove_element",args,1);
#line 331 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_remove_element",1,"int");
#line 331 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
index=Pike_sp[0-1].u.integer;
{
struct svalue s;

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

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


}
/*! @decl int _search(mixed value, void|int start)
 *!   Search the list 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@}.
 *!
 *! @throws 
 *!   An error if the start is out of range.
 */

#define f_CircularList_cq__search_defined

#ifdef f_CircularList_cq__search_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__search_fun_num = 0;

#endif /* f_CircularList_cq__search_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__search(INT32 args) {
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * start;
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args < 1) wrong_number_of_args_error("_search",args,1);
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args > 2) wrong_number_of_args_error("_search",args,2);
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if ((args > 1) &&
    ((TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[1-args]) != NUMBER_UNDEFINED))) {
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("_search",2,"void|int");
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
start=Pike_sp+1-args; dmalloc_touch_svalue(Pike_sp+1-args);
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
} else start = NULL;
{
int s;
int retval;
if(start)
{
if (TYPEOF(*start) != PIKE_T_INT)
{
SIMPLE_BAD_ARG_ERROR("_search",2,"int");
}
if(start->u.integer <0 || start->u.integer>=THIS->size) {
if (THIS->a->size) {
Pike_error("Start %"PRINTPIKEINT"d is out of array range 0 - %d.\n",
start->u.integer, 
THIS->size-1);
} else {
Pike_error("Attempt to index the empty array with %"PRINTPIKEINT"d.\n",
start->u.integer);
}
}
s = circ2array(start->u.integer);
retval = array2circ(array_search(THIS->a, value, s));
}
else 
{
retval = array2circ(array_search(THIS->a,value,0));
}
if (retval >= THIS->size || retval < 0)
{
retval = -1;
}
do { INT_TYPE ret_=(retval); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 398 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

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

#define f_CircularList_cq__sizeof_defined

#ifdef f_CircularList_cq__sizeof_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__sizeof_fun_num = 0;

#endif /* f_CircularList_cq__sizeof_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__sizeof(INT32 args) {
#line 406 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("_sizeof",args,0);
{
do { INT_TYPE ret_=(THIS->size);  push_int(ret_); return; }while(0);
#line 409 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

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

#define f_CircularList_cq__values_defined

#ifdef f_CircularList_cq__values_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__values_fun_num = 0;

#endif /* f_CircularList_cq__values_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cq__values(INT32 args) {
#line 417 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("_values",args,0);
{
struct array *a;
int end;
int tmp;

a=allocate_array_no_init(THIS->size, 0);
a->type_field = THIS->a->type_field;
end = circ2array(THIS->size);

if (end <= THIS->pos && THIS->size > 0)
{
/*if the list pass the end of the array do it in two parts */
tmp = THIS->a->size - THIS->pos;

assign_svalues_no_free(ITEM(a), ITEM(THIS->a) + THIS->pos, 
tmp, THIS->a->type_field);

assign_svalues_no_free(ITEM(a)+tmp, ITEM(THIS->a), 
THIS->size-tmp, THIS->a->type_field);
}
else
{
/*just do it direct */

assign_svalues_no_free(ITEM(a), ITEM(THIS->a) + THIS->pos, 
THIS->size, THIS->a->type_field);
}
do { struct array * ret_=(a);  push_array(ret_); return; }while(0);
#line 446 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}


}
/*! @decl void add(mixed value)
 *!   Add a value at the front of the list
 *!
 *! @param value
 *!   The value to add.
 *!
 *! @throws 
 *!   An error if the list is full.
 */

#define f_CircularList_add_defined

#ifdef f_CircularList_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_add_fun_num = 0;

#endif /* f_CircularList_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_add(INT32 args) {
#line 459 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 459 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("add",args,1);
#line 459 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
struct svalue ind;
if (THIS->size == THIS->a->size)
{
Pike_error("The list is full, could not add value, please allocate more space.\n");
}
should_copy();
THIS->pos--;
if (THIS->pos < 0)
{
THIS->pos=THIS->a->size-1;
}
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS->pos);
simple_set_index(THIS->a, &ind, value);
THIS->size++;
pop_n_elems(args);
}

}
/*! @decl void allocate(int elements)
   *! Increase the maxsize of the CircularlList.
   *!
   *! @param elements
   *!       Add this number of new elements to the list.
   */

#define f_CircularList_allocate_defined

#ifdef f_CircularList_allocate_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_allocate_fun_num = 0;

#endif /* f_CircularList_allocate_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_allocate(INT32 args) {
#line 485 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE elements;
#line 485 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("allocate",args,1);
#line 485 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("allocate",1,"int");
#line 485 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
elements=Pike_sp[0-1].u.integer;
{
INT32 size = THIS->a->size+elements;
INT32 endpos = THIS->a->size - THIS->pos; /*distanse of pos from the end */
if (elements <= 0)
{
Pike_error("Allocate expects a value larger than zero.\n");
}
if(THIS->a->refs <= 1 && THIS->a->malloced_size >= size)
{
THIS->a->size = size;
if (THIS->size > 0)
{
memmove(ITEM(THIS->a)+(size-endpos),
ITEM(THIS->a)+(THIS->pos),
(endpos) * sizeof(struct svalue));
THIS->pos = size-endpos;
}
while(elements) {
SET_SVAL(ITEM(THIS->a)[THIS->pos - elements], T_INT, NUMBER_NUMBER,
integer, 0);
elements--;
}
THIS->a->type_field |= BIT_INT;
}
else
{
struct array *a;
a=allocate_array_no_init(size, (THIS->a->size >> 1) + 4);
a->type_field = THIS->a->type_field;
if (THIS->size >0)
{
/*copy from pos to end */
assign_svalues_no_free(ITEM(a), 
ITEM(THIS->a)+(THIS->pos), 
endpos, 
THIS->a->type_field);
/*copy from start to size */
assign_svalues_no_free(ITEM(a)+endpos, 
ITEM(THIS->a), 
THIS->size-endpos, 
THIS->a->type_field);
}
free_array(THIS->a);
THIS->a=a;
THIS->pos=0;
}
pop_n_elems(args);
}

}
/*! @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 list to an array.
 *!   @endstring
 *!
 *! @returns
 *!   An array with the contents of this list.
 */

#define f_CircularList_cast_defined

#ifdef f_CircularList_cast_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cast_fun_num = 0;

#endif /* f_CircularList_cast_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_cast(INT32 args) {
#line 551 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct pike_string * type;
#line 551 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("cast",args,1);
#line 551 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("cast",1,"string");
#line 551 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
debug_malloc_pass(type=Pike_sp[0-1].u.string);
#line 553 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
pop_n_elems(args); /* type as at least one more reference. */
if (type == literal_array_string)
{
struct array *a;
int end;
int tmp;

a=allocate_array_no_init(THIS->size, 0);
a->type_field = THIS->a->type_field;
end = circ2array(THIS->size);

if (end < THIS->pos)
{
/*if the list pass the end of the array do it in two parts */
tmp = THIS->a->size - THIS->pos;

assign_svalues_no_free(ITEM(a), ITEM(THIS->a) + THIS->pos, 
tmp, THIS->a->type_field);

assign_svalues_no_free(ITEM(a)+tmp, ITEM(THIS->a), 
THIS->size-tmp, THIS->a->type_field);
}
else
{
/*just do it direct */

assign_svalues_no_free(ITEM(a), ITEM(THIS->a) + THIS->pos, 
THIS->size, THIS->a->type_field);
}
push_array(a);

}
else
push_undefined();
}

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

#define f_CircularList_clear_defined

#ifdef f_CircularList_clear_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_clear_fun_num = 0;

#endif /* f_CircularList_clear_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_clear(INT32 args) {
#line 595 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("clear",args,0);
{
int oldsize;
should_copy();
oldsize = THIS->a->size;
THIS->a = resize_array(THIS->a, 0);
THIS->a = resize_array(THIS->a, oldsize);
THIS->size =0;
THIS->pos =0;
} 

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

#define f_CircularList_delete_value_defined

#ifdef f_CircularList_delete_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_delete_value_fun_num = 0;

#endif /* f_CircularList_delete_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_delete_value(INT32 args) {
#line 617 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 617 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("delete_value",args,1);
#line 617 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
INT32 index = array_search(THIS->a, value, THIS->pos);
INT32 pos = array2circ(index);
if (pos < THIS->size && index > -1)
{
should_copy();
THIS->a = array_remove(THIS->a, index);
THIS->size--;
do { INT_TYPE ret_=(pos); pop_stack(); push_int(ret_); return; }while(0);
#line 627 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
do { INT_TYPE ret_=(-1); pop_stack(); push_int(ret_); return; }while(0);
#line 631 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
}

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

#define f_CircularList_is_empty_defined

#ifdef f_CircularList_is_empty_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_is_empty_fun_num = 0;

#endif /* f_CircularList_is_empty_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_is_empty(INT32 args) {
#line 640 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("is_empty",args,0);
{
do { INT_TYPE ret_=(!(THIS->size));  push_int(ret_); return; }while(0);
#line 643 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

}
/*! @decl int max_size()
   *!
   *! @returns
   *!   Returns the maximal size of this list.
   */

#define f_CircularList_max_size_defined

#ifdef f_CircularList_max_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_max_size_fun_num = 0;

#endif /* f_CircularList_max_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_max_size(INT32 args) {
#line 651 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("max_size",args,0);
{
do { INT_TYPE ret_=(THIS->a->size);  push_int(ret_); return; }while(0);
#line 654 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}

}
/*! @decl mixed peek_back()
   *!
   *! @returns
   *!    The value at the back of the list but do not remove it from the list.
   */

#define f_CircularList_peek_back_defined

#ifdef f_CircularList_peek_back_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_peek_back_fun_num = 0;

#endif /* f_CircularList_peek_back_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_peek_back(INT32 args) {
#line 662 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("peek_back",args,0);
{
struct svalue ind;
if (THIS->size <= 0)
{
Pike_error("Can not peek an empty list.\n");
}
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, circ2array(THIS->size-1));
simple_array_index_no_free(Pike_sp, THIS->a, &ind);
Pike_sp++;
}

}
/*! @decl mixed peek_front()
   *!
   *! @returns
   *!    The value at the front of the list but do not remove it from the list.
   */

#define f_CircularList_peek_front_defined

#ifdef f_CircularList_peek_front_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_peek_front_fun_num = 0;

#endif /* f_CircularList_peek_front_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_peek_front(INT32 args) {
#line 680 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("peek_front",args,0);
{
struct svalue ind;
if (THIS->size == 0)
{
Pike_error("Can not peek an empty list.\n");
}
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS->pos);
simple_array_index_no_free(Pike_sp, THIS->a, &ind);
Pike_sp++;
}

}
/*! @decl mixed pop_back()
   *! 
   *! Remove the value at the back of the list and return it.
   *!
   *! @returns
   *!    The value at the back of the list.
   */

#define f_CircularList_pop_back_defined

#ifdef f_CircularList_pop_back_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_pop_back_fun_num = 0;

#endif /* f_CircularList_pop_back_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_pop_back(INT32 args) {
#line 700 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("pop_back",args,0);
{
struct svalue ind;
struct svalue zero;
if (THIS->size <= 0)
{
Pike_error("Can not pop an empty list.\n");
}

should_copy();
THIS->size--;
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, circ2array(THIS->size));
SET_SVAL(zero, T_INT, NUMBER_NUMBER, integer, 0);
simple_array_index_no_free(Pike_sp, THIS->a, &ind);
simple_set_index(THIS->a, &ind, &zero);
Pike_sp++;
}


}
/*! @decl mixed pop_front()
   *! 
   *! Remove the value at the front of the list and return it.
   *!
   *! @returns
   *!    The value at the front of the list.
   */

#define f_CircularList_pop_front_defined

#ifdef f_CircularList_pop_front_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_pop_front_fun_num = 0;

#endif /* f_CircularList_pop_front_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_pop_front(INT32 args) {
#line 727 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("pop_front",args,0);
{
struct svalue ind;
struct svalue zero;
if (THIS->size == 0)
{
Pike_error("Can not pop an empty list.\n");
}

should_copy();
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS->pos);
SET_SVAL(zero, T_INT, NUMBER_NUMBER, integer, 0);
if (++THIS->pos >= THIS->a->size)
{
THIS->pos = 0;
}
THIS->size--;
simple_array_index_no_free(Pike_sp, THIS->a, &ind);
simple_set_index(THIS->a, &ind, &zero);
Pike_sp++;
}


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

#define f_CircularList_push_back_defined

#ifdef f_CircularList_push_back_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_push_back_fun_num = 0;

#endif /* f_CircularList_push_back_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_push_back(INT32 args) {
#line 758 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 758 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("push_back",args,1);
#line 758 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
struct svalue ind;
should_copy();
if (THIS->size == THIS->a->size)
{
Pike_error("The list is full, could not add value, please allocate more memory.\n");
}

SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, circ2array(THIS->size));
THIS->size++;
simple_set_index(THIS->a, &ind, value);
}


}
/*! @decl void push_front(mixed value)
   *!
   *! Add a new value at the front of the list.
   *!
   *! @param value
   *!    The value to add.
   */

#define f_CircularList_push_front_defined

#ifdef f_CircularList_push_front_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_push_front_fun_num = 0;

#endif /* f_CircularList_push_front_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_push_front(INT32 args) {
#line 781 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * value;
#line 781 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("push_front",args,1);
#line 781 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
value=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
struct svalue ind;
if (THIS->size == THIS->a->size)
{
Pike_error("The list is full, could not add value, please allocate more space.\n");
}
should_copy();
THIS->pos--;
if (THIS->pos < 0)
{
THIS->pos=THIS->a->size-1;
}
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS->pos);
simple_set_index(THIS->a, &ind, value);
THIS->size++;
pop_n_elems(args);
}


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

#define f_CircularList_create_defined

#ifdef f_CircularList_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_create_fun_num = 0;

#endif /* f_CircularList_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_create(INT32 args) {
#line 806 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * arg;
#line 806 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 806 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
arg=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*arg) == T_INT)
{
THIS->a =allocate_array_no_init(arg->u.integer, 0);
THIS->a->type_field = BIT_INT;
}
else if (TYPEOF(*arg) == T_ARRAY)
{
add_ref(THIS->a=arg->u.array);
THIS->size=THIS->a->size;
}

pop_n_elems(args);
}

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



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


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



#undef internal_init_CircularList_defined
#define internal_init_CircularList_defined

#undef CircularList_event_handler_defined
#define CircularList_event_handler_defined
static void init_CircularList_struct(void)
#line 855 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
THIS->a=NULL;
THIS->pos=0;
THIS->size=0;
}


#undef internal_exit_CircularList_defined
#define internal_exit_CircularList_defined

#undef CircularList_event_handler_defined
#define CircularList_event_handler_defined
static void exit_CircularList_struct(void)
#line 863 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
if( THIS->a )
{
free_array(THIS->a);
THIS->a = NULL;
}
}



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


#undef class_CircularList_CircularListIterator_defined
#define class_CircularList_CircularListIterator_defined
DEFAULT_CMOD_STORAGE struct program *CircularList_CircularListIterator_program=NULL;

#ifdef CircularList_CircularListIterator_program_fun_num_used
DEFAULT_CMOD_STORAGE int CircularList_CircularListIterator_program_fun_num=-1;
#endif /* CircularList_CircularListIterator_program_fun_num_used */

#undef var_pos_CircularList_CircularListIterator_defined
#define var_pos_CircularList_CircularListIterator_defined

#undef var_list_CircularList_CircularListIterator_defined
#define var_list_CircularList_CircularListIterator_defined

#undef var_obj_CircularList_CircularListIterator_defined
#define var_obj_CircularList_CircularListIterator_defined

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

#undef THIS_CIRCULARLIST_CIRCULARLISTITERATOR
#define THIS_CIRCULARLIST_CIRCULARLISTITERATOR ((struct CircularList_CircularListIterator_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR
#define OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(o) ((struct CircularList_CircularListIterator_struct *)(o->storage+CircularList_CircularListIterator_storage_offset))

#undef GET_CIRCULARLIST_CIRCULARLISTITERATOR_STORAGE
#define GET_CIRCULARLIST_CIRCULARLISTITERATOR_STORAGE(o) ((struct CircularList_CircularListIterator_struct *)(o->storage+CircularList_CircularListIterator_storage_offset)
static ptrdiff_t CircularList_CircularListIterator_storage_offset;
struct CircularList_CircularListIterator_struct {

#ifdef var_pos_CircularList_CircularListIterator_defined
#line 880 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
int pos;
#endif /* var_pos_CircularList_CircularListIterator_defined */

#ifdef var_list_CircularList_CircularListIterator_defined
#line 881 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct CircularList_struct *list;
#endif /* var_list_CircularList_CircularListIterator_defined */

#ifdef var_obj_CircularList_CircularListIterator_defined
#line 882 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct object *obj;
#endif /* var_obj_CircularList_CircularListIterator_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct CircularList_CircularListIterator_struct *CircularList_CircularListIterator_gdb_dummy_ptr;
#endif
/*! @decl void create(object list, void|int start)
   *!   Creates a new iterator for the CircularList @[list]. If @[start] is
   *!   supplied it will try to position the iterator at @[start].
   *! 
   */

#define f_CircularList_CircularListIterator_create_defined

#ifdef f_CircularList_CircularListIterator_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_create_fun_num = 0;

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

if (list->prog != CircularList_program)
{
SIMPLE_BAD_ARG_ERROR("create",1,"ADT.CircularList");

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

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

#define f_CircularList_CircularListIterator_index_defined

#ifdef f_CircularList_CircularListIterator_index_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_index_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_index_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_index(INT32 args) {
#line 928 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("index",args,0);
{
if(!THIS->list || 
!THIS->list->a || 
THIS->pos >= THIS->list->size) 
{
push_undefined();
}
else
{
do { INT_TYPE ret_=(THIS->pos);  push_int(ret_); return; }while(0);
#line 939 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
}


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

#define f_CircularList_CircularListIterator_value_defined

#ifdef f_CircularList_CircularListIterator_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_value_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_value(INT32 args) {
#line 949 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("value",args,0);
{
if(!THIS->list || 
!THIS->list->a || 
THIS->pos >= THIS->list->size) 
{
push_undefined();
}
else
{
push_svalue(THIS->list->a->item + 
(THIS->pos+THIS->list->pos)%THIS->list->a->size);
}
}


}
/*! @decl CircularListIterator `+(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_CircularList_CircularListIterator_cq__backtick_add_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_add_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_add(INT32 args) {
#line 973 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE steps;
#line 973 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`+",args,1);
#line 973 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`+",1,"int");
#line 973 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
steps=Pike_sp[0-1].u.integer;
{
struct object *o=low_clone(CircularList_CircularListIterator_program);
struct CircularList_CircularListIterator_struct *new;
new = OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(o);
new[0]=*THIS;
add_ref(THIS->obj);
new->pos+=steps;
if (new->pos < 0) 
{ 
new->pos = 0;
}
else if (new->pos > new->list->size) 
{ 
new->pos = new->list->size; 
}
do { struct object * ret_=(o); pop_stack(); push_object(ret_); return; }while(0);
#line 990 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
} 

}
/*! @decl CircularListIterator `+=(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_CircularList_CircularListIterator_cq__backtick_add_eq_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_add_eq(INT32 args) {
#line 1001 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE steps;
#line 1001 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`+=",args,1);
#line 1001 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`+=",1,"int");
#line 1001 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
steps=Pike_sp[0-1].u.integer;
{
THIS->pos+=steps;
if (THIS->pos < 0) 
{ 
THIS->pos = 0;
}
else if (THIS->pos > THIS->list->size) 
{ 
THIS->pos = THIS->list->size; 
}

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



}
/*! @decl CircularListIterator `-(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_CircularList_CircularListIterator_cq__backtick_2D_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_2D_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_2D(INT32 args) {
#line 1026 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
INT_TYPE steps;
#line 1026 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`-",args,1);
#line 1026 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("`-",1,"int");
#line 1026 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
steps=Pike_sp[0-1].u.integer;
{
struct object *o=low_clone(CircularList_CircularListIterator_program);
struct CircularList_CircularListIterator_struct *new;
new = OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(o);
new[0]=*THIS;
add_ref(THIS->obj);
new->pos-=steps;
if (new->pos < 0) 
{ 
new->pos = 0;
}
else if (new->pos > new->list->size) 
{ 
new->pos = new->list->size; 
}
do { struct object * ret_=(o); pop_stack(); push_object(ret_); return; }while(0);
#line 1043 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_CircularListIterator_has_next_defined

#ifdef f_CircularList_CircularListIterator_has_next_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_has_next_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_has_next_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_has_next(INT32 args) {
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * steps;
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args > 1) wrong_number_of_args_error("has_next",args,1);
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("has_next",1,"void|int");
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
steps=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
} else steps = NULL;
{
if (!steps)
{
do { INT_TYPE ret_=((THIS->list && 
(THIS->pos + 1) <= THIS->list->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 1059 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{ 
do { INT_TYPE ret_=((THIS->list && 
(THIS->pos + steps->u.integer) >= 0 &&
(THIS->pos + steps->u.integer) <= THIS->list->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 1065 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_CircularListIterator_has_previous_defined

#ifdef f_CircularList_CircularListIterator_has_previous_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_has_previous_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_has_previous_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_has_previous(INT32 args) {
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * steps;
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args > 1) wrong_number_of_args_error("has_previous",args,1);
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("has_previous",1,"void|int");
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
steps=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
} else steps = NULL;
{
if (!steps)
{
do { INT_TYPE ret_=((THIS->list && 
(THIS->pos) > 0)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 1082 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
do { INT_TYPE ret_=((THIS->list && 
(THIS->pos - steps->u.integer) >= 0 &&
(THIS->pos - steps->u.integer) <= THIS->list->size)); pop_n_elems(args); push_int(ret_); return; }while(0);
#line 1088 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
}


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

#define f_CircularList_CircularListIterator_cq__backtick_21_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_21_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_21(INT32 args) {
#line 1097 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("`!",args,0);
{
do { INT_TYPE ret_=((THIS->list && 
THIS->pos == THIS->list->size));  push_int(ret_); return; }while(0);
#line 1101 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_CircularListIterator_cq__equal_defined

#ifdef f_CircularList_CircularListIterator_cq__equal_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__equal_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__equal_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__equal(INT32 args) {
#line 1114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * iter;
#line 1114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("_equal",args,1);
#line 1114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == CircularList_CircularListIterator_program)
{
struct CircularList_CircularListIterator_struct *i = 
OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->list == i->list && THIS->pos == i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 1122 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
do { INT_TYPE ret_=(0); pop_stack(); push_int(ret_); return; }while(0);
#line 1126 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_CircularListIterator_cq__backtick_3C_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_3C_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_3C(INT32 args) {
#line 1138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * iter;
#line 1138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`<",args,1);
#line 1138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == CircularList_CircularListIterator_program)
{
struct CircularList_CircularListIterator_struct *i = 
OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->pos < i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 1146 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("`<",1,"ADT.CircularList.CircularListIterator");
}
}


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


#define f_CircularList_CircularListIterator_cq__backtick_3E_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_cq__backtick_3E_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_cq__backtick_3E(INT32 args) {
#line 1163 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * iter;
#line 1163 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("`>",args,1);
#line 1163 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
iter=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (TYPEOF(*iter) == T_OBJECT &&
iter->u.object->prog == CircularList_CircularListIterator_program)
{
struct CircularList_CircularListIterator_struct *i = 
OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(iter->u.object);
do { INT_TYPE ret_=((THIS->pos > i->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 1171 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("`>",1,"ADT.CircularList.CircularListIterator");
}
}

}
/*! @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_CircularList_CircularListIterator_distance_defined

#ifdef f_CircularList_CircularListIterator_distance_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_distance_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_distance_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_distance(INT32 args) {
#line 1188 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct object * iter;
#line 1188 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("distance",args,1);
#line 1188 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_OBJECT) SIMPLE_ARG_TYPE_ERROR("distance",1,"object");
#line 1188 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
debug_malloc_pass(iter=Pike_sp[0-1].u.object);
{
if (iter->prog == CircularList_CircularListIterator_program)
{

struct CircularList_CircularListIterator_struct *i = 
OBJ2_CIRCULARLIST_CIRCULARLISTITERATOR(iter);
do { INT_TYPE ret_=((i->pos - THIS->pos)); pop_stack(); push_int(ret_); return; }while(0);
#line 1196 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
}
else
{
SIMPLE_BAD_ARG_ERROR("`-",1,"ADT.CircularList.CircularListIterator");
}
}

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


#define f_CircularList_CircularListIterator_get_collection_defined

#ifdef f_CircularList_CircularListIterator_get_collection_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_get_collection_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_get_collection_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_get_collection(INT32 args) {
#line 1210 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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 1213 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_CircularListIterator_set_value_defined

#ifdef f_CircularList_CircularListIterator_set_value_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_CircularListIterator_set_value_fun_num = 0;

#endif /* f_CircularList_CircularListIterator_set_value_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_CircularListIterator_set_value(INT32 args) {
#line 1226 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
struct svalue * val;
#line 1226 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 1) wrong_number_of_args_error("set_value",args,1);
#line 1226 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
val=Pike_sp+0-1; dmalloc_touch_svalue(Pike_sp+0-1);
{
if (THIS->list && 
THIS->pos < THIS->list->size)
{
struct svalue ind;
struct svalue retval;

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

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

}

#undef internal_init_CircularList_CircularListIterator_defined
#define internal_init_CircularList_CircularListIterator_defined

#undef CircularList_CircularListIterator_event_handler_defined
#define CircularList_CircularListIterator_event_handler_defined
static void init_CircularList_CircularListIterator_struct(void)
#line 1255 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
THIS->list=0;
THIS->pos=0;
THIS->obj = NULL;
}


#undef internal_exit_CircularList_CircularListIterator_defined
#define internal_exit_CircularList_CircularListIterator_defined

#undef CircularList_CircularListIterator_event_handler_defined
#define CircularList_CircularListIterator_event_handler_defined
static void exit_CircularList_CircularListIterator_struct(void)
#line 1263 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
{
if( THIS->obj )
{
free_object(THIS->obj);
THIS->obj = NULL;
}
}


#ifdef CircularList_CircularListIterator_event_handler_defined
static void CircularList_CircularListIterator_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_CircularList_CircularListIterator_defined
  case PROG_EVENT_INIT: init_CircularList_CircularListIterator_struct(); break;

#endif /* internal_init_CircularList_CircularListIterator_defined */

#ifdef internal_exit_CircularList_CircularListIterator_defined
  case PROG_EVENT_EXIT: exit_CircularList_CircularListIterator_struct(); break;

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

#endif /* CircularList_CircularListIterator_event_handler_defined */
/*End CircularListIterator */
/*! @endclass
  */

#define f_CircularList_cq__get_iterator_defined

#ifdef f_CircularList_cq__get_iterator_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_cq__get_iterator_fun_num = 0;

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



}
#define f_CircularList_first_defined

#ifdef f_CircularList_first_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_first_fun_num = 0;

#endif /* f_CircularList_first_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_first(INT32 args) {
#line 1290 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("first",args,0);
{
ref_push_object(Pike_fp->current_object);
push_object(clone_object(CircularList_CircularListIterator_program, 1));
}



}
#define f_CircularList_last_defined

#ifdef f_CircularList_last_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_CircularList_last_fun_num = 0;

#endif /* f_CircularList_last_fun_num_used */
DEFAULT_CMOD_STORAGE void f_CircularList_last(INT32 args) {
#line 1298 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
if(args != 0) wrong_number_of_args_error("last",args,0);
{
struct svalue ind;
SET_SVAL(ind, T_INT, NUMBER_NUMBER, integer, THIS_CIRCULARLIST->size);
ref_push_object(Pike_fp->current_object);
push_svalue(&ind);
push_object(clone_object(CircularList_CircularListIterator_program, 2));
}


}

#ifdef CircularList_event_handler_defined
static void CircularList_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_CircularList_defined
  case PROG_EVENT_INIT: init_CircularList_struct(); break;

#endif /* internal_init_CircularList_defined */

#ifdef internal_exit_CircularList_defined
  case PROG_EVENT_EXIT: exit_CircularList_struct(); break;

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

#endif /* CircularList_event_handler_defined */
/*End of CircularList */
/*! @endclass    
  */

/*! @endmodule
 */


#line 1319 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
void pike_init_CircularList_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_CircularList_defined

#ifdef PROG_CIRCULARLIST_ID
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  START_NEW_PROGRAM_ID(CIRCULARLIST);
#else
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  start_new_program();

#endif /* PROG_CIRCULARLIST_ID */
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  CircularList_program = Pike_compiler->new_program;

#ifndef tObjImpl_CIRCULARLIST

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

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

#endif /* tObjImpl_CIRCULARLIST */

#ifdef THIS_CIRCULARLIST
  CircularList_storage_offset = ADD_STORAGE(struct CircularList_struct);
#endif /* THIS_CIRCULARLIST */

#ifdef class_CircularList_CircularListIterator_defined

#ifdef PROG_CIRCULARLIST_CIRCULARLISTITERATOR_ID
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  START_NEW_PROGRAM_ID(CIRCULARLIST_CIRCULARLISTITERATOR);
#else
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  start_new_program();

#endif /* PROG_CIRCULARLIST_CIRCULARLISTITERATOR_ID */
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  CircularList_CircularListIterator_program = Pike_compiler->new_program;

#ifndef tObjImpl_CIRCULARLIST_CIRCULARLISTITERATOR

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

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

#endif /* tObjImpl_CIRCULARLIST_CIRCULARLISTITERATOR */

#ifdef THIS_CIRCULARLIST_CIRCULARLISTITERATOR
  CircularList_CircularListIterator_storage_offset = ADD_STORAGE(struct CircularList_CircularListIterator_struct);
#endif /* THIS_CIRCULARLIST_CIRCULARLISTITERATOR */

#ifdef CircularList_CircularListIterator_event_handler_defined
  pike_set_prog_event_callback(CircularList_CircularListIterator_event_handler);

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

#endif /* CircularList_CircularListIterator_gc_live_obj */

#endif /* CircularList_CircularListIterator_event_handler_defined */

#ifdef f_CircularList_CircularListIterator_create_defined

#ifdef f_CircularList_CircularListIterator_create_fun_num_used
  f_CircularList_CircularListIterator_create_fun_num =
#endif /* f_CircularList_CircularListIterator_create_fun_num_used */
#line 891 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("create", f_CircularList_CircularListIterator_create, tFunc(tObj tOr(tVoid,"\10\200\0\0\0\177\377\377\377"),tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_create_defined */

#ifdef f_CircularList_CircularListIterator_index_defined

#ifdef f_CircularList_CircularListIterator_index_fun_num_used
  f_CircularList_CircularListIterator_index_fun_num =
#endif /* f_CircularList_CircularListIterator_index_fun_num_used */
#line 928 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("index", f_CircularList_CircularListIterator_index, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_index_defined */

#ifdef f_CircularList_CircularListIterator_value_defined

#ifdef f_CircularList_CircularListIterator_value_fun_num_used
  f_CircularList_CircularListIterator_value_fun_num =
#endif /* f_CircularList_CircularListIterator_value_fun_num_used */
#line 949 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("value", f_CircularList_CircularListIterator_value, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_value_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_add_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_add_fun_num_used */
#line 973 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`+", f_CircularList_CircularListIterator_cq__backtick_add, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_add_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_eq_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_add_eq_fun_num_used */
#line 1001 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`+=", f_CircularList_CircularListIterator_cq__backtick_add_eq, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_add_eq_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_2D_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_2D_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_2D_fun_num_used */
#line 1026 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`-", f_CircularList_CircularListIterator_cq__backtick_2D, tFunc("\10\200\0\0\0\177\377\377\377",tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_2D_defined */

#ifdef f_CircularList_CircularListIterator_has_next_defined

#ifdef f_CircularList_CircularListIterator_has_next_fun_num_used
  f_CircularList_CircularListIterator_has_next_fun_num =
#endif /* f_CircularList_CircularListIterator_has_next_fun_num_used */
#line 1053 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("has_next", f_CircularList_CircularListIterator_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_CircularList_CircularListIterator_has_next_defined */

#ifdef f_CircularList_CircularListIterator_has_previous_defined

#ifdef f_CircularList_CircularListIterator_has_previous_fun_num_used
  f_CircularList_CircularListIterator_has_previous_fun_num =
#endif /* f_CircularList_CircularListIterator_has_previous_fun_num_used */
#line 1076 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("has_previous", f_CircularList_CircularListIterator_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_CircularList_CircularListIterator_has_previous_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_21_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_21_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_21_fun_num_used */
#line 1097 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`!", f_CircularList_CircularListIterator_cq__backtick_21, tFunc(tNone,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_21_defined */

#ifdef f_CircularList_CircularListIterator_cq__equal_defined

#ifdef f_CircularList_CircularListIterator_cq__equal_fun_num_used
  f_CircularList_CircularListIterator_cq__equal_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__equal_fun_num_used */
#line 1114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_equal", f_CircularList_CircularListIterator_cq__equal, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__equal_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_3C_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_3C_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_3C_fun_num_used */
#line 1138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`<", f_CircularList_CircularListIterator_cq__backtick_3C, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_3C_defined */

#ifdef f_CircularList_CircularListIterator_cq__backtick_3E_defined

#ifdef f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used
  f_CircularList_CircularListIterator_cq__backtick_3E_fun_num =
#endif /* f_CircularList_CircularListIterator_cq__backtick_3E_fun_num_used */
#line 1163 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`>", f_CircularList_CircularListIterator_cq__backtick_3E, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_cq__backtick_3E_defined */

#ifdef f_CircularList_CircularListIterator_distance_defined

#ifdef f_CircularList_CircularListIterator_distance_fun_num_used
  f_CircularList_CircularListIterator_distance_fun_num =
#endif /* f_CircularList_CircularListIterator_distance_fun_num_used */
#line 1188 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("distance", f_CircularList_CircularListIterator_distance, tFunc(tObj,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_distance_defined */

#ifdef f_CircularList_CircularListIterator_get_collection_defined

#ifdef f_CircularList_CircularListIterator_get_collection_fun_num_used
  f_CircularList_CircularListIterator_get_collection_fun_num =
#endif /* f_CircularList_CircularListIterator_get_collection_fun_num_used */
#line 1210 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("get_collection", f_CircularList_CircularListIterator_get_collection, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_get_collection_defined */

#ifdef f_CircularList_CircularListIterator_set_value_defined

#ifdef f_CircularList_CircularListIterator_set_value_fun_num_used
  f_CircularList_CircularListIterator_set_value_fun_num =
#endif /* f_CircularList_CircularListIterator_set_value_fun_num_used */
#line 1226 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("set_value", f_CircularList_CircularListIterator_set_value, tFunc(tMix,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_CircularListIterator_set_value_defined */
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  CircularList_CircularListIterator_program=end_program();
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#ifdef CircularList_CircularListIterator_program_fun_num_used
CircularList_CircularListIterator_program_fun_num=
#endif
 add_program_constant("CircularListIterator",CircularList_CircularListIterator_program,0);

#endif /* class_CircularList_CircularListIterator_defined */

#ifdef CircularList_event_handler_defined
  pike_set_prog_event_callback(CircularList_event_handler);

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

#endif /* CircularList_gc_live_obj */

#endif /* CircularList_event_handler_defined */

#ifdef f_CircularList_cq__backtick_5B_5D_defined

#ifdef f_CircularList_cq__backtick_5B_5D_fun_num_used
  f_CircularList_cq__backtick_5B_5D_fun_num =
#endif /* f_CircularList_cq__backtick_5B_5D_fun_num_used */
#line 88 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`[]", f_CircularList_cq__backtick_5B_5D, tFunc("\10\200\0\0\0\177\377\377\377",tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__backtick_5B_5D_defined */

#ifdef f_CircularList_cq__backtick_5B_5D_eq_defined

#ifdef f_CircularList_cq__backtick_5B_5D_eq_fun_num_used
  f_CircularList_cq__backtick_5B_5D_eq_fun_num =
#endif /* f_CircularList_cq__backtick_5B_5D_eq_fun_num_used */
#line 114 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`[]=", f_CircularList_cq__backtick_5B_5D_eq, tFunc("\10\200\0\0\0\177\377\377\377" tMix,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__backtick_5B_5D_eq_defined */

#ifdef f_CircularList_cq__backtick_add_defined

#ifdef f_CircularList_cq__backtick_add_fun_num_used
  f_CircularList_cq__backtick_add_fun_num =
#endif /* f_CircularList_cq__backtick_add_fun_num_used */
#line 138 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("`+", f_CircularList_cq__backtick_add, tFuncV(tNone,tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__backtick_add_defined */

#ifdef f_CircularList_cq__equal_defined

#ifdef f_CircularList_cq__equal_fun_num_used
  f_CircularList_cq__equal_fun_num =
#endif /* f_CircularList_cq__equal_fun_num_used */
#line 214 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_equal", f_CircularList_cq__equal, tFunc(tMix,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__equal_defined */

#ifdef f_CircularList_cq__indices_defined

#ifdef f_CircularList_cq__indices_fun_num_used
  f_CircularList_cq__indices_fun_num =
#endif /* f_CircularList_cq__indices_fun_num_used */
#line 278 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_indices", f_CircularList_cq__indices, tFunc(tNone,tArray), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__indices_defined */

#ifdef f_CircularList_cq__insert_element_defined

#ifdef f_CircularList_cq__insert_element_fun_num_used
  f_CircularList_cq__insert_element_fun_num =
#endif /* f_CircularList_cq__insert_element_fun_num_used */
#line 308 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_insert_element", f_CircularList_cq__insert_element, tFunc("\10\200\0\0\0\177\377\377\377" tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__insert_element_defined */

#ifdef f_CircularList_cq__remove_element_defined

#ifdef f_CircularList_cq__remove_element_fun_num_used
  f_CircularList_cq__remove_element_fun_num =
#endif /* f_CircularList_cq__remove_element_fun_num_used */
#line 331 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_remove_element", f_CircularList_cq__remove_element, tFunc("\10\200\0\0\0\177\377\377\377",tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__remove_element_defined */

#ifdef f_CircularList_cq__search_defined

#ifdef f_CircularList_cq__search_fun_num_used
  f_CircularList_cq__search_fun_num =
#endif /* f_CircularList_cq__search_fun_num_used */
#line 365 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_search", f_CircularList_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_CircularList_cq__search_defined */

#ifdef f_CircularList_cq__sizeof_defined

#ifdef f_CircularList_cq__sizeof_fun_num_used
  f_CircularList_cq__sizeof_fun_num =
#endif /* f_CircularList_cq__sizeof_fun_num_used */
#line 406 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_sizeof", f_CircularList_cq__sizeof, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__sizeof_defined */

#ifdef f_CircularList_cq__values_defined

#ifdef f_CircularList_cq__values_fun_num_used
  f_CircularList_cq__values_fun_num =
#endif /* f_CircularList_cq__values_fun_num_used */
#line 417 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_values", f_CircularList_cq__values, tFunc(tNone,tArray), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cq__values_defined */

#ifdef f_CircularList_add_defined

#ifdef f_CircularList_add_fun_num_used
  f_CircularList_add_fun_num =
#endif /* f_CircularList_add_fun_num_used */
#line 459 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("add", f_CircularList_add, tFunc(tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_add_defined */

#ifdef f_CircularList_allocate_defined

#ifdef f_CircularList_allocate_fun_num_used
  f_CircularList_allocate_fun_num =
#endif /* f_CircularList_allocate_fun_num_used */
#line 485 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("allocate", f_CircularList_allocate, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_allocate_defined */

#ifdef f_CircularList_cast_defined

#ifdef f_CircularList_cast_fun_num_used
  f_CircularList_cast_fun_num =
#endif /* f_CircularList_cast_fun_num_used */
#line 551 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("cast", f_CircularList_cast, tFunc(tStr,tArray), ID_PROTECTED, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_cast_defined */

#ifdef f_CircularList_clear_defined

#ifdef f_CircularList_clear_fun_num_used
  f_CircularList_clear_fun_num =
#endif /* f_CircularList_clear_fun_num_used */
#line 595 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("clear", f_CircularList_clear, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_clear_defined */

#ifdef f_CircularList_delete_value_defined

#ifdef f_CircularList_delete_value_fun_num_used
  f_CircularList_delete_value_fun_num =
#endif /* f_CircularList_delete_value_fun_num_used */
#line 617 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("delete_value", f_CircularList_delete_value, tFunc(tMix,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_delete_value_defined */

#ifdef f_CircularList_is_empty_defined

#ifdef f_CircularList_is_empty_fun_num_used
  f_CircularList_is_empty_fun_num =
#endif /* f_CircularList_is_empty_fun_num_used */
#line 640 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("is_empty", f_CircularList_is_empty, tFunc(tNone,"\10\0\0\0\0\0\0\0\1"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_is_empty_defined */

#ifdef f_CircularList_max_size_defined

#ifdef f_CircularList_max_size_fun_num_used
  f_CircularList_max_size_fun_num =
#endif /* f_CircularList_max_size_fun_num_used */
#line 651 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("max_size", f_CircularList_max_size, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_max_size_defined */

#ifdef f_CircularList_peek_back_defined

#ifdef f_CircularList_peek_back_fun_num_used
  f_CircularList_peek_back_fun_num =
#endif /* f_CircularList_peek_back_fun_num_used */
#line 662 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("peek_back", f_CircularList_peek_back, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_peek_back_defined */

#ifdef f_CircularList_peek_front_defined

#ifdef f_CircularList_peek_front_fun_num_used
  f_CircularList_peek_front_fun_num =
#endif /* f_CircularList_peek_front_fun_num_used */
#line 680 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("peek_front", f_CircularList_peek_front, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_peek_front_defined */

#ifdef f_CircularList_pop_back_defined

#ifdef f_CircularList_pop_back_fun_num_used
  f_CircularList_pop_back_fun_num =
#endif /* f_CircularList_pop_back_fun_num_used */
#line 700 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("pop_back", f_CircularList_pop_back, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_pop_back_defined */

#ifdef f_CircularList_pop_front_defined

#ifdef f_CircularList_pop_front_fun_num_used
  f_CircularList_pop_front_fun_num =
#endif /* f_CircularList_pop_front_fun_num_used */
#line 727 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("pop_front", f_CircularList_pop_front, tFunc(tNone,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_pop_front_defined */

#ifdef f_CircularList_push_back_defined

#ifdef f_CircularList_push_back_fun_num_used
  f_CircularList_push_back_fun_num =
#endif /* f_CircularList_push_back_fun_num_used */
#line 758 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("push_back", f_CircularList_push_back, tFunc(tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_push_back_defined */

#ifdef f_CircularList_push_front_defined

#ifdef f_CircularList_push_front_fun_num_used
  f_CircularList_push_front_fun_num =
#endif /* f_CircularList_push_front_fun_num_used */
#line 781 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("push_front", f_CircularList_push_front, tFunc(tMix,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_push_front_defined */

#ifdef f_CircularList_create_defined

#ifdef f_CircularList_create_fun_num_used
  f_CircularList_create_fun_num =
#endif /* f_CircularList_create_fun_num_used */
#line 806 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("create", f_CircularList_create, tFunc(tOr(tArray,"\10\200\0\0\0\177\377\377\377"),tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_create_defined */

#ifdef f_CircularList_cq__get_iterator_defined

#ifdef f_CircularList_cq__get_iterator_fun_num_used
  f_CircularList_cq__get_iterator_fun_num =
#endif /* f_CircularList_cq__get_iterator_fun_num_used */
#line 1277 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("_get_iterator", f_CircularList_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_CircularList_cq__get_iterator_defined */

#ifdef f_CircularList_first_defined

#ifdef f_CircularList_first_fun_num_used
  f_CircularList_first_fun_num =
#endif /* f_CircularList_first_fun_num_used */
#line 1290 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("first", f_CircularList_first, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_first_defined */

#ifdef f_CircularList_last_defined

#ifdef f_CircularList_last_fun_num_used
  f_CircularList_last_fun_num =
#endif /* f_CircularList_last_fun_num_used */
#line 1298 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    ADD_FUNCTION2("last", f_CircularList_last, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_CircularList_last_defined */
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
  CircularList_program=end_program();
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
#ifdef CircularList_program_fun_num_used
CircularList_program_fun_num=
#endif
 add_program_constant("CircularList",CircularList_program,0);

#endif /* class_CircularList_defined */

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( 0 );
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
#line 1321 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
;
}

void pike_exit_CircularList_module(void)
{

#ifdef class_CircularList_defined

#ifdef class_CircularList_CircularListIterator_defined
  if(CircularList_CircularListIterator_program) {
#line 878 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    free_program(CircularList_CircularListIterator_program);
    CircularList_CircularListIterator_program=0;
  }

#endif /* class_CircularList_CircularListIterator_defined */
  if(CircularList_program) {
#line 40 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.cmod"
    free_program(CircularList_program);
    CircularList_program=0;
  }

#endif /* class_CircularList_defined */
#line 1327 "/Users/hww3/devel/pike/src/post_modules/_ADT/circular_list.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_CircularList_defined
if(id==2) return CircularList_program->id;
#endif
#ifdef class_CircularList_CircularListIterator_defined
if(id==3) return CircularList_CircularListIterator_program->id;
#endif
  return 0;
}
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
