Exemplo n.º 1
0
static inline void
send_module_msg_function (CARD32 func,
						  const char *name, const char *text, const send_signed_data_type *func_val, const send_signed_data_type *unit_val)
{
	if( as_module_out_buffer.fd >= 0 ) 
	{	
		CARD32        spare_func_val[2] = { 0, 0 };
		CARD32        spare_unit_val[2] = { 0, 0 };

		ASSocketWriteInt32 (&as_module_out_buffer, &func, 1 );
		ASSocketWriteString(&as_module_out_buffer , name);
		ASSocketWriteString(&as_module_out_buffer , text);
		if (func_val != NULL)
		{
			spare_func_val[0] = func_val[0] ;
			spare_func_val[1] = func_val[1] ;
		}
		if (unit_val != NULL)
		{
			spare_unit_val[0] = unit_val[0] ;
			spare_unit_val[1] = unit_val[1] ;
		}
		ASSocketWriteInt32 (&as_module_out_buffer, &(spare_func_val[0]), 2);
		ASSocketWriteInt32 (&as_module_out_buffer, &(spare_unit_val[0]), 2);
	}
}
Exemplo n.º 2
0
static inline void send_module_msg_header (Window w, CARD32 bytes)
{
	if (as_module_out_buffer.fd >= 0) {
		CARD32 w32 = w;

		ASSocketWriteInt32 (&as_module_out_buffer, &w32, 1);
		ASSocketWriteInt32 (&as_module_out_buffer, &bytes, 1);
	}
}
Exemplo n.º 3
0
static inline void send_module_msg_tail ()
{
	if (as_module_out_buffer.fd >= 0) {
		CARD32 cont = F_FUNCTIONS_NUM;

		ASSocketWriteInt32 (&as_module_out_buffer, &cont, 1);
		socket_write_flush (&as_module_out_buffer);
	}
}
Exemplo n.º 4
0
void as_socket_write_string (ASSocketBuffer * sb, const char *string)
{
	if (sb && sb->fd >= 0) {
		CARD32 len = 0;

		if (string != NULL)
			len = strlen ((char *)string);
		ASSocketWriteInt32 (sb, &len, 1);
		if (len)
			socket_buffered_write (sb, string, len);
	}
}