41 |
// Client socket stuff. |
// Client socket stuff. |
42 |
lscp_client_proc_t pfnCallback; |
lscp_client_proc_t pfnCallback; |
43 |
void * pvData; |
void * pvData; |
44 |
lscp_socket_agent_t tcp; |
lscp_socket_agent_t cmd; |
45 |
lscp_socket_agent_t udp; |
lscp_socket_agent_t evt; |
46 |
// Session identifier. |
// Subscribed events. |
47 |
char * sessid; |
lscp_event_t events; |
48 |
// Client struct persistent caches. |
// Client struct persistent caches. |
49 |
char ** audio_drivers; |
char ** audio_drivers; |
50 |
char ** midi_drivers; |
char ** midi_drivers; |
51 |
|
int * audio_devices; |
52 |
|
int * midi_devices; |
53 |
char ** engines; |
char ** engines; |
54 |
|
int * channels; |
55 |
// Client struct volatile caches. |
// Client struct volatile caches. |
56 |
lscp_driver_info_t audio_info; |
lscp_driver_info_t audio_driver_info; |
57 |
lscp_driver_info_t midi_info; |
lscp_driver_info_t midi_driver_info; |
58 |
|
lscp_device_info_t audio_device_info; |
59 |
|
lscp_device_info_t midi_device_info; |
60 |
|
lscp_param_info_t audio_param_info; |
61 |
|
lscp_param_info_t midi_param_info; |
62 |
|
lscp_device_port_info_t audio_channel_info; |
63 |
|
lscp_device_port_info_t midi_port_info; |
64 |
|
lscp_param_info_t audio_channel_param_info; |
65 |
|
lscp_param_info_t midi_port_param_info; |
66 |
lscp_engine_info_t engine_info; |
lscp_engine_info_t engine_info; |
67 |
lscp_channel_info_t channel_info; |
lscp_channel_info_t channel_info; |
68 |
// Result and error status. |
// Result and error status. |
74 |
// Transaction call timeout (msecs). |
// Transaction call timeout (msecs). |
75 |
int iTimeout; |
int iTimeout; |
76 |
lscp_mutex_t mutex; |
lscp_mutex_t mutex; |
77 |
|
lscp_cond_t cond; |
78 |
}; |
}; |
79 |
|
|
80 |
|
|
81 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
82 |
|
// Local client request executive. |
83 |
|
|
84 |
|
lscp_status_t lscp_client_recv (lscp_client_t *pClient, char *pchBuffer, int *pcchBuffer, int iTimeout); |
85 |
|
lscp_status_t lscp_client_call (lscp_client_t *pClient, const char *pszQuery); |
86 |
|
void lscp_client_set_result (lscp_client_t *pClient, char *pszResult, int iErrno); |
87 |
|
|
88 |
|
//------------------------------------------------------------------------- |
89 |
// General utility function prototypes. |
// General utility function prototypes. |
90 |
|
|
91 |
char * lscp_strtok (char *pchBuffer, const char *pszSeps, char **ppch); |
char * lscp_strtok (char *pchBuffer, const char *pszSeps, char **ppch); |
92 |
char * lscp_ltrim (char *psz); |
char * lscp_ltrim (char *psz); |
93 |
char * lscp_unquote (char **ppsz, int dup); |
char * lscp_unquote (char **ppsz, int dup); |
94 |
|
void lscp_unquote_dup (char **ppszDst, char **ppszSrc); |
95 |
|
|
96 |
char ** lscp_szsplit_create (const char *pszCsv, const char *pszSeps); |
char ** lscp_szsplit_create (const char *pszCsv, const char *pszSeps); |
97 |
void lscp_szsplit_destroy (char **ppszSplit); |
void lscp_szsplit_destroy (char **ppszSplit); |
98 |
#ifdef LSCP_SZSPLIT_COUNT |
#ifdef LSCP_SZSPLIT_COUNT |
99 |
int lscp_szsplit_count (char **ppszSplit); |
int lscp_szsplit_count (char **ppszSplit); |
100 |
int lscp_szsplit_size (char **ppszSplit); |
int lscp_szsplit_size (char **ppszSplit); |
101 |
|
#endif |
102 |
|
|
103 |
|
int * lscp_isplit_create (const char *pszCsv, const char *pszSeps); |
104 |
|
void lscp_isplit_destroy (int *piSplit); |
105 |
|
#ifdef LSCP_ISPLIT_COUNT |
106 |
|
int lscp_isplit_count (int *piSplit); |
107 |
|
int lscp_isplit_size (int *piSplit); |
108 |
#endif |
#endif |
109 |
|
|
110 |
|
lscp_param_t * lscp_psplit_create (const char *pszCsv, const char *pszSep1, const char *pszSep2); |
111 |
|
void lscp_psplit_destroy (lscp_param_t *ppSplit); |
112 |
|
#ifdef LSCP_PSPLIT_COUNT |
113 |
|
int lscp_psplit_count (lscp_param_t *ppSplit); |
114 |
|
int lscp_psplit_size (lscp_param_t *ppSplit); |
115 |
|
#endif |
116 |
|
|
117 |
|
void lscp_plist_alloc (lscp_param_t **ppList); |
118 |
|
void lscp_plist_free (lscp_param_t **ppList); |
119 |
|
void lscp_plist_append (lscp_param_t **ppList, const char *pszKey, const char *pszValue); |
120 |
|
#ifdef LSCP_PLIST_COUNT |
121 |
|
int lscp_plist_count (lscp_param_t **ppList); |
122 |
|
int lscp_plist_size (lscp_param_t **ppList); |
123 |
|
#endif |
124 |
|
|
125 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
126 |
// Engine struct helper functions. |
// Engine struct helper functions. |
127 |
|
|
128 |
void lscp_engine_info_init (lscp_engine_info_t *pEngineInfo); |
void lscp_engine_info_init (lscp_engine_info_t *pEngineInfo); |
129 |
void lscp_engine_info_reset (lscp_engine_info_t *pEngineInfo); |
void lscp_engine_info_free (lscp_engine_info_t *pEngineInfo); |
130 |
|
void lscp_engine_info_reset (lscp_engine_info_t *pEngineInfo); |
131 |
|
|
132 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
133 |
// Channel struct helper functions. |
// Channel struct helper functions. |
134 |
|
|
135 |
void lscp_channel_info_init (lscp_channel_info_t *pChannelInfo); |
void lscp_channel_info_init (lscp_channel_info_t *pChannelInfo); |
136 |
void lscp_channel_info_reset (lscp_channel_info_t *pChannelInfo); |
void lscp_channel_info_free (lscp_channel_info_t *pChannelInfo); |
137 |
|
void lscp_channel_info_reset (lscp_channel_info_t *pChannelInfo); |
138 |
|
|
139 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
140 |
// Driver struct helper functions. |
// Driver struct helper functions. |
141 |
|
|
142 |
void lscp_driver_info_init (lscp_driver_info_t *pDriverInfo); |
void lscp_driver_info_init (lscp_driver_info_t *pDriverInfo); |
143 |
void lscp_driver_info_reset (lscp_driver_info_t *pDriverInfo); |
void lscp_driver_info_free (lscp_driver_info_t *pDriverInfo); |
144 |
|
void lscp_driver_info_reset (lscp_driver_info_t *pDriverInfo); |
145 |
|
|
146 |
|
//------------------------------------------------------------------------- |
147 |
|
// Device struct helper functions. |
148 |
|
|
149 |
|
void lscp_device_info_init (lscp_device_info_t *pDeviceInfo); |
150 |
|
void lscp_device_info_free (lscp_device_info_t *pDeviceInfo); |
151 |
|
void lscp_device_info_reset (lscp_device_info_t *pDeviceInfo); |
152 |
|
|
153 |
|
//------------------------------------------------------------------------- |
154 |
|
// Device channel/port struct helper functions. |
155 |
|
|
156 |
|
void lscp_device_port_info_init (lscp_device_port_info_t *pDevicePortInfo); |
157 |
|
void lscp_device_port_info_free (lscp_device_port_info_t *pDevicePortInfo); |
158 |
|
void lscp_device_port_info_reset (lscp_device_port_info_t *pDevicePortInfo); |
159 |
|
|
160 |
|
//------------------------------------------------------------------------- |
161 |
|
// Parameter struct helper functions. |
162 |
|
|
163 |
|
void lscp_param_info_init (lscp_param_info_t *pParamInfo); |
164 |
|
void lscp_param_info_free (lscp_param_info_t *pParamInfo); |
165 |
|
void lscp_param_info_reset (lscp_param_info_t *pParamInfo); |
166 |
|
|
167 |
|
//------------------------------------------------------------------------- |
168 |
|
// Concatenate a parameter list (key='value'...) into a string. |
169 |
|
|
170 |
|
int lscp_param_concat (char *pszBuffer, int cchMaxBuffer, lscp_param_t *pParams); |
171 |
|
|
172 |
|
|
173 |
#endif // __LSCP_COMMON_H |
#endif // __LSCP_COMMON_H |