diff options
| author | 2009-04-28 02:02:55 +0200 | |
|---|---|---|
| committer | 2009-04-28 02:02:55 +0200 | |
| commit | cc9e6a2318352a8fd3a35c25fcb294331ff54288 (patch) | |
| tree | 75b891a06a7eddf9674327ae387784b0c64967b0 /utils.h | |
| parent | d982007a7350df35c5aeba820a520779694514a7 (diff) | |
| download | usbmuxd-cc9e6a2318352a8fd3a35c25fcb294331ff54288.tar.gz usbmuxd-cc9e6a2318352a8fd3a35c25fcb294331ff54288.tar.bz2 | |
USB mostly complete, main loop added, polls for devices
Diffstat (limited to 'utils.h')
| -rw-r--r-- | utils.h | 16 |
1 files changed, 7 insertions, 9 deletions
| @@ -18,8 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
| 18 | 18 | ||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #ifndef __LOG_H__ | 21 | #ifndef __UTILS_H__ |
| 22 | #define __LOG_H__ | 22 | #define __UTILS_H__ |
| 23 | 23 | ||
| 24 | #include <poll.h> | 24 | #include <poll.h> |
| 25 | 25 | ||
| @@ -29,19 +29,17 @@ enum fdowner { | |||
| 29 | FD_USB | 29 | FD_USB |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | typedef struct { | 32 | struct fdlist { |
| 33 | int count; | 33 | int count; |
| 34 | int capacity; | 34 | int capacity; |
| 35 | enum fdowner *owners; | 35 | enum fdowner *owners; |
| 36 | struct pollfd *fds; | 36 | struct pollfd *fds; |
| 37 | } fdlist; | 37 | }; |
| 38 | 38 | ||
| 39 | void fdlist_create(fdlist *list); | 39 | void fdlist_create(struct fdlist *list); |
| 40 | void fdlist_add(fdlist *list, enum fdowner owner, int fd, short events); | 40 | void fdlist_add(struct fdlist *list, enum fdowner owner, int fd, short events); |
| 41 | void fdlist_free(fdlist *list); | 41 | void fdlist_free(struct fdlist *list); |
| 42 | 42 | ||
| 43 | #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) | 43 | #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) |
| 44 | 44 | ||
| 45 | |||
| 46 | |||
| 47 | #endif | 45 | #endif |
