Exemplo n.º 1
0
static void init_available_charsets_IB(char* fname)
{
  myf myflags = MYF(0);
  if (!charset_initialized)
  {
    CHARSET_INFO **cs;
      bzero(&all_charsets,sizeof(all_charsets));
      init_compiled_charsets(myflags);

      /* Copy compiled charsets */
      for (cs=all_charsets;
           cs < all_charsets+array_elements(all_charsets)-1 ;
           cs++)
      {
        if (*cs)
        {
          if (cs[0]->ctype)
            if (init_state_maps(*cs))
              *cs= NULL;
        }
      }
      my_read_charset_file(fname,myflags);
      charset_initialized=1;
  }
}
Exemplo n.º 2
0
static void init_available_charsets(void)
{
  char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
  CHARSET_INFO **cs;
  MY_CHARSET_LOADER loader;

  memset(&all_charsets, 0, sizeof(all_charsets));
  init_compiled_charsets(MYF(0));

  /* Copy compiled charsets */
  for (cs=all_charsets;
       cs < all_charsets+array_elements(all_charsets)-1 ;
       cs++)
  {
    if (*cs)
    {
      if (cs[0]->ctype)
        if (init_state_maps(*cs))
          *cs= NULL;
    }
  }

  my_charset_loader_init_mysys(&loader);
  my_stpcpy(get_charsets_dir(fname), MY_CHARSET_INDEX);
  my_read_charset_file(&loader, fname, MYF(0));
}
Exemplo n.º 3
0
static void init_available_charsets(void)
{
  char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
  MY_CHARSET_LOADER loader;

  memset(&all_charsets, 0, sizeof(all_charsets));
  init_compiled_charsets(MYF(0));

  /* Copy compiled charsets */

  my_charset_loader_init_mysys(&loader);
  my_stpcpy(get_charsets_dir(fname), MY_CHARSET_INDEX);
  my_read_charset_file(&loader, fname, MYF(0));
}
Exemplo n.º 4
0
static my_bool init_available_charsets(myf myflags)
#endif
{
  char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
  my_bool error=FALSE;
  /*
    We have to use charset_initialized to not lock on THR_LOCK_charset
    inside get_internal_charset...
  */
  if (!charset_initialized)
  {
    CHARSET_INFO **cs;
    /*
      To make things thread safe we are not allowing other threads to interfere
      while we may changing the cs_info_table
    */
    pthread_mutex_lock(&THR_LOCK_charset);
    if (!charset_initialized)
    {
      bzero(&all_charsets,sizeof(all_charsets));
      init_compiled_charsets(myflags);
      
      /* Copy compiled charsets */
      for (cs=all_charsets;
           cs < all_charsets+array_elements(all_charsets)-1 ;
           cs++)
      {
        if (*cs)
        {
          if (cs[0]->ctype)
            if (init_state_maps(*cs))
              *cs= NULL;
        }
      }
      
      strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
      error= my_read_charset_file(fname,myflags);
      charset_initialized=1;
    }
    pthread_mutex_unlock(&THR_LOCK_charset);
  }
  return error;
}
Exemplo n.º 5
0
static void init_available_charsets(void)
{
  char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
  CHARSET_INFO **cs;

  bzero(&all_charsets,sizeof(all_charsets));
  init_compiled_charsets(MYF(0));

  /* Copy compiled charsets */
  for (cs=all_charsets;
       cs < all_charsets+array_elements(all_charsets)-1 ;
       cs++)
  {
    if (*cs)
    {
      if (cs[0]->ctype)
        if (init_state_maps(*cs))
          *cs= NULL;
    }
  }

  strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
  my_read_charset_file(fname, MYF(0));
}