/* curl_global_init_mem() globally initializes curl and also registers the user provided callback routines.  */
CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c)
/* curl_global_init_mem() globally initializes curl and also registers the user provided callback routines.  */
CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c)
{
  if(!m || !f || !r || !s || !c)
    return CURLE_FAILED_INIT;
  if(initialized) {
    initialized++;
    return CURLE_OK;
  }
  Curl_cmalloc = m;
  Curl_cfree = f;
  Curl_cstrdup = s;
  Curl_crealloc = r;
  Curl_ccalloc = c;
  return global_init(flags, FALSE);
}