您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vfs_path_free函数代码示例

51自学网 2021-06-03 09:38:49
  C++
这篇教程C++ vfs_path_free函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vfs_path_free函数的典型用法代码示例。如果您正苦于以下问题:C++ vfs_path_free函数的具体用法?C++ vfs_path_free怎么用?C++ vfs_path_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vfs_path_free函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: mcview_done

voidmcview_done (mcview_t * view){    /* Save current file position */    if (mcview_remember_file_position && view->filename_vpath != NULL)    {        save_file_position (view->filename_vpath, -1, 0,                            view->hex_mode ? view->hex_cursor : view->dpy_start,                            view->saved_bookmarks);        view->saved_bookmarks = NULL;    }    /* Write back the global viewer mode */    mcview_default_hex_mode = view->hex_mode;    mcview_default_nroff_flag = view->text_nroff_mode;    mcview_default_magic_flag = view->magic_mode;    mcview_global_wrap_mode = view->text_wrap_mode;    /* Free memory used by the viewer */    /* view->widget needs no destructor */    vfs_path_free (view->filename_vpath);    view->filename_vpath = NULL;    vfs_path_free (view->workdir_vpath);    view->workdir_vpath = NULL;    MC_PTR_FREE (view->command);    mcview_close_datasource (view);    /* the growing buffer is freed with the datasource */    coord_cache_free (view->coord_cache), view->coord_cache = NULL;    if (view->converter == INVALID_CONV)        view->converter = str_cnv_from_term;    if (view->converter != str_cnv_from_term)    {        str_close_conv (view->converter);        view->converter = str_cnv_from_term;    }    mc_search_free (view->search);    view->search = NULL;    g_free (view->last_search_string);    view->last_search_string = NULL;    mcview_nroff_seq_free (&view->search_nroff_seq);    mcview_hexedit_free_change_list (view);    if (mc_global.mc_run_mode == MC_RUN_VIEWER && view->dir != NULL)    {        /* mcviewer is the owner of file list */        dir_list_clean (view->dir);        g_free (view->dir->list);        g_free (view->dir_idx);        g_free (view->dir);    }    view->dir = NULL;}
开发者ID:iNode,项目名称:mc,代码行数:60,


示例2: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */END_PARAMETRIZED_TEST/* *INDENT-ON* *//* --------------------------------------------------------------------------------------------- *//* @Test(dataSource = "test_vfs_path_relative_ds") *//* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_vfs_path_relative_clone, test_vfs_path_relative_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath, *cloned_vpath;    vpath = vfs_path_from_str_flags (data->input_path, VPF_NO_CANON);    /* when */    cloned_vpath = vfs_path_clone (vpath);    /* then */    mctest_assert_int_eq (cloned_vpath->relative, TRUE);    mctest_assert_str_eq (vfs_path_get_last_path_str (cloned_vpath),                          data->expected_last_path_in_element);    mctest_assert_str_eq (vfs_path_as_str (cloned_vpath), data->expected_path);    vfs_path_free (vpath);    vfs_path_free (cloned_vpath);}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:29,


示例3: edit_symlink_cmd

voidedit_symlink_cmd (void){    if (S_ISLNK (selection (current_panel)->st.st_mode))    {        char buffer[MC_MAXPATHLEN];        char *p = NULL;        int i;        char *q;        vfs_path_t *p_vpath;        p = selection (current_panel)->fname;        p_vpath = vfs_path_from_str (p);        q = g_strdup_printf (_("Symlink '%s/' points to:"), str_trunc (p, 32));        i = readlink (p, buffer, MC_MAXPATHLEN - 1);        if (i > 0)        {            char *dest;            buffer[i] = 0;            dest =                input_expand_dialog (_("Edit symlink"), q, MC_HISTORY_FM_EDIT_LINK, buffer,                                     INPUT_COMPLETE_FILENAMES);            if (dest)            {                if (*dest && strcmp (buffer, dest))                {                    save_cwds_stat ();                    if (mc_unlink (p_vpath) == -1)                    {                        message (D_ERROR, MSG_ERROR, _("edit symlink, unable to remove %s: %s"),                                 p, unix_error_string (errno));                    }                    else                    {                        vfs_path_t *dest_vpath;                        dest_vpath = vfs_path_from_str_flags (dest, VPF_NO_CANON);                        if (mc_symlink (dest_vpath, p_vpath) == -1)                            message (D_ERROR, MSG_ERROR, _("edit symlink: %s"),                                     unix_error_string (errno));                        vfs_path_free (dest_vpath);                    }                    update_panels (UP_OPTIMIZE, UP_KEEPSEL);                    repaint_screen ();                }                g_free (dest);            }        }        g_free (q);        vfs_path_free (p_vpath);    }    else    {        message (D_ERROR, MSG_ERROR, _("'%s' is not a symbolic link"),                 selection (current_panel)->fname);    }}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:60,


