Пример #1
0
static int
get_args_needed (printf_spec_dynarr *specs)
{
  int args_needed = 0;
  REGISTER int i;

  /* Figure out how many args are needed.  This may be less than
     the number of specs because a spec could be %% or could be
     missing (literal text at end of format string) or there
     could be specs where the field number is explicitly given.
     We just look for the maximum argument number that's referenced. */

  for (i = 0; i < Dynarr_length (specs); i++)
    {
      char ch = Dynarr_at (specs, i).converter;
      if (ch && ch != '%')
	{
	  int argnum = Dynarr_at (specs, i).argnum;
	  if (argnum > args_needed)
	    args_needed = argnum;
	}
    }

  return args_needed;
}
Пример #2
0
struct console_methods *
decode_console_type (Lisp_Object type, Error_Behavior errb)
{
  int i;

  for (i = 0; i < Dynarr_length (the_console_type_entry_dynarr); i++)
    if (EQ (type, Dynarr_at (the_console_type_entry_dynarr, i).symbol))
      return Dynarr_at (the_console_type_entry_dynarr, i).meths;

  maybe_invalid_constant ("Invalid console type", type, Qconsole, errb);

  return 0;
}