Beispiel #1
0
/*
 * print_category(): Print out all the keyword's value
 *                  in the given category
 */
static int
print_category(int category, int cflag, int kflag)
{
	int		i;
	int		retval = 0;

	if (category == LC_ALL) {
		retval += print_category(LC_CTYPE, cflag, kflag);
		retval += print_category(LC_NUMERIC, cflag, kflag);
		retval += print_category(LC_TIME, cflag, kflag);
		retval += print_category(LC_COLLATE, cflag, kflag);
		retval += print_category(LC_MONETARY, cflag, kflag);
		retval += print_category(LC_MESSAGES, cflag, kflag);
	} else {
		if (cflag) {
			(void) printf("%s\n",
			    locale_name[category].name);
		}

		for (i = 0; key[i].name != NULL; i++) {
			if (key[i].category == category) {
				retval += print_keyword(key[i].name, 0, kflag);
			}
		}
	}
	return (retval);
}
Beispiel #2
0
static void
print_spr (CGEN_CPU_DESC cd,
	   void * dis_info,
	   CGEN_KEYWORD *names,
	   long regno,
	   unsigned int attrs)
{
  /* Use the register index format for any unnamed registers.  */
  if (cgen_keyword_lookup_value (names, regno) == NULL)
    {
      disassemble_info *info = (disassemble_info *) dis_info;
      (*info->fprintf_func) (info->stream, "spr[%ld]", regno);
    }
  else
    print_keyword (cd, dis_info, names, regno, attrs);
}
Beispiel #3
0
/*
 * Print out the keyword value or category info.
 * Call print_category() to print the entire locale category, if the name
 * given is recognized as a category.
 * Otherwise, assume that it is a keyword, and call print_keyword().
 */
static int
print_locale_info(char *name, int cflag, int kflag)
{
	int i;

	for (i = 0; locale_name[i].name != NULL; i++) {
		if (strcmp(locale_name[i].name, name) == 0) {
			/*
			 * name is a category name
			 * print out all keywords in this category
			 */
			return (print_category(locale_name[i].category,
				cflag, kflag));
		}
	}

	/* The name is a keyword name */
	return (print_keyword(name, cflag, kflag));
}