Numworks Epsilon  1.4.1
Graphing Calculator Operating System
stream.h File Reference
#include "py/obj.h"
#include "py/mperrno.h"

Go to the source code of this file.

Classes

struct  mp_stream_seek_t
 

Macros

#define MP_STREAM_ERROR   ((mp_uint_t)-1)
 
#define MP_STREAM_FLUSH   (1)
 
#define MP_STREAM_SEEK   (2)
 
#define MP_STREAM_POLL   (3)
 
#define MP_STREAM_TIMEOUT   (5)
 
#define MP_STREAM_GET_OPTS   (6)
 
#define MP_STREAM_SET_OPTS   (7)
 
#define MP_STREAM_GET_DATA_OPTS   (8)
 
#define MP_STREAM_SET_DATA_OPTS   (9)
 
#define MP_STREAM_POLL_RD   (0x0001)
 
#define MP_STREAM_POLL_WR   (0x0004)
 
#define MP_STREAM_POLL_ERR   (0x0008)
 
#define MP_STREAM_POLL_HUP   (0x0010)
 
#define MP_SEEK_SET   (0)
 
#define MP_SEEK_CUR   (1)
 
#define MP_SEEK_END   (2)
 
#define MP_STREAM_OP_READ   (1)
 
#define MP_STREAM_OP_WRITE   (2)
 
#define MP_STREAM_OP_IOCTL   (4)
 
#define MP_STREAM_RW_READ   0
 
#define MP_STREAM_RW_WRITE   2
 
#define MP_STREAM_RW_ONCE   1
 
#define mp_stream_write_exactly(stream, buf, size, err)   mp_stream_rw(stream, (byte*)buf, size, err, MP_STREAM_RW_WRITE)
 
#define mp_stream_read_exactly(stream, buf, size, err)   mp_stream_rw(stream, buf, size, err, MP_STREAM_RW_READ)
 
#define mp_is_nonblocking_error(errno)   (0)
 

