liblscp  0.5.6.5
server.h
Go to the documentation of this file.
1 // server.h
2 //
3 /****************************************************************************
4  liblscp - LinuxSampler Control Protocol API
5  Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 
21 *****************************************************************************/
22 
23 #ifndef __LSCP_SERVER_H
24 #define __LSCP_SERVER_H
25 
26 #include "lscp/socket.h"
27 #include "lscp/event.h"
28 
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif
32 
33 //-------------------------------------------------------------------------
34 // Server socket modes.
35 
37 typedef enum _lscp_server_mode_t
38 {
41 
43 
44 
47 {
50 
52 
53 
54 //-------------------------------------------------------------------------
55 // Server socket structures.
56 
57 struct _lscp_server_t;
58 
60 typedef struct _lscp_connect_t
61 {
67 
69 
71 typedef struct _lscp_connect_list_t
72 {
75  unsigned int count;
77 
79 
82 (
83  lscp_connect_t *pConnect,
84  const char *pchBuffer,
85  int cchBuffer,
86  void *pvData
87 );
88 
90 typedef struct _lscp_server_t
91 {
95  void *pvData;
97 
99 
100 
101 //-------------------------------------------------------------------------
102 // Server versioning teller fuunctions.
103 
104 const char * lscp_server_package (void);
105 const char * lscp_server_version (void);
106 const char * lscp_server_build (void);
107 
108 
109 //-------------------------------------------------------------------------
110 // Server socket functions.
111 
112 lscp_server_t * lscp_server_create (int iPort, lscp_server_proc_t pfnCallback, void *pvData);
113 lscp_server_t * lscp_server_create_ex (int iPort, lscp_server_proc_t pfnCallback, void *pvData, lscp_server_mode_t mode);
116 
117 lscp_status_t lscp_server_broadcast (lscp_server_t *pServer, lscp_event_t event, const char *pchData, int cchData);
118 
119 lscp_status_t lscp_server_result (lscp_connect_t *pConnect, const char *pchBuffer, int cchBuffer);
120 
123 
124 
125 #if defined(__cplusplus)
126 }
127 #endif
128 
129 #endif // __LSCP_SERVER_H
130 
131 // end of server.h