Removed unused protocol functions
This commit is contained in:
parent
bec554e6d6
commit
48346747b9
2 changed files with 0 additions and 39 deletions
|
@ -23,8 +23,6 @@
|
|||
*/
|
||||
#include <pb_encode.h>
|
||||
#include <pb_decode.h>
|
||||
#include <nanomsg/nn.h>
|
||||
#include <nanomsg/pipeline.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
@ -32,35 +30,4 @@
|
|||
#include "criterion/internal/common.h"
|
||||
#include "protocol.h"
|
||||
|
||||
static bool write_fd_callback(pb_ostream_t *stream, const uint8_t *buf, size_t count) {
|
||||
int fd = (intptr_t) stream->state;
|
||||
ssize_t result = write(fd, buf, count);
|
||||
|
||||
if (result < 0)
|
||||
return false;
|
||||
return (size_t) result == count;
|
||||
}
|
||||
|
||||
static bool read_fd_callback(pb_istream_t *stream, uint8_t *buf, size_t count) {
|
||||
int fd = (intptr_t) stream->state;
|
||||
ssize_t result = read(fd, buf, count);
|
||||
|
||||
if (result < 0)
|
||||
return false;
|
||||
|
||||
if ((size_t) result < count)
|
||||
stream->bytes_left = result;
|
||||
return (size_t) result == count;
|
||||
}
|
||||
|
||||
pb_ostream_t pb_ostream_from_fd(int fd) {
|
||||
pb_ostream_t stream = {&write_fd_callback, (void*)(intptr_t) fd, SIZE_MAX, 0, NULL};
|
||||
return stream;
|
||||
}
|
||||
|
||||
pb_istream_t pb_istream_from_fd(int fd) {
|
||||
pb_istream_t stream = {&read_fd_callback, (void*)(intptr_t) fd, SIZE_MAX, NULL};
|
||||
return stream;
|
||||
}
|
||||
|
||||
volatile bool is_extern_worker = false;
|
||||
|
|
|
@ -34,12 +34,6 @@ enum protocol_version {
|
|||
PROTOCOL_V1 = 1,
|
||||
};
|
||||
|
||||
bool pb_write_string(pb_ostream_t *stream, const pb_field_t *field, void * const *arg);
|
||||
bool pb_read_string(pb_istream_t *stream, const pb_field_t *field, void **arg);
|
||||
|
||||
pb_ostream_t pb_ostream_from_fd(int fd);
|
||||
pb_istream_t pb_istream_from_fd(int fd);
|
||||
|
||||
extern volatile bool is_extern_worker;
|
||||
|
||||
# define criterion_message_set_id(Msg) \
|
||||
|
|
Loading…
Add table
Reference in a new issue