Ejemplo n.º 1
0
static Array HHVM_STATIC_METHOD(Locale, parseLocale, const String& locale) {
  String locname = localeOrDefault(locale);
  Array ret = Array::Create();
  if (std::find(g_grandfathered.begin(),
                g_grandfathered.end(), locale.data()) !=
                g_grandfathered.end()) {
    ret.set(s_GRANDFATHERED, locname);
    return ret;
  }
  add_array_entry(ret, locname, LOC_LANG);
  add_array_entry(ret, locname, LOC_SCRIPT);
  add_array_entry(ret, locname, LOC_REGION);
  add_array_entry(ret, locname, LOC_VARIANT);
  add_array_entry(ret, locname, LOC_PRIVATE);
  return ret;
}
Ejemplo n.º 2
0
int	get_option(int argc, char **argv, t_option_struct *option_struct)
{
  int			i;
  int			a;

  i = 1;
  if (argc > 1)
      while (i != argc)
	{
	  if (argv[i][0] == '-')
	    {
	      if (analyze_option(option_struct, argv[i]) == 1)
		return (1);
	    }
	  else 
	    option_struct->pathname = add_array_entry(option_struct->pathname, argv[i]);
	  i++;
	}
  return (0);
}