示例4: do_view_cmd

/** * Run viewer (internal or external) on the currently selected file. * If normal is TRUE, force internal viewer and raw mode (used for F13). */static voiddo_view_cmd (gboolean normal){    /* Directories are viewed by changing to them */    if (S_ISDIR (selection (current_panel)->st.st_mode) || link_isdir (selection (current_panel)))    {        vfs_path_t *fname_vpath;        if (confirm_view_dir && (current_panel->marked || current_panel->dirs_marked))        {            if (query_dialog                (_("Confirmation"), _("Files tagged, want to cd?"), D_NORMAL, 2,                 _("&Yes"), _("&No")) != 0)            {                return;            }        }        fname_vpath = vfs_path_from_str (selection (current_panel)->fname);        if (!do_cd (fname_vpath, cd_exact))            message (D_ERROR, MSG_ERROR, _("Cannot change directory"));        vfs_path_free (fname_vpath);    }    else    {        int file_idx;        vfs_path_t *filename_vpath;        file_idx = current_panel->selected;        filename_vpath = vfs_path_from_str (current_panel->dir.list[file_idx].fname);        view_file (filename_vpath, normal, use_internal_view != 0);        vfs_path_free (filename_vpath);    }    repaint_screen ();}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:39,


示例5: START_TEST

/* *INDENT-OFF* */END_TEST/* *INDENT-ON* *//* --------------------------------------------------------------------------------------------- *//* @Test *//* *INDENT-OFF* */START_TEST (the_file_is_remote)/* *INDENT-ON* */{    /* given */    vfs_path_t *filename_vpath, *local_vpath, *local_vpath_should_be_freeing;    filename_vpath = vfs_path_from_str ("/ftp://some.host/editme.txt");    local_vpath = vfs_path_from_str ("/tmp/blabla-editme.txt");    local_vpath_should_be_freeing = vfs_path_clone (local_vpath);    vfs_file_is_local__return_value = FALSE;    mc_getlocalcopy__return_value = local_vpath_should_be_freeing;    /* when */    execute_with_vfs_arg ("cmd_for_remote_file", filename_vpath);    /* then */    mctest_assert_str_eq (do_execute__lc_shell__captured, "cmd_for_remote_file");    mctest_assert_str_eq (do_execute__command__captured, "/tmp/blabla-editme.txt");    mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);    mctest_assert_int_eq (vfs_path_equal                          (g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),                           filename_vpath), TRUE);    mctest_assert_int_eq (vfs_path_equal                          (mc_getlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);    mctest_assert_int_eq (mc_stat__vpath__captured->len, 2);    mctest_assert_int_eq (vfs_path_equal                          (g_ptr_array_index (mc_stat__vpath__captured, 0), local_vpath), TRUE);    mctest_assert_int_eq (vfs_path_equal                          (g_ptr_array_index (mc_stat__vpath__captured, 0),                           g_ptr_array_index (mc_stat__vpath__captured, 1)), TRUE);    mctest_assert_int_eq (vfs_path_equal                          (mc_ungetlocalcopy__pathname_vpath__captured, filename_vpath), TRUE);    mctest_assert_int_eq (vfs_path_equal (mc_ungetlocalcopy__local_vpath__captured, local_vpath),                          TRUE);    vfs_path_free (filename_vpath);    vfs_path_free (local_vpath);}
开发者ID:MidnightCommander,项目名称:mc,代码行数:54,


示例6: edit_mc_menu_cmd

