write_or_die: raise SIGPIPE when we get EPIPE
[git/git.git] / pkt-line.h
CommitLineData
f3a3214e
LT
1#ifndef PKTLINE_H
2#define PKTLINE_H
3
07d68930 4#include "git-compat-util.h"
f5615d24 5#include "strbuf.h"
07d68930 6
f3a3214e
LT
7/*
8 * Silly packetized line writing interface
9 */
10void packet_flush(int fd);
4ec99bf0 11void packet_write(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
f5615d24
SP
12void packet_buf_flush(struct strbuf *buf);
13void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
f3a3214e
LT
14
15int packet_read_line(int fd, char *buffer, unsigned size);
46284dd1 16int packet_read(int fd, char *buffer, unsigned size);
f5615d24 17int packet_get_line(struct strbuf *out, char **src_buf, size_t *src_len);
583b7ea3 18ssize_t safe_write(int, const void *, ssize_t);
f3a3214e
LT
19
20#endif