Skip to content

Commit e6a4d4e

Browse files
committed
py: Move stream-related declarations from obj.h to stream.h.
1 parent e4cb7c6 commit e6a4d4e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

py/obj.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ bool mp_get_buffer(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flags);
444444
void mp_get_buffer_raise(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flags);
445445

446446
// Stream protocol
447-
#define MP_STREAM_ERROR ((mp_uint_t)-1)
448447
typedef struct _mp_stream_p_t {
449448
// On error, functions should return MP_STREAM_ERROR and fill in *errcode (values
450449
// are implementation-dependent, but will be exposed to user, e.g. via exception).
@@ -454,17 +453,6 @@ typedef struct _mp_stream_p_t {
454453
mp_uint_t is_text : 1; // default is bytes, set this for text stream
455454
} mp_stream_p_t;
456455

457-
// Stream ioctl request codes
458-
#define MP_STREAM_FLUSH (1)
459-
#define MP_STREAM_SEEK (2)
460-
#define MP_STREAM_POLL (3)
461-
462-
// Argument structure for MP_STREAM_SEEK
463-
struct mp_stream_seek_t {
464-
mp_off_t offset;
465-
int whence;
466-
};
467-
468456
struct _mp_obj_type_t {
469457
mp_obj_base_t base;
470458
qstr name;

py/stream.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@
2828

2929
#include "py/obj.h"
3030

31+
#define MP_STREAM_ERROR ((mp_uint_t)-1)
32+
33+
// Stream ioctl request codes
34+
#define MP_STREAM_FLUSH (1)
35+
#define MP_STREAM_SEEK (2)
36+
#define MP_STREAM_POLL (3)
37+
38+
// Argument structure for MP_STREAM_SEEK
39+
struct mp_stream_seek_t {
40+
mp_off_t offset;
41+
int whence;
42+
};
43+
3144
MP_DECLARE_CONST_FUN_OBJ(mp_stream_read_obj);
3245
MP_DECLARE_CONST_FUN_OBJ(mp_stream_readinto_obj);
3346
MP_DECLARE_CONST_FUN_OBJ(mp_stream_readall_obj);

0 commit comments

Comments
 (0)