voidedit_mc_menu_cmd (void){    vfs_path_t *buffer_vpath;    vfs_path_t *menufile_vpath;    int dir = 0;    query_set_sel (1);    dir = query_dialog (_("Menu edit"),                        _("Which menu file do you want to edit?"),                        D_NORMAL, geteuid ()? 2 : 3, _("&Local"), _("&User"), _("&System Wide"));    menufile_vpath = vfs_path_build_filename (mc_global.sysconfig_dir, MC_GLOBAL_MENU, NULL);    if (!exist_file (vfs_path_get_last_path_str (menufile_vpath)))    {        vfs_path_free (menufile_vpath);        menufile_vpath = vfs_path_build_filename (mc_global.share_data_dir, MC_GLOBAL_MENU, NULL);    }    switch (dir)    {    case 0:        buffer_vpath = vfs_path_from_str (MC_LOCAL_MENU);        check_for_default (menufile_vpath, buffer_vpath);        chmod (vfs_path_get_last_path_str (buffer_vpath), 0600);        break;    case 1:        buffer_vpath = mc_config_get_full_vpath (MC_USERMENU_FILE);        check_for_default (menufile_vpath, buffer_vpath);        break;    case 2:        buffer_vpath = vfs_path_build_filename (mc_global.sysconfig_dir, MC_GLOBAL_MENU, NULL);        if (!exist_file (vfs_path_get_last_path_str (buffer_vpath)))        {            vfs_path_free (buffer_vpath);            buffer_vpath = vfs_path_build_filename (mc_global.share_data_dir, MC_GLOBAL_MENU, NULL);        }        break;    default:        vfs_path_free (menufile_vpath);        return;    }    do_edit (buffer_vpath);    vfs_path_free (buffer_vpath);    vfs_path_free (menufile_vpath);}
开发者ID:BpArCuCTeMbI,项目名称:mc,代码行数:52,


示例7: apply_advanced_chowns

static voidapply_advanced_chowns (struct stat *sf){    vfs_path_t *vpath;    char *lc_fname;    gid_t a_gid = sf->st_gid;    uid_t a_uid = sf->st_uid;    lc_fname = current_panel->dir.list[current_file].fname;    vpath = vfs_path_from_str (lc_fname);    need_update = end_chown = TRUE;    if (mc_chmod (vpath, get_mode ()) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chmod /"%s/"/n%s"),                 lc_fname, unix_error_string (errno));    /* call mc_chown only, if mc_chmod didn't fail */    else if (mc_chown (vpath, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) (-1),                       (ch_flags[10] == '+') ? sf->st_gid : (gid_t) (-1)) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chown /"%s/"/n%s"),                 lc_fname, unix_error_string (errno));    do_file_mark (current_panel, current_file, 0);    vfs_path_free (vpath);    do    {        lc_fname = next_file ();        vpath = vfs_path_from_str (lc_fname);        if (mc_stat (vpath, sf) != 0)        {            vfs_path_free (vpath);            break;        }        ch_cmode = sf->st_mode;        if (mc_chmod (vpath, get_mode ()) == -1)            message (D_ERROR, MSG_ERROR, _("Cannot chmod /"%s/"/n%s"),                     lc_fname, unix_error_string (errno));        /* call mc_chown only, if mc_chmod didn't fail */        else if (mc_chown (vpath, (ch_flags[9] == '+') ? a_uid : (uid_t) (-1),                           (ch_flags[10] == '+') ? a_gid : (gid_t) (-1)) == -1)            message (D_ERROR, MSG_ERROR, _("Cannot chown /"%s/"/n%s"),                     lc_fname, unix_error_string (errno));        do_file_mark (current_panel, current_file, 0);        vfs_path_free (vpath);    }    while (current_panel->marked != 0);}
开发者ID:jskDr,项目名称:mc,代码行数:49,


示例8: mc_config_new_or_override_file

static gbooleanmc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path, GError ** error){    gchar *data, *written_data;    gsize len, total_written;    gboolean ret;    int fd;    ssize_t cur_written;    vfs_path_t *ini_vpath;    ini_vpath = vfs_path_from_str (ini_path);    data = g_key_file_to_data (mc_config->handle, &len, NULL);    if (!exist_file (ini_path))    {        ret = g_file_set_contents (ini_path, data, len, error);        g_free (data);        vfs_path_free (ini_vpath);        return ret;    }    mc_util_make_backup_if_possible (ini_path, "~");    fd = mc_open (ini_vpath, O_WRONLY | O_TRUNC, 0);    if (fd == -1)    {        g_propagate_error (error, g_error_new (MC_ERROR, 0, "%s", unix_error_string (errno)));        g_free (data);        vfs_path_free (ini_vpath);        return FALSE;    }    for (written_data = data, total_written = len;         (cur_written = mc_write (fd, (const void *) written_data, total_written)) > 0;         written_data += cur_written, total_written -= cur_written);    mc_close (fd);    g_free (data);    if (cur_written == -1)    {        mc_util_restore_from_backup_if_possible (ini_path, "~");        g_propagate_error (error, g_error_new (MC_ERROR, 0, "%s", unix_error_string (errno)));        vfs_path_free (ini_vpath);        return FALSE;    }    mc_util_unlink_backup_if_possible (ini_path, "~");    vfs_path_free (ini_vpath);    return TRUE;}
开发者ID:Chainie,项目名称:mc,代码行数:48,


