- int fd = *(int*)stream->state;
- return send(fd, buf, count, 0) == count;
-}
-
-bool read_callback(pb_istream_t *stream, uint8_t *buf, size_t count)
-{
- int fd = *(int*)stream->state;
-
- if (buf == NULL)
- {
- /* Well, this is a really inefficient way to skip input. */
- /* It is only used when there are unknown fields. */
- char dummy;
- while (count-- && recv(fd, &dummy, 1, 0) == 1);
- return count == 0;
- }
-
- return recv(fd, buf, count, MSG_WAITALL) == count;
-}
-
-bool listdir_callback(pb_ostream_t *stream, const pb_field_t *field, const void *arg)
-{
- DIR *dir = (DIR*) arg;