12 #define RZP(x) ((RzPipe *)(x)->data)
18 char *bufn, bufnum[4096];
19 int i, rv, rescount = -1;
20 if (!
fd || !
fd->data) {
26 int bufn_sz =
sizeof(bufnum) - (bufn - bufnum);
31 "{\"op\":\"write\",\"address\":%" PFMT64d ",\"data\":[%s]}",
33 if (
len >=
sizeof(fmt)) {
34 eprintf(
"rzpipe_write: error, fmt string has been truncated\n");
39 eprintf(
"rzpipe_write: error\n");
49 char fmt[4096],
num[128];
50 int rv, rescount = -1;
53 if (!
fd || !
fd->data) {
60 "{\"op\":\"read\",\"address\":%" PFMT64d ",\"count\":%d}",
64 eprintf(
"rzpipe_write: error\n");
70 r = strstr(res,
"result");
72 rescount = atoi(
r + 6 + 2);
74 r = strstr(res,
"data");
76 char *
arr = strchr(
r,
':');
77 if (!
arr ||
arr[1] !=
'[') {
120 if (!
fd || !
fd->data) {
138 return (!strncmp(
pathname,
"rzpipe://", 9));
155 pj_ks(pj,
"op",
"system");
162 eprintf(
"rzpipe_write: error\n");
168 char *
r = strstr(res,
"result");
170 int rescount = atoi(
r + 6 + 1);
171 eprintf(
"RESULT %d\n", rescount);
179 .desc =
"rzpipe io plugin",
191 #ifndef RZ_PLUGIN_INCORE
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
RZ_API void Ht_() free(HtName_(Ht) *ht)
static bool __check(RzIO *io, const char *pathname, bool many)
static int __read(RzIO *io, RzIODesc *fd, ut8 *buf, int count)
static char * __system(RzIO *io, RzIODesc *fd, const char *msg)
static RzIODesc * __open(RzIO *io, const char *pathname, int rw, int mode)
RZ_API RzLibStruct rizin_plugin
RzIOPlugin rz_io_plugin_rzpipe
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 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 static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
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
#define rz_return_val_if_fail(expr, val)
RZ_API RzIODesc * rz_io_desc_new(RzIO *io, RzIOPlugin *plugin, const char *uri, int flags, int mode, void *data)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API int rzpipe_close(RzPipe *rzpipe)
RZ_API RzPipe * rzpipe_open(const char *cmd)
RZ_API char * rzpipe_read(RzPipe *rzpipe)
RZ_API int rzpipe_write(RzPipe *rzpipe, const char *str)
static struct sockaddr static addrlen static backlog const void msg
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]