예제 #1
0
int main(int argc, char *argv[])
{
	AdjList *p;
	AdjMatrix *G;

	p = (AdjList *)malloc(sizeof(AdjList));

	p = Creat(p);

	show(p);

	G = init (G);

	G = trans(G, p);

	show_two(G);
//	show_result(p);

	short_path(G);

	return EXIT_SUCCESS;
}
예제 #2
0
/******* The 'show' command *******/
void show_command()
{
    /* show at is undocumented/hidden... */
    static char GPFAR showmess[] =
    "valid set options:  [] = choose one, {} means optional\n\n\
\t'all',  'angles',  'arrow',  'autoscale',  'bar', 'border',  'boxwidth',\n\
\t'clip', 'cntrparam', 'contour',  'data',  'dgrid3d',  'dummy',\n\
\t'encoding', 'format', 'function',  'grid',  'hidden',  'isosamples',\n\
\t'key', 'label', 'linestyle', 'locale', 'logscale', 'mapping', 'margin',\n\
\t'missing', 'offsets', 'origin', 'output', 'plot', 'parametric',\n\
\t'pointsize', 'polar', '[rtuv]range', 'samples', 'size', 'terminal',\n\
\t'tics', 'timestamp', 'timefmt', 'title', 'variables', 'version',\n\
\t'view',   '[xyz]{2}label',   '[xyz]{2}range',   '{m}[xyz]{2}tics',\n\
\t'[xyz]{2}[md]tics',   '[xyz]{2}zeroaxis',   '[xyz]data',   'zero',\n\
\t'zeroaxis'";


    c_token++;

    if (!show_one() && !show_two())
	int_error(showmess, c_token);
    screen_ok = FALSE;
    (void) putc('\n', stderr);
}
예제 #3
0
status_t    __init
c4hw_attach_all (void)
{
    hdw_info_t *hi;
    struct pci_dev *pdev = NULL;
    int         found = 0, i, j;

    error_flag = 0;
    prep_hdw_info ();
    /*** scan PCI bus for all possible boards */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    while ((pdev = pci_get_device (PCI_VENDOR_ID_CONEXANT,
                                   PCI_DEVICE_ID_CN8474,
                                   pdev)))
#else
    while ((pdev = pci_find_device (PCI_VENDOR_ID_CONEXANT,
                                    PCI_DEVICE_ID_CN8474,
                                    pdev)))
#endif
    {
        if (c4_hdw_init (pdev, found))
            found++;
    }
    if (!found)
    {
        pr_warning("No boards found\n");
        return ENODEV;
    }
    /* sanity check for consistant hardware found */
    for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++)
    {
        if (hi->pci_slot != 0xff && (!hi->addr[0] || !hi->addr[1]))
        {
            pr_warning("%s: something very wrong with pci_get_device\n",
                       hi->devname);
            return EIO;
        }
    }
    /* bring board's memory regions on/line */
    for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++)
    {
        if (hi->pci_slot == 0xff)
            break;
        for (j = 0; j < 2; j++)
        {
            if (request_mem_region (hi->addr[j], hi->len[j], hi->devname) == 0)
            {
                pr_warning("%s: memory in use, addr=0x%lx, len=0x%lx ?\n",
                           hi->devname, hi->addr[j], hi->len[j]);
                cleanup_ioremap ();
                return ENOMEM;
            }
            hi->addr_mapped[j] = (unsigned long) ioremap (hi->addr[j], hi->len[j]);
            if (!hi->addr_mapped[j])
            {
                pr_warning("%s: ioremap fails, addr=0x%lx, len=0x%lx ?\n",
                           hi->devname, hi->addr[j], hi->len[j]);
                cleanup_ioremap ();
                return ENOMEM;
            }
#ifdef SBE_MAP_DEBUG
            pr_warning("%s: io remapped from phys %x to virt %x\n",
                       hi->devname, (u_int32_t) hi->addr[j], (u_int32_t) hi->addr_mapped[j]);
#endif
        }
    }

    drvr_state = SBE_DRVR_AVAILABLE;

    /* Have now memory mapped all boards.  Now allow board's access to system */
    for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++)
    {
        if (hi->pci_slot == 0xff)
            break;
        if (pci_enable_device (hi->pdev[0]) ||
                pci_enable_device (hi->pdev[1]))
        {
            drvr_state = SBE_DRVR_DOWN;
            pr_warning("%s: failed to enable card %d slot %d\n",
                       hi->devname, i, hi->pci_slot);
            cleanup_devs ();
            cleanup_ioremap ();
            return EIO;
        }
        pci_set_master (hi->pdev[0]);
        pci_set_master (hi->pdev[1]);
        if (!(hi->ndev = c4_add_dev (hi, i, (long) hi->addr_mapped[0],
                                     (long) hi->addr_mapped[1],
                                     hi->pdev[0]->irq,
                                     hi->pdev[1]->irq)))
        {
            drvr_state = SBE_DRVR_DOWN;
            cleanup_ioremap ();
            /* NOTE: c4_add_dev() does its own device cleanup */
#if 0
            cleanup_devs ();
#endif
            return error_flag;      /* error_flag set w/in add_dev() */
        }
        show_two (hi, i);           /* displays found information */
    }
    return 0;
}