drone-micropython-raw 0.1.1

Bindings to MicroPython.
#ifndef INCLUDED_IO_H
#define INCLUDED_IO_H

#include <sys/types.h>
#include <unistd.h>

#include "py/obj.h"

#if MICROPY_PY_IO

typedef struct _mp_obj_fdfile_t
{
  mp_obj_base_t base;
  int fd;
} mp_obj_fdfile_t;

#if MICROPY_PY_IO_FILEIO

extern const mp_obj_type_t mp_type_fileio;
extern const mp_obj_type_t mp_type_textio;

#endif // MICROPY_PY_IO_FILEIO

#define O_READ 1
#define O_WRITE 2
#define O_APPEND 4
#define O_TRUNC 8
#define O_CREAT 16
#define O_CREATNEW 32

int open(const char* path, char flags);

ssize_t read(int fd, void* buf, size_t count);

ssize_t write(int fd, const void* buf, size_t count);

off_t lseek(int fd, off_t offset, int whence);

int fsync(int fd);

int close(int fd);

#endif // MICROPY_PY_IO

#endif // INCLUDED_IO_H