#include <rz_io.h>
#include <rz_lib.h>
Go to the source code of this file.
|
static int | __write (RzIO *io, RzIODesc *fd, const ut8 *buf, int count) |
|
static bool | __resize (RzIO *io, RzIODesc *fd, ut64 count) |
|
static int | __read (RzIO *io, RzIODesc *fd, ut8 *buf, int count) |
|
static int | __close (RzIODesc *fd) |
|
static ut64 | __lseek (RzIO *io, RzIODesc *fd, ut64 offset, int whence) |
|
static bool | __plugin_open (RzIO *io, const char *pathname, bool many) |
|
static RzIODesc * | __open (RzIO *io, const char *pathname, int rw, int mode) |
|
◆ __close()
◆ __lseek()
Definition at line 65 of file io_null.c.
67 if (!
fd || !
fd->data) {
73 if (
offset >= null->size) {
74 return null->offset =
null->size - 1;
76 return null->offset =
offset;
78 if ((null->offset +
offset) >=
null->size) {
79 return null->offset =
null->size - 1;
81 return null->offset +=
offset;
83 return null->offset =
null->size - 1;
References fd, SEEK_CUR, SEEK_END, and SEEK_SET.
◆ __open()
Definition at line 92 of file io_null.c.
RzIOPlugin rz_io_plugin_null
static bool __plugin_open(RzIO *io, const char *pathname, bool many)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char pathname
RZ_API RzIODesc * rz_io_desc_new(RzIO *io, RzIOPlugin *plugin, const char *uri, int flags, int mode, void *data)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
References __plugin_open(), NULL, pathname, rz_io_desc_new(), rz_io_plugin_null, RZ_NEW0, and rz_num_math().
◆ __plugin_open()
◆ __read()
Definition at line 43 of file io_null.c.
49 if ((null->offset +
count) >
null->size) {
50 int ret =
null->size -
null->offset;
52 null->offset =
null->size;
56 null->offset +=
count;
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
return memset(p, 0, total)
if(dbg->bits==RZ_SYS_BITS_64)
References count, fd, if(), and memset().
◆ __resize()
◆ __write()
Definition at line 13 of file io_null.c.
19 if ((null->offset +
count) >
null->size) {
20 int ret =
null->size -
null->offset;
23 null->offset +=
count;
References count, fd, and if().
◆ rizin_plugin
◆ rz_io_plugin_null
Initial value:= {
.name = "null",
.desc = "Null plugin",
.license = "LGPL3",
.uris = "null://",
}
static int __read(RzIO *io, RzIODesc *fd, ut8 *buf, int count)
static RzIODesc * __open(RzIO *io, const char *pathname, int rw, int mode)
static int __write(RzIO *io, RzIODesc *fd, const ut8 *buf, int count)
static ut64 __lseek(RzIO *io, RzIODesc *fd, ut64 offset, int whence)
static int __close(RzIODesc *fd)
static bool __resize(RzIO *io, RzIODesc *fd, ut64 count)
Definition at line 105 of file io_null.c.
Referenced by __open().