示例9: clipboard_text_to_file

/* event callback */gbooleanclipboard_text_to_file (const gchar * event_group_name, const gchar * event_name,                        gpointer init_data, gpointer data){    int file;    vfs_path_t *fname_vpath = NULL;    size_t str_len;    const char *text = (const char *) data;    (void) event_group_name;    (void) event_name;    (void) init_data;    if (text == NULL)        return FALSE;    fname_vpath = mc_config_get_full_vpath (EDIT_CLIP_FILE);    file = mc_open (fname_vpath, O_CREAT | O_WRONLY | O_TRUNC,                    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | O_BINARY);    vfs_path_free (fname_vpath);    if (file == -1)        return TRUE;    str_len = strlen (text);    {        ssize_t ret;        ret = mc_write (file, (char *) text, str_len);        (void) ret;    }    mc_close (file);    return TRUE;}
开发者ID:GarothLongint,项目名称:mc,代码行数:35,


示例10: apply_mask

static voidapply_mask (struct stat *sf){    need_update = TRUE;    end_chmod = TRUE;    do_chmod (sf);    do    {        char *fname;        vfs_path_t *vpath;        gboolean ok;        fname = next_file ();        vpath = vfs_path_from_str (fname);        ok = (mc_stat (vpath, sf) == 0);        vfs_path_free (vpath);        if (!ok)            return;        c_stat = sf->st_mode;        do_chmod (sf);    }    while (current_panel->marked != 0);}
开发者ID:BrEacK,项目名称:mc,代码行数:27,


示例11: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (check_if_filename_and_lineno_will_be_subtituted, check_subtitute_ds)/* *INDENT-ON* */{    /* given */    char *actual_result;    vfs_path_t *filename_vpath;    g_ptr_array_add (mc_config_get_string__return_value, g_strdup (data->config_opts_string));    filename_vpath = vfs_path_from_str (data->file_name);    /* when */    actual_result =        execute_get_external_cmd_opts_from_config (data->app_name, filename_vpath,                                                   data->start_line);    /* then */    /* check returned value */    mctest_assert_str_eq (actual_result, data->expected_result);    /* check calls to mc_config_get_string() function */    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__group__captured, 0),                          CONFIG_EXT_EDITOR_VIEWER_SECTION);    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__param__captured, 0),                          data->app_name);    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__default_value__captured, 0),                          NULL);    vfs_path_free (filename_vpath);}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:32,


示例12: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (the_file_is_local, the_file_is_local_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *filename_vpath;    filename_vpath = vfs_path_from_str (data->input_path);    vfs_file_is_local__return_value = TRUE;    /* when */    execute_with_vfs_arg ("cmd_for_local_file", filename_vpath);    /* then */    mctest_assert_str_eq (do_execute__lc_shell__captured, "cmd_for_local_file");    mctest_assert_str_eq (do_execute__command__captured, data->input_path);    mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);    {        const vfs_path_t *tmp_vpath;        tmp_vpath = (data->input_path == NULL) ? vfs_get_raw_current_dir () : filename_vpath;        mctest_assert_int_eq (vfs_path_equal                              (g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),                               tmp_vpath), TRUE);    }    mctest_assert_int_eq (do_execute__flags__captured, EXECUTE_INTERNAL);    fail_unless (mc_getlocalcopy__pathname_vpath__captured == NULL,                 "/nFunction mc_getlocalcopy() shouldn't be called!");    vfs_path_free (filename_vpath);}
开发者ID:MidnightCommander,项目名称:mc,代码行数:32,


示例13: START_TEST

END_TEST/* --------------------------------------------------------------------------------------------- */#define ETALON_STR "/path/to/file.ext/test1://#enc:KOI8-R"START_TEST (test_vfs_path_encoding_at_end){    vfs_path_t *vpath;    char *result;    const vfs_path_element_t *element;    mc_global.sysconfig_dir = (char *) TEST_SHARE_DIR;    load_codepages_list ();    vpath = vfs_path_from_str_flags ("/path/to/file.ext#test1:/#enc:KOI8-R", VPF_USE_DEPRECATED_PARSER);    result = vfs_path_to_str(vpath);    element = vfs_path_get_by_index(vpath, -1);    fail_unless(*element->path == '/0', "element->path should be empty, but actual value is '%s'",element->path);    fail_unless(element->encoding != NULL && strcmp(element->encoding, "KOI8-R") == 0,     "element->encoding should be 'KOI8-R', but actual value is '%s'",element->encoding);    fail_unless( result != NULL && strcmp(result, ETALON_STR) ==0,    "/nactual: %s/netalon: %s", result , ETALON_STR );    g_free(result);    vfs_path_free(vpath);    free_codepages_list ();}
开发者ID:ryanlee,项目名称:mc,代码行数:28,


