示例#1
0
文件: csmsg.c 项目: rcrowder/Burt
/**
 * Send detailed information about a particular pixel -- it's rgb values.
 */
void send_image_info_msg(image_info_pkt_t* info) {
    char txt[64]; // should be plenty
    sprintf(txt, "R,G,B:(%d,%d,%d) Average in area:(%d,%d,%d)", 
            info->r, info->g, info->b, info->avg_r, info->avg_g, info->avg_b, info->x, info->y);

    ScripterMsg* msg = build_debug_msg(txt);
    msg->id = PIXBUF_INFO_MSG_ID;
    send_msg(msg);
    destroy_msg(msg);
    free(info);
}
示例#2
0
文件: csmsg.c 项目: rcrowder/Burt
void send_debug_msg( char* msg, ... ) {
	va_list arg;
	va_start(arg, msg);
	char* txt = malloc(1024); //1K worth of debug is a good start
	vsprintf(txt, msg, arg); //Pay Attention: vprintf - not printf
	va_end(arg);
	ScripterMsg* s_msg = build_debug_msg(txt);
	send_msg(s_msg);
	destroy_msg(s_msg);
	free(txt);
}
示例#3
0
static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
		void (*destroy_msg)(struct rpc_pipe_msg *), int err)
{
	struct rpc_pipe_msg *msg;

	if (list_empty(head))
		return;
	do {
		msg = list_entry(head->next, struct rpc_pipe_msg, list);
		list_del_init(&msg->list);
		msg->errno = err;
		destroy_msg(msg);
	} while (!list_empty(head));
	wake_up(&rpci->waitq);
}
示例#4
0
static void Send(kn_thread_mailbox_t io,ident conn,packet_t p){
	msg_t _msg = new_msg(MSG_PACKET,conn,p,NULL);
	if(0 != kn_send_mail(io,_msg,destroy_msg)){
		destroy_msg(_msg);
	}
}