diff options
| author | 2009-08-20 03:42:52 +0200 | |
|---|---|---|
| committer | 2009-08-20 06:51:10 +0200 | |
| commit | 1a0c58e4062da7db73b4c08963f741cf016f6aa5 (patch) | |
| tree | b250f094e978d48622ecf652e28e9f3b68873893 /libusbmuxd/sock_stuff.h | |
| parent | f4854f3fd725b5ba49cd5157d941783cffa08c04 (diff) | |
| parent | 79ca4d9a3c3a82bb5a3f9be1ac7a2533c7a89b05 (diff) | |
| download | usbmuxd-1a0c58e4062da7db73b4c08963f741cf016f6aa5.tar.gz usbmuxd-1a0c58e4062da7db73b4c08963f741cf016f6aa5.tar.bz2 | |
Merge the two development histories
Diffstat (limited to 'libusbmuxd/sock_stuff.h')
| -rw-r--r-- | libusbmuxd/sock_stuff.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libusbmuxd/sock_stuff.h b/libusbmuxd/sock_stuff.h new file mode 100644 index 0000000..190f7e1 --- /dev/null +++ b/libusbmuxd/sock_stuff.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #ifndef __SOCK_STUFF_H | ||
| 2 | #define __SOCK_STUFF_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | |||
| 6 | enum fd_mode { | ||
| 7 | FD_READ, | ||
| 8 | FD_WRITE, | ||
| 9 | FD_EXCEPT | ||
| 10 | }; | ||
| 11 | typedef enum fd_mode fd_mode; | ||
| 12 | |||
| 13 | int create_unix_socket(const char *filename); | ||
| 14 | int connect_unix_socket(const char *filename); | ||
| 15 | int create_socket(uint16_t port); | ||
| 16 | int connect_socket(const char *addr, uint16_t port); | ||
| 17 | int check_fd(int fd, fd_mode fdm, unsigned int timeout); | ||
| 18 | |||
| 19 | int recv_buf(int fd, void *data, size_t size); | ||
| 20 | int peek_buf(int fd, void *data, size_t size); | ||
| 21 | int recv_buf_timeout(int fd, void *data, size_t size, int flags, | ||
| 22 | unsigned int timeout); | ||
| 23 | |||
| 24 | int send_buf(int fd, void *data, size_t size); | ||
| 25 | |||
| 26 | void sock_stuff_set_verbose(int level); | ||
| 27 | |||
| 28 | #endif /* __SOCK_STUFF_H */ | ||
