static void get_systeminfo (HWND hDlg)
{
    int type;
    HWND hwnd;
    char buff [BUF_LEN + 1];
    size_t size = 0;

    type = (int)GetWindowAdditionalData (hDlg);
    hwnd = GetDlgItem (hDlg, IDC_SYSINFO);

    buff [BUF_LEN] = 0;
    switch (type) {
    case PAGE_VERSION:
	    size = read_sysinfo ("/proc/version", buff, BUF_LEN);
    	    buff [size] = 0;
	    break;

    case PAGE_CPU:
	    size = read_sysinfo ("/proc/cpuinfo", buff, BUF_LEN);
    	    buff [size] = 0;
	    break;

    case PAGE_MEMINFO:
	    size = read_sysinfo ("/proc/meminfo", buff, BUF_LEN);
    	    buff [size] = 0;
	    break;

    case PAGE_PARTITION:
	    size = read_sysinfo ("/proc/partitions", buff, BUF_LEN);
    	    buff [size] = 0;
	    break;

    case PAGE_MINIGUI:
	    size = snprintf (buff, BUF_LEN,
		"MiniGUI version %d.%d.%d.\n"
		"Copyright (C) 1998-2008 Feynman Software.\n\n"
		"MiniGUI is a mature, rich-featured, embedded "
        "GUI support system.\n\n"
		"For more information, please visit\n\n"
		"http://www.minigui.com\n",
		MINIGUI_MAJOR_VERSION, MINIGUI_MINOR_VERSION, MINIGUI_MICRO_VERSION);
	    break;
    }

    if (size) {
	    SetWindowText (hwnd, buff);
    }
}
예제 #2
0
int
start_session(dldev_t *dev)
{
	/* is the watch connected? */
	if(comm_dev_info_req(dev)){
		ERROR("comm_dev_info_req");
		return -1;
	}

	/* read the system map table */
	if(read_sysmap(dev)){
		ERROR("read_sysmap");
		return -1;
	}

	if(read_sysinfo(dev)){
		ERROR("read_sysinfo");
		return -1;
	}

	return 0;
}