Example #1
0
static int do_dump(knode_s *node, void *ua, void *ub)
{
	int i;
	kbuf_s *kb = (kbuf_s*)ua;

	kbuf_addf(kb, "\r\nT:%08x A:%08x F:%08x push:%p name:%s\r\n",
			node->type, node->attr, node->flg, node->push,
			node->name);

	for (i = 0; i < node->dstr.cnt; i++)
		kbuf_addf(kb, "\t%02d: %s\r\n", i,
				node->dstr.arr[i].node->name);

	return 0;
}
Example #2
0
static void rpc_watch(int ses, void *opt, void *wch)
{
	void *ua = kopt_wch_ua(wch);
	char *ini;
	kbuf_s kb;
	char *path = kopt_path(opt);

	klog("path:%s\n", path);

	if (kopt_getini_by_opt(opt, &ini))
		return;

	kbuf_init(&kb, 4096);

	kbuf_addf(&kb, "wchnotify %s\r\n%s", path, ini);
	if (send_watch_message((rpc_client_s*)ua, kb.buf))
		close_client((rpc_client_s*)ua);

	kmem_free(ini);
	kbuf_release(&kb);
}