return buff;
}
-int32_t write_mpbin(MP_INT *a, uint8_t *buffer, int32_t buflen)
-{
- char *hb = write_mpstring(a);
- int32_t len;
- hex_decode(buffer, buflen, &len, hb, True);
- free(hb);
- return len;
-}
-
#define DEFINE_SETFDFLAG(fn,FL,FLAG) \
void fn(int fd) { \
int r=fcntl(fd, F_GET##FL); \
return 0;
}
+void pathprefix_template_init(struct pathprefix_template *out,
+ const char *prefix, int maxsuffix)
+{
+ size_t l=strlen(prefix);
+ NEW_ARY(out->buffer,l+maxsuffix+1);
+ strcpy(out->buffer,prefix);
+ out->write_here=out->buffer+l;
+}
+
enum async_linebuf_result
async_linebuf_read(struct pollfd *pfd, struct buffer_if *buf,
const char **emsg_out)