Reformat testprotocol.c
This commit is contained in:
@ -24,8 +24,8 @@
|
|||||||
*
|
*
|
||||||
* @verbatim
|
* @verbatim
|
||||||
* Revision History
|
* Revision History
|
||||||
* Date Who Description
|
* Date Who Description
|
||||||
* 20/02/2015 Markus Mäkelä Initial implementation
|
* 20/02/2015 Markus Mäkelä Initial implementation
|
||||||
*
|
*
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
@ -34,11 +34,12 @@
|
|||||||
#include <dcb.h>
|
#include <dcb.h>
|
||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
|
|
||||||
MODULE_INFO info = {
|
MODULE_INFO info =
|
||||||
MODULE_API_PROTOCOL,
|
{
|
||||||
MODULE_IN_DEVELOPMENT,
|
MODULE_API_PROTOCOL,
|
||||||
GWPROTOCOL_VERSION,
|
MODULE_IN_DEVELOPMENT,
|
||||||
"Test protocol"
|
GWPROTOCOL_VERSION,
|
||||||
|
"Test protocol"
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *version_str = "V1.0.0";
|
static char *version_str = "V1.0.0";
|
||||||
@ -57,19 +58,20 @@ static int test_session(DCB *dcb, void* data){ return 1;}
|
|||||||
/**
|
/**
|
||||||
* The "module object" for the httpd protocol module.
|
* The "module object" for the httpd protocol module.
|
||||||
*/
|
*/
|
||||||
static GWPROTOCOL MyObject = {
|
static GWPROTOCOL MyObject =
|
||||||
test_read, /**< Read - EPOLLIN handler */
|
{
|
||||||
test_write, /**< Write - data from gateway */
|
test_read, /**< Read - EPOLLIN handler */
|
||||||
test_write_ready, /**< WriteReady - EPOLLOUT handler */
|
test_write, /**< Write - data from gateway */
|
||||||
test_error, /**< Error - EPOLLERR handler */
|
test_write_ready, /**< WriteReady - EPOLLOUT handler */
|
||||||
test_hangup, /**< HangUp - EPOLLHUP handler */
|
test_error, /**< Error - EPOLLERR handler */
|
||||||
test_accept, /**< Accept */
|
test_hangup, /**< HangUp - EPOLLHUP handler */
|
||||||
test_connect, /**< Connect */
|
test_accept, /**< Accept */
|
||||||
test_close, /**< Close */
|
test_connect, /**< Connect */
|
||||||
test_listen, /**< Create a listener */
|
test_close, /**< Close */
|
||||||
test_auth, /**< Authentication */
|
test_listen, /**< Create a listener */
|
||||||
test_session /**< Session */
|
test_auth, /**< Authentication */
|
||||||
};
|
test_session /**< Session */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,18 +79,16 @@ static GWPROTOCOL MyObject = {
|
|||||||
*
|
*
|
||||||
* @return version string of the module
|
* @return version string of the module
|
||||||
*/
|
*/
|
||||||
char *
|
char* version()
|
||||||
version()
|
|
||||||
{
|
{
|
||||||
return version_str;
|
return version_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The module initialisation routine, called when the module
|
* The module initialisation routine, called when the module
|
||||||
* is first loaded.
|
* is first loaded.
|
||||||
*/
|
*/
|
||||||
void
|
void ModuleInit()
|
||||||
ModuleInit()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,8 +100,7 @@ ModuleInit()
|
|||||||
*
|
*
|
||||||
* @return The module object
|
* @return The module object
|
||||||
*/
|
*/
|
||||||
GWPROTOCOL *
|
GWPROTOCOL* GetModuleObject()
|
||||||
GetModuleObject()
|
|
||||||
{
|
{
|
||||||
return &MyObject;
|
return &MyObject;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user