Functions

 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_read_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_read1_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_readinto_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_unbuffered_readline_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_1 (mp_stream_unbuffered_readlines_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_write_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_2 (mp_stream_write1_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_seek_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_1 (mp_stream_tell_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_1 (mp_stream_flush_obj)
 
 MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN (mp_stream_ioctl_obj)
 
const mp_stream_p_tmp_get_stream_raise (mp_obj_t self_in, int flags)
 
mp_obj_t mp_stream_close (mp_obj_t stream)
 
mp_obj_t mp_stream_unbuffered_iter (mp_obj_t self)
 
mp_obj_t mp_stream_write (mp_obj_t self_in, const void *buf, size_t len, byte flags)
 
mp_uint_t mp_stream_rw (mp_obj_t stream, void *buf, mp_uint_t size, int *errcode, byte flags)
 
void mp_stream_write_adaptor (void *self, const char *buf, size_t len)
 

Macro Definition Documentation

◆ mp_is_nonblocking_error

#define mp_is_nonblocking_error (   errno)    (0)

Definition at line 111 of file stream.h.

◆ MP_SEEK_CUR

#define MP_SEEK_CUR   (1)

Definition at line 62 of file stream.h.

◆ MP_SEEK_END

#define MP_SEEK_END   (2)

Definition at line 63 of file stream.h.

◆ MP_SEEK_SET

#define MP_SEEK_SET   (0)

Definition at line 61 of file stream.h.

◆ MP_STREAM_ERROR

#define MP_STREAM_ERROR   ((mp_uint_t)-1)

Definition at line 32 of file stream.h.

◆ MP_STREAM_FLUSH

#define MP_STREAM_FLUSH   (1)

Definition at line 35 of file stream.h.

◆ MP_STREAM_GET_DATA_OPTS

#define MP_STREAM_GET_DATA_OPTS   (8)

Definition at line 42 of file stream.h.

◆ MP_STREAM_GET_OPTS

#define MP_STREAM_GET_OPTS   (6)

Definition at line 40 of file stream.h.

◆ MP_STREAM_OP_IOCTL

#define MP_STREAM_OP_IOCTL   (4)

Definition at line 80 of file stream.h.

◆ MP_STREAM_OP_READ

#define MP_STREAM_OP_READ   (1)

Definition at line 78 of file stream.h.

◆ MP_STREAM_OP_WRITE

#define MP_STREAM_OP_WRITE   (2)

Definition at line 79 of file stream.h.

◆ MP_STREAM_POLL

#define MP_STREAM_POLL   (3)

Definition at line 37 of file stream.h.

◆ MP_STREAM_POLL_ERR

#define MP_STREAM_POLL_ERR   (0x0008)

Definition at line 48 of file stream.h.

◆ MP_STREAM_POLL_HUP

#define MP_STREAM_POLL_HUP   (0x0010)

Definition at line 49 of file stream.h.

◆ MP_STREAM_POLL_RD

#define MP_STREAM_POLL_RD   (0x0001)

Definition at line 46 of file stream.h.

◆ MP_STREAM_POLL_WR

#define MP_STREAM_POLL_WR   (0x0004)

Definition at line 47 of file stream.h.

◆ mp_stream_read_exactly

#define mp_stream_read_exactly (   stream,
  buf,
  size,
  err 
)    mp_stream_rw(stream, buf, size, err, MP_STREAM_RW_READ)

Definition at line 96 of file stream.h.

◆ MP_STREAM_RW_ONCE

#define MP_STREAM_RW_ONCE   1

Definition at line 93 of file stream.h.

◆ MP_STREAM_RW_READ

#define MP_STREAM_RW_READ   0

Definition at line 91 of file stream.h.

◆ MP_STREAM_RW_WRITE

#define MP_STREAM_RW_WRITE   2

Definition at line 92 of file stream.h.

◆ MP_STREAM_SEEK

#define MP_STREAM_SEEK   (2)

Definition at line 36 of file stream.h.

◆ MP_STREAM_SET_DATA_OPTS

#define MP_STREAM_SET_DATA_OPTS   (9)

Definition at line 43 of file stream.h.

◆ MP_STREAM_SET_OPTS

#define MP_STREAM_SET_OPTS   (7)

Definition at line 41 of file stream.h.

◆ MP_STREAM_TIMEOUT

#define MP_STREAM_TIMEOUT   (5)

Definition at line 39 of file stream.h.

◆ mp_stream_write_exactly

#define mp_stream_write_exactly (   stream,
  buf,
  size,
  err 
)    mp_stream_rw(stream, (byte*)buf, size, err, MP_STREAM_RW_WRITE)

Definition at line 95 of file stream.h.

Function Documentation

◆ MP_DECLARE_CONST_FUN_OBJ_1() [1/3]

MP_DECLARE_CONST_FUN_OBJ_1 ( mp_stream_unbuffered_readlines_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_1() [2/3]

MP_DECLARE_CONST_FUN_OBJ_1 ( mp_stream_tell_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_1() [3/3]

MP_DECLARE_CONST_FUN_OBJ_1 ( mp_stream_flush_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_2()

MP_DECLARE_CONST_FUN_OBJ_2 ( mp_stream_write1_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [1/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_read_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [2/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_read1_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [3/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_readinto_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [4/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_unbuffered_readline_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [5/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_write_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [6/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_seek_obj  )

◆ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN() [7/7]

MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_stream_ioctl_obj  )

◆ mp_get_stream_raise()

const mp_stream_p_t* mp_get_stream_raise ( mp_obj_t  self_in,
int  flags 
)

Definition at line 95 of file stream.c.

◆ mp_stream_close()

mp_obj_t mp_stream_close ( mp_obj_t  stream)

Definition at line 108 of file stream.c.

◆ mp_stream_rw()

mp_uint_t mp_stream_rw ( mp_obj_t  stream,
void *  buf,
mp_uint_t  size,
int *  errcode,
byte  flags 
)

Definition at line 55 of file stream.c.

◆ mp_stream_unbuffered_iter()

mp_obj_t mp_stream_unbuffered_iter ( mp_obj_t  self)

Definition at line 429 of file stream.c.

◆ mp_stream_write()

mp_obj_t mp_stream_write ( mp_obj_t  self_in,
const void *  buf,
size_t  len,
byte  flags 
)

Definition at line 243 of file stream.c.

◆ mp_stream_write_adaptor()

void mp_stream_write_adaptor ( void *  self,
const char *  buf,
size_t  len 
)

Definition at line 262 of file stream.c.