if (__strcasestr (step->from_name, "ANSI_X3.4-1968") != NULL) { dir = from_iso646; var = US; } else if (__strcasestr (step->from_name, "BS_4730") != NULL) { dir = from_iso646; var = GB; } else if (__strcasestr (step->to_name, "ANSI_X3.4-1968") != NULL) { dir = to_iso646; var = US; } else if (__strcasestr (step->to_name, "BS_4730") != NULL) { dir = to_iso646; var = GB; } else { dir = illegal_dir; var = illegal_var; }
for (var = sizeof (names) / sizeof (names[0]) - 1; var > illegal_var; --var) if (__strcasecmp (step->from_name, names[var]) == 0) { dir = from_iso646; break; } else if (__strcasecmp (step->to_name, names[var]) == 0) { dir = to_iso646; break; }
gconv_init (struct gconv_step *step){  /* Determine which direction.  */  struct iso646_data *new_data;  enum direction dir;  enum variant var;  int result;  if (__strcasestr (step->from_name, "ANSI_X3.4-1968") != NULL)    {      dir = from_iso646;      var = US;    }  else if (__strcasestr (step->from_name, "BS_4730") != NULL)    {      dir = from_iso646;      var = GB;    }  else if (__strcasestr (step->to_name, "ANSI_X3.4-1968") != NULL)    {      dir = to_iso646;      var = US;    }  else if (__strcasestr (step->to_name, "BS_4730") != NULL)    {      dir = to_iso646;      var = GB;    }  else    {      dir = illegal_dir;      var = illegal_var;    }  result = GCONV_NOCONV;  if (dir != illegal_dir      && ((new_data	   = (struct iso646_data *) malloc (sizeof (struct iso646_data)))	  != NULL))    {      new_data->dir = dir;      new_data->var = var;      step->data = new_data;      result = GCONV_OK;    }  step->min_needed_from = MIN_NEEDED_FROM;  step->max_needed_from = MIN_NEEDED_FROM;  step->min_needed_to = MIN_NEEDED_TO;  step->max_needed_to = MIN_NEEDED_TO;  step->stateful = 0;  return result;}