lscp_client.h | lscp_client.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
typedef struct _lscp_client_t { | typedef struct _lscp_client_t { | |||
lscp_client_proc_t pfnCallback; | lscp_client_proc_t pfnCallback; | |||
void *pvData; | void *pvData; | |||
lscp_socket_agent_t tcp; | lscp_socket_agent_t tcp; | |||
lscp_socket_agent_t udp; | lscp_socket_agent_t udp; | |||
} lscp_client_t; | } lscp_client_t; | |||
lscp_client_t* lscp_client_create (char *pszHost, int iPort, lscp_client_ | lscp_client_t* lscp_client_create (char *pszHost, int iPort, lscp_cli | |||
proc_t pfnCallback, void *pvData); | ent_proc_t pfnCallback, void *pvData); | |||
lscp_status_t lscp_client_join (lscp_client_t *pClient); | lscp_status_t lscp_client_join (lscp_client_t *pClient); | |||
lscp_status_t lscp_client_destroy (lscp_client_t *pClient); | lscp_status_t lscp_client_destroy (lscp_client_t *pClient); | |||
lscp_status_t lscp_client_call (lscp_client_t *pClient, const char | ||||
*pchBuffer, int cchBuffer, char *pchResult, int *pcchResult); | ||||
lscp_status_t lscp_client_subscribe (lscp_client_t *pClient); | ||||
lscp_status_t lscp_client_unsubscribe (lscp_client_t *pClient); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif // __LSCP_CLIENT_H | #endif // __LSCP_CLIENT_H | |||
// end of lscp_client.h | // end of lscp_client.h | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 10 lines changed or added | |||
lscp_parser.h | lscp_parser.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
{ | { | |||
char *pchBuffer; | char *pchBuffer; | |||
int cchBuffer; | int cchBuffer; | |||
char *pszToken; | char *pszToken; | |||
char *pch; | char *pch; | |||
} lscp_parser_t; | } lscp_parser_t; | |||
void lscp_parser_init (lscp_parser_t *pParser, const char *pchBuf fer, int cchBuffer); | void lscp_parser_init (lscp_parser_t *pParser, const char *pchBuf fer, int cchBuffer); | |||
const char *lscp_parser_next (lscp_parser_t *pParser); | const char *lscp_parser_next (lscp_parser_t *pParser); | |||
int lscp_parser_nextint (lscp_parser_t *pParser); | ||||
int lscp_parser_test (lscp_parser_t *pParser, const char *pszTok en); | int lscp_parser_test (lscp_parser_t *pParser, const char *pszTok en); | |||
int lscp_parser_test2 (lscp_parser_t *pParser, const char *pszTok en, const char *pszToken2); | int lscp_parser_test2 (lscp_parser_t *pParser, const char *pszTok en, const char *pszToken2); | |||
void lscp_parser_free (lscp_parser_t *pParser); | void lscp_parser_free (lscp_parser_t *pParser); | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif // __LSCP_PARSER_H | #endif // __LSCP_PARSER_H | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
lscp_server.h | lscp_server.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
// Server sockets. | // Server sockets. | |||
struct _lscp_server_t; | struct _lscp_server_t; | |||
typedef struct _lscp_connect_t | typedef struct _lscp_connect_t | |||
{ | { | |||
struct _lscp_server_t *server; | struct _lscp_server_t *server; | |||
lscp_socket_agent_t client; | lscp_socket_agent_t client; | |||
int port; | ||||
int ping; | ||||
struct _lscp_connect_t *prev; | struct _lscp_connect_t *prev; | |||
struct _lscp_connect_t *next; | struct _lscp_connect_t *next; | |||
} lscp_connect_t; | } lscp_connect_t; | |||
typedef struct _lscp_connect_list_t | typedef struct _lscp_connect_list_t | |||
{ | { | |||
lscp_connect_t *first; | lscp_connect_t *first; | |||
lscp_connect_t *last; | lscp_connect_t *last; | |||
unsigned int count; | unsigned int count; | |||
skipping to change at line 50 | skipping to change at line 52 | |||
void *pvData | void *pvData | |||
); | ); | |||
typedef struct _lscp_server_t { | typedef struct _lscp_server_t { | |||
lscp_connect_list_t connects; | lscp_connect_list_t connects; | |||
lscp_server_proc_t pfnCallback; | lscp_server_proc_t pfnCallback; | |||
void *pvData; | void *pvData; | |||
lscp_socket_agent_t tcp; | lscp_socket_agent_t tcp; | |||
lscp_socket_agent_t udp; | lscp_socket_agent_t udp; | |||
lscp_thread_t *pWatchdog; | ||||
int iWatchdog; | ||||
int iSleep; | ||||
} lscp_server_t; | } lscp_server_t; | |||
lscp_server_t* lscp_server_create (int iPort, lscp_server_proc_t pfnCall | lscp_server_t* lscp_server_create (int iPort, lscp_server_proc_t pfnC | |||
back, void *pvData); | allback, void *pvData); | |||
lscp_status_t lscp_server_destroy (lscp_server_t *pServer); | lscp_status_t lscp_server_destroy (lscp_server_t *pServer); | |||
lscp_status_t lscp_server_result (lscp_connect_t *pConnect, const char | lscp_status_t lscp_server_result (lscp_connect_t *pConnect, const ch | |||
*pchBuffer, int cchBuffer); | ar *pchBuffer, int cchBuffer); | |||
lscp_status_t lscp_server_subscribe (lscp_connect_t *pConnect, int iPor | ||||
t); | ||||
lscp_status_t lscp_server_unsubscribe (lscp_connect_t *pConnect); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif // __LSCP_SERVER_H | #endif // __LSCP_SERVER_H | |||
// end of lscp_server.h | // end of lscp_server.h | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 14 lines changed or added | |||
lscp_socket.h | lscp_socket.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
#if defined(WIN32) | #if defined(WIN32) | |||
typedef SOCKET lscp_socket_t; | typedef SOCKET lscp_socket_t; | |||
#else | #else | |||
typedef int lscp_socket_t; | typedef int lscp_socket_t; | |||
#define INVALID_SOCKET -1 | #define INVALID_SOCKET -1 | |||
#define SOCKET_ERROR -1 | #define SOCKET_ERROR -1 | |||
#define closesocket(s) close(s) | #define closesocket(s) close(s) | |||
#endif | #endif | |||
#define LSCP_BUFSIZ 1024 | ||||
void lscp_socket_perror (const char *pszPrefix); | void lscp_socket_perror (const char *pszPrefix); | |||
//------------------------------------------------------------------------- | //------------------------------------------------------------------------- | |||
// Threaded socket agent struct helpers. | // Threaded socket agent struct helpers. | |||
typedef struct _lscp_socket_agent_t { | typedef struct _lscp_socket_agent_t { | |||
lscp_socket_t sock; | lscp_socket_t sock; | |||
struct sockaddr_in addr; | struct sockaddr_in addr; | |||
lscp_thread_t *pThread; | lscp_thread_t *pThread; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||