当前位置: 首页>>代码示例>>C++>>正文


C++ pager_output函数代码示例

本文整理汇总了C++中pager_output函数的典型用法代码示例。如果您正苦于以下问题:C++ pager_output函数的具体用法?C++ pager_output怎么用?C++ pager_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pager_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: beri_sdcard_disk_print

static int
beri_sdcard_disk_print(int verbose)
{
	struct disk_devdesc dev;
	char line[80];
	int ret;

	printf("%s devices:", beri_sdcard_disk.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);
	
	snprintf(line, sizeof(line), "    sdcard%d   Altera SD card drive\n", 0);
	ret = pager_output(line);
	if (ret != 0)
	    return (ret);
	dev.dd.d_dev = &beri_sdcard_disk;
	dev.dd.d_unit = 0;
	dev.d_slice = D_SLICENONE;
	dev.d_partition = D_PARTNONE;
	if (disk_open(&dev, altera_sdcard_get_mediasize(),
	    altera_sdcard_get_sectorsize()) == 0) {
		snprintf(line, sizeof(line), "    sdcard%d", 0);
		ret = disk_print(&dev, line, verbose);
		disk_close(&dev);
	}
	return (ret);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:27,代码来源:beri_disk_sdcard.c

示例2: stor_print

static int
stor_print(int verbose)
{
	struct disk_devdesc dev;
	static char line[80];
	int i, ret = 0;

	if (stor_info_no == 0)
		return (ret);

	printf("%s devices:", uboot_storage.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);

	for (i = 0; i < stor_info_no; i++) {
		dev.d_dev = &uboot_storage;
		dev.d_unit = i;
		dev.d_slice = -1;
		dev.d_partition = -1;
		snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i,
		    ub_stor_type(SI(&dev).type));
		if ((ret = pager_output(line)) != 0)
			break;
		if (stor_opendev(&dev) == 0) {
			sprintf(line, "\tdisk%d", i);
			ret = disk_print(&dev, line, verbose);
			disk_close(&dev);
			if (ret != 0)
				break;
		}
	}
	return (ret);
}
开发者ID:yaneurabeya,项目名称:freebsd,代码行数:33,代码来源:disk.c

示例3: beri_cfi_disk_print

static int
beri_cfi_disk_print(int verbose)
{
	struct disk_devdesc dev;
	char line[80];
	int ret;

	printf("%s devices:", beri_cfi_disk.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);

	snprintf(line, sizeof(line), "    cfi%d   CFI flash device\n", 0);
	ret = pager_output(line);
	if (ret != 0)
		return (ret);
	dev.d_dev = &beri_cfi_disk;
	dev.d_unit = 0;
	dev.d_slice = -1;
	dev.d_partition = -1;
	if (disk_open(&dev, cfi_get_mediasize(),
	    cfi_get_sectorsize(), 0) == 0) {
		snprintf(line, sizeof(line), "    cfi%d", 0);
		ret = disk_print(&dev, line, verbose);
		disk_close(&dev);
	}

	return (ret);
}
开发者ID:yaneurabeya,项目名称:freebsd,代码行数:28,代码来源:beri_disk_cfi.c

示例4: command_lskern

int
command_lskern(int argc, char *argv[])
{
    struct preloaded_file	*fp;
    char			lbuf[80];
    int				ch, verbose;

    verbose = 0;
    optind = 1;
    optreset = 1;

    pager_open();
    for (fp = preloaded_files; fp; fp = fp->f_next) {
	snprintf(lbuf, sizeof(lbuf), " %p: %s (%s, 0x%lx)\n", 
		(void *) fp->f_addr, fp->f_name, fp->f_type, (long) fp->f_size);
	pager_output(lbuf);
	if (fp->f_args != NULL) {
	    pager_output("    args: ");
	    pager_output(fp->f_args);
	    pager_output("\n");
	}
    }
    pager_close();
    return(CMD_OK);
}
开发者ID:krytarowski,项目名称:netbsd-current-src-sys,代码行数:25,代码来源:fileload.c

示例5: net_print

static int
net_print(int verbose)
{
	struct netif_driver *drv;
	int i, d, cnt;
	int ret = 0;

	if (netif_drivers[0] == NULL)
		return (ret);

	printf("%s devices:", netdev.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);

	cnt = 0;
	for (d = 0; netif_drivers[d]; d++) {
		drv = netif_drivers[d];
		for (i = 0; i < drv->netif_nifs; i++) {
			printf("\t%s%d:", netdev.dv_name, cnt++);
			if (verbose) {
				printf(" (%s%d)", drv->netif_bname,
				    drv->netif_ifs[i].dif_unit);
			}
			if ((ret = pager_output("\n")) != 0)
				return (ret);
		}
	}
	return (ret);
}
开发者ID:andy2gi,项目名称:illumos-gate,代码行数:29,代码来源:dev_net.c

示例6: efipart_print

