Changeset 5579:3887ff7af8e7 in roaraudio for plugins/universal/protocol-discard.c
- Timestamp:
- 07/21/12 19:40:17 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/universal/protocol-discard.c
r5444 r5579 24 24 */ 25 25 26 #include <roar d/include/roard.h>26 #include <roaraudio.h> 27 27 28 static int check_client(int client, struct roar_vio_calls * vio) {28 static int _handle(int client, struct roar_vio_calls * vio, struct roar_buffer ** obuffer, void ** userdata, const struct roar_keyval * para, ssize_t paralen) { 29 29 char buf[4096]; 30 30 31 ROAR_DBG("check_client(client=%i, vio=%p) = ?", client, vio);31 (void)client, (void)obuffer, (void)userdata, (void)para, (void)paralen; 32 32 33 33 if ( roar_vio_read(vio, buf, sizeof(buf)) < 1 ) { 34 clients_delete(client);35 34 return -1; 36 35 } 37 36 38 ROAR_DBG("check_client(client=%i, vio=%p) = 0", client, vio);39 37 return 0; 40 38 } 41 39 42 43 static struct roard_proto proto[1] = { 44 {ROAR_PROTO_DISCARD, ROAR_SUBSYS_NONE, "Discard all data send to the server", NULL, NULL, NULL, check_client, NULL, NULL} 40 static const struct roar_dl_proto proto = { 41 .proto = ROAR_PROTO_DISCARD, 42 .description = "Discard all data send to the server", 43 .flags = ROAR_DL_PROTO_FLAGS_NONE, 44 .set_proto = NULL, 45 .unset_proto = NULL, 46 .handle = _handle, 47 .flush = NULL, 48 .flushed = NULL, 49 .status = NULL 45 50 }; 46 51 47 ROARD_DL_REG_PROTO(proto) 52 static int __reg_proto(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib) { 53 (void)para, (void)lib; 54 ROAR_DL_PLUGIN_REG_FN(ROAR_DL_PROTO_SUBTYPE, proto, ROAR_DL_PROTO_VERSION); 55 return 0; 56 } 48 57 49 58 ROAR_DL_PLUGIN_START(protocol_discard) { 50 ROARD_DL_CHECK_VERSIONS();51 52 59 ROAR_DL_PLUGIN_META_PRODUCT_NIV("protocol-discard", ROAR_VID_ROARAUDIO, ROAR_VNAME_ROARAUDIO); 53 60 ROAR_DL_PLUGIN_META_VERSION(ROAR_VERSION_STRING); … … 56 63 ROAR_DL_PLUGIN_META_DESC("Implementation of a dummy protocol discarding all data"); 57 64 58 ROAR D_DL_REGFN_PROTO();65 ROAR_DL_PLUGIN_REG(ROAR_DL_FN_PROTO, __reg_proto); 59 66 } ROAR_DL_PLUGIN_END 60 67
Note: See TracChangeset
for help on using the changeset viewer.