From 1685fa66b1676e37e79bd2441034048b8b97dd2e Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Tue, 1 Aug 2006 20:28:28 -0500 Subject: [PATCH] Made most symbols from mooutils-fs.h private --- moo/mooapp/mooapp.c | 10 +-- moo/mooedit/mooeditor.c | 8 +-- moo/mooedit/plugins/activestrings/as-plugin.c | 2 +- .../plugins/fileselector/moofileselector.c | 2 +- moo/moofileview/moofilesystem.c | 12 ++-- moo/moofileview/moofileview.c | 2 +- moo/mooutils/moomarkup.c | 4 +- moo/mooutils/mooprefs.c | 2 +- moo/mooutils/mooutils-fs.c | 64 +++++++++---------- moo/mooutils/mooutils-fs.h | 28 ++++---- moo/mooutils/mooutils-misc.c | 6 +- 11 files changed, 70 insertions(+), 70 deletions(-) diff --git a/moo/mooapp/mooapp.c b/moo/mooapp/mooapp.c index 78a7354c..91beb3c6 100644 --- a/moo/mooapp/mooapp.c +++ b/moo/mooapp/mooapp.c @@ -660,7 +660,7 @@ moo_app_create_user_data_dir (MooApp *app) if (g_file_test (dir, G_FILE_TEST_IS_DIR)) return dir; - if (!moo_mkdir (dir, &error)) + if (!_moo_mkdir (dir, &error)) { g_warning ("%s: %s", G_STRLOC, error->message); g_error_free (error); @@ -692,7 +692,7 @@ moo_app_python_execute_file (G_GNUC_UNUSED GtkWindow *parent_window) if (!filename) return; - file = m_fopen (filename, "r"); + file = _m_fopen (filename, "r"); if (!file) { @@ -724,7 +724,7 @@ moo_app_python_run_file (MooApp *app, g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (moo_python_running (), FALSE); - file = m_fopen (filename, "r"); + file = _m_fopen (filename, "r"); g_return_val_if_fail (file != NULL, FALSE); res = moo_python_run_file (file, filename); @@ -1126,7 +1126,7 @@ moo_app_quit_real (MooApp *app) if (app->priv->tmpdir) { GError *error = NULL; - moo_rmdir (app->priv->tmpdir, TRUE, &error); + _moo_rmdir (app->priv->tmpdir, TRUE, &error); if (error) { @@ -1613,7 +1613,7 @@ moo_app_tempnam (MooApp *app) dirname = g_build_filename (g_get_tmp_dir (), basename, NULL); g_free (basename); - if (m_mkdir (dirname)) + if (_m_mkdir (dirname)) { g_free (dirname); dirname = NULL; diff --git a/moo/mooedit/mooeditor.c b/moo/mooedit/mooeditor.c index cf538036..70ddaa4e 100644 --- a/moo/mooedit/mooeditor.c +++ b/moo/mooedit/mooeditor.c @@ -843,7 +843,7 @@ window_list_find_file (MooEditor *editor, MooEdit *edit; } data; - data.filename = moo_normalize_file_path (filename); + data.filename = _moo_normalize_file_path (filename); data.edit = NULL; link = g_slist_find_custom (editor->priv->windows, &data, (GCompareFunc) filename_and_doc_cmp); @@ -1088,7 +1088,7 @@ moo_editor_open (MooEditor *editor, MooEdit *doc = NULL; char *filename; - filename = moo_normalize_file_path (info->filename); + filename = _moo_normalize_file_path (info->filename); if (window_list_find_file (editor, filename, &bring_to_front)) { @@ -1672,7 +1672,7 @@ moo_editor_open_file_line (MooEditor *editor, return doc; } - freeme = moo_normalize_file_path (filename); + freeme = _moo_normalize_file_path (filename); filename = freeme; if (!g_file_test (filename, G_FILE_TEST_EXISTS)) @@ -1714,7 +1714,7 @@ moo_editor_new_file (MooEditor *editor, return moo_editor_open_file (editor, window, parent, filename, encoding); - freeme = moo_normalize_file_path (filename); + freeme = _moo_normalize_file_path (filename); filename = freeme; if (!window) diff --git a/moo/mooedit/plugins/activestrings/as-plugin.c b/moo/mooedit/plugins/activestrings/as-plugin.c index 6283303d..642c3e3d 100644 --- a/moo/mooedit/plugins/activestrings/as-plugin.c +++ b/moo/mooedit/plugins/activestrings/as-plugin.c @@ -1139,7 +1139,7 @@ _as_plugin_save_config (MooConfig *config, if (is_default) result = moo_save_user_data_file (AS_FILE, string, -1, error); else - result = moo_save_file_utf8 (file, string, -1, error); + result = _moo_save_file_utf8 (file, string, -1, error); g_free (string); return result; diff --git a/moo/mooedit/plugins/fileselector/moofileselector.c b/moo/mooedit/plugins/fileselector/moofileselector.c index 14fb8b32..21a2bead 100644 --- a/moo/mooedit/plugins/fileselector/moofileselector.c +++ b/moo/mooedit/plugins/fileselector/moofileselector.c @@ -975,7 +975,7 @@ doc_move (MooFileSelector *filesel, { if (moo_edit_save_as (doc, filename, moo_edit_get_encoding (doc), NULL)) { - m_unlink (old_filename); + _m_unlink (old_filename); select_file (filesel, filename, destdir); } diff --git a/moo/moofileview/moofilesystem.c b/moo/moofileview/moofilesystem.c index b83c71bf..19504aab 100644 --- a/moo/moofileview/moofilesystem.c +++ b/moo/moofileview/moofilesystem.c @@ -455,7 +455,7 @@ create_folder (G_GNUC_UNUSED MooFileSystem *fs, { int saved_errno = errno; g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (saved_errno), + _moo_file_error_from_errno (saved_errno), "%s", g_strerror (saved_errno)); return FALSE; } @@ -594,14 +594,14 @@ delete_file (G_GNUC_UNUSED MooFileSystem *fs, isdir = g_file_test (path, G_FILE_TEST_IS_DIR); if (isdir) - return moo_rmdir (path, recursive, error); + return _moo_rmdir (path, recursive, error); - if (m_remove (path)) + if (_m_remove (path)) { int err = errno; char *path_utf8 = g_filename_to_utf8 (path, -1, NULL, NULL, NULL); g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err), + _moo_file_error_from_errno (err), "Could not delete file '%s': %s", path_utf8 ? path_utf8 : BROKEN_NAME, g_strerror (err)); @@ -637,11 +637,11 @@ move_file_unix (G_GNUC_UNUSED MooFileSystem *fs, g_return_val_if_fail (g_path_is_absolute (new_path), FALSE); /* XXX */ - if (m_rename (old_path, new_path)) + if (_m_rename (old_path, new_path)) { int saved_errno = errno; g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (saved_errno), + _moo_file_error_from_errno (saved_errno), "%s", g_strerror (saved_errno)); return FALSE; } diff --git a/moo/moofileview/moofileview.c b/moo/moofileview/moofileview.c index 40bc5907..a0faaec6 100644 --- a/moo/moofileview/moofileview.c +++ b/moo/moofileview/moofileview.c @@ -5715,7 +5715,7 @@ moo_file_view_drop_text (G_GNUC_UNUSED MooFileView *fileview, goto out; } - if (!moo_save_file_utf8 (name, text, -1, &error)) + if (!_moo_save_file_utf8 (name, text, -1, &error)) { char *utf8_name = g_filename_display_name (name); char *err_text = g_strdup_printf ("Could not save file\n%s", utf8_name); diff --git a/moo/mooutils/moomarkup.c b/moo/mooutils/moomarkup.c index 6226a640..5194f2e6 100644 --- a/moo/mooutils/moomarkup.c +++ b/moo/mooutils/moomarkup.c @@ -995,7 +995,7 @@ moo_markup_save (MooMarkupDoc *doc, text = moo_markup_node_get_string (MOO_MARKUP_NODE (doc)); g_return_val_if_fail (text != NULL, FALSE); - result = moo_save_file_utf8 (filename, text, -1, error); + result = _moo_save_file_utf8 (filename, text, -1, error); g_free (text); return result; } @@ -1096,7 +1096,7 @@ moo_markup_save_pretty (MooMarkupDoc *doc, if (MOO_MARKUP_IS_ELEMENT (child)) format_pretty_element (MOO_MARKUP_ELEMENT (child), str, 0, indent); - result = moo_save_file_utf8 (filename, str->str, -1, error); + result = _moo_save_file_utf8 (filename, str->str, -1, error); g_string_free (str, TRUE); return result; } diff --git a/moo/mooutils/mooprefs.c b/moo/mooutils/mooprefs.c index 9baef327..69874460 100644 --- a/moo/mooutils/mooprefs.c +++ b/moo/mooutils/mooprefs.c @@ -1059,7 +1059,7 @@ moo_prefs_save (const char *file, if (empty) { if (g_file_test (file, G_FILE_TEST_EXISTS)) - if (m_unlink (file)) + if (_m_unlink (file)) g_critical ("%s: %s", G_STRLOC, g_strerror (errno)); return TRUE; diff --git a/moo/mooutils/mooutils-fs.c b/moo/mooutils/mooutils-fs.c index a254bdfc..03f81058 100644 --- a/moo/mooutils/mooutils-fs.c +++ b/moo/mooutils/mooutils-fs.c @@ -43,10 +43,10 @@ /* XXX fix this */ gboolean -moo_save_file_utf8 (const char *name, - const char *text, - gssize len, - GError **error) +_moo_save_file_utf8 (const char *name, + const char *text, + gssize len, + GError **error) { GIOChannel *file; GIOStatus status; @@ -150,7 +150,7 @@ rm_r (const char *path, errno = 0; - if (m_remove (file_path)) + if (_m_remove (file_path)) { int err = errno; @@ -165,7 +165,7 @@ rm_r (const char *path, default: success = FALSE; g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err), + _moo_file_error_from_errno (err), "Could not remove '%s': %s", file_path, g_strerror (err)); } @@ -180,12 +180,12 @@ rm_r (const char *path, { errno = 0; - if (m_remove (path) != 0) + if (_m_remove (path) != 0) { int err = errno; success = FALSE; g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err), + _moo_file_error_from_errno (err), "Could not remove '%s': %s", path, g_strerror (err)); } @@ -197,9 +197,9 @@ rm_r (const char *path, gboolean -moo_rmdir (const char *path, - gboolean recursive, - GError **error) +_moo_rmdir (const char *path, + gboolean recursive, + GError **error) { g_return_val_if_fail (path != NULL, FALSE); @@ -207,12 +207,12 @@ moo_rmdir (const char *path, { errno = 0; - if (m_rmdir (path) != 0) + if (_m_rmdir (path) != 0) { int err = errno; char *path_utf8 = g_filename_to_utf8 (path, -1, NULL, NULL, NULL); g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err), + _moo_file_error_from_errno (err), "Could not remove '%s': %s", path_utf8 ? path_utf8 : BROKEN_NAME, g_strerror (err)); @@ -234,8 +234,8 @@ moo_rmdir (const char *path, gboolean -moo_mkdir (const char *path, - GError **error) +_moo_mkdir (const char *path, + GError **error) { struct stat buf; char *utf8_path; @@ -251,7 +251,7 @@ moo_mkdir (const char *path, g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err_code), + _moo_file_error_from_errno (err_code), "Could not create directory '%s': %s", utf8_path ? utf8_path : BROKEN_NAME, g_strerror (err_code)); @@ -264,14 +264,14 @@ moo_mkdir (const char *path, { errno = 0; - if (m_mkdir (path) == -1) + if (_m_mkdir (path) == -1) { int err_code = errno; utf8_path = g_filename_to_utf8 (path, -1, NULL, NULL, NULL); g_set_error (error, MOO_FILE_ERROR, - moo_file_error_from_errno (err_code), + _moo_file_error_from_errno (err_code), "Could not create directory '%s': %s", utf8_path ? utf8_path : BROKEN_NAME, g_strerror (err_code)); @@ -299,7 +299,7 @@ moo_mkdir (const char *path, GQuark -moo_file_error_quark (void) +_moo_file_error_quark (void) { static GQuark quark = 0; @@ -311,7 +311,7 @@ moo_file_error_quark (void) MooFileError -moo_file_error_from_errno (int code) +_moo_file_error_from_errno (int code) { switch (code) { @@ -376,7 +376,7 @@ moo_filename_from_locale (const char *file) char * -moo_normalize_file_path (const char *filename) +_moo_normalize_file_path (const char *filename) { char *freeme = NULL; char *working_dir, *basename, *dirname; @@ -399,7 +399,7 @@ moo_normalize_file_path (const char *filename) errno = 0; - if (m_chdir (dirname) != 0) + if (_m_chdir (dirname) != 0) { int err = errno; g_warning ("%s: %s", G_STRLOC, g_strerror (err)); @@ -412,7 +412,7 @@ moo_normalize_file_path (const char *filename) errno = 0; - if (m_chdir (working_dir) != 0) + if (_m_chdir (working_dir) != 0) { int err = errno; g_warning ("%s: %s", G_STRLOC, g_strerror (err)); @@ -486,7 +486,7 @@ G_STMT_START { \ int -m_unlink (const char *path) +_m_unlink (const char *path) { #ifdef __WIN32__ CCALL_1 (unlink, _wunlink, path); @@ -497,7 +497,7 @@ m_unlink (const char *path) int -m_rmdir (const char *path) +_m_rmdir (const char *path) { #ifdef __WIN32__ CCALL_1 (rmdir, _wrmdir, path); @@ -508,7 +508,7 @@ m_rmdir (const char *path) int -m_chdir (const char *path) +_m_chdir (const char *path) { #ifdef __WIN32__ CCALL_1 (_chdir, _wchdir, path); @@ -519,7 +519,7 @@ m_chdir (const char *path) int -m_mkdir (const char *path) +_m_mkdir (const char *path) { #ifdef __WIN32__ CCALL_1 (mkdir, _wmkdir, path); @@ -530,7 +530,7 @@ m_mkdir (const char *path) int -m_remove (const char *path) +_m_remove (const char *path) { #ifdef __WIN32__ gboolean use_wide_char_api; @@ -573,8 +573,8 @@ m_remove (const char *path) gpointer -m_fopen (const char *path, - const char *mode) +_m_fopen (const char *path, + const char *mode) { #ifdef __WIN32__ gboolean use_wide_char_api; @@ -623,8 +623,8 @@ m_fopen (const char *path, int -m_rename (const char *old_name, - const char *new_name) +_m_rename (const char *old_name, + const char *new_name) { #ifdef __WIN32__ gboolean use_wide_char_api; diff --git a/moo/mooutils/mooutils-fs.h b/moo/mooutils/mooutils-fs.h index 54eb309e..cbf33283 100644 --- a/moo/mooutils/mooutils-fs.h +++ b/moo/mooutils/mooutils-fs.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS -#define MOO_FILE_ERROR (moo_file_error_quark ()) +#define MOO_FILE_ERROR (_moo_file_error_quark ()) typedef enum { @@ -43,37 +43,37 @@ typedef enum MOO_FILE_ERROR_NOT_IMPLEMENTED } MooFileError; -GQuark moo_file_error_quark (void) G_GNUC_CONST; -MooFileError moo_file_error_from_errno (int err_code); +GQuark _moo_file_error_quark (void) G_GNUC_CONST; +MooFileError _moo_file_error_from_errno (int err_code); -gboolean moo_save_file_utf8 (const char *name, +gboolean _moo_save_file_utf8 (const char *name, const char *text, gssize len, GError **error); -gboolean moo_rmdir (const char *path, +gboolean _moo_rmdir (const char *path, gboolean recursive, GError **error); -gboolean moo_mkdir (const char *path, +gboolean _moo_mkdir (const char *path, GError **error); char **moo_filenames_from_locale (char **files); char *moo_filename_from_locale (const char *file); -char *moo_normalize_file_path (const char *filename); +char *_moo_normalize_file_path (const char *filename); /* * C library and WinAPI functions wrappers analogous to glib/gstdio.h */ -int m_unlink (const char *path); -int m_mkdir (const char *path); /* S_IRWXU on unix */ -int m_rmdir (const char *path); -int m_remove (const char *path); -gpointer m_fopen (const char *path, +int _m_unlink (const char *path); +int _m_mkdir (const char *path); /* S_IRWXU on unix */ +int _m_rmdir (const char *path); +int _m_remove (const char *path); +gpointer _m_fopen (const char *path, const char *mode); -int m_rename (const char *old_name, +int _m_rename (const char *old_name, const char *new_name); -int m_chdir (const char *path); +int _m_chdir (const char *path); G_END_DECLS diff --git a/moo/mooutils/mooutils-misc.c b/moo/mooutils/mooutils-misc.c index 618f773f..366d92ff 100644 --- a/moo/mooutils/mooutils-misc.c +++ b/moo/mooutils/mooutils-misc.c @@ -1242,7 +1242,7 @@ moo_make_user_data_dir (void) if (!g_file_test (dir, G_FILE_TEST_IS_DIR)) { - result = m_mkdir (dir); + result = _m_mkdir (dir); if (result) { @@ -1428,10 +1428,10 @@ moo_save_user_data_file (const char *basename, file = moo_get_user_data_file (basename); g_return_val_if_fail (dir && file, FALSE); - if (!moo_mkdir (dir, error)) + if (!_moo_mkdir (dir, error)) goto out; - if (!moo_save_file_utf8 (file, content, len, error)) + if (!_moo_save_file_utf8 (file, content, len, error)) goto out; result = TRUE;