static int
efipart_print(int verbose)
{
	char line[80];
	EFI_BLOCK_IO *blkio;
	EFI_HANDLE h;
	EFI_STATUS status;
	u_int unit;
	int ret = 0;

	for (unit = 0, h = efi_find_handle(&efipart_dev, 0);
	    h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) {
		snprintf(line, sizeof(line), "    %s%d:",
		    efipart_dev.dv_name, unit);
		if ((ret = pager_output(line)) != 0)
			break;

		status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio);
		if (!EFI_ERROR(status)) {
			snprintf(line, sizeof(line), "    %llu blocks",
			    (unsigned long long)(blkio->Media->LastBlock + 1));
			if ((ret = pager_output(line)) != 0)
				break;
			if (blkio->Media->RemovableMedia)
				if ((ret = pager_output(" (removable)")) != 0)
					break;
		}
		if ((ret = pager_output("\n")) != 0)
			break;
	}
	return (ret);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:32,代码来源:efipart.c

示例7: fw_print

/*
 * Print information about OHCI chips
 */
static int
fw_print(int verbose)
{
	char line[80];
	int i, ret = 0;
	struct fwohci_softc *sc;

	printf("%s devices:", fwohci.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);

	for (i = 0; i < MAX_OHCI; i ++) {
		sc = &fwinfo[i];
		if (sc->state == FWOHCI_STATE_DEAD)
			break;
		snprintf(line, sizeof(line), "%d: locator=0x%04x devid=0x%08x"
			" base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n",
			i, sc->locator, sc->devid,
			sc->base_addr, sc->handle, sc->bus_id);
		ret = pager_output(line);
		if (ret != 0)
			break;
	}
	return (ret);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:28,代码来源:firewire.c

示例8: efipart_print

static void
efipart_print(int verbose)
{
	char line[80];
	EFI_BLOCK_IO *blkio;
	EFI_HANDLE h;
	EFI_STATUS status;
	u_int unit;

	for (unit = 0, h = efi_find_handle(&efipart_dev, 0);
	    h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) {
		sprintf(line, "    %s%d:", efipart_dev.dv_name, unit);
		pager_output(line);

		status = BS->HandleProtocol(h, &blkio_guid, &blkio);
		if (!EFI_ERROR(status)) {
			sprintf(line, "    %llu blocks",
			    (unsigned long long)(blkio->Media->LastBlock + 1));
			pager_output(line);
			if (blkio->Media->RemovableMedia)
				pager_output(" (removable)");
		}
		pager_output("\n");
	}
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:25,代码来源:efipart.c

示例9: efinet_dev_print

static int
efinet_dev_print(int verbose)
{
	CHAR16 *text;
	EFI_HANDLE h;
	int unit, ret = 0;

	printf("%s devices:", efinet_dev.dv_name);
	if ((ret = pager_output("\n")) != 0)
		return (ret);

	for (unit = 0, h = efi_find_handle(&efinet_dev, 0);
	    h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) {
		printf("    %s%d:", efinet_dev.dv_name, unit);
		if (verbose) {
			text = efi_devpath_name(efi_lookup_devpath(h));
			if (text != NULL) {
				printf("    %S", text);
				efi_free_devpath_name(text);
			}
		}
		if ((ret = pager_output("\n")) != 0)
			break;
	}
	return (ret);
}
开发者ID:benjaminmonthouel,项目名称:illumos-gate,代码行数:26,代码来源:efinet.c

示例10: md_print

static int
md_print(int verbose)
{

    printf("%s devices:", md_dev.dv_name);
    if (pager_output("\n") != 0)
        return (1);

    printf("MD (%u bytes)", MD_IMAGE_SIZE);
    return (pager_output("\n"));
}
开发者ID:yaneurabeya,项目名称:freebsd,代码行数:11,代码来源:md.c

示例11: host_dev_print

static int
host_dev_print(int verbose)
{
	char line[80];

	printf("%s devices:", host_dev.dv_name);
	if (pager_output("\n") != 0)
		return (1);

	sprintf(line, "    host%d:   Host filesystem\n", 0);
	pager_output(line);
}
开发者ID:andy2gi,项目名称:illumos-gate,代码行数:12,代码来源:host.c

示例12: bd_printbsdslice

/*
 * Print out each valid partition in the disklabel of a FreeBSD slice.
 * For size calculations, we assume a 512 byte sector size.
 */
static int
bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix,
    int verbose)
{
    char		line[80];
    char		buf[BIOSDISK_SECSIZE];
    struct disklabel	*lp;
    int			i;

    /* read disklabel */
    if (bd_read(od, offset + LABELSECTOR, 1, buf))
        return (0);
    lp =(struct disklabel *)(&buf[0]);
    if (lp->d_magic != DISKMAGIC) {
	sprintf(line, "%s: FFS  bad disklabel\n", prefix);
	return (pager_output(line));
    }
    
    /* Print partitions */
    for (i = 0; i < lp->d_npartitions; i++) {
	/*
	 * For each partition, make sure we know what type of fs it is.  If
	 * not, then skip it.  However, since floppies often have bogus
	 * fstypes, print the 'a' partition on a floppy even if it is marked
	 * unused.
	 */
	if ((lp->d_partitions[i].p_fstype == FS_BSDFFS) ||
            (lp->d_partitions[i].p_fstype == FS_SWAP) ||
            (lp->d_partitions[i].p_fstype == FS_VINUM) ||
	    ((lp->d_partitions[i].p_fstype == FS_UNUSED) && 
	     (od->od_flags & BD_FLOPPY) && (i == 0))) {

	    /* Only print out statistics in verbose mode */
	    if (verbose)
	        sprintf(line, "  %s%c: %s %s (%d - %d)\n", prefix, 'a' + i,
		    (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap " : 
		    (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
		    "FFS  ",
		    display_size(lp->d_partitions[i].p_size),
		    lp->d_partitions[i].p_offset,
		    lp->d_partitions[i].p_offset + lp->d_partitions[i].p_size);
	    else
	        sprintf(line, "  %s%c: %s\n", prefix, 'a' + i,
		    (lp->d_partitions[i].p_fstype == FS_SWAP) ? "swap" : 
		    (lp->d_partitions[i].p_fstype == FS_VINUM) ? "vinum" :
		    "FFS");
	    if (pager_output(line))
		    return (1);
	}
    }
    return (0);
}
开发者ID:yaneurabeya,项目名称:freebsd,代码行数:56,代码来源:biosdisk.c

示例13: bd_print

/*
 * Print information about disks
 */
static void
bd_print(int verbose)
{
    int		i;
    char	line[80];
    
    for (i = 0; i < nbdinfo; i++) {
	sprintf(line, "    disk%d:   SRM drive %s", i, bdinfo[i].bd_name);
	pager_output(line);
	/* XXX more detail? */
	pager_output("\n");
    }
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:16,代码来源:srmdisk.c

示例14: command_configuration

static int
command_configuration(int argc, char *argv[])
{
	char line[80];
	UINTN i;

	snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n",
		(unsigned long)ST->NumberOfTableEntries);
	pager_open();
	if (pager_output(line)) {
		pager_close();
		return (CMD_OK);
	}

	for (i = 0; i < ST->NumberOfTableEntries; i++) {
		EFI_GUID *guid;

		printf("  ");
		guid = &ST->ConfigurationTable[i].VendorGuid;
		if (!memcmp(guid, &mps, sizeof(EFI_GUID)))
			printf("MPS Table");
		else if (!memcmp(guid, &acpi, sizeof(EFI_GUID)))
			printf("ACPI Table");
		else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID)))
			printf("ACPI 2.0 Table");
		else if (!memcmp(guid, &smbios, sizeof(EFI_GUID)))
			printf("SMBIOS Table %p",
			    ST->ConfigurationTable[i].VendorTable);
		else if (!memcmp(guid, &dxe, sizeof(EFI_GUID)))
			printf("DXE Table");
		else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID)))
			printf("HOB List Table");
		else if (!memcmp(guid, &memtype, sizeof(EFI_GUID)))
			printf("Memory Type Information Table");
		else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID)))
			printf("Debug Image Info Table");
		else if (!memcmp(guid, &fdtdtb, sizeof(EFI_GUID)))
			printf("FDT Table");
		else
			printf("Unknown Table (%s)", guid_to_string(guid));
		snprintf(line, sizeof(line), " at %p\n",
		    ST->ConfigurationTable[i].VendorTable);
		if (pager_output(line))
			break;
	}

	pager_close();
	return (CMD_OK);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:49,代码来源:main.c

示例15: bd_print

/*
 * Print information about disks
 */
static void
bd_print(int verbose)
{
    int				i, j;
    char			line[80];
    struct i386_devdesc		dev;
    struct open_disk		*od;
    struct pc98_partition	*dptr;
    
    for (i = 0; i < nbdinfo; i++) {
	sprintf(line, "    disk%d:   BIOS drive %c:\n", i, 'A' + i);
	pager_output(line);

	/* try to open the whole disk */
	dev.d_unit = i;
	dev.d_kind.biosdisk.slice = -1;
	dev.d_kind.biosdisk.partition = -1;
	
	if (!bd_opendisk(&od, &dev)) {

	    /* Do we have a partition table? */
	    if (od->od_flags & BD_PARTTABOK) {
		dptr = &od->od_slicetab[0];

		/* Check for a "dedicated" disk */
		for (j = 0; j < od->od_nslices; j++) {
		    sprintf(line, "      disk%ds%d", i, j + 1);
		    bd_printslice(od, &dptr[j], line, verbose);
		}
	    }
	    bd_closedisk(od);
	}
    }
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:37,代码来源:biosdisk.c


注:本文中的pager_output函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。