示例14: hotlist_cmd

voidhotlist_cmd (void){    char *target;    target = hotlist_show (LIST_HOTLIST);    if (!target)        return;    if (get_current_type () == view_tree)        tree_chdir (the_tree, target);    else    {        vfs_path_t *deprecated_vpath;        char *cmd;        deprecated_vpath = vfs_path_from_str_flags (target, VPF_USE_DEPRECATED_PARSER);        cmd = g_strconcat ("cd ", vfs_path_as_str (deprecated_vpath), (char *) NULL);        vfs_path_free (deprecated_vpath);        do_cd_command (cmd);        g_free (cmd);    }    g_free (target);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:25,


示例15: edit_cmd_new

voidedit_cmd_new (void){    vfs_path_t *fname_vpath = NULL;    if (editor_ask_filename_before_edit)    {        char *fname;        fname = input_expand_dialog (_("Edit file"), _("Enter file name:"),                                     MC_HISTORY_EDIT_LOAD, "", INPUT_COMPLETE_FILENAMES);        if (fname == NULL)            return;        if (*fname != '/0')            fname_vpath = vfs_path_from_str (fname);        g_free (fname);    }#ifdef HAVE_CHARSET    mc_global.source_codepage = default_source_codepage;#endif    do_edit (fname_vpath);    vfs_path_free (fname_vpath);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:27,


示例16: my_mkdir_rec

static intmy_mkdir_rec (const vfs_path_t * s_vpath, mode_t mode){    vfs_path_t *q;    int result;    if (mc_mkdir (s_vpath, mode) == 0)        return 0;    if (errno != ENOENT)        return (-1);    /* FIXME: should check instead if s_vpath is at the root of that filesystem */    if (!vfs_file_is_local (s_vpath))        return (-1);    if (strcmp (vfs_path_as_str (s_vpath), PATH_SEP_STR) == 0)    {        errno = ENOTDIR;        return (-1);    }    q = vfs_path_append_new (s_vpath, "..", NULL);    result = my_mkdir_rec (q, mode);    vfs_path_free (q);    if (result == 0)        result = mc_mkdir (s_vpath, mode);    return result;}
开发者ID:BpArCuCTeMbI,项目名称:mc,代码行数:30,


示例17: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_path_to_str_flags, test_path_to_str_flags_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath;    char *str_path;    test_init_vfs ("UTF-8");    test_subclass1.flags = VFS_S_REMOTE;    vfs_s_init_class (&vfs_test_ops1, &test_subclass1);    vfs_test_ops1.name = "testfs1";    vfs_test_ops1.flags = VFSF_NOLINKS;    vfs_test_ops1.prefix = "test1";    vfs_register_class (&vfs_test_ops1);    /* when */    vpath = vfs_path_from_str_flags (data->input_path, data->input_from_str_flags);    str_path = vfs_path_to_str_flags (vpath, 0, data->input_to_str_flags);    /* then */    mctest_assert_str_eq (str_path, data->expected_path);    g_free (str_path);    vfs_path_free (vpath);    test_deinit_vfs ();}
开发者ID:Wizzardich,项目名称:mc,代码行数:29,


示例18: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_cd, test_cd_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath;    vfs_test_ops.flags = data->input_class_flags;    test_subclass.flags = data->input_subclass_flags;    vfs_register_class (&vfs_test_ops);    vfs_set_raw_current_dir (vfs_path_from_str (data->input_initial_path));    vpath = vfs_path_from_str (data->input_cd_path);    /* when */    mc_chdir (vpath);    /* then */    {        char *actual_cd_path;        actual_cd_path = _vfs_get_cwd ();        mctest_assert_str_eq (actual_cd_path, data->expected_cd_path);        g_free (actual_cd_path);    }    vfs_path_free (vpath);}
开发者ID:CTU-OSP,项目名称:mc,代码行数:28,


示例19: START_TEST

