2005-06-30 11:50:15 +08:00
|
|
|
#ifndef PKTLINE_H
|
|
|
|
#define PKTLINE_H
|
|
|
|
|
2006-06-26 16:27:07 +08:00
|
|
|
#include "git-compat-util.h"
|
2009-10-31 08:47:21 +08:00
|
|
|
#include "strbuf.h"
|
2006-06-26 16:27:07 +08:00
|
|
|
|
2005-06-30 11:50:15 +08:00
|
|
|
/*
|
|
|
|
* Silly packetized line writing interface
|
|
|
|
*/
|
|
|
|
void packet_flush(int fd);
|
2005-08-09 23:30:22 +08:00
|
|
|
void packet_write(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
|
2009-10-31 08:47:21 +08:00
|
|
|
void packet_buf_flush(struct strbuf *buf);
|
|
|
|
void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
|
2005-06-30 11:50:15 +08:00
|
|
|
|
|
|
|
int packet_read_line(int fd, char *buffer, unsigned size);
|
2009-10-31 08:47:21 +08:00
|
|
|
int packet_get_line(struct strbuf *out, char **src_buf, size_t *src_len);
|
2006-06-21 15:30:21 +08:00
|
|
|
ssize_t safe_write(int, const void *, ssize_t);
|
2005-06-30 11:50:15 +08:00
|
|
|
|
|
|
|
#endif
|