コード例 #1
0
static unit_version_t *
hosting_plugin_load (const char *plugin_dll_name, const char *plugin_load_path)
{
  char *filename, *funname;
  const char *dot;
  hosting_version_t *hver;
  int inx;
  size_t file_name_max_len = strlen (plugin_load_path) + 1 + strlen (plugin_dll_name) + 1;
  size_t funname_max_len;

  filename = (char *) dk_alloc (strlen (plugin_load_path) + 1 + strlen (plugin_dll_name) + 1);
  snprintf (filename, file_name_max_len, "%s/%s", plugin_load_path, plugin_dll_name);
  funname_max_len = strlen (plugin_dll_name) + 6 /* == strlen ("_check") */ + 1;

  filename = (char *) dk_alloc (file_name_max_len);
  snprintf (filename, file_name_max_len, "%s/%s", plugin_load_path, plugin_dll_name);
  funname = (char *) dk_alloc (funname_max_len);
  dot = strchr (plugin_dll_name, '.');
  if (!dot)
    dot = plugin_dll_name + strlen (plugin_dll_name);
  strncpy (funname, plugin_dll_name, dot - plugin_dll_name);
  funname[dot - plugin_dll_name] = 0;
  strncat_size_ck (funname, "_check", funname_max_len - strlen (funname) - 1, funname_max_len);
  hver = hosting_load_and_check_plugin (filename, funname, &dock_hosting_version, NULL);

  for (inx = 0; hver->hv_extensions && hver->hv_extensions[inx]; inx++)
    {
      caddr_t ext = box_dv_short_string (hver->hv_extensions[inx]);
      id_hash_set (ext_hash, (caddr_t) &ext, (caddr_t) &hver);
    }

  return &(hver->hv_pversion);
}
コード例 #2
0
ファイル: CLIcr.c プロジェクト: jplu/virtuoso-opensource
long
stmt_row_bookmark (cli_stmt_t * stmt, caddr_t * row)
{
    long *bmidp;
    long bmid;
    cli_connection_t *con = stmt->stmt_connection;
    caddr_t bm;
    int len;

    if (!stmt->stmt_opts->so_use_bookmarks)
        return 0;

    IN_CON (con);

    if (!con->con_bookmarks)
        con->con_bookmarks = hash_table_allocate (101);

    if (!stmt->stmt_bookmarks)
    {
        stmt->stmt_bookmarks = hash_table_allocate (101);
        stmt->stmt_bookmarks_rev = id_tree_hash_create (101);
    }

    con->con_last_bookmark++;
    len = BOX_ELEMENTS (row);
    bm = row[len - 2];

    bmidp = (long *) id_hash_get (stmt->stmt_bookmarks_rev, (caddr_t) & bm);
    if (bmidp)
    {
        LEAVE_CON (con);
        return (*bmidp);
    }

    bmid = con->con_last_bookmark;
    bm = box_copy_tree (bm);
    sethash ((void *) (ptrlong) bmid, stmt->stmt_bookmarks, (void *) bm);
    id_hash_set (stmt->stmt_bookmarks_rev, (caddr_t) & bm, (caddr_t) & bmid);
    sethash ((void *) (ptrlong) bmid, con->con_bookmarks, (void *) bm);

    LEAVE_CON (con);

    return bmid;
}
コード例 #3
0
void
mpschema_set_view_def (char *name, caddr_t tree)
{
  caddr_t *old_tree = NULL;

  old_tree = (caddr_t *) id_hash_get (xml_global->xs_views, (caddr_t) &name);
  if (old_tree)
    {
      if (*old_tree)
        {
	  if (*old_tree == tree)
	    GPF_T;
	  dk_set_push (xml_global->xs_old_views, *old_tree);
        }
      *old_tree = tree;
    }
  else
    {
      name = box_dv_short_string (name);
      id_hash_set (xml_global->xs_views, (caddr_t) & name, (caddr_t) & tree);
    }
}