END_TEST/* --------------------------------------------------------------------------------------------- */START_TEST(test_encode_info_at_start){    vfs_path_t *vpath;    char *actual;    const vfs_path_element_t *vpath_element;    test_init_vfs("UTF-8");    vpath = vfs_path_from_str ("#enc:KOI8-R/bla-bla/some/path");    actual = vfs_path_to_str (vpath);    fail_unless (strcmp ("/#enc:KOI8-R/bla-bla/some/path", actual) == 0, "/nactual=%s/n", actual);    vpath_element = vfs_path_get_by_index (vpath, -1);    fail_unless (strcmp ("/bla-bla/some/path", vpath_element->path) == 0, "/nvpath_element->path=%s/n", vpath_element->path);    g_free (actual);    vfs_path_free (vpath);    test_deinit_vfs();}
开发者ID:Chainie,项目名称:mc,代码行数:26,


示例20: teardown

/* @After */static voidteardown (void){    vfs_path_free (do_cd__new_dir_vpath__captured);    vfs_shut ();    str_uninit_strings ();}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:8,


示例21: START_TEST

/* *INDENT-OFF* */END_TEST/* *INDENT-ON* *//* --------------------------------------------------------------------------------------------- *//* @Test *//* *INDENT-OFF* */START_TEST (test_mc_mkstemps)/* *INDENT-ON* */{    /* given */    vfs_path_t *pname_vpath = NULL;    char *pname = NULL;    char *begin_pname;    int fd;    /* when */    fd = mc_mkstemps (&pname_vpath, "mctest-", NULL);    if (fd != -1)        pname = vfs_path_to_str (pname_vpath);    begin_pname = g_build_filename (mc_tmpdir (), "mctest-", NULL);    /* then */    vfs_path_free (pname_vpath);    close (fd);    mctest_assert_int_ne (fd, -1);    fail_unless (g_file_test (pname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR),                 "/nNo such file: %s/n", pname);    unlink (pname);    fail_unless (strncmp (pname, begin_pname, strlen (begin_pname)) == 0,                 "/nstart of %s should be equal to %s/n", pname, begin_pname);    g_free (pname);}
开发者ID:Wizzardich,项目名称:mc,代码行数:34,


示例22: exec_cleanup_script

static voidexec_cleanup_script (vfs_path_t * script_vpath){    if (script_vpath != NULL)    {        (void) mc_unlink (script_vpath);        vfs_path_free (script_vpath);    }}
开发者ID:inso,项目名称:mc,代码行数:9,


示例23: my_rmdir

intmy_rmdir (const char *s){    int result;    vfs_path_t *vpath;    vpath = vfs_path_from_str_flags (s, VPF_NO_CANON);    /* FIXME: Should receive a Wtree! */    result = mc_rmdir (vpath);    if (result == 0)    {        vfs_path_t *my_s;        my_s = get_absolute_name (vpath);        vfs_path_free (my_s);    }    vfs_path_free (vpath);    return result;}
开发者ID:BpArCuCTeMbI,项目名称:mc,代码行数:19,


示例24: mcview_remove_ext_script

static voidmcview_remove_ext_script (mcview_t * view){    if (view->ext_script != NULL)    {        mc_unlink (view->ext_script);        vfs_path_free (view->ext_script);        view->ext_script = NULL;    }}
开发者ID:m32,项目名称:mc,代码行数:10,


示例25: edit_cmd_force_internal

voidedit_cmd_force_internal (void){    vfs_path_t *fname;    fname = vfs_path_from_str (selection (current_panel)->fname);    if (regex_command (fname, "Edit") == 0)        edit_file_at_line (fname, TRUE, 1);    vfs_path_free (fname);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:10,


示例26: edit_cmd

voidedit_cmd (void){    vfs_path_t *fname;    fname = vfs_path_from_str (selection (current_panel)->fname);    if (regex_command (fname, "Edit") == 0)        do_edit (fname);    vfs_path_free (fname);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:10,


示例27: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_path_equal_len, test_path_equal_len_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath1, *vpath2;    gboolean actual_result;    vpath1 = vfs_path_from_str (data->input_path1);    vpath2 = vfs_path_from_str (data->input_path2);    /* when */    actual_result = vfs_path_equal_len (vpath1, vpath2, data->input_length);    /* then */    mctest_assert_int_eq (actual_result, data->expected_result);    vfs_path_free (vpath1);    vfs_path_free (vpath2);}
开发者ID:idispatch,项目名称:mc,代码行数:20,



注:本文中的vfs_path_free函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vfs_path_from_str函数代码示例
C++ vfs_path_as_str函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。