• Home
  • Raw
  • Download

Lines Matching refs:desc

145     CoreConnection* desc;  in core_connection_create()  local
146 ANEW0(desc); in core_connection_create()
147 desc->console_address = console_address[0]; in core_connection_create()
148 desc->ssocket = NULL; in core_connection_create()
149 desc->stream_name = NULL; in core_connection_create()
151 return desc; in core_connection_create()
155 core_connection_free(CoreConnection* desc) in core_connection_free() argument
157 if (desc == NULL) { in core_connection_free()
160 if (desc->ssocket != NULL) { in core_connection_free()
161 syncsocket_free(desc->ssocket); in core_connection_free()
163 if (desc->stream_name != NULL) { in core_connection_free()
164 free(desc->stream_name); in core_connection_free()
166 free(desc); in core_connection_free()
170 core_connection_open(CoreConnection* desc) in core_connection_open() argument
172 if (desc == NULL) { in core_connection_open()
176 if (desc->ssocket != NULL) { in core_connection_open()
180 desc->ssocket = core_connection_open_socket(&desc->console_address); in core_connection_open()
182 return (desc->ssocket != NULL) ? 0 : -1; in core_connection_open()
186 core_connection_close(CoreConnection* desc) in core_connection_close() argument
188 if (desc == NULL) { in core_connection_close()
191 if (desc->ssocket != NULL) { in core_connection_close()
192 syncsocket_close(desc->ssocket); in core_connection_close()
197 core_connection_write(CoreConnection* desc, in core_connection_write() argument
204 int status = syncsocket_start_write(desc->ssocket); in core_connection_write()
211 syncsocket_write(desc->ssocket, buffer, to_write, CORE_PORT_TIMEOUT_MS); in core_connection_write()
212 syncsocket_stop_write(desc->ssocket); in core_connection_write()
225 core_connection_read(CoreConnection* desc, in core_connection_read() argument
232 int status = syncsocket_start_read(desc->ssocket); in core_connection_read()
239 syncsocket_read(desc->ssocket, buffer, to_read, CORE_PORT_TIMEOUT_MS); in core_connection_read()
240 syncsocket_stop_read(desc->ssocket); in core_connection_read()
253 core_connection_switch_stream(CoreConnection* desc, in core_connection_switch_stream() argument
263 if (desc == NULL || desc->stream_name != NULL || stream_name == NULL) { in core_connection_switch_stream()
270 if (core_connection_write(desc, buf, strlen(buf), NULL)) { in core_connection_switch_stream()
275 status = syncsocket_start_read(desc->ssocket); in core_connection_switch_stream()
281 syncsocket_read_line_absolute(desc->ssocket, buf, sizeof(buf), deadline); in core_connection_switch_stream()
296 desc->stream_name = strdup(stream_name); in core_connection_switch_stream()
298 status = syncsocket_read_line_absolute(desc->ssocket, buf, sizeof(buf), in core_connection_switch_stream()
300 syncsocket_stop_read(desc->ssocket); in core_connection_switch_stream()
312 syncsocket_stop_read(desc->ssocket); in core_connection_switch_stream()
318 syncsocket_stop_read(desc->ssocket); in core_connection_switch_stream()
354 core_connection_detach(CoreConnection* desc) in core_connection_detach() argument
356 core_connection_write(desc, "\n", 1, NULL); in core_connection_detach()
360 core_connection_get_socket(CoreConnection* desc) in core_connection_get_socket() argument
362 return (desc != NULL) ? syncsocket_get_socket(desc->ssocket) : -1; in core_connection_get_socket()