/* Parse command line modifiers. Return error or number arg parsed. Modifiers must be at the beggining of command line.  */
static int parse_modifiers(char *args[], int count, __u16 *pout, const struct iwconfig_modifier modifier[], int modnum)
/* Parse command line modifiers. Return error or number arg parsed. Modifiers must be at the beggining of command line.  */
static int parse_modifiers(char *args[], int count, __u16 *pout, const struct iwconfig_modifier modifier[], int modnum)
{
  int		i = 0;
  int		k = 0;
  __u16		result = 0;
  do
    {
      for(k = 0; k < modnum; k++)
	{
	  if(!strcasecmp(args[i], modifier[k].cmd))
	    {
	      if(result & modifier[k].exclude)
		{
		  errarg = i;
		  return(IWERR_ARG_CONFLICT);
		}
	      result |= modifier[k].flag;
	      ++i;
	      break;
	    }
	}
    }
  while((i < count) && (k < modnum));
  if(i >= count)
    return(IWERR_ARG_NUM);
  *pout = result;
  return(i);
}