Numworks Epsilon  1.4.1
Graphing Calculator Operating System
objrange.c File Reference
#include <stdlib.h>
#include "py/runtime.h"

Go to the source code of this file.

Classes

struct  _mp_obj_range_it_t
 
struct  _mp_obj_range_t
 

Typedefs

typedef struct _mp_obj_range_it_t mp_obj_range_it_t
 
typedef struct _mp_obj_range_t mp_obj_range_t
 

Functions

STATIC mp_obj_t range_it_iternext (mp_obj_t o_in)
 
STATIC mp_obj_t mp_obj_new_range_iterator (mp_int_t cur, mp_int_t stop, mp_int_t step, mp_obj_iter_buf_t *iter_buf)
 
STATIC void range_print (const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind)
 
STATIC mp_obj_t range_make_new (const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
 
STATIC mp_int_t range_len (mp_obj_range_t *self)
 
STATIC mp_obj_t range_unary_op (mp_unary_op_t op, mp_obj_t self_in)
 
STATIC mp_obj_t range_subscr (mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
 
STATIC mp_obj_t range_getiter (mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf)
 

Variables

STATIC const mp_obj_type_t range_it_type
 
const mp_obj_type_t mp_type_range
 

Typedef Documentation

◆ mp_obj_range_it_t

◆ mp_obj_range_t

Function Documentation

◆ mp_obj_new_range_iterator()

STATIC mp_obj_t mp_obj_new_range_iterator ( mp_int_t  cur,
mp_int_t  stop,
mp_int_t  step,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 60 of file objrange.c.

◆ range_getiter()

STATIC mp_obj_t range_getiter ( mp_obj_t  o_in,
mp_obj_iter_buf_t iter_buf 
)

Definition at line 169 of file objrange.c.

◆ range_it_iternext()

STATIC mp_obj_t range_it_iternext ( mp_obj_t  o_in)

Definition at line 42 of file objrange.c.

◆ range_len()

STATIC mp_int_t range_len ( mp_obj_range_t self)

Definition at line 116 of file objrange.c.

◆ range_make_new()

STATIC mp_obj_t range_make_new ( const mp_obj_type_t type,
size_t  n_args,
size_t  n_kw,
const mp_obj_t args 
)

Definition at line 92 of file objrange.c.

◆ range_print()

STATIC void range_print ( const mp_print_t print,
mp_obj_t  self_in,
mp_print_kind_t  kind 
)

Definition at line 81 of file objrange.c.

◆ range_subscr()

STATIC mp_obj_t range_subscr ( mp_obj_t  self_in,
mp_obj_t  index,
mp_obj_t  value 
)

Definition at line 141 of file objrange.c.

◆ range_unary_op()

STATIC mp_obj_t range_unary_op ( mp_unary_op_t  op,
mp_obj_t  self_in 
)

Definition at line 131 of file objrange.c.

Variable Documentation

◆ mp_type_range

const mp_obj_type_t mp_type_range
Initial value:
= {
.name = MP_QSTR_range,
.print = range_print,
.make_new = range_make_new,
.unary_op = range_unary_op,
.subscr = range_subscr,
.getiter = range_getiter,
}
STATIC mp_obj_t range_getiter(mp_obj_t o_in, mp_obj_iter_buf_t *iter_buf)
Definition: objrange.c:169
STATIC mp_obj_t range_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
Definition: objrange.c:141
STATIC mp_obj_t range_unary_op(mp_unary_op_t op, mp_obj_t self_in)
Definition: objrange.c:131
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
STATIC void range_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind)
Definition: objrange.c:81
qstr name
Definition: obj.h:478
STATIC mp_obj_t range_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args)
Definition: objrange.c:92

Definition at line 192 of file objrange.c.

◆ range_it_type

STATIC const mp_obj_type_t range_it_type
Initial value:
= {
.name = MP_QSTR_iterator,
.getiter = mp_identity_getiter,
.iternext = range_it_iternext,
}
STATIC mp_obj_t range_it_iternext(mp_obj_t o_in)
Definition: objrange.c:42
const mp_obj_type_t mp_type_type
Definition: objtype.c:969
mp_obj_t mp_identity_getiter(mp_obj_t self, mp_obj_iter_buf_t *iter_buf)
Definition: obj.c:507
qstr name
Definition: obj.h:478

Definition at line 53 of file objrange.c.