示例#1
0
文件: t-arch.c 项目: CharizTeam/dpkg
static void
test_dpkg_arch_get_list(void)
{
	struct dpkg_arch *arch;
	int count = 1;

	/* Must never return NULL. */
	arch = dpkg_arch_get_list();
	test_alloc(arch);

	while ((arch = arch->next))
		count++;

	/* The default list should contain 3 architectures. */
	test_pass(count == 3);
}
int
print_foreign_arches(const char *const *argv)
{
  struct dpkg_arch *arch;

  if (*argv)
    badusage(_("--%s takes no arguments"), cipaction->olong);

  dpkg_arch_load_list();

  for (arch = dpkg_arch_get_list(); arch; arch = arch->next) {
    if (arch->type != DPKG_ARCH_FOREIGN)
      continue;

    printf("%s\n", arch->name);
  }

  m_output(stdout, _("<standard output>"));

  return 0;
}
示例#3
0
文件: enquiry.c 项目: pexip/os-dpkg
int
print_foreign_archs(const char *const *argv)
{
  struct dpkg_arch *arch;
  const char *space = "";

  if (*argv)
    badusage(_("--%s takes no arguments"), cipaction->olong);

  for (arch = dpkg_arch_get_list(); arch; arch = arch->next) {
    if (arch->type != arch_foreign)
      continue;
    printf("%s%s", space, arch->name);
    space = " ";
  }
  printf("\n");

  m_output(stdout, _("<standard output>"));

  return 0;
}