Mercurial > audlegacy
annotate Plugins/Input/wma/libffwma/mmsio.h @ 1715:14e6dd38e108 trunk
[svn] Fixed 3 warnings, 2 unused variables and 1 missing include
author | js |
---|---|
date | Sat, 16 Sep 2006 10:08:23 -0700 |
parents | b94847e68f33 |
children |
rev | line source |
---|---|
1407
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
1 #ifndef __MMS_IO_H__ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
2 #define __MMS_IO_H__ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
3 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
4 #ifdef __cplusplus |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
5 extern "C" { |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
6 #endif /* __cplusplus */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
7 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
8 typedef off_t (*mms_io_write_func)(void *data, int socket, char *buf, off_t num); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
9 typedef off_t (*mms_io_read_func)(void *data, int socket, char *buf, off_t num); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
10 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
11 /* select states */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
12 #define MMS_IO_READ_READY 1 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
13 #define MMS_IO_WRITE_READY 2 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
14 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
15 enum |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
16 { |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
17 MMS_IO_STATUS_READY, /* IO can be safely performed */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
18 MMS_IO_STATUS_ERROR, /* There was IO error */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
19 MMS_IO_STATUS_ABORTED, /* IO command was (somehow) |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
20 aborted. This is not error, but invalidates IO for further operations*/ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
21 MMS_IO_STATUS_TIMEOUT /* Timeout was exceeded */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
22 }; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
23 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
24 /* |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
25 * Waits for a file descriptor/socket to change status. |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
26 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
27 * users can use this handler to provide their own implementations, |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
28 * for example abortable ones |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
29 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
30 * params : |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
31 * data whatever parameter may be needed by implementation |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
32 * fd file/socket descriptor |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
33 * state MMS_IO_READ_READY, MMS_IO_WRITE_READY |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
34 * timeout_sec timeout in seconds |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
35 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
36 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
37 * return value : |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
38 * MMS_IO_READY the file descriptor is ready for cmd |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
39 * MMS_IO_ERROR an i/o error occured |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
40 * MMS_IO_ABORTED command aborted |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
41 * MMS_IO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
42 * every other return value is interpreted same as MMS_IO_ABORTED |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
43 */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
44 typedef int (*mms_io_select_func)(void *data, int fd, int state, int timeout_msec); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
45 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
46 /* |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
47 * open a tcp connection |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
48 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
49 * params : |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
50 * stream needed for reporting errors but may be NULL |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
51 * host address of target |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
52 * port port on target |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
53 * |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
54 * returns a socket descriptor or -1 if an error occured |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
55 */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
56 typedef int (*mms_io_tcp_connect_func)(void *data, const char *host, int port); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
57 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
58 typedef struct |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
59 { |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
60 mms_io_select_func select; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
61 void *select_data; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
62 mms_io_read_func read; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
63 void *read_data; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
64 mms_io_write_func write; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
65 void *write_data; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
66 mms_io_tcp_connect_func connect; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
67 void *connect_data; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
68 } mms_io_t; |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
69 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
70 /* set default IO implementation, it will be used in absence of specific IO |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
71 parameter. Structure is referenced, not copied, must remain valid for entire |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
72 usage period. Passing NULL reverts to default, POSIX based implementation */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
73 void mms_set_default_io_impl(const mms_io_t *io); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
74 const mms_io_t* mms_get_default_io_impl(); |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
75 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
76 #ifdef __cplusplus |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
77 } |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
78 #endif /* __cplusplus */ |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
79 |
b94847e68f33
[svn] Newer libmms, from their CVS. Needs to be hooked up properly as it wants more arguments to its functions.
chainsaw
parents:
diff
changeset
|
80 #endif /* __MMS_IO_H__ */ |