Пример #1
0
caddr_t
bif_dt_set_tz (caddr_t * qst, caddr_t * err_ret, state_slot_t ** args)
{
  caddr_t arg = bif_date_arg (qst, args, 0, "dt_set_tz");
  long tz = (long) bif_long_arg (qst, args, 1, "dt_set_tz");
  caddr_t res = box_copy (arg);
  DT_SET_TZ (res, tz);
  return res;
}
Пример #2
0
char * media_mlex_macro_resolver (char *call)
{
  int envlen = BOX_ELEMENTS ((caddr_t)mediawiki_env);
  int envidx;
  int call_len;
  static caddr_t last_macro_found = NULL;
  char name_buf[140];
  dk_free_box (last_macro_found);
  last_macro_found = NULL;
  call_len = strlen (call);
  mlex_dbg_printf (("{'%s' => ", call));
  if ((call_len >= 66) || (call_len < 3))
    goto failed; /* see below */
  memcpy (name_buf, call + 1, call_len - 2);
  name_buf[call_len - 2] = '\0';
  for (envidx = 0; envidx < envlen; envidx += 2)
    {
      if (strcmp (mediawiki_env[envidx], name_buf))
        continue;
      last_macro_found = box_copy (mediawiki_env[envidx+1]);
      mlex_dbg_printf (("'%s' via env}", last_macro_found));
      return last_macro_found;
    }
  sprintf (name_buf, "WikiV (U=%.64s) %s", mediawiki_WIKINAME, call);
  IN_TXN;
  last_macro_found = registry_get (name_buf);
  if (NULL != last_macro_found)
    {
      mlex_dbg_printf (("'%s' via registry U=%s}", last_macro_found, mediawiki_WIKINAME));
      LEAVE_TXN;
      return last_macro_found;
    }
  sprintf (name_buf, "WikiV (C=%.64s) %s", mediawiki_CLUSTER, call);
  last_macro_found = registry_get (name_buf);
  if (NULL != last_macro_found)
    {
      mlex_dbg_printf (("'%s' via registry C=%s}", last_macro_found, mediawiki_CLUSTER));
      LEAVE_TXN;
      return last_macro_found;
    }
  sprintf (name_buf, "WikiV %s", call);
  last_macro_found = registry_get (name_buf);
  if (NULL != last_macro_found)
    {
      mlex_dbg_printf (("'%s' via registry}", last_macro_found));
      LEAVE_TXN;
      return last_macro_found;
    }
failed:
  mlex_dbg_printf (("failure }"));
  LEAVE_TXN;
  return NULL;
}
Пример #3
0
box_t* box_join_array(ap_manager_t* man, box_t** tab, size_t size)
{
  size_t i;
  box_t* res;
  res = box_copy(man,tab[0]);
  for (i=1;i<size;i++){
    box_join(man,true,res,tab[i]);
  }
  man->result.flag_best = true;
  man->result.flag_exact = false;
  return res;
}
Пример #4
0
box_t* box_meet_array(ap_manager_t* man, box_t** tab, size_t size)
{
  size_t i;
  box_t* res;
  res = box_copy(man,tab[0]);
  for (i=1;i<size;i++){
    box_meet(man,true,res,tab[i]);
    if (res->p==NULL) break;
  }
  man->result.flag_best = true;
  man->result.flag_exact = true;
  return res;
}
Пример #5
0
static MonoReflectionAssembly *
ves_icall_VInvoke_LoadAssemblyFromVirtuoso (MonoAppDomain *ad, MonoString *message)
{
  char *asm_name;
  caddr_t name = NULL;
  caddr_t code = NULL;
  long len;

  MonoAssembly *ass;
  MonoDomain *domain = virtuoso_domain;
  MonoImage *image = NULL;
#ifdef OLD_KIT_1_1_5
  MonoImageOpenStatus *status;
#else
  MonoImageOpenStatus status;
#endif

  asm_name = mono_string_to_utf8 (message);
  name = box_copy (asm_name);

  code = mono_get_assembly_by_name (&name);

  if (!code)
    return NULL;

  len = box_length (code);

  image = mono_image_open_from_data (code, len, 0, NULL);

  if (!image)
    return NULL;

#ifdef OLD_KIT_1_1_5
  ass = mono_assembly_open ("", NULL, image);
#else
  ass = mono_assembly_load_from (image, "", &status);
#endif

  if (!ass && !status)
    return NULL;

  return mono_assembly_get_object (domain, ass);
}