File: asyncpipe.h

package info (click to toggle)
hamlib 4.6.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,984 kB
  • sloc: ansic: 262,996; sh: 6,135; cpp: 1,578; perl: 876; makefile: 855; python: 148; awk: 58; xml: 26
file content (28 lines) | stat: -rw-r--r-- 801 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _ASYNC_PIPE_H
#define _ASYNC_PIPE_H 1

#include "hamlib/config.h"

#if defined(WIN32) && defined(HAVE_WINDOWS_H)

#include <hamlib/rig.h>
#include <windows.h>

#define PIPE_BUFFER_SIZE_DEFAULT 65536

struct hamlib_async_pipe {
    HANDLE write;
    HANDLE read;
    OVERLAPPED write_overlapped;
    OVERLAPPED read_overlapped;
};

int async_pipe_create(hamlib_async_pipe_t **pipe_out, unsigned long pipe_buffer_size, unsigned long pipe_connect_timeout_millis);
void async_pipe_close(hamlib_async_pipe_t *pipe);
ssize_t async_pipe_read(hamlib_async_pipe_t *pipe, void *buf, size_t count, int timeout);
int async_pipe_wait_for_data(hamlib_async_pipe_t *pipe, int timeout);
ssize_t async_pipe_write(hamlib_async_pipe_t *pipe, const unsigned char *buf, size_t count, int timeout);

#endif

#endif