mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Merge branch '4524_cleanup'
* 4524_cleanup: (41 commits) Update po/*.po files. Remove src/editor/.gitignore. Indentation using GNU indent-2.2.13. clang: fix `-Wconstant-conversion` warning clang: fix `-Wpointer-sign` warning buildsys: prefer gnu indent (gindent) to bsd indent if available buildsys: update ax_gcc_func_attribute to fix fallthrough detection clang: fix `-Wimplicit-fallthrough` warning clang: fix `-Wconditional-uninitialized` warnings buildsys: fix build on macOS with libssh2 present via homebrew m4: add Werror when checking for compiler flags (path_trunc): optimization. (vfs_path_build_url_params_str): minor refactoring. (vfs_path_from_str_uri_parser): fix coding style. (mc_search__glob_translate_to_regex): reduce variable scope, refactor. src/filemanager/find.c: remove unneeded intialization of local variables. (do_find): minor refactoring. src/filemanager/find.c: ret rid of string duplication. (search_content): reduce variable scope. (do_find): fix coding style. ...
This commit is contained in:
commit
4139bb82a7
@ -115,7 +115,7 @@ cppcheck-split-all: \
|
||||
cppcheck-unusedFunction \
|
||||
cppcheck-missingInclude
|
||||
|
||||
INDENT_CMD = indent \
|
||||
INDENT_CMD = $(INDENT) \
|
||||
--gnu-style \
|
||||
--format-first-column-comments \
|
||||
--indent-level4 \
|
||||
|
@ -212,6 +212,7 @@ dnl Check for other tools
|
||||
dnl ############################################################################
|
||||
|
||||
AC_CHECK_TOOL(AR, ar, ar)
|
||||
AC_CHECK_TOOL(INDENT, gindent, indent)
|
||||
mc_UNIT_TESTS
|
||||
|
||||
|
||||
|
37
doc/NEWS
37
doc/NEWS
@ -2,33 +2,34 @@ Version 4.8.31
|
||||
|
||||
- Core
|
||||
|
||||
* Minimal version of GLib is 2.32.0.
|
||||
* Minimal version of GLib is 2.32.0.
|
||||
|
||||
- VFS
|
||||
|
||||
* fish: drop support of native FISH server and protocol. Rename VFS to shell (#4232)
|
||||
* extfs;
|
||||
* uc1541 extfs: update up to 3.6 version (#4511)
|
||||
* s3+: port to Python3 (#4324)
|
||||
* Support for LZO/LZOP compression format (#4509)
|
||||
* fish: drop support of native FISH server and protocol. Rename VFS to shell (#4232)
|
||||
* extfs;
|
||||
* uc1541 extfs: update up to 3.6 version (#4511)
|
||||
* s3+: port to Python3 (#4324)
|
||||
* Support for LZO/LZOP compression format (#4509)
|
||||
|
||||
- Misc
|
||||
|
||||
* Skins: add color for non-printable characters in editor (#4433)
|
||||
* Code clean up (#4490)
|
||||
* Skins: add color for non-printable characters in editor (#4433)
|
||||
|
||||
- Fixes
|
||||
|
||||
* FTBFS on FreeBSD with ext2fs attribute support (#4493)
|
||||
* Broken stickchars (-a) mode (#4498)
|
||||
* Wrong timestamp after resuming of file copy operation (#4499)
|
||||
* Editor: wrong deletion of marked column (#3761)
|
||||
* Diff viewer: segfault when display of line numbers is enabled (#4500)
|
||||
* Tar VFS: broken handling of hard links (#4494)
|
||||
* Sftp VFS: failure establishing SSH session due hashed host names in ~/.ssh/known_hosts (#4506)
|
||||
* Shell VFS: incorrect file names with cyrillic or diacritic symbols (#4507)
|
||||
* mc.ext.ini: incorrect description of of how multiple sections and keys with same names are processed (#4497)
|
||||
* mc.ext.ini: unescaped backslash \ is treated as invalid escape sequence in glib-2.77.3 and glib-2.79 (#4502)
|
||||
* mc.ext.ini: file "Makefile.zip" is handled as Makefile not as zip-arhive (#4419)
|
||||
* FTBFS on FreeBSD with ext2fs attribute support (#4493)
|
||||
* Broken stickchars (-a) mode (#4498)
|
||||
* Wrong timestamp after resuming of file copy operation (#4499)
|
||||
* Editor: wrong deletion of marked column (#3761)
|
||||
* Diff viewer: segfault when display of line numbers is enabled (#4500)
|
||||
* Tar VFS: broken handling of hard links (#4494)
|
||||
* Sftp VFS: failure establishing SSH session due hashed host names in ~/.ssh/known_hosts (#4506)
|
||||
* Shell VFS: incorrect file names with cyrillic or diacritic symbols (#4507)
|
||||
* mc.ext.ini: incorrect description of of how multiple sections and keys with same names are processed (#4497)
|
||||
* mc.ext.ini: unescaped backslash \ is treated as invalid escape sequence in glib-2.77.3 and glib-2.79 (#4502)
|
||||
* mc.ext.ini: file "Makefile.zip" is handled as Makefile not as zip-arhive (#4419)
|
||||
|
||||
|
||||
Version 4.8.30
|
||||
|
@ -94,7 +94,7 @@ free_codepage_desc (gpointer data)
|
||||
/* returns display codepage */
|
||||
|
||||
static void
|
||||
load_codepages_list_from_file (GPtrArray ** list, const char *fname)
|
||||
load_codepages_list_from_file (GPtrArray **list, const char *fname)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[BUF_MEDIUM];
|
||||
|
@ -48,7 +48,7 @@ GTree *mc_event_grouplist = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_init (GError ** mcerror)
|
||||
mc_event_init (GError **mcerror)
|
||||
{
|
||||
mc_return_val_if_error (mcerror, FALSE);
|
||||
|
||||
@ -74,7 +74,7 @@ mc_event_init (GError ** mcerror)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_deinit (GError ** mcerror)
|
||||
mc_event_deinit (GError **mcerror)
|
||||
{
|
||||
mc_return_val_if_error (mcerror, FALSE);
|
||||
|
||||
@ -92,7 +92,7 @@ mc_event_deinit (GError ** mcerror)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_mass_add (const event_init_t * events, GError ** mcerror)
|
||||
mc_event_mass_add (const event_init_t *events, GError **mcerror)
|
||||
{
|
||||
size_t array_index;
|
||||
|
||||
@ -113,7 +113,7 @@ mc_event_mass_add (const event_init_t * events, GError ** mcerror)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_present (const gchar * event_group_name, const gchar * event_name)
|
||||
mc_event_present (const gchar *event_group_name, const gchar *event_name)
|
||||
{
|
||||
GTree *event_group;
|
||||
GPtrArray *callbacks;
|
||||
|
@ -57,8 +57,8 @@ mc_event_group_destroy_value (gpointer data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_add (const gchar * event_group_name, const gchar * event_name,
|
||||
mc_event_callback_func_t event_callback, gpointer event_init_data, GError ** mcerror)
|
||||
mc_event_add (const gchar *event_group_name, const gchar *event_name,
|
||||
mc_event_callback_func_t event_callback, gpointer event_init_data, GError **mcerror)
|
||||
{
|
||||
GTree *event_group;
|
||||
GPtrArray *callbacks;
|
||||
@ -95,7 +95,7 @@ mc_event_add (const gchar * event_group_name, const gchar * event_name,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_event_del (const gchar * event_group_name, const gchar * event_name,
|
||||
mc_event_del (const gchar *event_group_name, const gchar *event_name,
|
||||
mc_event_callback_func_t event_callback, gpointer event_init_data)
|
||||
{
|
||||
GTree *event_group;
|
||||
@ -122,7 +122,7 @@ mc_event_del (const gchar * event_group_name, const gchar * event_name,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_event_destroy (const gchar * event_group_name, const gchar * event_name)
|
||||
mc_event_destroy (const gchar *event_group_name, const gchar *event_name)
|
||||
{
|
||||
GTree *event_group;
|
||||
|
||||
@ -136,7 +136,7 @@ mc_event_destroy (const gchar * event_group_name, const gchar * event_name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_event_group_del (const gchar * event_group_name)
|
||||
mc_event_group_del (const gchar *event_group_name)
|
||||
{
|
||||
|
||||
if (mc_event_grouplist != NULL && event_group_name != NULL)
|
||||
@ -146,8 +146,8 @@ mc_event_group_del (const gchar * event_group_name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GTree *
|
||||
mc_event_get_event_group_by_name (const gchar * event_group_name, gboolean create_new,
|
||||
GError ** mcerror)
|
||||
mc_event_get_event_group_by_name (const gchar *event_group_name, gboolean create_new,
|
||||
GError **mcerror)
|
||||
{
|
||||
GTree *event_group;
|
||||
|
||||
@ -175,8 +175,8 @@ mc_event_get_event_group_by_name (const gchar * event_group_name, gboolean creat
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GPtrArray *
|
||||
mc_event_get_event_by_name (GTree * event_group, const gchar * event_name, gboolean create_new,
|
||||
GError ** mcerror)
|
||||
mc_event_get_event_by_name (GTree *event_group, const gchar *event_name, gboolean create_new,
|
||||
GError **mcerror)
|
||||
{
|
||||
GPtrArray *callbacks;
|
||||
|
||||
@ -199,7 +199,7 @@ mc_event_get_event_by_name (GTree * event_group, const gchar * event_name, gbool
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
mc_event_callback_t *
|
||||
mc_event_is_callback_in_array (GPtrArray * callbacks, mc_event_callback_func_t event_callback,
|
||||
mc_event_is_callback_in_array (GPtrArray *callbacks, mc_event_callback_func_t event_callback,
|
||||
gpointer event_init_data)
|
||||
{
|
||||
guint array_index;
|
||||
|
@ -46,7 +46,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_event_raise (const gchar * event_group_name, const gchar * event_name, gpointer event_data)
|
||||
mc_event_raise (const gchar *event_group_name, const gchar *event_name, gpointer event_data)
|
||||
{
|
||||
GTree *event_group;
|
||||
GPtrArray *callbacks;
|
||||
|
@ -63,7 +63,7 @@ mc_fhl_filter_free (gpointer data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_fhl_array_free (mc_fhl_t * fhl)
|
||||
mc_fhl_array_free (mc_fhl_t *fhl)
|
||||
{
|
||||
if (fhl->filters != NULL)
|
||||
{
|
||||
@ -104,7 +104,7 @@ mc_fhl_new (gboolean need_auto_fill)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_fhl_free (mc_fhl_t ** fhl)
|
||||
mc_fhl_free (mc_fhl_t **fhl)
|
||||
{
|
||||
if (fhl == NULL || *fhl == NULL)
|
||||
return;
|
||||
@ -117,7 +117,7 @@ mc_fhl_free (mc_fhl_t ** fhl)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_fhl_clear (mc_fhl_t * fhl)
|
||||
mc_fhl_clear (mc_fhl_t *fhl)
|
||||
{
|
||||
if (fhl != NULL)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
/*inline functions */
|
||||
inline static gboolean
|
||||
mc_fhl_is_file (const file_entry_t * fe)
|
||||
mc_fhl_is_file (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISREG == 0
|
||||
(void) fe;
|
||||
@ -60,7 +60,7 @@ mc_fhl_is_file (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_file_exec (const file_entry_t * fe)
|
||||
mc_fhl_is_file_exec (const file_entry_t *fe)
|
||||
{
|
||||
return is_exe (fe->st.st_mode);
|
||||
}
|
||||
@ -68,7 +68,7 @@ mc_fhl_is_file_exec (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_dir (const file_entry_t * fe)
|
||||
mc_fhl_is_dir (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISDIR == 0
|
||||
(void) fe;
|
||||
@ -79,7 +79,7 @@ mc_fhl_is_dir (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_link (const file_entry_t * fe)
|
||||
mc_fhl_is_link (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISLNK == 0
|
||||
(void) fe;
|
||||
@ -90,7 +90,7 @@ mc_fhl_is_link (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_hlink (const file_entry_t * fe)
|
||||
mc_fhl_is_hlink (const file_entry_t *fe)
|
||||
{
|
||||
return (fe->st.st_nlink > 1);
|
||||
}
|
||||
@ -98,7 +98,7 @@ mc_fhl_is_hlink (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_link_to_dir (const file_entry_t * fe)
|
||||
mc_fhl_is_link_to_dir (const file_entry_t *fe)
|
||||
{
|
||||
return mc_fhl_is_link (fe) && fe->f.link_to_dir != 0;
|
||||
}
|
||||
@ -106,7 +106,7 @@ mc_fhl_is_link_to_dir (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_stale_link (const file_entry_t * fe)
|
||||
mc_fhl_is_stale_link (const file_entry_t *fe)
|
||||
{
|
||||
return mc_fhl_is_link (fe) ? (fe->f.stale_link != 0) : !mc_fhl_is_file (fe);
|
||||
}
|
||||
@ -114,7 +114,7 @@ mc_fhl_is_stale_link (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_device_char (const file_entry_t * fe)
|
||||
mc_fhl_is_device_char (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISCHR == 0
|
||||
(void) fe;
|
||||
@ -125,7 +125,7 @@ mc_fhl_is_device_char (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_device_block (const file_entry_t * fe)
|
||||
mc_fhl_is_device_block (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISBLK == 0
|
||||
(void) fe;
|
||||
@ -136,7 +136,7 @@ mc_fhl_is_device_block (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_special_socket (const file_entry_t * fe)
|
||||
mc_fhl_is_special_socket (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISSOCK == 0
|
||||
(void) fe;
|
||||
@ -147,7 +147,7 @@ mc_fhl_is_special_socket (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_special_fifo (const file_entry_t * fe)
|
||||
mc_fhl_is_special_fifo (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISFIFO == 0
|
||||
(void) fe;
|
||||
@ -158,7 +158,7 @@ mc_fhl_is_special_fifo (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_special_door (const file_entry_t * fe)
|
||||
mc_fhl_is_special_door (const file_entry_t *fe)
|
||||
{
|
||||
#if HAVE_S_ISDOOR == 0
|
||||
(void) fe;
|
||||
@ -169,7 +169,7 @@ mc_fhl_is_special_door (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
inline static gboolean
|
||||
mc_fhl_is_special (const file_entry_t * fe)
|
||||
mc_fhl_is_special (const file_entry_t *fe)
|
||||
{
|
||||
return
|
||||
(mc_fhl_is_special_socket (fe) || mc_fhl_is_special_fifo (fe)
|
||||
@ -179,8 +179,8 @@ mc_fhl_is_special (const file_entry_t * fe)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_fhl_get_color_filetype (const mc_fhl_filter_t * mc_filter, const mc_fhl_t * fhl,
|
||||
const file_entry_t * fe)
|
||||
mc_fhl_get_color_filetype (const mc_fhl_filter_t *mc_filter, const mc_fhl_t *fhl,
|
||||
const file_entry_t *fe)
|
||||
{
|
||||
gboolean my_color = FALSE;
|
||||
|
||||
@ -258,8 +258,8 @@ mc_fhl_get_color_filetype (const mc_fhl_filter_t * mc_filter, const mc_fhl_t * f
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_fhl_get_color_regexp (const mc_fhl_filter_t * mc_filter, const mc_fhl_t * fhl,
|
||||
const file_entry_t * fe)
|
||||
mc_fhl_get_color_regexp (const mc_fhl_filter_t *mc_filter, const mc_fhl_t *fhl,
|
||||
const file_entry_t *fe)
|
||||
{
|
||||
(void) fhl;
|
||||
|
||||
@ -277,7 +277,7 @@ mc_fhl_get_color_regexp (const mc_fhl_filter_t * mc_filter, const mc_fhl_t * fhl
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_fhl_get_color (const mc_fhl_t * fhl, const file_entry_t * fe)
|
||||
mc_fhl_get_color (const mc_fhl_t *fhl, const file_entry_t *fe)
|
||||
{
|
||||
guint i;
|
||||
int ret;
|
||||
|
@ -52,7 +52,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_fhl_parse_fill_color_info (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, const gchar * group_name)
|
||||
mc_fhl_parse_fill_color_info (mc_fhl_filter_t *mc_filter, mc_fhl_t *fhl, const gchar *group_name)
|
||||
{
|
||||
(void) fhl;
|
||||
|
||||
@ -62,7 +62,7 @@ mc_fhl_parse_fill_color_info (mc_fhl_filter_t * mc_filter, mc_fhl_t * fhl, const
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_fhl_parse_get_file_type_id (mc_fhl_t * fhl, const gchar * group_name)
|
||||
mc_fhl_parse_get_file_type_id (mc_fhl_t *fhl, const gchar *group_name)
|
||||
{
|
||||
mc_fhl_filter_t *mc_filter;
|
||||
|
||||
@ -107,7 +107,7 @@ mc_fhl_parse_get_file_type_id (mc_fhl_t * fhl, const gchar * group_name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_fhl_parse_get_regexp (mc_fhl_t * fhl, const gchar * group_name)
|
||||
mc_fhl_parse_get_regexp (mc_fhl_t *fhl, const gchar *group_name)
|
||||
{
|
||||
mc_fhl_filter_t *mc_filter;
|
||||
gchar *regexp;
|
||||
@ -135,7 +135,7 @@ mc_fhl_parse_get_regexp (mc_fhl_t * fhl, const gchar * group_name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_fhl_parse_get_extensions (mc_fhl_t * fhl, const gchar * group_name)
|
||||
mc_fhl_parse_get_extensions (mc_fhl_t *fhl, const gchar *group_name)
|
||||
{
|
||||
mc_fhl_filter_t *mc_filter;
|
||||
gchar **exts, **exts_orig;
|
||||
@ -185,7 +185,7 @@ mc_fhl_parse_get_extensions (mc_fhl_t * fhl, const gchar * group_name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_fhl_read_ini_file (mc_fhl_t * fhl, const gchar * filename)
|
||||
mc_fhl_read_ini_file (mc_fhl_t *fhl, const gchar *filename)
|
||||
{
|
||||
if (fhl == NULL || filename == NULL || !exist_file (filename))
|
||||
return FALSE;
|
||||
@ -201,7 +201,7 @@ mc_fhl_read_ini_file (mc_fhl_t * fhl, const gchar * filename)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_fhl_init_from_standard_files (mc_fhl_t * fhl)
|
||||
mc_fhl_init_from_standard_files (mc_fhl_t *fhl)
|
||||
{
|
||||
gchar *name;
|
||||
gboolean ok;
|
||||
@ -230,7 +230,7 @@ mc_fhl_init_from_standard_files (mc_fhl_t * fhl)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_fhl_parse_ini_file (mc_fhl_t * fhl)
|
||||
mc_fhl_parse_ini_file (mc_fhl_t *fhl)
|
||||
{
|
||||
gchar **group_names, **orig_group_names;
|
||||
gboolean ok;
|
||||
|
3
lib/fs.h
3
lib/fs.h
@ -98,9 +98,6 @@
|
||||
#define MC_MAXPATHLEN MAXPATHLEN
|
||||
#endif
|
||||
|
||||
/* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
|
||||
#define NLENGTH(dirent) (strlen ((dirent)->d_name))
|
||||
|
||||
/* DragonFlyBSD doesn't provide MAXNAMLEN macro */
|
||||
#ifndef MAXNAMLEN
|
||||
#define MAXNAMLEN NAME_MAX
|
||||
|
@ -101,8 +101,8 @@ g_direct_equal (gconstpointer v1, gconstpointer v2)
|
||||
* Since: 2.54
|
||||
*/
|
||||
gboolean
|
||||
g_ptr_array_find_with_equal_func (GPtrArray * haystack, gconstpointer needle, GEqualFunc equal_func,
|
||||
guint * index_)
|
||||
g_ptr_array_find_with_equal_func (GPtrArray *haystack, gconstpointer needle, GEqualFunc equal_func,
|
||||
guint *index_)
|
||||
{
|
||||
guint i;
|
||||
|
||||
@ -138,7 +138,7 @@ g_ptr_array_find_with_equal_func (GPtrArray * haystack, gconstpointer needle, GE
|
||||
* Since: 2.64
|
||||
*/
|
||||
void
|
||||
g_clear_slist (GSList ** slist_ptr, GDestroyNotify destroy)
|
||||
g_clear_slist (GSList **slist_ptr, GDestroyNotify destroy)
|
||||
{
|
||||
GSList *slist;
|
||||
|
||||
@ -169,7 +169,7 @@ g_clear_slist (GSList ** slist_ptr, GDestroyNotify destroy)
|
||||
* Since: 2.64
|
||||
*/
|
||||
void
|
||||
g_clear_list (GList ** list_ptr, GDestroyNotify destroy)
|
||||
g_clear_list (GList **list_ptr, GDestroyNotify destroy)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
@ -202,7 +202,7 @@ g_clear_list (GList ** list_ptr, GDestroyNotify destroy)
|
||||
* Since: 2.60
|
||||
*/
|
||||
void
|
||||
g_queue_clear_full (GQueue * queue, GDestroyNotify free_func)
|
||||
g_queue_clear_full (GQueue *queue, GDestroyNotify free_func)
|
||||
{
|
||||
g_return_if_fail (queue != NULL);
|
||||
|
||||
@ -263,7 +263,7 @@ g_string_new_take (char *init)
|
||||
* There is no such API in GLib2.
|
||||
*/
|
||||
GString *
|
||||
mc_g_string_copy (GString * dest, const GString * src)
|
||||
mc_g_string_copy (GString *dest, const GString *src)
|
||||
{
|
||||
g_return_val_if_fail (src != NULL, NULL);
|
||||
g_return_val_if_fail (dest != NULL, NULL);
|
||||
@ -286,7 +286,7 @@ mc_g_string_copy (GString * dest, const GString * src)
|
||||
* There is no such API in GLib2.
|
||||
*/
|
||||
GString *
|
||||
mc_g_string_dup (const GString * s)
|
||||
mc_g_string_dup (const GString *s)
|
||||
{
|
||||
GString *ret = NULL;
|
||||
|
||||
@ -297,3 +297,32 @@ mc_g_string_dup (const GString * s)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* mc_g_string_append_c_len:
|
||||
* @s: (not nullable): the destination #GString.
|
||||
* @c: the byte to append onto the end of @s
|
||||
* @len: the number of bytes @c to append onto the end of @s
|
||||
* @return: @s
|
||||
*
|
||||
* Adds @len bytes @c onto the end of @s.
|
||||
*
|
||||
* There is no such API in GLib2.
|
||||
*/
|
||||
GString *
|
||||
mc_g_string_append_c_len (GString *s, gchar c, guint len)
|
||||
{
|
||||
g_return_val_if_fail (s != NULL, NULL);
|
||||
|
||||
if (len != 0)
|
||||
{
|
||||
guint s_len = s->len;
|
||||
|
||||
g_string_set_size (s, s->len + len);
|
||||
memset (s->str + s_len, (unsigned char) c, len);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -40,6 +40,9 @@ GString *mc_g_string_copy (GString * dest, const GString * src);
|
||||
/* There is no such API in GLib2 */
|
||||
GString *mc_g_string_dup (const GString * s);
|
||||
|
||||
/* There is no such API in GLib2 */
|
||||
GString *mc_g_string_append_c_len (GString * s, gchar c, guint len);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
#endif /* MC_GLIBCOMPAT_H */
|
||||
|
@ -54,7 +54,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
add_hook (hook_t ** hook_list, void (*hook_fn) (void *), void *data)
|
||||
add_hook (hook_t **hook_list, void (*hook_fn) (void *), void *data)
|
||||
{
|
||||
hook_t *new_hook = g_new (hook_t, 1);
|
||||
|
||||
@ -68,7 +68,7 @@ add_hook (hook_t ** hook_list, void (*hook_fn) (void *), void *data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
execute_hooks (hook_t * hook_list)
|
||||
execute_hooks (hook_t *hook_list)
|
||||
{
|
||||
hook_t *new_hook = NULL;
|
||||
hook_t *p;
|
||||
@ -101,7 +101,7 @@ execute_hooks (hook_t * hook_list)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
delete_hook (hook_t ** hook_list, void (*hook_fn) (void *))
|
||||
delete_hook (hook_t **hook_list, void (*hook_fn) (void *))
|
||||
{
|
||||
hook_t *new_list = NULL;
|
||||
hook_t *current, *next;
|
||||
@ -120,7 +120,7 @@ delete_hook (hook_t ** hook_list, void (*hook_fn) (void *))
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
hook_present (hook_t * hook_list, void (*hook_fn) (void *))
|
||||
hook_present (hook_t *hook_list, void (*hook_fn) (void *))
|
||||
{
|
||||
hook_t *p;
|
||||
|
||||
|
@ -415,7 +415,7 @@ sort_command_names (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
keymap_add (GArray * keymap, long key, long cmd, const char *caption)
|
||||
keymap_add (GArray *keymap, long key, long cmd, const char *caption)
|
||||
{
|
||||
if (key != 0 && cmd != CK_IgnoreKey)
|
||||
{
|
||||
@ -433,7 +433,7 @@ keymap_add (GArray * keymap, long key, long cmd, const char *caption)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
keybind_cmd_bind (GArray * keymap, const char *keybind, long action)
|
||||
keybind_cmd_bind (GArray *keymap, const char *keybind, long action)
|
||||
{
|
||||
char *caption = NULL;
|
||||
long key;
|
||||
@ -476,7 +476,7 @@ keybind_lookup_actionname (long action)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, long action)
|
||||
keybind_lookup_keymap_shortcut (const global_keymap_t *keymap, long action)
|
||||
{
|
||||
if (keymap != NULL)
|
||||
{
|
||||
@ -492,7 +492,7 @@ keybind_lookup_keymap_shortcut (const global_keymap_t * keymap, long action)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
long
|
||||
keybind_lookup_keymap_command (const global_keymap_t * keymap, long key)
|
||||
keybind_lookup_keymap_command (const global_keymap_t *keymap, long key)
|
||||
{
|
||||
if (keymap != NULL)
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ lock_build_name (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
lock_build_symlink_name (const vfs_path_t * fname_vpath)
|
||||
lock_build_symlink_name (const vfs_path_t *fname_vpath)
|
||||
{
|
||||
const char *elpath;
|
||||
char *str_filename, *str_dirname, *symlink_name;
|
||||
@ -197,7 +197,7 @@ lock_get_info (const char *lockfname)
|
||||
Warning: Might do screen refresh and lose edit->force */
|
||||
|
||||
int
|
||||
lock_file (const vfs_path_t * fname_vpath)
|
||||
lock_file (const vfs_path_t *fname_vpath)
|
||||
{
|
||||
char *lockfname = NULL, *newlock, *msg;
|
||||
struct stat statbuf;
|
||||
@ -276,7 +276,7 @@ lock_file (const vfs_path_t * fname_vpath)
|
||||
*/
|
||||
|
||||
int
|
||||
unlock_file (const vfs_path_t * fname_vpath)
|
||||
unlock_file (const vfs_path_t *fname_vpath)
|
||||
{
|
||||
char *lockfname;
|
||||
const char *elpath;
|
||||
|
@ -48,7 +48,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path, GError ** mcerror)
|
||||
mc_config_new_or_override_file (mc_config_t *mc_config, const gchar *ini_path, GError **mcerror)
|
||||
{
|
||||
gchar *data, *written_data;
|
||||
gsize len, total_written;
|
||||
@ -104,7 +104,7 @@ mc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
mc_config_t *
|
||||
mc_config_init (const gchar * ini_path, gboolean read_only)
|
||||
mc_config_init (const gchar *ini_path, gboolean read_only)
|
||||
{
|
||||
mc_config_t *mc_config;
|
||||
struct stat st;
|
||||
@ -148,7 +148,7 @@ mc_config_init (const gchar * ini_path, gboolean read_only)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_deinit (mc_config_t * mc_config)
|
||||
mc_config_deinit (mc_config_t *mc_config)
|
||||
{
|
||||
if (mc_config != NULL)
|
||||
{
|
||||
@ -161,7 +161,7 @@ mc_config_deinit (mc_config_t * mc_config)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_has_param (const mc_config_t * mc_config, const char *group, const gchar * param)
|
||||
mc_config_has_param (const mc_config_t *mc_config, const char *group, const gchar *param)
|
||||
{
|
||||
char *value;
|
||||
gboolean ret;
|
||||
@ -178,7 +178,7 @@ mc_config_has_param (const mc_config_t * mc_config, const char *group, const gch
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_has_group (mc_config_t * mc_config, const char *group)
|
||||
mc_config_has_group (mc_config_t *mc_config, const char *group)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL)
|
||||
return FALSE;
|
||||
@ -189,7 +189,7 @@ mc_config_has_group (mc_config_t * mc_config, const char *group)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_del_key (mc_config_t * mc_config, const char *group, const gchar * param)
|
||||
mc_config_del_key (mc_config_t *mc_config, const char *group, const gchar *param)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return FALSE;
|
||||
@ -200,7 +200,7 @@ mc_config_del_key (mc_config_t * mc_config, const char *group, const gchar * par
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_del_group (mc_config_t * mc_config, const char *group)
|
||||
mc_config_del_group (mc_config_t *mc_config, const char *group)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL)
|
||||
return FALSE;
|
||||
@ -211,7 +211,7 @@ mc_config_del_group (mc_config_t * mc_config, const char *group)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean read_only,
|
||||
mc_config_read_file (mc_config_t *mc_config, const gchar *ini_path, gboolean read_only,
|
||||
gboolean remove_empty)
|
||||
{
|
||||
mc_config_t *tmp_config;
|
||||
@ -261,7 +261,7 @@ mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean r
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_save_file (mc_config_t * mc_config, GError ** mcerror)
|
||||
mc_config_save_file (mc_config_t *mc_config, GError **mcerror)
|
||||
{
|
||||
mc_return_val_if_error (mcerror, FALSE);
|
||||
|
||||
@ -274,7 +274,7 @@ mc_config_save_file (mc_config_t * mc_config, GError ** mcerror)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_save_to_file (mc_config_t * mc_config, const gchar * ini_path, GError ** mcerror)
|
||||
mc_config_save_to_file (mc_config_t *mc_config, const gchar *ini_path, GError **mcerror)
|
||||
{
|
||||
mc_return_val_if_error (mcerror, FALSE);
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar **
|
||||
mc_config_get_groups (const mc_config_t * mc_config, gsize * len)
|
||||
mc_config_get_groups (const mc_config_t *mc_config, gsize *len)
|
||||
{
|
||||
gchar **ret = NULL;
|
||||
|
||||
@ -66,7 +66,7 @@ mc_config_get_groups (const mc_config_t * mc_config, gsize * len)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar **
|
||||
mc_config_get_keys (const mc_config_t * mc_config, const gchar * group, gsize * len)
|
||||
mc_config_get_keys (const mc_config_t *mc_config, const gchar *group, gsize *len)
|
||||
{
|
||||
gchar **ret = NULL;
|
||||
|
||||
@ -86,8 +86,8 @@ mc_config_get_keys (const mc_config_t * mc_config, const gchar * group, gsize *
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar *
|
||||
mc_config_get_string (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * def)
|
||||
mc_config_get_string (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *def)
|
||||
{
|
||||
GIConv conv;
|
||||
GString *buffer;
|
||||
@ -121,8 +121,8 @@ mc_config_get_string (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar *
|
||||
mc_config_get_string_raw (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * def)
|
||||
mc_config_get_string_raw (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *def)
|
||||
{
|
||||
gchar *ret;
|
||||
|
||||
@ -144,7 +144,7 @@ mc_config_get_string_raw (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_config_get_bool (mc_config_t * mc_config, const gchar * group, const gchar * param, gboolean def)
|
||||
mc_config_get_bool (mc_config_t *mc_config, const gchar *group, const gchar *param, gboolean def)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return def;
|
||||
@ -161,7 +161,7 @@ mc_config_get_bool (mc_config_t * mc_config, const gchar * group, const gchar *
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_config_get_int (mc_config_t * mc_config, const gchar * group, const gchar * param, int def)
|
||||
mc_config_get_int (mc_config_t *mc_config, const gchar *group, const gchar *param, int def)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return def;
|
||||
@ -178,8 +178,8 @@ mc_config_get_int (mc_config_t * mc_config, const gchar * group, const gchar * p
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar **
|
||||
mc_config_get_string_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gsize * length)
|
||||
mc_config_get_string_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, gsize *length)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return NULL;
|
||||
@ -190,8 +190,8 @@ mc_config_get_string_list (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean *
|
||||
mc_config_get_bool_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gsize * length)
|
||||
mc_config_get_bool_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, gsize *length)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return NULL;
|
||||
@ -202,8 +202,8 @@ mc_config_get_bool_list (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int *
|
||||
mc_config_get_int_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gsize * length)
|
||||
mc_config_get_int_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, gsize *length)
|
||||
{
|
||||
if (mc_config == NULL || group == NULL || param == NULL)
|
||||
return NULL;
|
||||
|
@ -125,7 +125,7 @@ mc_config_history_get_recent_item (const char *name)
|
||||
* Load history from the mc_config
|
||||
*/
|
||||
GList *
|
||||
mc_config_history_load (mc_config_t * cfg, const char *name)
|
||||
mc_config_history_load (mc_config_t *cfg, const char *name)
|
||||
{
|
||||
size_t i;
|
||||
GList *hist = NULL;
|
||||
@ -188,7 +188,7 @@ mc_config_history_load (mc_config_t * cfg, const char *name)
|
||||
* Save history to the mc_config, but don't save config to file
|
||||
*/
|
||||
void
|
||||
mc_config_history_save (mc_config_t * cfg, const char *name, GList * h)
|
||||
mc_config_history_save (mc_config_t *cfg, const char *name, GList *h)
|
||||
{
|
||||
GIConv conv = INVALID_CONV;
|
||||
GString *buffer;
|
||||
|
@ -56,8 +56,7 @@ static const struct
|
||||
{
|
||||
char **basedir;
|
||||
const char *filename;
|
||||
} mc_config_files_reference[] =
|
||||
{
|
||||
} mc_config_files_reference[] = {
|
||||
/* *INDENT-OFF* */
|
||||
/* config */
|
||||
{ &mc_config_str, MC_CONFIG_FILE },
|
||||
@ -101,7 +100,7 @@ static const struct
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_config_mkdir (const char *directory_name, GError ** mcerror)
|
||||
mc_config_mkdir (const char *directory_name, GError **mcerror)
|
||||
{
|
||||
mc_return_if_error (mcerror);
|
||||
|
||||
@ -113,7 +112,7 @@ mc_config_mkdir (const char *directory_name, GError ** mcerror)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
mc_config_init_one_config_path (const char *path_base, const char *subdir, GError ** mcerror)
|
||||
mc_config_init_one_config_path (const char *path_base, const char *subdir, GError **mcerror)
|
||||
{
|
||||
char *full_path;
|
||||
|
||||
@ -144,7 +143,7 @@ mc_config_init_one_config_path (const char *path_base, const char *subdir, GErro
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_init_config_paths (GError ** mcerror)
|
||||
mc_config_init_config_paths (GError **mcerror)
|
||||
{
|
||||
const char *profile_root;
|
||||
char *dir;
|
||||
|
@ -42,7 +42,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gchar *
|
||||
mc_config_normalize_before_save (const gchar * value)
|
||||
mc_config_normalize_before_save (const gchar *value)
|
||||
{
|
||||
GIConv conv;
|
||||
GString *buffer;
|
||||
@ -74,8 +74,8 @@ mc_config_normalize_before_save (const gchar * value)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * value)
|
||||
mc_config_set_string_raw (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *value)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL)
|
||||
g_key_file_set_string (mc_config->handle, group, param, value);
|
||||
@ -84,8 +84,8 @@ mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * value)
|
||||
mc_config_set_string_raw_value (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *value)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL)
|
||||
g_key_file_set_value (mc_config->handle, group, param, value);
|
||||
@ -94,8 +94,8 @@ mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_string (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * value)
|
||||
mc_config_set_string (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *value)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL)
|
||||
{
|
||||
@ -110,8 +110,7 @@ mc_config_set_string (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_bool (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gboolean value)
|
||||
mc_config_set_bool (mc_config_t *mc_config, const gchar *group, const gchar *param, gboolean value)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL)
|
||||
g_key_file_set_boolean (mc_config->handle, group, param, value);
|
||||
@ -120,7 +119,7 @@ mc_config_set_bool (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_int (mc_config_t * mc_config, const gchar * group, const gchar * param, int value)
|
||||
mc_config_set_int (mc_config_t *mc_config, const gchar *group, const gchar *param, int value)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL)
|
||||
g_key_file_set_integer (mc_config->handle, group, param, value);
|
||||
@ -129,8 +128,8 @@ mc_config_set_int (mc_config_t * mc_config, const gchar * group, const gchar * p
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_string_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * const value[], gsize length)
|
||||
mc_config_set_string_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, const gchar *const value[], gsize length)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0)
|
||||
g_key_file_set_string_list (mc_config->handle, group, param, value, length);
|
||||
@ -139,8 +138,8 @@ mc_config_set_string_list (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_bool_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gboolean value[], gsize length)
|
||||
mc_config_set_bool_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, gboolean value[], gsize length)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0)
|
||||
g_key_file_set_boolean_list (mc_config->handle, group, param, value, length);
|
||||
@ -149,8 +148,8 @@ mc_config_set_bool_list (mc_config_t * mc_config, const gchar * group,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_config_set_int_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, int value[], gsize length)
|
||||
mc_config_set_int_list (mc_config_t *mc_config, const gchar *group,
|
||||
const gchar *param, int value[], gsize length)
|
||||
{
|
||||
if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0)
|
||||
g_key_file_set_integer_list (mc_config->handle, group, param, value, length);
|
||||
|
@ -173,14 +173,14 @@ gboolean mc_search_run (mc_search_t * mc_search, const void *user_data, gsize st
|
||||
|
||||
gboolean mc_search_is_type_avail (mc_search_type_t search_type);
|
||||
|
||||
const mc_search_type_str_t *mc_search_types_list_get (size_t * num);
|
||||
const mc_search_type_str_t *mc_search_types_list_get (size_t *num);
|
||||
|
||||
GString *mc_search_prepare_replace_str (mc_search_t * mc_search, GString * replace_str);
|
||||
char *mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_str);
|
||||
|
||||
gboolean mc_search_is_fixed_search_str (const mc_search_t * lc_mc_search);
|
||||
|
||||
gchar **mc_search_get_types_strings_array (size_t * num);
|
||||
gchar **mc_search_get_types_strings_array (size_t *num);
|
||||
|
||||
gboolean mc_search (const gchar * pattern, const gchar * pattern_charset, const gchar * str,
|
||||
mc_search_type_t type);
|
||||
|
@ -47,9 +47,8 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GString *
|
||||
mc_search__glob_translate_to_regex (const GString * astr)
|
||||
mc_search__glob_translate_to_regex (const GString *astr)
|
||||
{
|
||||
const char *str = astr->str;
|
||||
GString *buff;
|
||||
gsize loop;
|
||||
gboolean inside_group = FALSE;
|
||||
@ -58,31 +57,36 @@ mc_search__glob_translate_to_regex (const GString * astr)
|
||||
|
||||
for (loop = 0; loop < astr->len; loop++)
|
||||
{
|
||||
const char *str = astr->str;
|
||||
gboolean not_escaped;
|
||||
|
||||
not_escaped = !str_is_char_escaped (str, str + loop);
|
||||
|
||||
switch (str[loop])
|
||||
{
|
||||
case '*':
|
||||
if (!str_is_char_escaped (str, &(str[loop])))
|
||||
if (not_escaped)
|
||||
{
|
||||
g_string_append (buff, inside_group ? ".*" : "(.*)");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
if (!str_is_char_escaped (str, &(str[loop])))
|
||||
if (not_escaped)
|
||||
{
|
||||
g_string_append (buff, inside_group ? "." : "(.)");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case ',':
|
||||
if (!str_is_char_escaped (str, &(str[loop])))
|
||||
if (not_escaped)
|
||||
{
|
||||
g_string_append_c (buff, inside_group ? '|' : ',');
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '{':
|
||||
if (!str_is_char_escaped (str, &(str[loop])))
|
||||
if (not_escaped)
|
||||
{
|
||||
g_string_append_c (buff, '(');
|
||||
inside_group = TRUE;
|
||||
@ -90,7 +94,7 @@ mc_search__glob_translate_to_regex (const GString * astr)
|
||||
}
|
||||
break;
|
||||
case '}':
|
||||
if (!str_is_char_escaped (str, &(str[loop])))
|
||||
if (not_escaped)
|
||||
{
|
||||
g_string_append_c (buff, ')');
|
||||
inside_group = FALSE;
|
||||
@ -162,8 +166,8 @@ mc_search__translate_replace_glob_to_regex (const char *str)
|
||||
/*** public functions ****************************************************************************/
|
||||
|
||||
void
|
||||
mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t * lc_mc_search,
|
||||
mc_search_cond_t * mc_search_cond)
|
||||
mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t *lc_mc_search,
|
||||
mc_search_cond_t *mc_search_cond)
|
||||
{
|
||||
GString *tmp;
|
||||
|
||||
@ -183,8 +187,8 @@ mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t * lc_mc_s
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search__run_glob (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize * found_len)
|
||||
mc_search__run_glob (mc_search_t *lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize *found_len)
|
||||
{
|
||||
return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len);
|
||||
}
|
||||
@ -192,7 +196,7 @@ mc_search__run_glob (mc_search_t * lc_mc_search, const void *user_data,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
mc_search_glob_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str)
|
||||
{
|
||||
GString *repl, *res;
|
||||
|
||||
|
@ -57,7 +57,7 @@ typedef enum
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GString *
|
||||
mc_search__hex_translate_to_regex (const GString * astr, mc_search_hex_parse_error_t * error_ptr,
|
||||
mc_search__hex_translate_to_regex (const GString *astr, mc_search_hex_parse_error_t *error_ptr,
|
||||
int *error_pos_ptr)
|
||||
{
|
||||
GString *buff;
|
||||
@ -135,8 +135,8 @@ mc_search__hex_translate_to_regex (const GString * astr, mc_search_hex_parse_err
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_search__cond_struct_new_init_hex (const char *charset, mc_search_t * lc_mc_search,
|
||||
mc_search_cond_t * mc_search_cond)
|
||||
mc_search__cond_struct_new_init_hex (const char *charset, mc_search_t *lc_mc_search,
|
||||
mc_search_cond_t *mc_search_cond)
|
||||
{
|
||||
GString *tmp;
|
||||
mc_search_hex_parse_error_t error = MC_SEARCH_HEX_E_OK;
|
||||
@ -215,8 +215,8 @@ mc_search__cond_struct_new_init_hex (const char *charset, mc_search_t * lc_mc_se
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search__run_hex (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize * found_len)
|
||||
mc_search__run_hex (mc_search_t *lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize *found_len)
|
||||
{
|
||||
return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len);
|
||||
}
|
||||
@ -224,7 +224,7 @@ mc_search__run_hex (mc_search_t * lc_mc_search, const void *user_data,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search_hex_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
mc_search_hex_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str)
|
||||
{
|
||||
(void) lc_mc_search;
|
||||
|
||||
|
@ -53,7 +53,7 @@ const char *STR_E_RPL_INVALID_TOKEN = N_("Invalid token number %d");
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
||||
typedef gboolean (*case_conv_fn) (const char *ch, char **out, size_t * remain);
|
||||
typedef gboolean (*case_conv_fn) (const char *ch, char **out, size_t *remain);
|
||||
|
||||
/*** forward declarations (file scope functions) *************************************************/
|
||||
|
||||
@ -64,7 +64,7 @@ typedef gboolean (*case_conv_fn) (const char *ch, char **out, size_t * remain);
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GString *
|
||||
mc_search__change_case_str (const char *charset, const GString * str, case_conv_fn case_conv)
|
||||
mc_search__change_case_str (const char *charset, const GString *str, case_conv_fn case_conv)
|
||||
{
|
||||
GString *ret;
|
||||
const char *src_ptr;
|
||||
@ -153,7 +153,7 @@ mc_search__recode_str (const char *str, gsize str_len, const char *charset_from,
|
||||
|
||||
GString *
|
||||
mc_search__get_one_symbol (const char *charset, const char *str, gsize str_len,
|
||||
gboolean * just_letters)
|
||||
gboolean *just_letters)
|
||||
{
|
||||
GString *converted_str;
|
||||
const gchar *next_char;
|
||||
@ -191,7 +191,7 @@ mc_search__get_one_symbol (const char *charset, const char *str, gsize str_len,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search__tolower_case_str (const char *charset, const GString * str)
|
||||
mc_search__tolower_case_str (const char *charset, const GString *str)
|
||||
{
|
||||
return mc_search__change_case_str (charset, str, str_tolower);
|
||||
}
|
||||
@ -199,7 +199,7 @@ mc_search__tolower_case_str (const char *charset, const GString * str)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search__toupper_case_str (const char *charset, const GString * str)
|
||||
mc_search__toupper_case_str (const char *charset, const GString *str)
|
||||
{
|
||||
return mc_search__change_case_str (charset, str, str_toupper);
|
||||
}
|
||||
@ -207,7 +207,7 @@ mc_search__toupper_case_str (const char *charset, const GString * str)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar **
|
||||
mc_search_get_types_strings_array (size_t * num)
|
||||
mc_search_get_types_strings_array (size_t *num)
|
||||
{
|
||||
gchar **ret;
|
||||
int lc_index;
|
||||
|
@ -47,7 +47,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_search__normal_translate_to_regex (GString * str)
|
||||
mc_search__normal_translate_to_regex (GString *str)
|
||||
{
|
||||
gsize loop;
|
||||
|
||||
@ -72,6 +72,7 @@ mc_search__normal_translate_to_regex (GString * str)
|
||||
case '|':
|
||||
g_string_insert_c (str, loop, '\\');
|
||||
loop++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -82,8 +83,8 @@ mc_search__normal_translate_to_regex (GString * str)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc_search,
|
||||
mc_search_cond_t * mc_search_cond)
|
||||
mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t *lc_mc_search,
|
||||
mc_search_cond_t *mc_search_cond)
|
||||
{
|
||||
mc_search__normal_translate_to_regex (mc_search_cond->str);
|
||||
mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond);
|
||||
@ -92,15 +93,15 @@ mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search__run_normal (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize * found_len)
|
||||
mc_search__run_normal (mc_search_t *lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize *found_len)
|
||||
{
|
||||
return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
GString *
|
||||
mc_search_normal_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
mc_search_normal_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str)
|
||||
{
|
||||
(void) lc_mc_search;
|
||||
|
||||
|
@ -65,8 +65,7 @@ typedef enum
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_search__regex_str_append_if_special (GString * copy_to, const GString * regex_str,
|
||||
gsize * offset)
|
||||
mc_search__regex_str_append_if_special (GString *copy_to, const GString *regex_str, gsize *offset)
|
||||
{
|
||||
const char *special_chars[] = {
|
||||
"\\s", "\\S",
|
||||
@ -123,8 +122,8 @@ mc_search__regex_str_append_if_special (GString * copy_to, const GString * regex
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_search__cond_struct_new_regex_hex_add (const char *charset, GString * str_to,
|
||||
const GString * one_char)
|
||||
mc_search__cond_struct_new_regex_hex_add (const char *charset, GString *str_to,
|
||||
const GString *one_char)
|
||||
{
|
||||
GString *upp, *low;
|
||||
gsize loop;
|
||||
@ -155,8 +154,8 @@ mc_search__cond_struct_new_regex_hex_add (const char *charset, GString * str_to,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_search__cond_struct_new_regex_accum_append (const char *charset, GString * str_to,
|
||||
GString * str_from)
|
||||
mc_search__cond_struct_new_regex_accum_append (const char *charset, GString *str_to,
|
||||
GString *str_from)
|
||||
{
|
||||
GString *recoded_part;
|
||||
gsize loop = 0;
|
||||
@ -208,7 +207,7 @@ mc_search__cond_struct_new_regex_accum_append (const char *charset, GString * st
|
||||
* this job itself.
|
||||
*/
|
||||
static GString *
|
||||
mc_search__cond_struct_new_regex_ci_str (const char *charset, const GString * astr)
|
||||
mc_search__cond_struct_new_regex_ci_str (const char *charset, const GString *astr)
|
||||
{
|
||||
GString *accumulator, *spec_char, *ret_str;
|
||||
gsize loop;
|
||||
@ -265,12 +264,12 @@ mc_search__cond_struct_new_regex_ci_str (const char *charset, const GString * as
|
||||
* requirement by glib and it might crash otherwise. See: mc ticket 3449.
|
||||
* Be careful: there might be embedded NULs in the strings. */
|
||||
static gboolean
|
||||
mc_search__g_regex_match_full_safe (const GRegex * regex,
|
||||
const gchar * string,
|
||||
mc_search__g_regex_match_full_safe (const GRegex *regex,
|
||||
const gchar *string,
|
||||
gssize string_len,
|
||||
gint start_position,
|
||||
GRegexMatchFlags match_options,
|
||||
GMatchInfo ** match_info, GError ** error)
|
||||
GMatchInfo **match_info, GError **error)
|
||||
{
|
||||
char *string_safe, *p, *end;
|
||||
gboolean ret;
|
||||
@ -318,8 +317,8 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static mc_search__found_cond_t
|
||||
mc_search__regex_found_cond_one (mc_search_t * lc_mc_search, mc_search_regex_t * regex,
|
||||
GString * search_str)
|
||||
mc_search__regex_found_cond_one (mc_search_t *lc_mc_search, mc_search_regex_t *regex,
|
||||
GString *search_str)
|
||||
{
|
||||
#ifdef SEARCH_TYPE_GLIB
|
||||
GError *mcerror = NULL;
|
||||
@ -364,7 +363,7 @@ mc_search__regex_found_cond_one (mc_search_t * lc_mc_search, mc_search_regex_t *
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static mc_search__found_cond_t
|
||||
mc_search__regex_found_cond (mc_search_t * lc_mc_search, GString * search_str)
|
||||
mc_search__regex_found_cond (mc_search_t *lc_mc_search, GString *search_str)
|
||||
{
|
||||
gsize loop1;
|
||||
|
||||
@ -391,7 +390,7 @@ mc_search__regex_found_cond (mc_search_t * lc_mc_search, GString * search_str)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_search_regex__get_max_num_of_replace_tokens (const gchar * str, gsize len)
|
||||
mc_search_regex__get_max_num_of_replace_tokens (const gchar *str, gsize len)
|
||||
{
|
||||
int max_token = 0;
|
||||
gsize loop;
|
||||
@ -434,7 +433,7 @@ mc_search_regex__get_max_num_of_replace_tokens (const gchar * str, gsize len)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
mc_search_regex__get_token_by_num (const mc_search_t * lc_mc_search, gsize lc_index)
|
||||
mc_search_regex__get_token_by_num (const mc_search_t *lc_mc_search, gsize lc_index)
|
||||
{
|
||||
int fnd_start = 0, fnd_end = 0;
|
||||
|
||||
@ -455,8 +454,8 @@ mc_search_regex__get_token_by_num (const mc_search_t * lc_mc_search, gsize lc_in
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_search_regex__replace_handle_esc_seq (const GString * replace_str, const gsize current_pos,
|
||||
gsize * skip_len, int *ret)
|
||||
mc_search_regex__replace_handle_esc_seq (const GString *replace_str, const gsize current_pos,
|
||||
gsize *skip_len, int *ret)
|
||||
{
|
||||
char *curr_str = &(replace_str->str[current_pos]);
|
||||
char c = curr_str[1];
|
||||
@ -537,8 +536,8 @@ mc_search_regex__replace_handle_esc_seq (const GString * replace_str, const gsiz
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_search_regex__process_replace_str (const GString * replace_str, const gsize current_pos,
|
||||
gsize * skip_len, replace_transform_type_t * replace_flags)
|
||||
mc_search_regex__process_replace_str (const GString *replace_str, const gsize current_pos,
|
||||
gsize *skip_len, replace_transform_type_t *replace_flags)
|
||||
{
|
||||
int ret = -1;
|
||||
const char *curr_str = &(replace_str->str[current_pos]);
|
||||
@ -629,8 +628,8 @@ mc_search_regex__process_replace_str (const GString * replace_str, const gsize c
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_search_regex__process_append_str (GString * dest_str, const char *from, gsize len,
|
||||
replace_transform_type_t * replace_flags)
|
||||
mc_search_regex__process_append_str (GString *dest_str, const char *from, gsize len,
|
||||
replace_transform_type_t *replace_flags)
|
||||
{
|
||||
gsize loop;
|
||||
gsize char_len;
|
||||
@ -684,9 +683,8 @@ mc_search_regex__process_append_str (GString * dest_str, const char *from, gsize
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_search_regex__process_escape_sequence (GString * dest_str, const char *from, gsize len,
|
||||
replace_transform_type_t * replace_flags,
|
||||
gboolean is_utf8)
|
||||
mc_search_regex__process_escape_sequence (GString *dest_str, const char *from, gsize len,
|
||||
replace_transform_type_t *replace_flags, gboolean is_utf8)
|
||||
{
|
||||
gsize i = 0;
|
||||
unsigned int c = 0;
|
||||
@ -789,8 +787,8 @@ mc_search_regex__process_escape_sequence (GString * dest_str, const char *from,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_search,
|
||||
mc_search_cond_t * mc_search_cond)
|
||||
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t *lc_mc_search,
|
||||
mc_search_cond_t *mc_search_cond)
|
||||
{
|
||||
if (lc_mc_search->whole_words && !lc_mc_search->is_entire_line)
|
||||
{
|
||||
@ -906,8 +904,8 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize * found_len)
|
||||
mc_search__run_regex (mc_search_t *lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize *found_len)
|
||||
{
|
||||
mc_search_cbret_t ret = MC_SEARCH_CB_NOTFOUND;
|
||||
gsize current_pos, virtual_pos;
|
||||
@ -1018,7 +1016,7 @@ mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
mc_search_regex_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str)
|
||||
{
|
||||
GString *ret;
|
||||
|
||||
|
@ -64,7 +64,7 @@ static const mc_search_type_str_t mc_search__list_types[] = {
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static mc_search_cond_t *
|
||||
mc_search__cond_struct_new (mc_search_t * lc_mc_search, const GString * str, const char *charset)
|
||||
mc_search__cond_struct_new (mc_search_t *lc_mc_search, const GString *str, const char *charset)
|
||||
{
|
||||
mc_search_cond_t *mc_search_cond;
|
||||
|
||||
@ -133,7 +133,7 @@ mc_search__cond_struct_free (gpointer data)
|
||||
*/
|
||||
|
||||
mc_search_t *
|
||||
mc_search_new (const gchar * original, const gchar * original_charset)
|
||||
mc_search_new (const gchar *original, const gchar *original_charset)
|
||||
{
|
||||
if (original == NULL)
|
||||
return NULL;
|
||||
@ -152,7 +152,7 @@ mc_search_new (const gchar * original, const gchar * original_charset)
|
||||
*/
|
||||
|
||||
mc_search_t *
|
||||
mc_search_new_len (const gchar * original, gsize original_len, const gchar * original_charset)
|
||||
mc_search_new_len (const gchar *original, gsize original_len, const gchar *original_charset)
|
||||
{
|
||||
mc_search_t *lc_mc_search;
|
||||
|
||||
@ -175,7 +175,7 @@ mc_search_new_len (const gchar * original, gsize original_len, const gchar * ori
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_search_free (mc_search_t * lc_mc_search)
|
||||
mc_search_free (mc_search_t *lc_mc_search)
|
||||
{
|
||||
if (lc_mc_search == NULL)
|
||||
return;
|
||||
@ -205,7 +205,7 @@ mc_search_free (mc_search_t * lc_mc_search)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search_prepare (mc_search_t * lc_mc_search)
|
||||
mc_search_prepare (mc_search_t *lc_mc_search)
|
||||
{
|
||||
GPtrArray *ret;
|
||||
|
||||
@ -272,8 +272,8 @@ mc_search_prepare (mc_search_t * lc_mc_search)
|
||||
* is in lc_mc_search->error_str.
|
||||
*/
|
||||
gboolean
|
||||
mc_search_run (mc_search_t * lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize * found_len)
|
||||
mc_search_run (mc_search_t *lc_mc_search, const void *user_data,
|
||||
gsize start_search, gsize end_search, gsize *found_len)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
|
||||
@ -338,7 +338,7 @@ mc_search_is_type_avail (mc_search_type_t search_type)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const mc_search_type_str_t *
|
||||
mc_search_types_list_get (size_t * num)
|
||||
mc_search_types_list_get (size_t *num)
|
||||
{
|
||||
/* don't count last NULL item */
|
||||
if (num != NULL)
|
||||
@ -350,7 +350,7 @@ mc_search_types_list_get (size_t * num)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GString *
|
||||
mc_search_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
|
||||
mc_search_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str)
|
||||
{
|
||||
GString *ret;
|
||||
|
||||
@ -384,7 +384,7 @@ mc_search_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_str)
|
||||
mc_search_prepare_replace_str2 (mc_search_t *lc_mc_search, const char *replace_str)
|
||||
{
|
||||
GString *ret;
|
||||
GString *replace_str2;
|
||||
@ -398,7 +398,7 @@ mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_search_is_fixed_search_str (const mc_search_t * lc_mc_search)
|
||||
mc_search_is_fixed_search_str (const mc_search_t *lc_mc_search)
|
||||
{
|
||||
if (lc_mc_search == NULL)
|
||||
return FALSE;
|
||||
@ -424,7 +424,7 @@ mc_search_is_fixed_search_str (const mc_search_t * lc_mc_search)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
mc_search (const gchar * pattern, const gchar * pattern_charset, const gchar * str,
|
||||
mc_search (const gchar *pattern, const gchar *pattern_charset, const gchar *str,
|
||||
mc_search_type_t type)
|
||||
{
|
||||
gboolean ret;
|
||||
@ -451,7 +451,7 @@ mc_search (const gchar * pattern, const gchar * pattern_charset, const gchar * s
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_search_getstart_result_by_num (mc_search_t * lc_mc_search, int lc_index)
|
||||
mc_search_getstart_result_by_num (mc_search_t *lc_mc_search, int lc_index)
|
||||
{
|
||||
if (lc_mc_search == NULL)
|
||||
return 0;
|
||||
@ -473,7 +473,7 @@ mc_search_getstart_result_by_num (mc_search_t * lc_mc_search, int lc_index)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_search_getend_result_by_num (mc_search_t * lc_mc_search, int lc_index)
|
||||
mc_search_getend_result_by_num (mc_search_t *lc_mc_search, int lc_index)
|
||||
{
|
||||
if (lc_mc_search == NULL)
|
||||
return 0;
|
||||
@ -502,7 +502,7 @@ mc_search_getend_result_by_num (mc_search_t * lc_mc_search, int lc_index)
|
||||
*/
|
||||
|
||||
void
|
||||
mc_search_set_error (mc_search_t * lc_mc_search, mc_search_error_t code, const gchar * format, ...)
|
||||
mc_search_set_error (mc_search_t *lc_mc_search, mc_search_error_t code, const gchar *format, ...)
|
||||
{
|
||||
lc_mc_search->error = code;
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
static void
|
||||
G_GNUC_PRINTF (2, 3)
|
||||
prepend_error_message (GError ** error, const char *format, ...)
|
||||
prepend_error_message (GError **error, const char *format, ...)
|
||||
{
|
||||
char *prepend_str;
|
||||
char *split_str;
|
||||
@ -79,7 +79,7 @@ prepend_error_message (GError ** error, const char *format, ...)
|
||||
|
||||
static const char *
|
||||
go_to_end_of_serialized_string (const char *non_serialized_data,
|
||||
const char *already_serialized_part, size_t * offset)
|
||||
const char *already_serialized_part, size_t *offset)
|
||||
{
|
||||
size_t calculated_offset;
|
||||
const char *semi_ptr = strchr (non_serialized_data + 1, SRLZ_DELIM_C);
|
||||
@ -109,7 +109,7 @@ go_to_end_of_serialized_string (const char *non_serialized_data,
|
||||
*/
|
||||
|
||||
char *
|
||||
mc_serialize_str (const char prefix, const char *data, GError ** error)
|
||||
mc_serialize_str (const char prefix, const char *data, GError **error)
|
||||
{
|
||||
if (data == NULL)
|
||||
{
|
||||
@ -132,7 +132,7 @@ mc_serialize_str (const char prefix, const char *data, GError ** error)
|
||||
|
||||
#define FUNC_NAME "mc_serialize_str()"
|
||||
char *
|
||||
mc_deserialize_str (const char prefix, const char *data, GError ** error)
|
||||
mc_deserialize_str (const char prefix, const char *data, GError **error)
|
||||
{
|
||||
size_t data_len;
|
||||
|
||||
@ -196,7 +196,7 @@ mc_deserialize_str (const char prefix, const char *data, GError ** error)
|
||||
*/
|
||||
|
||||
char *
|
||||
mc_serialize_config (mc_config_t * data, GError ** error)
|
||||
mc_serialize_config (mc_config_t *data, GError **error)
|
||||
{
|
||||
gchar **groups, **group_iterator;
|
||||
GString *buffer;
|
||||
@ -278,7 +278,7 @@ mc_serialize_config (mc_config_t * data, GError ** error)
|
||||
}
|
||||
|
||||
mc_config_t *
|
||||
mc_deserialize_config (const char *data, GError ** error)
|
||||
mc_deserialize_config (const char *data, GError **error)
|
||||
{
|
||||
char *current_group = NULL, *current_param = NULL, *current_value = NULL;
|
||||
size_t current_position = 0;
|
||||
|
@ -142,7 +142,7 @@ mc_shell_get_from_env (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_shell_recognize_real_path (mc_shell_t * mc_shell)
|
||||
mc_shell_recognize_real_path (mc_shell_t *mc_shell)
|
||||
{
|
||||
if (strstr (mc_shell->path, "/zsh") != NULL || strstr (mc_shell->real_path, "/zsh") != NULL
|
||||
|| getenv ("ZSH_VERSION") != NULL)
|
||||
@ -196,7 +196,7 @@ mc_shell_recognize_real_path (mc_shell_t * mc_shell)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_shell_recognize_path (mc_shell_t * mc_shell)
|
||||
mc_shell_recognize_path (mc_shell_t *mc_shell)
|
||||
{
|
||||
/* If shell is not symlinked to busybox, it is safe to assume it is a real shell */
|
||||
if (strstr (mc_shell->path, "/bash") != NULL || getenv ("BASH") != NULL)
|
||||
|
@ -147,7 +147,7 @@ mc_skin_colors_old_transform (const char *old_color, const char **group, const c
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_skin_colors_old_configure_one (mc_skin_t * mc_skin, const char *the_color_string)
|
||||
mc_skin_colors_old_configure_one (mc_skin_t *mc_skin, const char *the_color_string)
|
||||
{
|
||||
gchar **colors, **orig_colors;
|
||||
|
||||
@ -193,7 +193,7 @@ mc_skin_colors_old_configure_one (mc_skin_t * mc_skin, const char *the_color_str
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_colors_old_configure (mc_skin_t * mc_skin)
|
||||
mc_skin_colors_old_configure (mc_skin_t *mc_skin)
|
||||
{
|
||||
mc_skin_colors_old_configure_one (mc_skin, mc_global.tty.setup_color_string);
|
||||
mc_skin_colors_old_configure_one (mc_skin, mc_global.tty.term_color_string);
|
||||
|
@ -50,7 +50,7 @@ int mc_skin_color__cache[MC_SKIN_COLOR_CACHE_COUNT];
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static tty_color_pair_t *
|
||||
mc_skin_color_get_from_hash (mc_skin_t * mc_skin, const gchar * group, const gchar * key)
|
||||
mc_skin_color_get_from_hash (mc_skin_t *mc_skin, const gchar *group, const gchar *key)
|
||||
{
|
||||
gchar kname[BUF_TINY];
|
||||
tty_color_pair_t *mc_skin_color;
|
||||
@ -71,7 +71,7 @@ mc_skin_color_get_from_hash (mc_skin_t * mc_skin, const gchar * group, const gch
|
||||
|
||||
#if 0
|
||||
static void
|
||||
mc_skin_color_remove_from_hash (mc_skin_t * mc_skin, const gchar * group, const gchar * key)
|
||||
mc_skin_color_remove_from_hash (mc_skin_t *mc_skin, const gchar *group, const gchar *key)
|
||||
{
|
||||
gchar kname[BUF_TINY];
|
||||
if (group == NULL || key == NULL)
|
||||
@ -88,8 +88,8 @@ mc_skin_color_remove_from_hash (mc_skin_t * mc_skin, const gchar * group, const
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_skin_color_add_to_hash (mc_skin_t * mc_skin, const gchar * group, const gchar * key,
|
||||
tty_color_pair_t * mc_skin_color)
|
||||
mc_skin_color_add_to_hash (mc_skin_t *mc_skin, const gchar *group, const gchar *key,
|
||||
tty_color_pair_t *mc_skin_color)
|
||||
{
|
||||
gchar *kname;
|
||||
|
||||
@ -106,7 +106,7 @@ mc_skin_color_add_to_hash (mc_skin_t * mc_skin, const gchar * group, const gchar
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static tty_color_pair_t *
|
||||
mc_skin_color_get_with_defaults (const gchar * group, const gchar * name)
|
||||
mc_skin_color_get_with_defaults (const gchar *group, const gchar *name)
|
||||
{
|
||||
tty_color_pair_t *mc_skin_color;
|
||||
|
||||
@ -127,7 +127,7 @@ mc_skin_color_get_with_defaults (const gchar * group, const gchar * name)
|
||||
/* If an alias is found, alloc a new string for the resolved value and free the input parameter.
|
||||
Otherwise it's a no-op returning the original string. */
|
||||
static gchar *
|
||||
mc_skin_color_look_up_alias (mc_skin_t * mc_skin, gchar * str)
|
||||
mc_skin_color_look_up_alias (mc_skin_t *mc_skin, gchar *str)
|
||||
{
|
||||
gchar *orig, *str2;
|
||||
int hop = 0;
|
||||
@ -180,7 +180,7 @@ mc_skin_color_look_up_alias (mc_skin_t * mc_skin, gchar * str)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static tty_color_pair_t *
|
||||
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const gchar * key)
|
||||
mc_skin_color_get_from_ini_file (mc_skin_t *mc_skin, const gchar *group, const gchar *key)
|
||||
{
|
||||
gsize items_count;
|
||||
gchar **values;
|
||||
@ -221,7 +221,7 @@ mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_skin_color_set_default_for_terminal (mc_skin_t * mc_skin)
|
||||
mc_skin_color_set_default_for_terminal (mc_skin_t *mc_skin)
|
||||
{
|
||||
tty_color_pair_t *mc_skin_color;
|
||||
|
||||
@ -324,7 +324,7 @@ mc_skin_color_cache_init (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_skin_color_check_inisection (const gchar * group)
|
||||
mc_skin_color_check_inisection (const gchar *group)
|
||||
{
|
||||
return !((strcasecmp ("skin", group) == 0) || (strcasecmp ("aliases", group) == 0)
|
||||
|| (strcasecmp ("lines", group) == 0) || (strncasecmp ("widget-", group, 7) == 0));
|
||||
@ -333,7 +333,7 @@ mc_skin_color_check_inisection (const gchar * group)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_skin_color_check_bw_mode (mc_skin_t * mc_skin)
|
||||
mc_skin_color_check_bw_mode (mc_skin_t *mc_skin)
|
||||
{
|
||||
gchar **groups, **orig_groups;
|
||||
|
||||
@ -356,7 +356,7 @@ mc_skin_color_check_bw_mode (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
|
||||
mc_skin_color_parse_ini_file (mc_skin_t *mc_skin)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
gsize items_count;
|
||||
@ -408,7 +408,7 @@ mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_skin_color_get (const gchar * group, const gchar * name)
|
||||
mc_skin_color_get (const gchar *group, const gchar *name)
|
||||
{
|
||||
tty_color_pair_t *mc_skin_color;
|
||||
|
||||
|
@ -113,7 +113,7 @@ mc_skin_try_to_load_default (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_skin_init (const gchar * skin_override, GError ** mcerror)
|
||||
mc_skin_init (const gchar *skin_override, GError **mcerror)
|
||||
{
|
||||
gboolean is_good_init = TRUE;
|
||||
GError *error = NULL;
|
||||
@ -198,7 +198,7 @@ mc_skin_deinit (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar *
|
||||
mc_skin_get (const gchar * group, const gchar * key, const gchar * default_value)
|
||||
mc_skin_get (const gchar *group, const gchar *key, const gchar *default_value)
|
||||
{
|
||||
if (mc_global.tty.ugly_line_drawing)
|
||||
return g_strdup (default_value);
|
||||
|
@ -47,7 +47,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_hardcoded_blackwhite_colors (mc_skin_t * mc_skin)
|
||||
mc_skin_hardcoded_blackwhite_colors (mc_skin_t *mc_skin)
|
||||
{
|
||||
mc_config_set_string (mc_skin->config, "core", "_default_", "default;default");
|
||||
mc_config_set_string (mc_skin->config, "core", "selected", "A_REVERSE");
|
||||
@ -85,7 +85,7 @@ mc_skin_hardcoded_blackwhite_colors (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_hardcoded_space_lines (mc_skin_t * mc_skin)
|
||||
mc_skin_hardcoded_space_lines (mc_skin_t *mc_skin)
|
||||
{
|
||||
/* single lines */
|
||||
set_lines ("vert", " ");
|
||||
@ -115,7 +115,7 @@ mc_skin_hardcoded_space_lines (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_hardcoded_ugly_lines (mc_skin_t * mc_skin)
|
||||
mc_skin_hardcoded_ugly_lines (mc_skin_t *mc_skin)
|
||||
{
|
||||
/* single lines */
|
||||
set_lines ("vert", "|");
|
||||
|
@ -49,7 +49,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_skin_get_list_from_dir (const gchar * base_dir, GPtrArray * list)
|
||||
mc_skin_get_list_from_dir (const gchar *base_dir, GPtrArray *list)
|
||||
{
|
||||
gchar *name;
|
||||
GDir *dir;
|
||||
@ -99,7 +99,7 @@ string_array_comparator (gconstpointer a, gconstpointer b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mc_skin_ini_file_load_search_in_dir (mc_skin_t * mc_skin, const gchar * base_dir)
|
||||
mc_skin_ini_file_load_search_in_dir (mc_skin_t *mc_skin, const gchar *base_dir)
|
||||
{
|
||||
char *file_name, *file_name2;
|
||||
|
||||
@ -147,7 +147,7 @@ mc_skin_list (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_skin_ini_file_load (mc_skin_t * mc_skin)
|
||||
mc_skin_ini_file_load (mc_skin_t *mc_skin)
|
||||
{
|
||||
char *file_name;
|
||||
|
||||
@ -180,7 +180,7 @@ mc_skin_ini_file_load (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_skin_ini_file_parse (mc_skin_t * mc_skin)
|
||||
mc_skin_ini_file_parse (mc_skin_t *mc_skin)
|
||||
{
|
||||
mc_skin->description =
|
||||
mc_config_get_string (mc_skin->config, "skin", "description", "- no description -");
|
||||
@ -197,7 +197,7 @@ mc_skin_ini_file_parse (mc_skin_t * mc_skin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_set_hardcoded_skin (mc_skin_t * mc_skin)
|
||||
mc_skin_set_hardcoded_skin (mc_skin_t *mc_skin)
|
||||
{
|
||||
mc_skin->config = mc_config_init (NULL, TRUE);
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_skin_lines_load_frm (mc_skin_t * mc_skin, const char *name)
|
||||
mc_skin_lines_load_frm (mc_skin_t *mc_skin, const char *name)
|
||||
{
|
||||
int ret;
|
||||
char *frm_val;
|
||||
@ -62,7 +62,7 @@ mc_skin_lines_load_frm (mc_skin_t * mc_skin, const char *name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
mc_skin_lines_parse_ini_file (mc_skin_t * mc_skin)
|
||||
mc_skin_lines_parse_ini_file (mc_skin_t *mc_skin)
|
||||
{
|
||||
if (mc_global.tty.slow_terminal)
|
||||
mc_skin_hardcoded_space_lines (mc_skin);
|
||||
|
@ -356,13 +356,13 @@ gboolean str_iscombiningmark (const char *ch);
|
||||
* decrase remain by size of returned characters
|
||||
* if out is not big enough, do nothing
|
||||
*/
|
||||
gboolean str_toupper (const char *ch, char **out, size_t * remain);
|
||||
gboolean str_toupper (const char *ch, char **out, size_t *remain);
|
||||
|
||||
/* write upper from of first characters in ch into out
|
||||
* decrase remain by size of returned characters
|
||||
* if out is not big enough, do nothing
|
||||
*/
|
||||
gboolean str_tolower (const char *ch, char **out, size_t * remain);
|
||||
gboolean str_tolower (const char *ch, char **out, size_t *remain);
|
||||
|
||||
/* return length of text in characters
|
||||
* I
|
||||
|
@ -48,7 +48,7 @@
|
||||
* Otherwise, *len should be nonnegative, s is a char array, and *len does not change.
|
||||
*/
|
||||
static ssize_t
|
||||
file_prefixlen (const char *s, ssize_t * len)
|
||||
file_prefixlen (const char *s, ssize_t *len)
|
||||
{
|
||||
size_t n = (size_t) (*len); /* SIZE_MAX if N == -1 */
|
||||
size_t i = 0;
|
||||
|
@ -101,7 +101,7 @@ str_test_not_convert (const char *enc)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static estr_t
|
||||
_str_convert (GIConv coder, const char *string, int size, GString * buffer)
|
||||
_str_convert (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
estr_t state = ESTR_SUCCESS;
|
||||
gssize left;
|
||||
@ -153,9 +153,7 @@ _str_convert (GIConv coder, const char *string, int size, GString * buffer)
|
||||
case G_CONVERT_ERROR_NO_CONVERSION:
|
||||
/* Conversion between the requested character sets is not supported. */
|
||||
g_free (tmp_buff);
|
||||
tmp_buff = g_strnfill (strlen (string), '?');
|
||||
g_string_append (buffer, tmp_buff);
|
||||
g_free (tmp_buff);
|
||||
mc_g_string_append_c_len (buffer, '?', strlen (string));
|
||||
return ESTR_FAILURE;
|
||||
|
||||
case G_CONVERT_ERROR_ILLEGAL_SEQUENCE:
|
||||
@ -186,12 +184,7 @@ _str_convert (GIConv coder, const char *string, int size, GString * buffer)
|
||||
g_string_append (buffer, tmp_buff);
|
||||
g_free (tmp_buff);
|
||||
if ((int) bytes_read < left)
|
||||
{
|
||||
left = left - bytes_read;
|
||||
tmp_buff = g_strnfill (left, '?');
|
||||
g_string_append (buffer, tmp_buff);
|
||||
g_free (tmp_buff);
|
||||
}
|
||||
mc_g_string_append_c_len (buffer, '?', left - bytes_read);
|
||||
return ESTR_PROBLEM;
|
||||
|
||||
case G_CONVERT_ERROR_BAD_URI: /* Don't know how handle this error :( */
|
||||
@ -288,7 +281,7 @@ str_close_conv (GIConv conv)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
estr_t
|
||||
str_convert (GIConv coder, const char *string, GString * buffer)
|
||||
str_convert (GIConv coder, const char *string, GString *buffer)
|
||||
{
|
||||
return _str_convert (coder, string, -1, buffer);
|
||||
}
|
||||
@ -296,7 +289,7 @@ str_convert (GIConv coder, const char *string, GString * buffer)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
estr_t
|
||||
str_nconvert (GIConv coder, const char *string, int size, GString * buffer)
|
||||
str_nconvert (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
return _str_convert (coder, string, size, buffer);
|
||||
}
|
||||
@ -304,7 +297,7 @@ str_nconvert (GIConv coder, const char *string, int size, GString * buffer)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gchar *
|
||||
str_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
str_conv_gerror_message (GError *mcerror, const char *def_msg)
|
||||
{
|
||||
return used_class.conv_gerror_message (mcerror, def_msg);
|
||||
}
|
||||
@ -312,7 +305,7 @@ str_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
estr_t
|
||||
str_vfs_convert_from (GIConv coder, const char *string, GString * buffer)
|
||||
str_vfs_convert_from (GIConv coder, const char *string, GString *buffer)
|
||||
{
|
||||
estr_t result = ESTR_SUCCESS;
|
||||
|
||||
@ -327,7 +320,7 @@ str_vfs_convert_from (GIConv coder, const char *string, GString * buffer)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
estr_t
|
||||
str_vfs_convert_to (GIConv coder, const char *string, int size, GString * buffer)
|
||||
str_vfs_convert_to (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
return used_class.vfs_convert_to (coder, string, size, buffer);
|
||||
}
|
||||
@ -335,7 +328,7 @@ str_vfs_convert_to (GIConv coder, const char *string, int size, GString * buffer
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
str_printf (GString * buffer, const char *format, ...)
|
||||
str_printf (GString *buffer, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
@ -347,7 +340,7 @@ str_printf (GString * buffer, const char *format, ...)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
str_insert_replace_char (GString * buffer)
|
||||
str_insert_replace_char (GString *buffer)
|
||||
{
|
||||
used_class.insert_replace_char (buffer);
|
||||
}
|
||||
@ -756,7 +749,7 @@ str_isdigit (const char *ch)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
str_toupper (const char *ch, char **out, size_t * remain)
|
||||
str_toupper (const char *ch, char **out, size_t *remain)
|
||||
{
|
||||
return used_class.char_toupper (ch, out, remain);
|
||||
}
|
||||
@ -764,7 +757,7 @@ str_toupper (const char *ch, char **out, size_t * remain)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
str_tolower (const char *ch, char **out, size_t * remain)
|
||||
str_tolower (const char *ch, char **out, size_t *remain)
|
||||
{
|
||||
return used_class.char_tolower (ch, out, remain);
|
||||
}
|
||||
@ -994,7 +987,7 @@ strrstr_skip_count (const char *haystack, const char *needle, size_t skip_count)
|
||||
*/
|
||||
|
||||
uintmax_t
|
||||
parse_integer (const char *str, gboolean * invalid)
|
||||
parse_integer (const char *str, gboolean *invalid)
|
||||
{
|
||||
uintmax_t n;
|
||||
char *suffix;
|
||||
|
@ -79,7 +79,7 @@ DECLARE_CTYPE_WRAPPER (tolower)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
str_8bit_insert_replace_char (GString * buffer)
|
||||
str_8bit_insert_replace_char (GString *buffer)
|
||||
{
|
||||
g_string_append_c (buffer, replch);
|
||||
}
|
||||
@ -195,7 +195,7 @@ str_8bit_iscombiningmark (const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
str_8bit_toupper (const char *text, char **out, size_t * remain)
|
||||
str_8bit_toupper (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
if (*remain <= 1)
|
||||
return FALSE;
|
||||
@ -209,7 +209,7 @@ str_8bit_toupper (const char *text, char **out, size_t * remain)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
str_8bit_tolower (const char *text, char **out, size_t * remain)
|
||||
str_8bit_tolower (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
if (*remain <= 1)
|
||||
return FALSE;
|
||||
@ -239,7 +239,7 @@ str_8bit_length2 (const char *text, int size)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gchar *
|
||||
str_8bit_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
str_8bit_conv_gerror_message (GError *mcerror, const char *def_msg)
|
||||
{
|
||||
GIConv conv;
|
||||
gchar *ret;
|
||||
@ -272,7 +272,7 @@ str_8bit_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static estr_t
|
||||
str_8bit_vfs_convert_to (GIConv coder, const char *string, int size, GString * buffer)
|
||||
str_8bit_vfs_convert_to (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
estr_t result = ESTR_SUCCESS;
|
||||
|
||||
|
@ -52,7 +52,7 @@ static const char replch = '?';
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
str_ascii_insert_replace_char (GString * buffer)
|
||||
str_ascii_insert_replace_char (GString *buffer)
|
||||
{
|
||||
g_string_append_c (buffer, replch);
|
||||
}
|
||||
@ -168,7 +168,7 @@ str_ascii_iscombiningmark (const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
str_ascii_toupper (const char *text, char **out, size_t * remain)
|
||||
str_ascii_toupper (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
if (*remain <= 1)
|
||||
return FALSE;
|
||||
@ -182,7 +182,7 @@ str_ascii_toupper (const char *text, char **out, size_t * remain)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
str_ascii_tolower (const char *text, char **out, size_t * remain)
|
||||
str_ascii_tolower (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
if (*remain <= 1)
|
||||
return FALSE;
|
||||
@ -212,7 +212,7 @@ str_ascii_length2 (const char *text, int size)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gchar *
|
||||
str_ascii_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
str_ascii_conv_gerror_message (GError *mcerror, const char *def_msg)
|
||||
{
|
||||
/* the same as str_utf8_conv_gerror_message() */
|
||||
if (mcerror != NULL)
|
||||
@ -224,7 +224,7 @@ str_ascii_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static estr_t
|
||||
str_ascii_vfs_convert_to (GIConv coder, const char *string, int size, GString * buffer)
|
||||
str_ascii_vfs_convert_to (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
(void) coder;
|
||||
g_string_append_len (buffer, string, size);
|
||||
|
@ -80,7 +80,7 @@ str_unichar_iscombiningmark (gunichar uni)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
str_utf8_insert_replace_char (GString * buffer)
|
||||
str_utf8_insert_replace_char (GString *buffer)
|
||||
{
|
||||
g_string_append (buffer, replch);
|
||||
}
|
||||
@ -277,7 +277,7 @@ str_utf8_cprev_noncomb_char (const char **text, const char *begin)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
str_utf8_toupper (const char *text, char **out, size_t * remain)
|
||||
str_utf8_toupper (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
gunichar uni;
|
||||
size_t left;
|
||||
@ -300,7 +300,7 @@ str_utf8_toupper (const char *text, char **out, size_t * remain)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
str_utf8_tolower (const char *text, char **out, size_t * remain)
|
||||
str_utf8_tolower (const char *text, char **out, size_t *remain)
|
||||
{
|
||||
gunichar uni;
|
||||
size_t left;
|
||||
@ -398,7 +398,7 @@ str_utf8_length_noncomb (const char *text)
|
||||
|
||||
#if 0
|
||||
static void
|
||||
str_utf8_questmark_sustb (char **string, size_t * left, GString * buffer)
|
||||
str_utf8_questmark_sustb (char **string, size_t *left, GString *buffer)
|
||||
{
|
||||
char *next;
|
||||
|
||||
@ -412,7 +412,7 @@ str_utf8_questmark_sustb (char **string, size_t * left, GString * buffer)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gchar *
|
||||
str_utf8_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
str_utf8_conv_gerror_message (GError *mcerror, const char *def_msg)
|
||||
{
|
||||
if (mcerror != NULL)
|
||||
return g_strdup (mcerror->message);
|
||||
@ -423,7 +423,7 @@ str_utf8_conv_gerror_message (GError * mcerror, const char *def_msg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static estr_t
|
||||
str_utf8_vfs_convert_to (GIConv coder, const char *string, int size, GString * buffer)
|
||||
str_utf8_vfs_convert_to (GIConv coder, const char *string, int size, GString *buffer)
|
||||
{
|
||||
estr_t result = ESTR_SUCCESS;
|
||||
|
||||
@ -1346,7 +1346,7 @@ str_utf8_caseprefix (const char *text, const char *prefix)
|
||||
|
||||
static char *
|
||||
str_utf8_create_key_gen (const char *text, gboolean case_sen,
|
||||
gchar * (*keygen) (const gchar * text, gssize size))
|
||||
gchar *(*keygen) (const gchar *text, gssize size))
|
||||
{
|
||||
char *result;
|
||||
|
||||
|
@ -69,7 +69,7 @@ str_tokenize_word (const char *string, int start)
|
||||
{
|
||||
int i = start;
|
||||
char delimiter = '\0';
|
||||
char delimopen;
|
||||
char delimopen = '\0';
|
||||
int nestdelim = 0;
|
||||
|
||||
if (member (string[i], "()\n")) /* XXX - included \n, but why? been here forever */
|
||||
|
@ -48,7 +48,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static strtol_error_t
|
||||
bkm_scale (uintmax_t * x, int scale_factor)
|
||||
bkm_scale (uintmax_t *x, int scale_factor)
|
||||
{
|
||||
if (UINTMAX_MAX / scale_factor < *x)
|
||||
{
|
||||
@ -63,7 +63,7 @@ bkm_scale (uintmax_t * x, int scale_factor)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static strtol_error_t
|
||||
bkm_scale_by_power (uintmax_t * x, int base, int power)
|
||||
bkm_scale_by_power (uintmax_t *x, int base, int power)
|
||||
{
|
||||
strtol_error_t err = LONGINT_OK;
|
||||
while (power-- != 0)
|
||||
@ -76,7 +76,7 @@ bkm_scale_by_power (uintmax_t * x, int base, int power)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
strtol_error_t
|
||||
xstrtoumax (const char *s, char **ptr, int base, uintmax_t * val, const char *valid_suffixes)
|
||||
xstrtoumax (const char *s, char **ptr, int base, uintmax_t *val, const char *valid_suffixes)
|
||||
{
|
||||
char *t_ptr;
|
||||
char **p;
|
||||
|
@ -103,7 +103,7 @@ color_get_attr (int color_pair)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_tty_color_pair_init_special (tty_color_lib_pair_t * mc_color_pair,
|
||||
mc_tty_color_pair_init_special (tty_color_lib_pair_t *mc_color_pair,
|
||||
int fg1, int bg1, int fg2, int bg2, int attr)
|
||||
{
|
||||
if (has_colors () && !mc_tty_color_disable)
|
||||
@ -145,7 +145,7 @@ tty_color_deinit_lib (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
tty_color_try_alloc_lib_pair (tty_color_lib_pair_t * mc_color_pair)
|
||||
tty_color_try_alloc_lib_pair (tty_color_lib_pair_t *mc_color_pair)
|
||||
{
|
||||
if (mc_color_pair->fg <= (int) SPEC_A_REVERSE)
|
||||
{
|
||||
@ -231,7 +231,7 @@ tty_set_normal_attrs (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
tty_use_256colors (GError ** error)
|
||||
tty_use_256colors (GError **error)
|
||||
{
|
||||
(void) error;
|
||||
|
||||
@ -241,7 +241,7 @@ tty_use_256colors (GError ** error)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
tty_use_truecolors (GError ** error)
|
||||
tty_use_truecolors (GError **error)
|
||||
{
|
||||
/* Not yet supported in ncurses */
|
||||
g_set_error (error, MC_ERROR, -1, _("True color not supported with ncurses."));
|
||||
|
@ -99,7 +99,7 @@ has_colors (gboolean disable, gboolean force)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_tty_color_pair_init_special (tty_color_lib_pair_t * mc_color_pair,
|
||||
mc_tty_color_pair_init_special (tty_color_lib_pair_t *mc_color_pair,
|
||||
const char *fg1, const char *bg1,
|
||||
const char *fg2, const char *bg2, SLtt_Char_Type mask)
|
||||
{
|
||||
@ -145,7 +145,7 @@ tty_color_deinit_lib (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
tty_color_try_alloc_lib_pair (tty_color_lib_pair_t * mc_color_pair)
|
||||
tty_color_try_alloc_lib_pair (tty_color_lib_pair_t *mc_color_pair)
|
||||
{
|
||||
if (mc_color_pair->fg <= (int) SPEC_A_REVERSE)
|
||||
{
|
||||
@ -213,7 +213,7 @@ tty_set_normal_attrs (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
tty_use_256colors (GError ** error)
|
||||
tty_use_256colors (GError **error)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
@ -229,7 +229,7 @@ tty_use_256colors (GError ** error)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
tty_use_truecolors (GError ** error)
|
||||
tty_use_truecolors (GError **error)
|
||||
{
|
||||
char *colorterm;
|
||||
|
||||
|
@ -74,7 +74,7 @@ static GHashTable *mc_tty_color__hashtable = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_color__deinit (tty_color_pair_t * color)
|
||||
mc_color__deinit (tty_color_pair_t *color)
|
||||
{
|
||||
g_free (color->fg);
|
||||
g_free (color->bg);
|
||||
@ -153,7 +153,7 @@ tty_use_colors (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
tty_try_alloc_color_pair (const tty_color_pair_t * color, gboolean is_temp)
|
||||
tty_try_alloc_color_pair (const tty_color_pair_t *color, gboolean is_temp)
|
||||
{
|
||||
gboolean is_base;
|
||||
gchar *color_pair;
|
||||
@ -220,7 +220,7 @@ tty_color_free_all (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
tty_color_set_defaults (const tty_color_pair_t * color)
|
||||
tty_color_set_defaults (const tty_color_pair_t *color)
|
||||
{
|
||||
mc_color__deinit (&tty_color_defaults);
|
||||
|
||||
|
@ -584,7 +584,7 @@ select_cmp_by_fd (gconstpointer a, gconstpointer b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
add_selects (fd_set * select_set)
|
||||
add_selects (fd_set *select_set)
|
||||
{
|
||||
int top_fd = 0;
|
||||
|
||||
@ -608,7 +608,7 @@ add_selects (fd_set * select_set)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
check_selects (fd_set * select_set)
|
||||
check_selects (fd_set *select_set)
|
||||
{
|
||||
while (disabled_channels == 0)
|
||||
{
|
||||
@ -690,7 +690,7 @@ create_sequence (const char *seq, int code, int action)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
define_sequences (const key_define_t * kd)
|
||||
define_sequences (const key_define_t *kd)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -745,7 +745,7 @@ getch_with_delay (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
xmouse_get_event (Gpm_Event * ev, gboolean extended)
|
||||
xmouse_get_event (Gpm_Event *ev, gboolean extended)
|
||||
{
|
||||
static gint64 tv1 = 0; /* Force first click as single */
|
||||
static int clicks = 0;
|
||||
@ -1173,7 +1173,7 @@ getch_with_timeout (unsigned int delay_us)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
learn_store_key (GString * buffer, int c)
|
||||
learn_store_key (GString *buffer, int c)
|
||||
{
|
||||
if (c == ESC_CHAR)
|
||||
g_string_append (buffer, "\\e");
|
||||
@ -1191,7 +1191,7 @@ learn_store_key (GString * buffer, int c)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
k_dispose (key_def * k)
|
||||
k_dispose (key_def *k)
|
||||
{
|
||||
if (k != NULL)
|
||||
{
|
||||
|
@ -94,8 +94,7 @@ static const struct
|
||||
{
|
||||
int key_code;
|
||||
const char *key_name;
|
||||
} key_table[] =
|
||||
{
|
||||
} key_table[] = {
|
||||
/* *INDENT-OFF* */
|
||||
{ KEY_F (0), "k0" },
|
||||
{ KEY_F (1), "k1" },
|
||||
|
@ -87,7 +87,7 @@ static gboolean longjmp_allowed = FALSE;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
x_io_error_handler (Display * dpy)
|
||||
x_io_error_handler (Display *dpy)
|
||||
{
|
||||
(void) dpy;
|
||||
|
||||
@ -103,7 +103,7 @@ x_io_error_handler (Display * dpy)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
x_error_handler (Display * dpy, XErrorEvent * ee)
|
||||
x_error_handler (Display *dpy, XErrorEvent *ee)
|
||||
{
|
||||
(void) ee;
|
||||
(void) func_XCloseDisplay (dpy);
|
||||
@ -205,7 +205,7 @@ mc_XOpenDisplay (const char *displayname)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_XCloseDisplay (Display * display)
|
||||
mc_XCloseDisplay (Display *display)
|
||||
{
|
||||
if (x11_available ())
|
||||
{
|
||||
@ -230,8 +230,8 @@ mc_XCloseDisplay (Display * display)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
Bool
|
||||
mc_XQueryPointer (Display * display, Window win, Window * root_return,
|
||||
Window * child_return, int *root_x_return, int *root_y_return,
|
||||
mc_XQueryPointer (Display *display, Window win, Window *root_return,
|
||||
Window *child_return, int *root_x_return, int *root_y_return,
|
||||
int *win_x_return, int *win_y_return, unsigned int *mask_return)
|
||||
{
|
||||
Bool retval;
|
||||
|
35
lib/util.c
35
lib/util.c
@ -111,7 +111,7 @@ is_8bit_printable (unsigned char c)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
resolve_symlinks (const vfs_path_t * vpath)
|
||||
resolve_symlinks (const vfs_path_t *vpath)
|
||||
{
|
||||
char *p, *p2;
|
||||
char *buf, *buf2, *q, *r, c;
|
||||
@ -332,16 +332,12 @@ const char *
|
||||
path_trunc (const char *path, size_t trunc_len)
|
||||
{
|
||||
vfs_path_t *vpath;
|
||||
char *secure_path;
|
||||
const char *ret;
|
||||
|
||||
vpath = vfs_path_from_str (path);
|
||||
secure_path = vfs_path_to_str_flags (vpath, 0, VPF_STRIP_PASSWORD);
|
||||
vpath = vfs_path_from_str_flags (path, VPF_STRIP_PASSWORD);
|
||||
ret = str_trunc (vfs_path_as_str (vpath), trunc_len);
|
||||
vfs_path_free (vpath, TRUE);
|
||||
|
||||
ret = str_trunc (secure_path, trunc_len);
|
||||
g_free (secure_path);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -456,11 +452,12 @@ size_trunc_len (char *buffer, unsigned int len, uintmax_t size, int units, gbool
|
||||
*/
|
||||
#endif
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static const char *const suffix[] =
|
||||
{ "", "K", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q", NULL };
|
||||
static const char *const suffix_lc[] =
|
||||
{ "", "k", "m", "g", "t", "p", "e", "z", "y", "r", "q", NULL };
|
||||
/* *INDENT-ON* */
|
||||
|
||||
const char *const *sfx = use_si ? suffix_lc : suffix;
|
||||
int j = 0;
|
||||
@ -597,7 +594,7 @@ extension (const char *filename)
|
||||
|
||||
char *
|
||||
load_mc_home_file (const char *from, const char *filename, char **allocated_filename,
|
||||
size_t * length)
|
||||
size_t *length)
|
||||
{
|
||||
char *hintfile_base, *hintfile;
|
||||
char *lang;
|
||||
@ -1029,7 +1026,7 @@ convert_controls (const char *p)
|
||||
*/
|
||||
|
||||
char *
|
||||
diff_two_paths (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
diff_two_paths (const vfs_path_t *vpath1, const vfs_path_t *vpath2)
|
||||
{
|
||||
int j, prevlen = -1, currlen;
|
||||
char *my_first = NULL, *my_second = NULL;
|
||||
@ -1100,7 +1097,7 @@ diff_two_paths (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
*/
|
||||
|
||||
GList *
|
||||
list_append_unique (GList * list, char *text)
|
||||
list_append_unique (GList *list, char *text)
|
||||
{
|
||||
GList *lc_link;
|
||||
|
||||
@ -1140,8 +1137,8 @@ list_append_unique (GList * list, char *text)
|
||||
*/
|
||||
|
||||
void
|
||||
load_file_position (const vfs_path_t * filename_vpath, long *line, long *column, off_t * offset,
|
||||
GArray ** bookmarks)
|
||||
load_file_position (const vfs_path_t *filename_vpath, long *line, long *column, off_t *offset,
|
||||
GArray **bookmarks)
|
||||
{
|
||||
char *fn;
|
||||
FILE *f;
|
||||
@ -1231,8 +1228,8 @@ load_file_position (const vfs_path_t * filename_vpath, long *line, long *column,
|
||||
*/
|
||||
|
||||
void
|
||||
save_file_position (const vfs_path_t * filename_vpath, long line, long column, off_t offset,
|
||||
GArray * bookmarks)
|
||||
save_file_position (const vfs_path_t *filename_vpath, long line, long column, off_t offset,
|
||||
GArray *bookmarks)
|
||||
{
|
||||
static size_t filepos_max_saved_entries = 0;
|
||||
char *fn, *tmp_fn;
|
||||
@ -1275,7 +1272,7 @@ save_file_position (const vfs_path_t * filename_vpath, long line, long column, o
|
||||
if (bookmarks != NULL)
|
||||
for (i = 0; i < bookmarks->len && i < MAX_SAVED_BOOKMARKS; i++)
|
||||
if (fprintf (f, ";%zu", g_array_index (bookmarks, size_t, i)) < 0)
|
||||
goto write_position_error;
|
||||
goto write_position_error;
|
||||
|
||||
if (fprintf (f, "\n") < 0)
|
||||
goto write_position_error;
|
||||
@ -1478,7 +1475,7 @@ mc_get_profile_root (void)
|
||||
*/
|
||||
|
||||
void
|
||||
mc_propagate_error (GError ** dest, int code, const char *format, ...)
|
||||
mc_propagate_error (GError **dest, int code, const char *format, ...)
|
||||
{
|
||||
if (dest != NULL && *dest == NULL)
|
||||
{
|
||||
@ -1504,7 +1501,7 @@ mc_propagate_error (GError ** dest, int code, const char *format, ...)
|
||||
*/
|
||||
|
||||
void
|
||||
mc_replace_error (GError ** dest, int code, const char *format, ...)
|
||||
mc_replace_error (GError **dest, int code, const char *format, ...)
|
||||
{
|
||||
if (dest != NULL)
|
||||
{
|
||||
@ -1533,7 +1530,7 @@ mc_replace_error (GError ** dest, int code, const char *format, ...)
|
||||
* @return TRUE if clock skew detected, FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
mc_time_elapsed (gint64 * timestamp, gint64 delay)
|
||||
mc_time_elapsed (gint64 *timestamp, gint64 delay)
|
||||
{
|
||||
gint64 now;
|
||||
|
||||
|
@ -186,7 +186,7 @@ char *diff_two_paths (const vfs_path_t * vpath1, const vfs_path_t * vpath2);
|
||||
const char *x_basename (const char *fname);
|
||||
|
||||
char *load_mc_home_file (const char *from, const char *filename, char **allocated_filename,
|
||||
size_t * length);
|
||||
size_t *length);
|
||||
|
||||
/* uid/gid managing */
|
||||
void init_groups (void);
|
||||
|
@ -113,7 +113,7 @@ static int_cache gid_cache[GID_CACHE_SIZE];
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
i_cache_match (int id, int_cache * cache, int size)
|
||||
i_cache_match (int id, int_cache *cache, int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -126,7 +126,7 @@ i_cache_match (int id, int_cache * cache, int size)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
i_cache_add (int id, int_cache * cache, int size, char *text, int *last)
|
||||
i_cache_add (int id, int_cache *cache, int size, char *text, int *last)
|
||||
{
|
||||
g_free (cache[*last].string);
|
||||
cache[*last].string = g_strdup (text);
|
||||
@ -167,7 +167,7 @@ my_fork (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
my_system__save_sigaction_handlers (my_system_sigactions_t * sigactions)
|
||||
my_system__save_sigaction_handlers (my_system_sigactions_t *sigactions)
|
||||
{
|
||||
struct sigaction ignore;
|
||||
|
||||
@ -186,7 +186,7 @@ my_system__save_sigaction_handlers (my_system_sigactions_t * sigactions)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
my_system__restore_sigaction_handlers (my_system_sigactions_t * sigactions)
|
||||
my_system__restore_sigaction_handlers (my_system_sigactions_t *sigactions)
|
||||
{
|
||||
sigaction (SIGINT, &sigactions->intr, NULL);
|
||||
sigaction (SIGQUIT, &sigactions->quit, NULL);
|
||||
@ -220,7 +220,7 @@ my_system_make_arg_array (int flags, const char *shell)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mc_pread_stream (mc_pipe_stream_t * ps, const fd_set * fds)
|
||||
mc_pread_stream (mc_pipe_stream_t *ps, const fd_set *fds)
|
||||
{
|
||||
size_t buf_len;
|
||||
ssize_t read_len;
|
||||
@ -496,7 +496,7 @@ my_systemv_flags (int flags, const char *command, char *const argv[])
|
||||
*/
|
||||
|
||||
mc_pipe_t *
|
||||
mc_popen (const char *command, gboolean read_out, gboolean read_err, GError ** error)
|
||||
mc_popen (const char *command, gboolean read_out, gboolean read_err, GError **error)
|
||||
{
|
||||
mc_pipe_t *p;
|
||||
const char *const argv[] = { "/bin/sh", "sh", "-c", command, NULL };
|
||||
@ -558,7 +558,7 @@ mc_popen (const char *command, gboolean read_out, gboolean read_err, GError ** e
|
||||
*/
|
||||
|
||||
void
|
||||
mc_pread (mc_pipe_t * p, GError ** error)
|
||||
mc_pread (mc_pipe_t *p, GError **error)
|
||||
{
|
||||
gboolean read_out, read_err;
|
||||
fd_set fds;
|
||||
@ -624,7 +624,7 @@ mc_pread (mc_pipe_t * p, GError ** error)
|
||||
*/
|
||||
|
||||
GString *
|
||||
mc_pstream_get_string (mc_pipe_stream_t * ps)
|
||||
mc_pstream_get_string (mc_pipe_stream_t *ps)
|
||||
{
|
||||
char *s;
|
||||
size_t size, i;
|
||||
@ -666,7 +666,7 @@ mc_pstream_get_string (mc_pipe_stream_t * ps)
|
||||
*/
|
||||
|
||||
void
|
||||
mc_pclose (mc_pipe_t * p, GError ** error)
|
||||
mc_pclose (mc_pipe_t *p, GError **error)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
@ -378,7 +378,7 @@ vfs_s_new_fh (struct vfs_s_inode *ino, gboolean changed)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
vfs_s_free_fh (struct vfs_s_subclass *s, vfs_file_handler_t * fh)
|
||||
vfs_s_free_fh (struct vfs_s_subclass *s, vfs_file_handler_t *fh)
|
||||
{
|
||||
if (s->fh_free != NULL)
|
||||
s->fh_free (fh);
|
||||
@ -391,7 +391,7 @@ vfs_s_free_fh (struct vfs_s_subclass *s, vfs_file_handler_t * fh)
|
||||
/* ------------------------ readdir & friends ----------------------------- */
|
||||
|
||||
static struct vfs_s_inode *
|
||||
vfs_s_inode_from_path (const vfs_path_t * vpath, int flags)
|
||||
vfs_s_inode_from_path (const vfs_path_t *vpath, int flags)
|
||||
{
|
||||
struct vfs_s_super *super;
|
||||
struct vfs_s_inode *ino;
|
||||
@ -420,7 +420,7 @@ vfs_s_inode_from_path (const vfs_path_t * vpath, int flags)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void *
|
||||
vfs_s_opendir (const vfs_path_t * vpath)
|
||||
vfs_s_opendir (const vfs_path_t *vpath)
|
||||
{
|
||||
struct vfs_s_inode *dir;
|
||||
struct dirhandle *info;
|
||||
@ -492,7 +492,7 @@ vfs_s_closedir (void *data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
vfs_s_chdir (const vfs_path_t * vpath)
|
||||
vfs_s_chdir (const vfs_path_t *vpath)
|
||||
{
|
||||
void *data;
|
||||
|
||||
@ -507,7 +507,7 @@ vfs_s_chdir (const vfs_path_t * vpath)
|
||||
/* --------------------------- stat and friends ---------------------------- */
|
||||
|
||||
static int
|
||||
vfs_s_internal_stat (const vfs_path_t * vpath, struct stat *buf, int flag)
|
||||
vfs_s_internal_stat (const vfs_path_t *vpath, struct stat *buf, int flag)
|
||||
{
|
||||
struct vfs_s_inode *ino;
|
||||
|
||||
@ -521,7 +521,7 @@ vfs_s_internal_stat (const vfs_path_t * vpath, struct stat *buf, int flag)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
vfs_s_readlink (const vfs_path_t * vpath, char *buf, size_t size)
|
||||
vfs_s_readlink (const vfs_path_t *vpath, char *buf, size_t size)
|
||||
{
|
||||
struct vfs_s_inode *ino;
|
||||
size_t len;
|
||||
@ -751,7 +751,7 @@ vfs_s_ferrno (struct vfs_class *me)
|
||||
*/
|
||||
|
||||
static vfs_path_t *
|
||||
vfs_s_getlocalcopy (const vfs_path_t * vpath)
|
||||
vfs_s_getlocalcopy (const vfs_path_t *vpath)
|
||||
{
|
||||
vfs_file_handler_t *fh;
|
||||
vfs_path_t *local = NULL;
|
||||
@ -782,7 +782,7 @@ vfs_s_getlocalcopy (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
static int
|
||||
vfs_s_ungetlocalcopy (const vfs_path_t * vpath, const vfs_path_t * local, gboolean has_changed)
|
||||
vfs_s_ungetlocalcopy (const vfs_path_t *vpath, const vfs_path_t *local, gboolean has_changed)
|
||||
{
|
||||
(void) vpath;
|
||||
(void) local;
|
||||
@ -793,7 +793,7 @@ vfs_s_ungetlocalcopy (const vfs_path_t * vpath, const vfs_path_t * local, gboole
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
vfs_s_setctl (const vfs_path_t * vpath, int ctlop, void *arg)
|
||||
vfs_s_setctl (const vfs_path_t *vpath, int ctlop, void *arg)
|
||||
{
|
||||
struct vfs_class *me;
|
||||
|
||||
@ -832,7 +832,7 @@ vfs_s_setctl (const vfs_path_t * vpath, int ctlop, void *arg)
|
||||
/* ----------------------------- Stamping support -------------------------- */
|
||||
|
||||
static vfsid
|
||||
vfs_s_getid (const vfs_path_t * vpath)
|
||||
vfs_s_getid (const vfs_path_t *vpath)
|
||||
{
|
||||
struct vfs_s_super *archive = NULL;
|
||||
const char *p;
|
||||
@ -1115,7 +1115,7 @@ vfs_s_find_inode (struct vfs_class *me, const struct vfs_s_super *super,
|
||||
*/
|
||||
|
||||
struct vfs_s_super *
|
||||
vfs_get_super_by_vpath (const vfs_path_t * vpath)
|
||||
vfs_get_super_by_vpath (const vfs_path_t *vpath)
|
||||
{
|
||||
GList *iter;
|
||||
void *cookie = NULL;
|
||||
@ -1172,7 +1172,7 @@ vfs_get_super_by_vpath (const vfs_path_t * vpath)
|
||||
* @return path from last VFS-element
|
||||
*/
|
||||
const char *
|
||||
vfs_s_get_path (const vfs_path_t * vpath, struct vfs_s_super **archive, int flags)
|
||||
vfs_s_get_path (const vfs_path_t *vpath, struct vfs_s_super **archive, int flags)
|
||||
{
|
||||
const char *retval = "";
|
||||
int result = -1;
|
||||
@ -1281,7 +1281,7 @@ vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
vfs_s_init_fh (vfs_file_handler_t * fh, struct vfs_s_inode *ino, gboolean changed)
|
||||
vfs_s_init_fh (vfs_file_handler_t *fh, struct vfs_s_inode *ino, gboolean changed)
|
||||
{
|
||||
fh->ino = ino;
|
||||
fh->handle = -1;
|
||||
@ -1293,7 +1293,7 @@ vfs_s_init_fh (vfs_file_handler_t * fh, struct vfs_s_inode *ino, gboolean change
|
||||
/* --------------------------- stat and friends ---------------------------- */
|
||||
|
||||
void *
|
||||
vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
|
||||
vfs_s_open (const vfs_path_t *vpath, int flags, mode_t mode)
|
||||
{
|
||||
gboolean was_changed = FALSE;
|
||||
vfs_file_handler_t *fh;
|
||||
@ -1404,7 +1404,7 @@ vfs_s_open (const vfs_path_t * vpath, int flags, mode_t mode)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
vfs_s_stat (const vfs_path_t * vpath, struct stat *buf)
|
||||
vfs_s_stat (const vfs_path_t *vpath, struct stat *buf)
|
||||
{
|
||||
return vfs_s_internal_stat (vpath, buf, FL_FOLLOW);
|
||||
}
|
||||
@ -1412,7 +1412,7 @@ vfs_s_stat (const vfs_path_t * vpath, struct stat *buf)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
vfs_s_lstat (const vfs_path_t * vpath, struct stat *buf)
|
||||
vfs_s_lstat (const vfs_path_t *vpath, struct stat *buf)
|
||||
{
|
||||
return vfs_s_internal_stat (vpath, buf, FL_NONE);
|
||||
}
|
||||
@ -1571,7 +1571,7 @@ vfs_init_subclass (struct vfs_s_subclass *sub, const char *name, vfs_flags_t fla
|
||||
/** Find VFS id for given directory name */
|
||||
|
||||
vfsid
|
||||
vfs_getid (const vfs_path_t * vpath)
|
||||
vfs_getid (const vfs_path_t *vpath)
|
||||
{
|
||||
const struct vfs_class *me;
|
||||
|
||||
|
@ -183,7 +183,7 @@ vfs_rmstamp (struct vfs_class *v, vfsid id)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
vfs_stamp_path (const vfs_path_t * vpath)
|
||||
vfs_stamp_path (const vfs_path_t *vpath)
|
||||
{
|
||||
vfsid id;
|
||||
struct vfs_class *me;
|
||||
@ -313,7 +313,7 @@ vfs_timeout_handler (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
vfs_release_path (const vfs_path_t * vpath)
|
||||
vfs_release_path (const vfs_path_t *vpath)
|
||||
{
|
||||
vfsid id;
|
||||
struct vfs_class *me;
|
||||
|
@ -80,7 +80,7 @@ extern struct vfs_dirent *mc_readdir_result;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static vfs_path_t *
|
||||
mc_def_getlocalcopy (const vfs_path_t * filename_vpath)
|
||||
mc_def_getlocalcopy (const vfs_path_t *filename_vpath)
|
||||
{
|
||||
vfs_path_t *tmp_vpath = NULL;
|
||||
int fdin, fdout = -1;
|
||||
@ -130,8 +130,8 @@ mc_def_getlocalcopy (const vfs_path_t * filename_vpath)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
mc_def_ungetlocalcopy (const vfs_path_t * filename_vpath,
|
||||
const vfs_path_t * local_vpath, gboolean has_changed)
|
||||
mc_def_ungetlocalcopy (const vfs_path_t *filename_vpath,
|
||||
const vfs_path_t *local_vpath, gboolean has_changed)
|
||||
{
|
||||
int fdin = -1, fdout = -1;
|
||||
const char *local;
|
||||
@ -188,7 +188,7 @@ mc_def_ungetlocalcopy (const vfs_path_t * filename_vpath,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_open (const vfs_path_t * vpath, int flags, ...)
|
||||
mc_open (const vfs_path_t *vpath, int flags, ...)
|
||||
{
|
||||
int result = -1;
|
||||
mode_t mode = 0;
|
||||
@ -267,7 +267,7 @@ MC_NAMEOP (mknod, (const vfs_path_t *vpath, mode_t mode, dev_t dev), (vpath, mod
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_symlink (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
mc_symlink (const vfs_path_t *vpath1, const vfs_path_t *vpath2)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
@ -361,7 +361,7 @@ mc_ctl (int handle, int ctlop, void *arg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_setctl (const vfs_path_t * vpath, int ctlop, void *arg)
|
||||
mc_setctl (const vfs_path_t *vpath, int ctlop, void *arg)
|
||||
{
|
||||
int result = -1;
|
||||
struct vfs_class *me;
|
||||
@ -408,7 +408,7 @@ mc_close (int handle)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
DIR *
|
||||
mc_opendir (const vfs_path_t * vpath)
|
||||
mc_opendir (const vfs_path_t *vpath)
|
||||
{
|
||||
int handle, *handlep;
|
||||
void *info;
|
||||
@ -450,7 +450,7 @@ mc_opendir (const vfs_path_t * vpath)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
struct vfs_dirent *
|
||||
mc_readdir (DIR * dirp)
|
||||
mc_readdir (DIR *dirp)
|
||||
{
|
||||
int handle;
|
||||
struct vfs_class *vfs;
|
||||
@ -481,7 +481,7 @@ mc_readdir (DIR * dirp)
|
||||
#ifdef HAVE_CHARSET
|
||||
str_vfs_convert_from (vfs_path_element->dir.converter, entry->d_name, vfs_str_buffer);
|
||||
#else
|
||||
g_string_assign (vfs_str_buffer, entry->d_name);
|
||||
g_string_append_len (vfs_str_buffer, entry->d_name, entry->d_len);
|
||||
#endif
|
||||
vfs_dirent_assign (mc_readdir_result, vfs_str_buffer->str, entry->d_ino);
|
||||
vfs_dirent_free (entry);
|
||||
@ -494,7 +494,7 @@ mc_readdir (DIR * dirp)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
mc_closedir (DIR * dirp)
|
||||
mc_closedir (DIR *dirp)
|
||||
{
|
||||
int handle;
|
||||
struct vfs_class *vfs;
|
||||
|
@ -205,7 +205,7 @@ is_year (char *str, struct tm *tim)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_filetype (const char *s, size_t * ret_skipped, mode_t * ret_type)
|
||||
vfs_parse_filetype (const char *s, size_t *ret_skipped, mode_t *ret_type)
|
||||
{
|
||||
mode_t type;
|
||||
|
||||
@ -272,7 +272,7 @@ vfs_parse_filetype (const char *s, size_t * ret_skipped, mode_t * ret_type)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_fileperms (const char *s, size_t * ret_skipped, mode_t * ret_perms)
|
||||
vfs_parse_fileperms (const char *s, size_t *ret_skipped, mode_t *ret_perms)
|
||||
{
|
||||
const char *p = s;
|
||||
mode_t perms = 0;
|
||||
@ -411,7 +411,7 @@ vfs_parse_fileperms (const char *s, size_t * ret_skipped, mode_t * ret_perms)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode)
|
||||
vfs_parse_filemode (const char *s, size_t *ret_skipped, mode_t *ret_mode)
|
||||
{
|
||||
const char *p = s;
|
||||
mode_t type, perms;
|
||||
@ -434,7 +434,7 @@ vfs_parse_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_raw_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode)
|
||||
vfs_parse_raw_filemode (const char *s, size_t *ret_skipped, mode_t *ret_mode)
|
||||
{
|
||||
const char *p = s;
|
||||
mode_t remote_type = 0, local_type, perms = 0;
|
||||
@ -495,7 +495,7 @@ vfs_parse_raw_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_month (const char *str, struct tm * tim)
|
||||
vfs_parse_month (const char *str, struct tm *tim)
|
||||
{
|
||||
static const char *month = "JanFebMarAprMayJunJulAugSepOctNovDec";
|
||||
const char *pos;
|
||||
@ -517,7 +517,7 @@ vfs_parse_month (const char *str, struct tm * tim)
|
||||
/** This function parses from idx in the columns[] array */
|
||||
|
||||
int
|
||||
vfs_parse_filedate (int idx, time_t * t)
|
||||
vfs_parse_filedate (int idx, time_t *t)
|
||||
{
|
||||
char *p;
|
||||
struct tm tim;
|
||||
@ -679,8 +679,8 @@ vfs_parse_ls_lga_get_final_spaces (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_parse_ls_lga (const char *p, struct stat * s, char **filename, char **linkname,
|
||||
size_t * num_spaces)
|
||||
vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linkname,
|
||||
size_t *num_spaces)
|
||||
{
|
||||
int idx, idx2, num_cols;
|
||||
int i;
|
||||
|
@ -151,6 +151,7 @@ vfs_canon (const char *path)
|
||||
|
||||
char *local;
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
if (g_str_has_prefix (path, VFS_ENCODING_PREFIX))
|
||||
{
|
||||
/*
|
||||
@ -160,6 +161,7 @@ vfs_canon (const char *path)
|
||||
local = mc_build_filename (PATH_SEP_STR, path, (char *) NULL);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
const char *curr_dir;
|
||||
|
||||
@ -238,7 +240,7 @@ vfs_get_encoding (const char *path, ssize_t len)
|
||||
*/
|
||||
|
||||
static void
|
||||
vfs_path_url_split (vfs_path_element_t * path_element, const char *path)
|
||||
vfs_path_url_split (vfs_path_element_t *path_element, const char *path)
|
||||
{
|
||||
char *pcopy;
|
||||
char *colon, *at, *rest;
|
||||
@ -439,11 +441,20 @@ vfs_path_from_str_deprecated_parser (char *path)
|
||||
static vfs_path_t *
|
||||
vfs_path_from_str_uri_parser (char *path)
|
||||
{
|
||||
gboolean path_is_absolute;
|
||||
vfs_path_t *vpath;
|
||||
vfs_path_element_t *element;
|
||||
char *url_delimiter;
|
||||
|
||||
vpath = vfs_path_new (path != NULL && !IS_PATH_SEP (*path));
|
||||
if (path == NULL)
|
||||
return vfs_path_new (FALSE);
|
||||
|
||||
path_is_absolute = IS_PATH_SEP (*path);
|
||||
#ifdef HAVE_CHARSET
|
||||
path_is_absolute = path_is_absolute || g_str_has_prefix (path, VFS_ENCODING_PREFIX);
|
||||
#endif
|
||||
|
||||
vpath = vfs_path_new (!path_is_absolute);
|
||||
|
||||
while ((url_delimiter = g_strrstr (path, VFS_PATH_URL_DELIMITER)) != NULL)
|
||||
{
|
||||
@ -455,7 +466,7 @@ vfs_path_from_str_uri_parser (char *path)
|
||||
vfs_prefix_start = real_vfs_prefix_start;
|
||||
|
||||
if (IS_PATH_SEP (*vfs_prefix_start))
|
||||
vfs_prefix_start += 1;
|
||||
vfs_prefix_start++;
|
||||
|
||||
*url_delimiter = '\0';
|
||||
|
||||
@ -471,9 +482,7 @@ vfs_path_from_str_uri_parser (char *path)
|
||||
|
||||
slash_pointer = strchr (url_delimiter, PATH_SEP);
|
||||
if (slash_pointer == NULL)
|
||||
{
|
||||
element->path = g_strdup ("");
|
||||
}
|
||||
else
|
||||
{
|
||||
element->path = vfs_translate_path_n (slash_pointer + 1);
|
||||
@ -531,8 +540,8 @@ vfs_path_from_str_uri_parser (char *path)
|
||||
*/
|
||||
|
||||
static void
|
||||
vfs_path_tokens_add_class_info (const vfs_path_element_t * element, GString * ret_tokens,
|
||||
GString * element_tokens)
|
||||
vfs_path_tokens_add_class_info (const vfs_path_element_t *element, GString *ret_tokens,
|
||||
GString *element_tokens)
|
||||
{
|
||||
if (((element->class->flags & VFSF_LOCAL) == 0 || ret_tokens->len > 0)
|
||||
&& element_tokens->len > 0)
|
||||
@ -626,7 +635,7 @@ vfs_path_strip_home (const char *dir)
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_flag_t flags)
|
||||
vfs_path_to_str_flags (const vfs_path_t *vpath, int elements_count, vfs_path_flag_t flags)
|
||||
{
|
||||
int element_index;
|
||||
GString *buffer;
|
||||
@ -661,7 +670,7 @@ vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_fl
|
||||
g_string_append (buffer, element->vfs_prefix);
|
||||
g_string_append (buffer, VFS_PATH_URL_DELIMITER);
|
||||
|
||||
url_str = vfs_path_build_url_params_str (element, !(flags & VPF_STRIP_PASSWORD));
|
||||
url_str = vfs_path_build_url_params_str (element, (flags & VPF_STRIP_PASSWORD) == 0);
|
||||
if (url_str != NULL)
|
||||
{
|
||||
g_string_append_len (buffer, url_str->str, url_str->len);
|
||||
@ -718,7 +727,7 @@ vfs_path_to_str_flags (const vfs_path_t * vpath, int elements_count, vfs_path_fl
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_to_str_elements_count (const vfs_path_t * vpath, int elements_count)
|
||||
vfs_path_to_str_elements_count (const vfs_path_t *vpath, int elements_count)
|
||||
{
|
||||
return vfs_path_to_str_flags (vpath, elements_count, VPF_NONE);
|
||||
}
|
||||
@ -805,7 +814,7 @@ vfs_path_new (gboolean relative)
|
||||
*/
|
||||
|
||||
int
|
||||
vfs_path_elements_count (const vfs_path_t * vpath)
|
||||
vfs_path_elements_count (const vfs_path_t *vpath)
|
||||
{
|
||||
return (vpath != NULL && vpath->path != NULL) ? vpath->path->len : 0;
|
||||
}
|
||||
@ -818,7 +827,7 @@ vfs_path_elements_count (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
void
|
||||
vfs_path_add_element (vfs_path_t * vpath, const vfs_path_element_t * path_element)
|
||||
vfs_path_add_element (vfs_path_t *vpath, const vfs_path_element_t *path_element)
|
||||
{
|
||||
g_array_append_val (vpath->path, path_element);
|
||||
g_free (vpath->str);
|
||||
@ -839,7 +848,7 @@ vfs_path_add_element (vfs_path_t * vpath, const vfs_path_element_t * path_elemen
|
||||
*/
|
||||
|
||||
const vfs_path_element_t *
|
||||
vfs_path_get_by_index (const vfs_path_t * vpath, int element_index)
|
||||
vfs_path_get_by_index (const vfs_path_t *vpath, int element_index)
|
||||
{
|
||||
int n;
|
||||
|
||||
@ -873,7 +882,7 @@ vfs_path_get_by_index (const vfs_path_t * vpath, int element_index)
|
||||
*/
|
||||
|
||||
vfs_path_element_t *
|
||||
vfs_path_element_clone (const vfs_path_element_t * element)
|
||||
vfs_path_element_clone (const vfs_path_element_t *element)
|
||||
{
|
||||
vfs_path_element_t *new_element = g_new (vfs_path_element_t, 1);
|
||||
|
||||
@ -906,7 +915,7 @@ vfs_path_element_clone (const vfs_path_element_t * element)
|
||||
*/
|
||||
|
||||
void
|
||||
vfs_path_element_free (vfs_path_element_t * element)
|
||||
vfs_path_element_free (vfs_path_element_t *element)
|
||||
{
|
||||
if (element == NULL)
|
||||
return;
|
||||
@ -937,7 +946,7 @@ vfs_path_element_free (vfs_path_element_t * element)
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_clone (const vfs_path_t * vpath)
|
||||
vfs_path_clone (const vfs_path_t *vpath)
|
||||
{
|
||||
vfs_path_t *new_vpath;
|
||||
int vpath_element_index;
|
||||
@ -971,7 +980,7 @@ vfs_path_clone (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_free (vfs_path_t * vpath, gboolean free_str)
|
||||
vfs_path_free (vfs_path_t *vpath, gboolean free_str)
|
||||
{
|
||||
int vpath_element_index;
|
||||
char *ret;
|
||||
@ -1013,7 +1022,7 @@ vfs_path_free (vfs_path_t * vpath, gboolean free_str)
|
||||
*/
|
||||
|
||||
void
|
||||
vfs_path_remove_element_by_index (vfs_path_t * vpath, int element_index)
|
||||
vfs_path_remove_element_by_index (vfs_path_t *vpath, int element_index)
|
||||
{
|
||||
vfs_path_element_t *element;
|
||||
|
||||
@ -1071,7 +1080,7 @@ vfs_prefix_to_class (const char *prefix)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
vfs_path_element_need_cleanup_converter (const vfs_path_element_t * element)
|
||||
vfs_path_element_need_cleanup_converter (const vfs_path_element_t *element)
|
||||
{
|
||||
return (element->dir.converter != str_cnv_from_term && element->dir.converter != INVALID_CONV);
|
||||
}
|
||||
@ -1086,7 +1095,7 @@ vfs_path_element_need_cleanup_converter (const vfs_path_element_t * element)
|
||||
* @return pointer to path structure (for use function in another functions)
|
||||
*/
|
||||
vfs_path_t *
|
||||
vfs_path_change_encoding (vfs_path_t * vpath, const char *encoding)
|
||||
vfs_path_change_encoding (vfs_path_t *vpath, const char *encoding)
|
||||
{
|
||||
vfs_path_element_t *path_element;
|
||||
|
||||
@ -1122,7 +1131,7 @@ vfs_path_change_encoding (vfs_path_t * vpath, const char *encoding)
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_serialize (const vfs_path_t * vpath, GError ** mcerror)
|
||||
vfs_path_serialize (const vfs_path_t *vpath, GError **mcerror)
|
||||
{
|
||||
mc_config_t *cpath;
|
||||
ssize_t element_index;
|
||||
@ -1177,7 +1186,7 @@ vfs_path_serialize (const vfs_path_t * vpath, GError ** mcerror)
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_deserialize (const char *data, GError ** mcerror)
|
||||
vfs_path_deserialize (const char *data, GError **mcerror)
|
||||
{
|
||||
mc_config_t *cpath;
|
||||
size_t element_index;
|
||||
@ -1286,7 +1295,7 @@ vfs_path_build_filename (const char *first_element, ...)
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_append_new (const vfs_path_t * vpath, const char *first_element, ...)
|
||||
vfs_path_append_new (const vfs_path_t *vpath, const char *first_element, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *str_path;
|
||||
@ -1320,7 +1329,7 @@ vfs_path_append_new (const vfs_path_t * vpath, const char *first_element, ...)
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_append_vpath_new (const vfs_path_t * first_vpath, ...)
|
||||
vfs_path_append_vpath_new (const vfs_path_t *first_vpath, ...)
|
||||
{
|
||||
va_list args;
|
||||
vfs_path_t *ret_vpath;
|
||||
@ -1364,7 +1373,7 @@ vfs_path_append_vpath_new (const vfs_path_t * first_vpath, ...)
|
||||
*/
|
||||
|
||||
size_t
|
||||
vfs_path_tokens_count (const vfs_path_t * vpath)
|
||||
vfs_path_tokens_count (const vfs_path_t *vpath)
|
||||
{
|
||||
size_t count_tokens = 0;
|
||||
int element_index;
|
||||
@ -1408,7 +1417,7 @@ vfs_path_tokens_count (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
char *
|
||||
vfs_path_tokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t length)
|
||||
vfs_path_tokens_get (const vfs_path_t *vpath, ssize_t start_position, ssize_t length)
|
||||
{
|
||||
GString *ret_tokens, *element_tokens;
|
||||
int element_index;
|
||||
@ -1490,7 +1499,7 @@ vfs_path_tokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t l
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_vtokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t length)
|
||||
vfs_path_vtokens_get (const vfs_path_t *vpath, ssize_t start_position, ssize_t length)
|
||||
{
|
||||
char *str_tokens;
|
||||
vfs_path_t *ret_vpath = NULL;
|
||||
@ -1516,7 +1525,7 @@ vfs_path_vtokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t
|
||||
*/
|
||||
|
||||
GString *
|
||||
vfs_path_build_url_params_str (const vfs_path_element_t * element, gboolean keep_password)
|
||||
vfs_path_build_url_params_str (const vfs_path_element_t *element, gboolean keep_password)
|
||||
{
|
||||
GString *buffer;
|
||||
|
||||
@ -1543,12 +1552,9 @@ vfs_path_build_url_params_str (const vfs_path_element_t * element, gboolean keep
|
||||
g_string_append (buffer, element->host);
|
||||
if (element->ipv6)
|
||||
g_string_append_c (buffer, ']');
|
||||
}
|
||||
|
||||
if ((element->port) != 0 && (element->host != NULL))
|
||||
{
|
||||
g_string_append_c (buffer, ':');
|
||||
g_string_append_printf (buffer, "%d", element->port);
|
||||
if (element->port != 0)
|
||||
g_string_append_printf (buffer, ":%d", element->port);
|
||||
}
|
||||
|
||||
if (buffer->len != 0)
|
||||
@ -1568,7 +1574,7 @@ vfs_path_build_url_params_str (const vfs_path_element_t * element, gboolean keep
|
||||
*/
|
||||
|
||||
GString *
|
||||
vfs_path_element_build_pretty_path_str (const vfs_path_element_t * element)
|
||||
vfs_path_element_build_pretty_path_str (const vfs_path_element_t *element)
|
||||
{
|
||||
GString *url_params, *pretty_path;
|
||||
|
||||
@ -1599,7 +1605,7 @@ vfs_path_element_build_pretty_path_str (const vfs_path_element_t * element)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
vfs_path_equal (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
vfs_path_equal (const vfs_path_t *vpath1, const vfs_path_t *vpath2)
|
||||
{
|
||||
const char *path1, *path2;
|
||||
gboolean ret_val;
|
||||
@ -1627,7 +1633,7 @@ vfs_path_equal (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
vfs_path_equal_len (const vfs_path_t * vpath1, const vfs_path_t * vpath2, size_t len)
|
||||
vfs_path_equal_len (const vfs_path_t *vpath1, const vfs_path_t *vpath2, size_t len)
|
||||
{
|
||||
const char *path1, *path2;
|
||||
gboolean ret_val;
|
||||
@ -1653,7 +1659,7 @@ vfs_path_equal_len (const vfs_path_t * vpath1, const vfs_path_t * vpath2, size_t
|
||||
*/
|
||||
|
||||
size_t
|
||||
vfs_path_len (const vfs_path_t * vpath)
|
||||
vfs_path_len (const vfs_path_t *vpath)
|
||||
{
|
||||
if (vpath == NULL)
|
||||
return 0;
|
||||
@ -1671,7 +1677,7 @@ vfs_path_len (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
vfs_path_t *
|
||||
vfs_path_to_absolute (const vfs_path_t * vpath)
|
||||
vfs_path_to_absolute (const vfs_path_t *vpath)
|
||||
{
|
||||
vfs_path_t *absolute_vpath;
|
||||
const char *path_str;
|
||||
|
@ -100,7 +100,7 @@ vfs_path_t *vfs_path_to_absolute (const vfs_path_t * vpath);
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
vfs_path_element_valid (const vfs_path_element_t * element)
|
||||
vfs_path_element_valid (const vfs_path_element_t *element)
|
||||
{
|
||||
return (element != NULL && element->class != NULL);
|
||||
}
|
||||
@ -108,7 +108,7 @@ vfs_path_element_valid (const vfs_path_element_t * element)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline const char *
|
||||
vfs_path_get_last_path_str (const vfs_path_t * vpath)
|
||||
vfs_path_get_last_path_str (const vfs_path_t *vpath)
|
||||
{
|
||||
const vfs_path_element_t *element;
|
||||
if (vpath == NULL)
|
||||
@ -120,7 +120,7 @@ vfs_path_get_last_path_str (const vfs_path_t * vpath)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline const struct vfs_class *
|
||||
vfs_path_get_last_path_vfs (const vfs_path_t * vpath)
|
||||
vfs_path_get_last_path_vfs (const vfs_path_t *vpath)
|
||||
{
|
||||
const vfs_path_element_t *element;
|
||||
if (vpath == NULL)
|
||||
@ -139,7 +139,7 @@ vfs_path_get_last_path_vfs (const vfs_path_t * vpath)
|
||||
*/
|
||||
|
||||
static inline const char *
|
||||
vfs_path_as_str (const vfs_path_t * vpath)
|
||||
vfs_path_as_str (const vfs_path_t *vpath)
|
||||
{
|
||||
return (vpath == NULL ? NULL : vpath->str);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ vfs_findgid (const char *gname)
|
||||
*/
|
||||
|
||||
int
|
||||
vfs_mkstemps (vfs_path_t ** pname_vpath, const char *prefix, const char *param_basename)
|
||||
vfs_mkstemps (vfs_path_t **pname_vpath, const char *prefix, const char *param_basename)
|
||||
{
|
||||
const char *p;
|
||||
GString *suffix;
|
||||
@ -356,7 +356,7 @@ vfs_url_split (const char *path, int default_port, vfs_url_flags_t flags)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void __attribute__ ((noreturn)) vfs_die (const char *m)
|
||||
void __attribute__((noreturn)) vfs_die (const char *m)
|
||||
{
|
||||
message (D_ERROR, _("Internal error:"), "%s", m);
|
||||
exit (EXIT_FAILURE);
|
||||
|
@ -48,14 +48,14 @@ char *vfs_get_password (const char *msg);
|
||||
|
||||
char *vfs_get_local_username (void);
|
||||
|
||||
gboolean vfs_parse_filetype (const char *s, size_t * ret_skipped, mode_t * ret_type);
|
||||
gboolean vfs_parse_fileperms (const char *s, size_t * ret_skipped, mode_t * ret_perms);
|
||||
gboolean vfs_parse_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
|
||||
gboolean vfs_parse_raw_filemode (const char *s, size_t * ret_skipped, mode_t * ret_mode);
|
||||
gboolean vfs_parse_filetype (const char *s, size_t *ret_skipped, mode_t * ret_type);
|
||||
gboolean vfs_parse_fileperms (const char *s, size_t *ret_skipped, mode_t * ret_perms);
|
||||
gboolean vfs_parse_filemode (const char *s, size_t *ret_skipped, mode_t * ret_mode);
|
||||
gboolean vfs_parse_raw_filemode (const char *s, size_t *ret_skipped, mode_t * ret_mode);
|
||||
|
||||
void vfs_parse_ls_lga_init (void);
|
||||
gboolean vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linkname,
|
||||
size_t * filename_pos);
|
||||
size_t *filename_pos);
|
||||
size_t vfs_parse_ls_lga_get_final_spaces (void);
|
||||
gboolean vfs_parse_month (const char *str, struct tm *tim);
|
||||
int vfs_parse_filedate (int idx, time_t * t);
|
||||
|
@ -118,7 +118,7 @@ static long vfs_free_handle_list = -1;
|
||||
*/
|
||||
|
||||
static estr_t
|
||||
_vfs_translate_path (const char *path, int size, GIConv defcnv, GString * buffer)
|
||||
_vfs_translate_path (const char *path, int size, GIConv defcnv, GString *buffer)
|
||||
{
|
||||
estr_t state = ESTR_SUCCESS;
|
||||
#ifdef HAVE_CHARSET
|
||||
@ -212,7 +212,7 @@ vfs_get_openfile (int handle)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
vfs_test_current_dir (const vfs_path_t * vpath)
|
||||
vfs_test_current_dir (const vfs_path_t *vpath)
|
||||
{
|
||||
struct stat my_stat, my_stat2;
|
||||
|
||||
@ -308,7 +308,7 @@ vfs_ferrno (struct vfs_class *vfs)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_register_class (struct vfs_class * vfs)
|
||||
vfs_register_class (struct vfs_class *vfs)
|
||||
{
|
||||
if (vfs->init != NULL) /* vfs has own initialization function */
|
||||
if (!vfs->init (vfs)) /* but it failed */
|
||||
@ -430,7 +430,7 @@ vfs_get_raw_current_dir (void)
|
||||
* @param vpath new path
|
||||
*/
|
||||
void
|
||||
vfs_set_raw_current_dir (const vfs_path_t * vpath)
|
||||
vfs_set_raw_current_dir (const vfs_path_t *vpath)
|
||||
{
|
||||
vfs_path_free (current_path, TRUE);
|
||||
current_path = (vfs_path_t *) vpath;
|
||||
@ -449,7 +449,7 @@ vfs_current_is_local (void)
|
||||
/* Return flags of the VFS class of the given filename */
|
||||
|
||||
vfs_flags_t
|
||||
vfs_file_class_flags (const vfs_path_t * vpath)
|
||||
vfs_file_class_flags (const vfs_path_t *vpath)
|
||||
{
|
||||
const vfs_path_element_t *path_element;
|
||||
|
||||
@ -565,6 +565,7 @@ vfs_dirent_assign (struct vfs_dirent *d, const char *fname, ino_t ino)
|
||||
{
|
||||
g_string_assign (d->d_name_str, fname);
|
||||
d->d_name = d->d_name_str->str;
|
||||
d->d_len = d->d_name_str->len;
|
||||
d->d_ino = ino;
|
||||
}
|
||||
|
||||
@ -606,7 +607,7 @@ vfs_fill_names (fill_names_f func)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
vfs_file_is_local (const vfs_path_t * vpath)
|
||||
vfs_file_is_local (const vfs_path_t *vpath)
|
||||
{
|
||||
return (vfs_file_class_flags (vpath) & VFSF_LOCAL) != 0;
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ struct vfs_dirent
|
||||
/* public */
|
||||
ino_t d_ino;
|
||||
char *d_name; /* Alias of d_name_str->str */
|
||||
size_t d_len; /* Alias of d_name_str->len */
|
||||
};
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
@ -51,7 +51,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static const int *
|
||||
background_get_colors (const Widget * w)
|
||||
background_get_colors (const Widget *w)
|
||||
{
|
||||
return &(CONST_BACKGROUND (w)->color);
|
||||
}
|
||||
@ -59,7 +59,7 @@ background_get_colors (const Widget * w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
background_adjust (WBackground * b)
|
||||
background_adjust (WBackground *b)
|
||||
{
|
||||
Widget *w = WIDGET (b);
|
||||
|
||||
@ -70,7 +70,7 @@ background_adjust (WBackground * b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
background_draw (const WBackground * b)
|
||||
background_draw (const WBackground *b)
|
||||
{
|
||||
const Widget *w = CONST_WIDGET (b);
|
||||
|
||||
@ -83,7 +83,7 @@ background_draw (const WBackground * b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
background_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
background_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WBackground *b = BACKGROUND (w);
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
button_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
button_default_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WButton *b = BUTTON (w);
|
||||
WGroup *g = w->owner;
|
||||
@ -181,7 +181,7 @@ button_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
button_mouse_default_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
button_mouse_default_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
(void) event;
|
||||
|
||||
@ -228,7 +228,7 @@ button_new (int y, int x, int action, button_flags_t flags, const char *text, bc
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
button_get_text (const WButton * b)
|
||||
button_get_text (const WButton *b)
|
||||
{
|
||||
return hotkey_get_text (b->text);
|
||||
}
|
||||
@ -236,7 +236,7 @@ button_get_text (const WButton * b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
button_set_text (WButton * b, const char *text)
|
||||
button_set_text (WButton *b, const char *text)
|
||||
{
|
||||
Widget *w = WIDGET (b);
|
||||
hotkey_t hk;
|
||||
@ -258,7 +258,7 @@ button_set_text (WButton * b, const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
button_get_len (const WButton * b)
|
||||
button_get_len (const WButton *b)
|
||||
{
|
||||
int ret = hotkey_width (b->text);
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
/* calculate positions of buttons; width is never less than 7 */
|
||||
static void
|
||||
buttonbar_init_button_positions (WButtonBar * bb)
|
||||
buttonbar_init_button_positions (WButtonBar *bb)
|
||||
{
|
||||
int i;
|
||||
int pos = 0;
|
||||
@ -111,7 +111,7 @@ buttonbar_init_button_positions (WButtonBar * bb)
|
||||
|
||||
/* return width of one button */
|
||||
static int
|
||||
buttonbar_get_button_width (const WButtonBar * bb, int i)
|
||||
buttonbar_get_button_width (const WButtonBar *bb, int i)
|
||||
{
|
||||
if (i == 0)
|
||||
return bb->labels[0].end_coord;
|
||||
@ -121,7 +121,7 @@ buttonbar_get_button_width (const WButtonBar * bb, int i)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
buttonbar_get_button_by_x_coord (const WButtonBar * bb, int x)
|
||||
buttonbar_get_button_by_x_coord (const WButtonBar *bb, int x)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -135,7 +135,7 @@ buttonbar_get_button_by_x_coord (const WButtonBar * bb, int x)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
set_label_text (WButtonBar * bb, int idx, const char *text)
|
||||
set_label_text (WButtonBar *bb, int idx, const char *text)
|
||||
{
|
||||
g_free (bb->labels[idx - 1].text);
|
||||
bb->labels[idx - 1].text = g_strdup (text);
|
||||
@ -145,7 +145,7 @@ set_label_text (WButtonBar * bb, int idx, const char *text)
|
||||
|
||||
/* returns TRUE if a function has been called, FALSE otherwise. */
|
||||
static gboolean
|
||||
buttonbar_call (WButtonBar * bb, int i)
|
||||
buttonbar_call (WButtonBar *bb, int i)
|
||||
{
|
||||
cb_ret_t ret = MSG_NOT_HANDLED;
|
||||
Widget *w = WIDGET (bb);
|
||||
@ -162,7 +162,7 @@ buttonbar_call (WButtonBar * bb, int i)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
buttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
buttonbar_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WButtonBar *bb = BUTTONBAR (w);
|
||||
int i;
|
||||
@ -216,7 +216,7 @@ buttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
buttonbar_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
buttonbar_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
@ -260,8 +260,8 @@ buttonbar_new (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
buttonbar_set_label (WButtonBar * bb, int idx, const char *text, const global_keymap_t * keymap,
|
||||
Widget * receiver)
|
||||
buttonbar_set_label (WButtonBar *bb, int idx, const char *text, const global_keymap_t *keymap,
|
||||
Widget *receiver)
|
||||
{
|
||||
if ((bb != NULL) && (idx >= 1) && (idx <= BUTTONBAR_LABELS_NUM))
|
||||
{
|
||||
@ -284,7 +284,7 @@ buttonbar_set_label (WButtonBar * bb, int idx, const char *text, const global_ke
|
||||
|
||||
/* Find ButtonBar widget in the dialog */
|
||||
WButtonBar *
|
||||
buttonbar_find (const WDialog * h)
|
||||
buttonbar_find (const WDialog *h)
|
||||
{
|
||||
return BUTTONBAR (widget_find_by_type (CONST_WIDGET (h), buttonbar_callback));
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
check_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WCheck *c = CHECK (w);
|
||||
|
||||
@ -110,7 +110,7 @@ check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
check_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
check_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
(void) event;
|
||||
|
||||
@ -156,7 +156,7 @@ check_new (int y, int x, gboolean state, const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
check_set_text (WCheck * check, const char *text)
|
||||
check_set_text (WCheck *check, const char *text)
|
||||
{
|
||||
Widget *w = WIDGET (check);
|
||||
hotkey_t hk;
|
||||
|
@ -89,7 +89,7 @@ dialog_switch_suspend (void *data, void *user_data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dialog_switch_goto (GList * dlg)
|
||||
dialog_switch_goto (GList *dlg)
|
||||
{
|
||||
if (mc_current != dlg)
|
||||
{
|
||||
@ -125,7 +125,7 @@ dialog_switch_goto (GList * dlg)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dialog_switch_resize (WDialog * d)
|
||||
dialog_switch_resize (WDialog *d)
|
||||
{
|
||||
if (widget_get_state (WIDGET (d), WST_ACTIVE))
|
||||
send_message (d, NULL, MSG_RESIZE, 0, NULL);
|
||||
@ -138,7 +138,7 @@ dialog_switch_resize (WDialog * d)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dialog_switch_add (WDialog * h)
|
||||
dialog_switch_add (WDialog *h)
|
||||
{
|
||||
GList *dlg;
|
||||
|
||||
@ -159,7 +159,7 @@ dialog_switch_add (WDialog * h)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dialog_switch_remove (WDialog * h)
|
||||
dialog_switch_remove (WDialog *h)
|
||||
{
|
||||
GList *this;
|
||||
|
||||
@ -252,9 +252,8 @@ dialog_switch_list (void)
|
||||
else
|
||||
title = g_strdup ("");
|
||||
|
||||
listbox_add_item (listbox->list, LISTBOX_APPEND_BEFORE, get_hotkey (i++), title, h, FALSE);
|
||||
|
||||
g_free (title);
|
||||
listbox_add_item_take (listbox->list, LISTBOX_APPEND_BEFORE, get_hotkey (i++), title, h,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
selected = listbox_run_with_data (listbox, mc_current);
|
||||
|
@ -76,7 +76,7 @@ const global_keymap_t *dialog_map = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static const int *
|
||||
dlg_default_get_colors (const Widget * w)
|
||||
dlg_default_get_colors (const Widget *w)
|
||||
{
|
||||
return CONST_DIALOG (w)->colors;
|
||||
}
|
||||
@ -86,7 +86,7 @@ dlg_default_get_colors (const Widget * w)
|
||||
* Read histories from the ${XDG_DATA_HOME}/mc/history file
|
||||
*/
|
||||
static void
|
||||
dlg_read_history (WDialog * h)
|
||||
dlg_read_history (WDialog *h)
|
||||
{
|
||||
char *profile;
|
||||
ev_history_load_save_t event_data;
|
||||
@ -123,7 +123,7 @@ refresh_cmd (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dlg_help (const WDialog * h)
|
||||
dlg_help (const WDialog *h)
|
||||
{
|
||||
ev_help_t event_data = { NULL, h->help_ctx };
|
||||
|
||||
@ -133,7 +133,7 @@ dlg_help (const WDialog * h)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dlg_execute_cmd (WDialog * h, long command)
|
||||
dlg_execute_cmd (WDialog *h, long command)
|
||||
{
|
||||
WGroup *g = GROUP (h);
|
||||
cb_ret_t ret = MSG_HANDLED;
|
||||
@ -202,7 +202,7 @@ dlg_execute_cmd (WDialog * h, long command)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dlg_handle_key (WDialog * h, int d_key)
|
||||
dlg_handle_key (WDialog *h, int d_key)
|
||||
{
|
||||
long command;
|
||||
|
||||
@ -218,7 +218,7 @@ dlg_handle_key (WDialog * h, int d_key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dlg_key_event (WDialog * h, int d_key)
|
||||
dlg_key_event (WDialog *h, int d_key)
|
||||
{
|
||||
Widget *w = WIDGET (h);
|
||||
WGroup *g = GROUP (h);
|
||||
@ -261,7 +261,7 @@ dlg_key_event (WDialog * h, int d_key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
dlg_handle_mouse_event (Widget * w, Gpm_Event * event)
|
||||
dlg_handle_mouse_event (Widget *w, Gpm_Event *event)
|
||||
{
|
||||
if (w->mouse_callback != NULL)
|
||||
{
|
||||
@ -278,7 +278,7 @@ dlg_handle_mouse_event (Widget * w, Gpm_Event * event)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
frontend_dlg_run (WDialog * h)
|
||||
frontend_dlg_run (WDialog *h)
|
||||
{
|
||||
Widget *wh = WIDGET (h);
|
||||
Gpm_Event event;
|
||||
@ -328,7 +328,7 @@ frontend_dlg_run (WDialog * h)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dlg_default_destroy (Widget * w)
|
||||
dlg_default_destroy (Widget *w)
|
||||
{
|
||||
WDialog *h = DIALOG (w);
|
||||
|
||||
@ -349,7 +349,7 @@ dlg_default_destroy (Widget * w)
|
||||
/** Default dialog callback */
|
||||
|
||||
cb_ret_t
|
||||
dlg_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
dlg_default_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
@ -374,7 +374,7 @@ dlg_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dlg_default_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
dlg_default_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
@ -474,7 +474,7 @@ dlg_set_default_colors (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dlg_close (WDialog * h)
|
||||
dlg_close (WDialog *h)
|
||||
{
|
||||
widget_set_state (WIDGET (h), WST_CLOSED, TRUE);
|
||||
}
|
||||
@ -483,7 +483,7 @@ dlg_close (WDialog * h)
|
||||
/** Init the process */
|
||||
|
||||
void
|
||||
dlg_init (WDialog * h)
|
||||
dlg_init (WDialog *h)
|
||||
{
|
||||
WGroup *g = GROUP (h);
|
||||
Widget *wh = WIDGET (h);
|
||||
@ -518,7 +518,7 @@ dlg_init (WDialog * h)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dlg_process_event (WDialog * h, int key, Gpm_Event * event)
|
||||
dlg_process_event (WDialog *h, int key, Gpm_Event *event)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
@ -545,7 +545,7 @@ dlg_process_event (WDialog * h, int key, Gpm_Event * event)
|
||||
/** Shutdown the dlg_run */
|
||||
|
||||
void
|
||||
dlg_run_done (WDialog * h)
|
||||
dlg_run_done (WDialog *h)
|
||||
{
|
||||
top_dlg = g_list_remove (top_dlg, h);
|
||||
|
||||
@ -567,7 +567,7 @@ dlg_run_done (WDialog * h)
|
||||
*/
|
||||
|
||||
int
|
||||
dlg_run (WDialog * h)
|
||||
dlg_run (WDialog *h)
|
||||
{
|
||||
dlg_init (h);
|
||||
frontend_dlg_run (h);
|
||||
@ -581,7 +581,7 @@ dlg_run (WDialog * h)
|
||||
* Write history to the ${XDG_DATA_HOME}/mc/history file
|
||||
*/
|
||||
void
|
||||
dlg_save_history (WDialog * h)
|
||||
dlg_save_history (WDialog *h)
|
||||
{
|
||||
char *profile;
|
||||
int i;
|
||||
@ -615,7 +615,7 @@ dlg_save_history (WDialog * h)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
dlg_get_title (const WDialog * h, size_t len)
|
||||
dlg_get_title (const WDialog *h, size_t len)
|
||||
{
|
||||
char *t;
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
frame_adjust (WFrame * f)
|
||||
frame_adjust (WFrame *f)
|
||||
{
|
||||
Widget *w = WIDGET (f);
|
||||
|
||||
@ -65,7 +65,7 @@ frame_adjust (WFrame * f)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
frame_draw (const WFrame * f)
|
||||
frame_draw (const WFrame *f)
|
||||
{
|
||||
const Widget *wf = CONST_WIDGET (f);
|
||||
const WRect *w = &wf->rect;
|
||||
@ -117,7 +117,7 @@ frame_new (int y, int x, int lines, int cols, const char *title, gboolean single
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
frame_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
frame_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WFrame *f = FRAME (w);
|
||||
|
||||
@ -143,7 +143,7 @@ frame_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
frame_set_title (WFrame * f, const char *title)
|
||||
frame_set_title (WFrame *f, const char *title)
|
||||
{
|
||||
MC_PTR_FREE (f->title);
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
gauge_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
gauge_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WGauge *g = GAUGE (w);
|
||||
const int *colors;
|
||||
@ -151,7 +151,7 @@ gauge_new (int y, int x, int cols, gboolean shown, int max, int current)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
gauge_set_value (WGauge * g, int max, int current)
|
||||
gauge_set_value (WGauge *g, int max, int current)
|
||||
{
|
||||
if (g->current == current && g->max == max)
|
||||
return; /* Do not flicker */
|
||||
@ -166,7 +166,7 @@ gauge_set_value (WGauge * g, int max, int current)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
gauge_show (WGauge * g, gboolean shown)
|
||||
gauge_show (WGauge *g, gboolean shown)
|
||||
{
|
||||
if (g->shown != shown)
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ group_widget_init (void *data, void *user_data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GList *
|
||||
group_get_next_or_prev_of (GList * list, gboolean next)
|
||||
group_get_next_or_prev_of (GList *list, gboolean next)
|
||||
{
|
||||
GList *l = NULL;
|
||||
|
||||
@ -110,7 +110,7 @@ group_get_next_or_prev_of (GList * list, gboolean next)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
group_select_next_or_prev (WGroup * g, gboolean next)
|
||||
group_select_next_or_prev (WGroup *g, gboolean next)
|
||||
{
|
||||
if (g->widgets != NULL && g->current != NULL)
|
||||
{
|
||||
@ -148,7 +148,7 @@ group_widget_set_state (gpointer data, gpointer user_data)
|
||||
*/
|
||||
|
||||
static void
|
||||
group_send_broadcast_msg_custom (WGroup * g, widget_msg_t msg, gboolean reverse,
|
||||
group_send_broadcast_msg_custom (WGroup *g, widget_msg_t msg, gboolean reverse,
|
||||
widget_options_t options)
|
||||
{
|
||||
GList *p, *first;
|
||||
@ -186,7 +186,7 @@ group_send_broadcast_msg_custom (WGroup * g, widget_msg_t msg, gboolean reverse,
|
||||
*/
|
||||
|
||||
static void
|
||||
group_default_make_global (Widget * w, const WRect * delta)
|
||||
group_default_make_global (Widget *w, const WRect *delta)
|
||||
{
|
||||
GList *iter;
|
||||
|
||||
@ -222,7 +222,7 @@ group_default_make_global (Widget * w, const WRect * delta)
|
||||
*/
|
||||
|
||||
static void
|
||||
group_default_make_local (Widget * w, const WRect * delta)
|
||||
group_default_make_local (Widget *w, const WRect *delta)
|
||||
{
|
||||
GList *iter;
|
||||
|
||||
@ -260,7 +260,7 @@ group_default_make_local (Widget * w, const WRect * delta)
|
||||
*/
|
||||
|
||||
static GList *
|
||||
group_default_find (const Widget * w, const Widget * what)
|
||||
group_default_find (const Widget *w, const Widget *what)
|
||||
{
|
||||
GList *w0;
|
||||
|
||||
@ -292,7 +292,7 @@ group_default_find (const Widget * w, const Widget * what)
|
||||
*/
|
||||
|
||||
static Widget *
|
||||
group_default_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
group_default_find_by_type (const Widget *w, widget_cb_fn cb)
|
||||
{
|
||||
Widget *w0;
|
||||
|
||||
@ -324,7 +324,7 @@ group_default_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
*/
|
||||
|
||||
static Widget *
|
||||
group_default_find_by_id (const Widget * w, unsigned long id)
|
||||
group_default_find_by_id (const Widget *w, unsigned long id)
|
||||
{
|
||||
Widget *w0;
|
||||
|
||||
@ -354,7 +354,7 @@ group_default_find_by_id (const Widget * w, unsigned long id)
|
||||
*/
|
||||
|
||||
static cb_ret_t
|
||||
group_update_cursor (WGroup * g)
|
||||
group_update_cursor (WGroup *g)
|
||||
{
|
||||
GList *p = g->current;
|
||||
|
||||
@ -422,7 +422,7 @@ group_widget_set_position (gpointer data, gpointer user_data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
group_set_position (WGroup * g, const WRect * r)
|
||||
group_set_position (WGroup *g, const WRect *r)
|
||||
{
|
||||
WRect *w = &WIDGET (g)->rect;
|
||||
widget_shift_scale_t wss;
|
||||
@ -451,7 +451,7 @@ group_set_position (WGroup * g, const WRect * r)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
group_default_resize (WGroup * g, WRect * r)
|
||||
group_default_resize (WGroup *g, WRect *r)
|
||||
{
|
||||
/* This is default resizing mechanism.
|
||||
* The main idea of this code is to resize dialog according to flags
|
||||
@ -470,7 +470,7 @@ group_default_resize (WGroup * g, WRect * r)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
group_draw (WGroup * g)
|
||||
group_draw (WGroup *g)
|
||||
{
|
||||
Widget *wg = WIDGET (g);
|
||||
|
||||
@ -495,7 +495,7 @@ group_draw (WGroup * g)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
group_handle_key (WGroup * g, int key)
|
||||
group_handle_key (WGroup *g, int key)
|
||||
{
|
||||
cb_ret_t handled;
|
||||
|
||||
@ -516,7 +516,7 @@ group_handle_key (WGroup * g, int key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
group_handle_hotkey (WGroup * g, int key)
|
||||
group_handle_hotkey (WGroup *g, int key)
|
||||
{
|
||||
GList *current;
|
||||
Widget *w;
|
||||
@ -596,7 +596,7 @@ group_handle_hotkey (WGroup * g, int key)
|
||||
*/
|
||||
|
||||
void
|
||||
group_init (WGroup * g, const WRect * r, widget_cb_fn callback, widget_mouse_cb_fn mouse_callback)
|
||||
group_init (WGroup *g, const WRect *r, widget_cb_fn callback, widget_mouse_cb_fn mouse_callback)
|
||||
{
|
||||
Widget *w = WIDGET (g);
|
||||
|
||||
@ -619,7 +619,7 @@ group_init (WGroup * g, const WRect * r, widget_cb_fn callback, widget_mouse_cb_
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
group_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
group_default_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WGroup *g = GROUP (w);
|
||||
|
||||
@ -669,7 +669,7 @@ group_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
* @return MSG_HANDLED if set was handled successfully, MSG_NOT_HANDLED otherwise.
|
||||
*/
|
||||
cb_ret_t
|
||||
group_default_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
group_default_set_state (Widget *w, widget_state_t state, gboolean enable)
|
||||
{
|
||||
gboolean ret = MSG_HANDLED;
|
||||
WGroup *g = GROUP (w);
|
||||
@ -711,7 +711,7 @@ group_default_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
* @return result of mouse event handling
|
||||
*/
|
||||
int
|
||||
group_handle_mouse_event (Widget * w, Gpm_Event * event)
|
||||
group_handle_mouse_event (Widget *w, Gpm_Event *event)
|
||||
{
|
||||
WGroup *g = GROUP (w);
|
||||
|
||||
@ -761,7 +761,7 @@ group_handle_mouse_event (Widget * w, Gpm_Event * event)
|
||||
*/
|
||||
|
||||
unsigned long
|
||||
group_add_widget_autopos (WGroup * g, void *w, widget_pos_flags_t pos_flags, const void *before)
|
||||
group_add_widget_autopos (WGroup *g, void *w, widget_pos_flags_t pos_flags, const void *before)
|
||||
{
|
||||
Widget *wg = WIDGET (g);
|
||||
Widget *ww = WIDGET (w);
|
||||
@ -861,7 +861,7 @@ group_remove_widget (void *w)
|
||||
*/
|
||||
|
||||
void
|
||||
group_set_current_widget_next (WGroup * g)
|
||||
group_set_current_widget_next (WGroup *g)
|
||||
{
|
||||
g->current = group_get_next_or_prev_of (g->current, TRUE);
|
||||
}
|
||||
@ -874,7 +874,7 @@ group_set_current_widget_next (WGroup * g)
|
||||
*/
|
||||
|
||||
void
|
||||
group_set_current_widget_prev (WGroup * g)
|
||||
group_set_current_widget_prev (WGroup *g)
|
||||
{
|
||||
g->current = group_get_next_or_prev_of (g->current, FALSE);
|
||||
}
|
||||
@ -889,7 +889,7 @@ group_set_current_widget_prev (WGroup * g)
|
||||
*/
|
||||
|
||||
GList *
|
||||
group_get_widget_next_of (GList * w)
|
||||
group_get_widget_next_of (GList *w)
|
||||
{
|
||||
return group_get_next_or_prev_of (w, TRUE);
|
||||
}
|
||||
@ -904,7 +904,7 @@ group_get_widget_next_of (GList * w)
|
||||
*/
|
||||
|
||||
GList *
|
||||
group_get_widget_prev_of (GList * w)
|
||||
group_get_widget_prev_of (GList *w)
|
||||
{
|
||||
return group_get_next_or_prev_of (w, FALSE);
|
||||
}
|
||||
@ -917,7 +917,7 @@ group_get_widget_prev_of (GList * w)
|
||||
*/
|
||||
|
||||
void
|
||||
group_select_next_widget (WGroup * g)
|
||||
group_select_next_widget (WGroup *g)
|
||||
{
|
||||
group_select_next_or_prev (g, TRUE);
|
||||
}
|
||||
@ -930,7 +930,7 @@ group_select_next_widget (WGroup * g)
|
||||
*/
|
||||
|
||||
void
|
||||
group_select_prev_widget (WGroup * g)
|
||||
group_select_prev_widget (WGroup *g)
|
||||
{
|
||||
group_select_next_or_prev (g, FALSE);
|
||||
}
|
||||
@ -944,7 +944,7 @@ group_select_prev_widget (WGroup * g)
|
||||
*/
|
||||
|
||||
void
|
||||
group_select_widget_by_id (const WGroup * g, unsigned long id)
|
||||
group_select_widget_by_id (const WGroup *g, unsigned long id)
|
||||
{
|
||||
Widget *w;
|
||||
|
||||
@ -962,7 +962,7 @@ group_select_widget_by_id (const WGroup * g, unsigned long id)
|
||||
*/
|
||||
|
||||
void
|
||||
group_send_broadcast_msg (WGroup * g, widget_msg_t msg)
|
||||
group_send_broadcast_msg (WGroup *g, widget_msg_t msg)
|
||||
{
|
||||
group_send_broadcast_msg_custom (g, msg, FALSE, WOP_DEFAULT);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ void group_send_broadcast_msg (WGroup * g, widget_msg_t message);
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
group_add_widget (WGroup * g, void *w)
|
||||
group_add_widget (WGroup *g, void *w)
|
||||
{
|
||||
return group_add_widget_autopos (g, w, WPOS_KEEP_DEFAULT,
|
||||
g->current != NULL ? g->current->data : NULL);
|
||||
@ -95,7 +95,7 @@ group_add_widget (WGroup * g, void *w)
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
group_add_widget_before (WGroup * g, void *w, void *before)
|
||||
group_add_widget_before (WGroup *g, void *w, void *before)
|
||||
{
|
||||
return group_add_widget_autopos (g, w, WPOS_KEEP_DEFAULT, before);
|
||||
}
|
||||
@ -108,7 +108,7 @@ group_add_widget_before (WGroup * g, void *w, void *before)
|
||||
*/
|
||||
|
||||
static inline void
|
||||
group_select_current_widget (WGroup * g)
|
||||
group_select_current_widget (WGroup *g)
|
||||
{
|
||||
if (g->current != NULL)
|
||||
widget_select (WIDGET (g->current->data));
|
||||
@ -117,7 +117,7 @@ group_select_current_widget (WGroup * g)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline unsigned long
|
||||
group_get_current_widget_id (const WGroup * g)
|
||||
group_get_current_widget_id (const WGroup *g)
|
||||
{
|
||||
return WIDGET (g->current->data)->id;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
groupbox_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WGroupbox *g = GROUPBOX (w);
|
||||
|
||||
@ -116,7 +116,7 @@ groupbox_new (int y, int x, int height, int width, const char *title)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
groupbox_set_title (WGroupbox * g, const char *title)
|
||||
groupbox_set_title (WGroupbox *g, const char *title)
|
||||
{
|
||||
MC_PTR_FREE (g->title);
|
||||
|
||||
|
@ -70,7 +70,7 @@ typedef struct
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
history_dlg_reposition (WDialog * dlg_head)
|
||||
history_dlg_reposition (WDialog *dlg_head)
|
||||
{
|
||||
history_dlg_data *data;
|
||||
int x = 0, y, he, wi;
|
||||
@ -115,7 +115,7 @@ history_dlg_reposition (WDialog * dlg_head)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
history_dlg_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
history_dlg_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
@ -154,7 +154,7 @@ history_dlg_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
history_create_item (history_descriptor_t * hd, void *data)
|
||||
history_create_item (history_descriptor_t *hd, void *data)
|
||||
{
|
||||
char *text = (char *) data;
|
||||
size_t width;
|
||||
@ -168,7 +168,7 @@ history_create_item (history_descriptor_t * hd, void *data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void *
|
||||
history_release_item (history_descriptor_t * hd, WLEntry * le)
|
||||
history_release_item (history_descriptor_t *hd, WLEntry *le)
|
||||
{
|
||||
void *text;
|
||||
|
||||
@ -185,7 +185,7 @@ history_release_item (history_descriptor_t * hd, WLEntry * le)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
history_descriptor_init (history_descriptor_t * hd, int y, int x, GList * history, int current)
|
||||
history_descriptor_init (history_descriptor_t *hd, int y, int x, GList *history, int current)
|
||||
{
|
||||
hd->list = history;
|
||||
hd->y = y;
|
||||
@ -204,7 +204,7 @@ history_descriptor_init (history_descriptor_t * hd, int y, int x, GList * histor
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
history_show (history_descriptor_t * hd)
|
||||
history_show (history_descriptor_t *hd)
|
||||
{
|
||||
GList *z, *hi;
|
||||
size_t count;
|
||||
|
@ -59,7 +59,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
hline_adjust_cols (WHLine * l)
|
||||
hline_adjust_cols (WHLine *l)
|
||||
{
|
||||
if (l->auto_adjust_cols)
|
||||
{
|
||||
@ -84,7 +84,7 @@ hline_adjust_cols (WHLine * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
hline_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
hline_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WHLine *l = HLINE (w);
|
||||
|
||||
@ -164,7 +164,7 @@ hline_new (int y, int x, int width)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
hline_set_text (WHLine * l, const char *text)
|
||||
hline_set_text (WHLine *l, const char *text)
|
||||
{
|
||||
g_free (l->text);
|
||||
|
||||
@ -179,7 +179,7 @@ hline_set_text (WHLine * l, const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
hline_set_textv (WHLine * l, const char *format, ...)
|
||||
hline_set_textv (WHLine *l, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUF_1K]; /* FIXME: is it enough? */
|
||||
|
@ -88,7 +88,7 @@ static char *kill_buffer = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static size_t
|
||||
get_history_length (GList * history)
|
||||
get_history_length (GList *history)
|
||||
{
|
||||
size_t len = 0;
|
||||
|
||||
@ -101,7 +101,7 @@ get_history_length (GList * history)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
draw_history_button (WInput * in)
|
||||
draw_history_button (WInput *in)
|
||||
{
|
||||
char c;
|
||||
gboolean disabled;
|
||||
@ -128,7 +128,7 @@ draw_history_button (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
input_mark_cmd (WInput * in, gboolean mark)
|
||||
input_mark_cmd (WInput *in, gboolean mark)
|
||||
{
|
||||
in->mark = mark ? in->point : -1;
|
||||
}
|
||||
@ -136,7 +136,7 @@ input_mark_cmd (WInput * in, gboolean mark)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
input_eval_marks (WInput * in, long *start_mark, long *end_mark)
|
||||
input_eval_marks (WInput *in, long *start_mark, long *end_mark)
|
||||
{
|
||||
if (in->mark >= 0)
|
||||
{
|
||||
@ -152,7 +152,7 @@ input_eval_marks (WInput * in, long *start_mark, long *end_mark)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
do_show_hist (WInput * in)
|
||||
do_show_hist (WInput *in)
|
||||
{
|
||||
size_t len;
|
||||
history_descriptor_t hd;
|
||||
@ -218,7 +218,7 @@ input_history_strip_password (char *url)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
input_push_history (WInput * in)
|
||||
input_push_history (WInput *in)
|
||||
{
|
||||
char *t;
|
||||
gboolean empty;
|
||||
@ -261,7 +261,7 @@ input_push_history (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
move_buffer_backward (WInput * in, int start, int end)
|
||||
move_buffer_backward (WInput *in, int start, int end)
|
||||
{
|
||||
int str_len;
|
||||
|
||||
@ -277,7 +277,7 @@ move_buffer_backward (WInput * in, int start, int end)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
beginning_of_line (WInput * in)
|
||||
beginning_of_line (WInput *in)
|
||||
{
|
||||
in->point = 0;
|
||||
in->charpoint = 0;
|
||||
@ -286,7 +286,7 @@ beginning_of_line (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
end_of_line (WInput * in)
|
||||
end_of_line (WInput *in)
|
||||
{
|
||||
in->point = str_length (in->buffer->str);
|
||||
in->charpoint = 0;
|
||||
@ -295,7 +295,7 @@ end_of_line (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
backward_char (WInput * in)
|
||||
backward_char (WInput *in)
|
||||
{
|
||||
if (in->point > 0)
|
||||
{
|
||||
@ -311,7 +311,7 @@ backward_char (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
forward_char (WInput * in)
|
||||
forward_char (WInput *in)
|
||||
{
|
||||
const char *act;
|
||||
|
||||
@ -324,7 +324,7 @@ forward_char (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
forward_word (WInput * in)
|
||||
forward_word (WInput *in)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
@ -340,7 +340,7 @@ forward_word (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
backward_word (WInput * in)
|
||||
backward_word (WInput *in)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
@ -370,7 +370,7 @@ backward_word (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
backward_delete (WInput * in)
|
||||
backward_delete (WInput *in)
|
||||
{
|
||||
const char *act;
|
||||
int start;
|
||||
@ -389,7 +389,7 @@ backward_delete (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
copy_region (WInput * in, int start, int end)
|
||||
copy_region (WInput *in, int start, int end)
|
||||
{
|
||||
int first = MIN (start, end);
|
||||
int last = MAX (start, end);
|
||||
@ -418,7 +418,7 @@ copy_region (WInput * in, int start, int end)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
delete_region (WInput * in, int start, int end)
|
||||
delete_region (WInput *in, int start, int end)
|
||||
{
|
||||
int first = MIN (start, end);
|
||||
int last = MAX (start, end);
|
||||
@ -433,7 +433,7 @@ delete_region (WInput * in, int start, int end)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
insert_char (WInput * in, int c_code)
|
||||
insert_char (WInput *in, int c_code)
|
||||
{
|
||||
int res;
|
||||
long m1, m2;
|
||||
@ -471,7 +471,7 @@ insert_char (WInput * in, int c_code)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
delete_char (WInput * in)
|
||||
delete_char (WInput *in)
|
||||
{
|
||||
const char *act;
|
||||
int end;
|
||||
@ -486,7 +486,7 @@ delete_char (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
kill_word (WInput * in)
|
||||
kill_word (WInput *in)
|
||||
{
|
||||
int old_point = in->point;
|
||||
int new_point;
|
||||
@ -503,7 +503,7 @@ kill_word (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
back_kill_word (WInput * in)
|
||||
back_kill_word (WInput *in)
|
||||
{
|
||||
int old_point = in->point;
|
||||
int new_point;
|
||||
@ -519,7 +519,7 @@ back_kill_word (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
yank (WInput * in)
|
||||
yank (WInput *in)
|
||||
{
|
||||
if (kill_buffer != NULL)
|
||||
{
|
||||
@ -535,7 +535,7 @@ yank (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
kill_line (WInput * in)
|
||||
kill_line (WInput *in)
|
||||
{
|
||||
int chp;
|
||||
|
||||
@ -549,7 +549,7 @@ kill_line (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
clear_line (WInput * in)
|
||||
clear_line (WInput *in)
|
||||
{
|
||||
in->need_push = TRUE;
|
||||
g_string_set_size (in->buffer, 0);
|
||||
@ -561,7 +561,7 @@ clear_line (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
ins_from_clip (WInput * in)
|
||||
ins_from_clip (WInput *in)
|
||||
{
|
||||
char *p = NULL;
|
||||
ev_clipboard_text_from_file_t event_data = { NULL, FALSE };
|
||||
@ -585,7 +585,7 @@ ins_from_clip (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
hist_prev (WInput * in)
|
||||
hist_prev (WInput *in)
|
||||
{
|
||||
GList *prev;
|
||||
|
||||
@ -608,7 +608,7 @@ hist_prev (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
hist_next (WInput * in)
|
||||
hist_next (WInput *in)
|
||||
{
|
||||
GList *next;
|
||||
|
||||
@ -640,7 +640,7 @@ hist_next (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
port_region_marked_for_delete (WInput * in)
|
||||
port_region_marked_for_delete (WInput *in)
|
||||
{
|
||||
g_string_set_size (in->buffer, 0);
|
||||
in->point = 0;
|
||||
@ -651,7 +651,7 @@ port_region_marked_for_delete (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
input_execute_cmd (WInput * in, long command)
|
||||
input_execute_cmd (WInput *in, long command)
|
||||
{
|
||||
cb_ret_t res = MSG_HANDLED;
|
||||
|
||||
@ -804,7 +804,7 @@ input_execute_cmd (WInput * in, long command)
|
||||
|
||||
/* "history_load" event handler */
|
||||
static gboolean
|
||||
input_load_history (const gchar * event_group_name, const gchar * event_name,
|
||||
input_load_history (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
WInput *in = INPUT (init_data);
|
||||
@ -833,7 +833,7 @@ input_load_history (const gchar * event_group_name, const gchar * event_name,
|
||||
|
||||
/* "history_save" event handler */
|
||||
static gboolean
|
||||
input_save_history (const gchar * event_group_name, const gchar * event_name,
|
||||
input_save_history (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
WInput *in = INPUT (init_data);
|
||||
@ -857,7 +857,7 @@ input_save_history (const gchar * event_group_name, const gchar * event_name,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
input_destroy (WInput * in)
|
||||
input_destroy (WInput *in)
|
||||
{
|
||||
input_complete_free (in);
|
||||
|
||||
@ -879,7 +879,7 @@ input_destroy (WInput * in)
|
||||
* Calculates the buffer index (aka "point") corresponding to some screen coordinate.
|
||||
*/
|
||||
static int
|
||||
input_screen_to_point (const WInput * in, int x)
|
||||
input_screen_to_point (const WInput *in, int x)
|
||||
{
|
||||
x += in->term_first_shown;
|
||||
|
||||
@ -895,7 +895,7 @@ input_screen_to_point (const WInput * in, int x)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
input_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
input_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
/* save point between MSG_MOUSE_DOWN and MSG_MOUSE_DRAG */
|
||||
static int prev_point = 0;
|
||||
@ -1001,7 +1001,7 @@ input_new (int y, int x, const int *colors, int width, const char *def_text,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
input_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
input_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WInput *in = INPUT (w);
|
||||
WDialog *h = DIALOG (w->owner);
|
||||
@ -1087,7 +1087,7 @@ input_set_default_colors (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
input_handle_char (WInput * in, int key)
|
||||
input_handle_char (WInput *in, int key)
|
||||
{
|
||||
cb_ret_t v;
|
||||
long command;
|
||||
@ -1132,7 +1132,7 @@ input_handle_char (WInput * in, int key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_assign_text (WInput * in, const char *text)
|
||||
input_assign_text (WInput *in, const char *text)
|
||||
{
|
||||
if (text == NULL)
|
||||
text = "";
|
||||
@ -1150,7 +1150,7 @@ input_assign_text (WInput * in, const char *text)
|
||||
|
||||
/* Inserts text in input line */
|
||||
void
|
||||
input_insert (WInput * in, const char *text, gboolean insert_extra_space)
|
||||
input_insert (WInput *in, const char *text, gboolean insert_extra_space)
|
||||
{
|
||||
input_disable_update (in);
|
||||
while (*text != '\0')
|
||||
@ -1164,7 +1164,7 @@ input_insert (WInput * in, const char *text, gboolean insert_extra_space)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_set_point (WInput * in, int pos)
|
||||
input_set_point (WInput *in, int pos)
|
||||
{
|
||||
int max_pos;
|
||||
|
||||
@ -1180,7 +1180,7 @@ input_set_point (WInput * in, int pos)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_update (WInput * in, gboolean clear_first)
|
||||
input_update (WInput *in, gboolean clear_first)
|
||||
{
|
||||
Widget *wi = WIDGET (in);
|
||||
const WRect *w = &wi->rect;
|
||||
@ -1286,7 +1286,7 @@ input_update (WInput * in, gboolean clear_first)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_enable_update (WInput * in)
|
||||
input_enable_update (WInput *in)
|
||||
{
|
||||
in->disable_update--;
|
||||
input_update (in, FALSE);
|
||||
@ -1295,7 +1295,7 @@ input_enable_update (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_disable_update (WInput * in)
|
||||
input_disable_update (WInput *in)
|
||||
{
|
||||
in->disable_update++;
|
||||
}
|
||||
@ -1308,7 +1308,7 @@ input_disable_update (WInput * in)
|
||||
* @param in the input line
|
||||
*/
|
||||
void
|
||||
input_clean (WInput * in)
|
||||
input_clean (WInput *in)
|
||||
{
|
||||
input_push_history (in);
|
||||
in->need_push = TRUE;
|
||||
|
@ -58,7 +58,7 @@ typedef struct
|
||||
gboolean init_from_history; /* init text will be get from history */
|
||||
gboolean need_push; /* need to push the current Input on hist? */
|
||||
gboolean strip_password; /* need to strip password before placing string to history */
|
||||
char **completions; /* possible completions array */
|
||||
GPtrArray *completions; /* possible completions array */
|
||||
input_complete_t completion_flags;
|
||||
char charbuf[MB_LEN_MAX]; /* buffer for multibytes characters */
|
||||
size_t charpoint; /* point to end of mulibyte sequence in charbuf */
|
||||
@ -114,7 +114,7 @@ void input_complete_free (WInput * in);
|
||||
* @return newly allocated string that contains a copy of @in's text.
|
||||
*/
|
||||
static inline char *
|
||||
input_get_text (const WInput * in)
|
||||
input_get_text (const WInput *in)
|
||||
{
|
||||
return g_strndup (in->buffer->str, in->buffer->len);
|
||||
}
|
||||
@ -129,7 +129,7 @@ input_get_text (const WInput * in)
|
||||
* @return pointer to @in->buffer->str.
|
||||
*/
|
||||
static inline const char *
|
||||
input_get_ctext (const WInput * in)
|
||||
input_get_ctext (const WInput *in)
|
||||
{
|
||||
return in->buffer->str;
|
||||
}
|
||||
@ -144,7 +144,7 @@ input_get_ctext (const WInput * in)
|
||||
* @return TRUE if buffer of @in is empty, FALSE otherwise.
|
||||
*/
|
||||
static inline gboolean
|
||||
input_is_empty (const WInput * in)
|
||||
input_is_empty (const WInput *in)
|
||||
{
|
||||
return (in->buffer->len == 0);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ typedef struct
|
||||
|
||||
/*** forward declarations (file scope functions) *************************************************/
|
||||
|
||||
char **try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags);
|
||||
GPtrArray *try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags);
|
||||
void complete_engine_fill_completions (WInput * in);
|
||||
|
||||
/*** file scope variables ************************************************************************/
|
||||
@ -212,9 +212,8 @@ filename_completion_function (const char *text, int state, input_complete_t flag
|
||||
{
|
||||
/* Otherwise, if these match up to the length of filename, then
|
||||
it may be a match. */
|
||||
if ((entry->d_name[0] != filename[0]) ||
|
||||
((NLENGTH (entry)) < filename_len) ||
|
||||
strncmp (filename, entry->d_name, filename_len) != 0)
|
||||
if (entry->d_name[0] != filename[0] || entry->d_len < filename_len
|
||||
|| strncmp (filename, entry->d_name, filename_len) != 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -283,7 +282,7 @@ filename_completion_function (const char *text, int state, input_complete_t flag
|
||||
|
||||
temp = g_string_sized_new (16);
|
||||
|
||||
if (users_dirname != NULL && (users_dirname[0] != '.' || users_dirname[1] != '\0'))
|
||||
if (users_dirname != NULL && !DIR_IS_DOT (users_dirname))
|
||||
{
|
||||
g_string_append (temp, users_dirname);
|
||||
|
||||
@ -291,7 +290,7 @@ filename_completion_function (const char *text, int state, input_complete_t flag
|
||||
if (!IS_PATH_SEP (temp->str[temp->len - 1]))
|
||||
g_string_append_c (temp, PATH_SEP);
|
||||
}
|
||||
g_string_append (temp, entry->d_name);
|
||||
g_string_append_len (temp, entry->d_name, entry->d_len);
|
||||
if (isdir)
|
||||
g_string_append_c (temp, PATH_SEP);
|
||||
|
||||
@ -399,7 +398,7 @@ host_equal_func (gconstpointer a, gconstpointer b)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
fetch_hosts (const char *filename, GPtrArray * hosts)
|
||||
fetch_hosts (const char *filename, GPtrArray *hosts)
|
||||
{
|
||||
FILE *file;
|
||||
char buffer[BUF_MEDIUM];
|
||||
@ -681,7 +680,7 @@ command_completion_function (const char *text, int state, input_complete_t flags
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
match_compare (const void *a, const void *b)
|
||||
match_compare (gconstpointer a, gconstpointer b)
|
||||
{
|
||||
return strcmp (*(char *const *) a, *(char *const *) b);
|
||||
}
|
||||
@ -695,97 +694,76 @@ match_compare (const void *a, const void *b)
|
||||
as the second.
|
||||
In case no matches were found we return NULL. */
|
||||
|
||||
static char **
|
||||
static GPtrArray *
|
||||
completion_matches (const char *text, CompletionFunction entry_function, input_complete_t flags)
|
||||
{
|
||||
/* Number of slots in match_list. */
|
||||
size_t match_list_size = 30;
|
||||
/* The list of matches. */
|
||||
char **match_list;
|
||||
/* Number of matches actually found. */
|
||||
size_t matches = 0;
|
||||
|
||||
/* Temporary string binder. */
|
||||
GPtrArray *match_list;
|
||||
char *string;
|
||||
|
||||
match_list = g_new (char *, match_list_size + 1);
|
||||
match_list[1] = NULL;
|
||||
match_list = g_ptr_array_new_with_free_func (g_free);
|
||||
|
||||
while ((string = (*entry_function) (text, matches, flags)) != NULL)
|
||||
{
|
||||
if (matches + 1 == match_list_size)
|
||||
{
|
||||
match_list_size += 30;
|
||||
match_list = (char **) g_renew (char *, match_list, match_list_size + 1);
|
||||
}
|
||||
match_list[++matches] = string;
|
||||
match_list[matches + 1] = NULL;
|
||||
}
|
||||
while ((string = entry_function (text, match_list->len, flags)) != NULL)
|
||||
g_ptr_array_add (match_list, string);
|
||||
|
||||
/* If there were any matches, then look through them finding out the
|
||||
lowest common denominator. That then becomes match_list[0]. */
|
||||
if (matches == 0)
|
||||
MC_PTR_FREE (match_list); /* There were no matches. */
|
||||
else
|
||||
if (match_list->len == 0)
|
||||
{
|
||||
/* If only one match, just use that. */
|
||||
if (matches == 1)
|
||||
/* There were no matches. */
|
||||
g_ptr_array_free (match_list, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If only one match, just use that. */
|
||||
|
||||
if (match_list->len > 1)
|
||||
{
|
||||
size_t i, j;
|
||||
size_t low = 4096; /* Count of max-matched characters. */
|
||||
|
||||
g_ptr_array_sort (match_list, match_compare);
|
||||
|
||||
/* And compare each member of the list with
|
||||
the next, finding out where they stop matching.
|
||||
If we find two equal strings, we have to put one away... */
|
||||
for (i = 0, j = 1; j < match_list->len;)
|
||||
{
|
||||
match_list[0] = match_list[1];
|
||||
match_list[1] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t i = 1;
|
||||
int low = 4096; /* Count of max-matched characters. */
|
||||
size_t j;
|
||||
char *si, *sj, *mi;
|
||||
|
||||
qsort (match_list + 1, matches, sizeof (char *), match_compare);
|
||||
si = g_ptr_array_index (match_list, i);
|
||||
sj = g_ptr_array_index (match_list, j);
|
||||
mi = si;
|
||||
|
||||
/* And compare each member of the list with
|
||||
the next, finding out where they stop matching.
|
||||
If we find two equal strings, we have to put one away... */
|
||||
|
||||
j = i + 1;
|
||||
while (j < matches + 1)
|
||||
while (si[0] != '\0' && sj[0] != '\0')
|
||||
{
|
||||
char *si, *sj;
|
||||
char *ni, *nj;
|
||||
|
||||
for (si = match_list[i], sj = match_list[j]; si[0] != '\0' && sj[0] != '\0';)
|
||||
{
|
||||
ni = str_get_next_char (si);
|
||||
nj = str_get_next_char (sj);
|
||||
|
||||
ni = str_get_next_char (si);
|
||||
nj = str_get_next_char (sj);
|
||||
if (ni - si != nj - sj || strncmp (si, sj, ni - si) != 0)
|
||||
break;
|
||||
|
||||
if (ni - si != nj - sj)
|
||||
break;
|
||||
if (strncmp (si, sj, ni - si) != 0)
|
||||
break;
|
||||
si = ni;
|
||||
sj = nj;
|
||||
}
|
||||
|
||||
si = ni;
|
||||
sj = nj;
|
||||
}
|
||||
if (si[0] == '\0' && sj[0] == '\0')
|
||||
{
|
||||
/* Two equal strings */
|
||||
g_ptr_array_remove_index (match_list, j);
|
||||
}
|
||||
else
|
||||
{
|
||||
low = MIN (low, (size_t) (si - mi));
|
||||
|
||||
if (si[0] == '\0' && sj[0] == '\0')
|
||||
{ /* Two equal strings */
|
||||
g_free (match_list[j]);
|
||||
j++;
|
||||
if (j > matches)
|
||||
break;
|
||||
continue; /* Look for a run of equal strings */
|
||||
}
|
||||
else if (low > si - match_list[i])
|
||||
low = si - match_list[i];
|
||||
if (i + 1 != j) /* So there's some gap */
|
||||
match_list[i + 1] = match_list[j];
|
||||
i++;
|
||||
j++;
|
||||
}
|
||||
matches = i;
|
||||
match_list[matches + 1] = NULL;
|
||||
match_list[0] = g_strndup (match_list[1], low);
|
||||
}
|
||||
|
||||
string = g_ptr_array_index (match_list, 0);
|
||||
g_ptr_array_insert (match_list, 0, g_strndup (string, low));
|
||||
}
|
||||
|
||||
return match_list;
|
||||
@ -816,7 +794,7 @@ check_is_cd (const char *text, int lc_start, input_complete_t flags)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
try_complete_commands_prepare (try_complete_automation_state_t * state, char *text, int *lc_start)
|
||||
try_complete_commands_prepare (try_complete_automation_state_t *state, char *text, int *lc_start)
|
||||
{
|
||||
const char *command_separator_chars = ";|&{(`";
|
||||
char *ti;
|
||||
@ -856,7 +834,7 @@ try_complete_commands_prepare (try_complete_automation_state_t * state, char *te
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
try_complete_find_start_sign (try_complete_automation_state_t * state)
|
||||
try_complete_find_start_sign (try_complete_automation_state_t *state)
|
||||
{
|
||||
if ((state->flags & INPUT_COMPLETE_COMMANDS) != 0)
|
||||
state->p = strrchr (state->word, '`');
|
||||
@ -886,10 +864,10 @@ try_complete_find_start_sign (try_complete_automation_state_t * state)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char **
|
||||
try_complete_all_possible (try_complete_automation_state_t * state, char *text, int *lc_start)
|
||||
static GPtrArray *
|
||||
try_complete_all_possible (try_complete_automation_state_t *state, char *text, int *lc_start)
|
||||
{
|
||||
char **matches = NULL;
|
||||
GPtrArray *matches = NULL;
|
||||
|
||||
if (state->in_command_position != 0)
|
||||
{
|
||||
@ -958,7 +936,7 @@ try_complete_all_possible (try_complete_automation_state_t * state, char *text,
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
insert_text (WInput * in, char *text, ssize_t size)
|
||||
insert_text (WInput *in, const char *text, ssize_t size)
|
||||
{
|
||||
size_t text_len;
|
||||
int buff_len;
|
||||
@ -1008,7 +986,7 @@ insert_text (WInput * in, char *text, ssize_t size)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
complete_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
complete_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
static int bl = 0;
|
||||
|
||||
@ -1188,7 +1166,7 @@ complete_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
|
||||
/** Returns TRUE if the user would like to see us again */
|
||||
static gboolean
|
||||
complete_engine (WInput * in, int what_to_do)
|
||||
complete_engine (WInput *in, int what_to_do)
|
||||
{
|
||||
if (in->completions != NULL && str_offset_to_pos (in->buffer->str, in->point) != end)
|
||||
input_complete_free (in);
|
||||
@ -1201,32 +1179,37 @@ complete_engine (WInput * in, int what_to_do)
|
||||
else
|
||||
{
|
||||
if ((what_to_do & DO_INSERTION) != 0
|
||||
|| ((what_to_do & DO_QUERY) != 0 && in->completions[1] == NULL))
|
||||
|| ((what_to_do & DO_QUERY) != 0 && in->completions->len == 1))
|
||||
{
|
||||
char *lc_complete = in->completions[0];
|
||||
const char *lc_complete;
|
||||
|
||||
if (!insert_text (in, lc_complete, -1) || in->completions[1] != NULL)
|
||||
lc_complete = g_ptr_array_index (in->completions, 0);
|
||||
if (!insert_text (in, lc_complete, -1) || in->completions->len > 1)
|
||||
tty_beep ();
|
||||
else
|
||||
input_complete_free (in);
|
||||
}
|
||||
|
||||
if ((what_to_do & DO_QUERY) != 0 && in->completions != NULL && in->completions[1] != NULL)
|
||||
if ((what_to_do & DO_QUERY) != 0 && in->completions != NULL && in->completions->len > 1)
|
||||
{
|
||||
int maxlen = 0, count = 0, i;
|
||||
int maxlen = 0;
|
||||
int i;
|
||||
size_t k;
|
||||
int count;
|
||||
int x, y, w, h;
|
||||
int start_x, start_y;
|
||||
char **p, *q;
|
||||
char *q;
|
||||
WDialog *complete_dlg;
|
||||
WListbox *complete_list;
|
||||
|
||||
for (p = in->completions + 1; *p != NULL; count++, p++)
|
||||
for (k = 1; k < in->completions->len; k++)
|
||||
{
|
||||
i = str_term_width1 (*p);
|
||||
if (i > maxlen)
|
||||
maxlen = i;
|
||||
q = g_ptr_array_index (in->completions, k);
|
||||
i = str_term_width1 (q);
|
||||
maxlen = MAX (maxlen, i);
|
||||
}
|
||||
|
||||
count = in->completions->len - 1;
|
||||
start_x = WIDGET (in)->rect.x;
|
||||
start_y = WIDGET (in)->rect.y;
|
||||
if (start_y - 2 >= count)
|
||||
@ -1262,8 +1245,11 @@ complete_engine (WInput * in, int what_to_do)
|
||||
complete_list = listbox_new (1, 1, h - 2, w - 2, FALSE, NULL);
|
||||
group_add_widget (GROUP (complete_dlg), complete_list);
|
||||
|
||||
for (p = in->completions + 1; *p != NULL; p++)
|
||||
listbox_add_item (complete_list, LISTBOX_APPEND_AT_END, 0, *p, NULL, FALSE);
|
||||
for (k = 1; k < in->completions->len; k++)
|
||||
{
|
||||
q = g_ptr_array_index (in->completions, k);
|
||||
listbox_add_item (complete_list, LISTBOX_APPEND_AT_END, 0, q, NULL, FALSE);
|
||||
}
|
||||
|
||||
i = dlg_run (complete_dlg);
|
||||
q = NULL;
|
||||
@ -1290,11 +1276,11 @@ complete_engine (WInput * in, int what_to_do)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/** Returns an array of matches, or NULL if none. */
|
||||
char **
|
||||
GPtrArray *
|
||||
try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
|
||||
{
|
||||
try_complete_automation_state_t state;
|
||||
char **matches = NULL;
|
||||
GPtrArray *matches = NULL;
|
||||
|
||||
memset (&state, 0, sizeof (state));
|
||||
state.flags = flags;
|
||||
@ -1371,16 +1357,16 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
|
||||
(flags & INPUT_COMPLETE_SHELL_ESC) == 0)
|
||||
{
|
||||
/* FIXME: HACK? INPUT_COMPLETE_SHELL_ESC is used only in command line. */
|
||||
char **m;
|
||||
size_t i;
|
||||
|
||||
for (m = matches; *m != NULL; m++)
|
||||
for (i = 0; i < matches->len; i++)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = *m;
|
||||
p = g_ptr_array_index (matches, i);
|
||||
/* Escape only '?', '*', and '&' symbols as described in the
|
||||
manual page (see a11995e12b88285e044f644904c306ed6c342ad0). */
|
||||
*m = str_escape (*m, -1, "?*&", TRUE);
|
||||
g_ptr_array_index (matches, i) = str_escape (p, -1, "?*&", TRUE);
|
||||
g_free (p);
|
||||
}
|
||||
}
|
||||
@ -1391,7 +1377,7 @@ try_complete (char *text, int *lc_start, int *lc_end, input_complete_t flags)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
complete_engine_fill_completions (WInput * in)
|
||||
complete_engine_fill_completions (WInput *in)
|
||||
{
|
||||
char *s;
|
||||
const char *word_separators;
|
||||
@ -1430,7 +1416,7 @@ complete_engine_fill_completions (WInput * in)
|
||||
|
||||
/* declared in lib/widget/input.h */
|
||||
void
|
||||
input_complete (WInput * in)
|
||||
input_complete (WInput *in)
|
||||
{
|
||||
int engine_flags;
|
||||
|
||||
@ -1454,10 +1440,13 @@ input_complete (WInput * in)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_complete_free (WInput * in)
|
||||
input_complete_free (WInput *in)
|
||||
{
|
||||
g_strfreev (in->completions);
|
||||
in->completions = NULL;
|
||||
if (in->completions != NULL)
|
||||
{
|
||||
g_ptr_array_free (in->completions, TRUE);
|
||||
in->completions = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -61,7 +61,7 @@
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
label_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
label_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WLabel *l = LABEL (w);
|
||||
|
||||
@ -154,7 +154,7 @@ label_new (int y, int x, const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
label_set_text (WLabel * label, const char *text)
|
||||
label_set_text (WLabel *label, const char *text)
|
||||
{
|
||||
Widget *w = WIDGET (label);
|
||||
int newcols = w->rect.cols;
|
||||
@ -186,7 +186,7 @@ label_set_text (WLabel * label, const char *text)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
label_set_textv (WLabel * label, const char *format, ...)
|
||||
label_set_textv (WLabel *label, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUF_1K]; /* FIXME: is it enough? */
|
||||
|
@ -126,7 +126,7 @@ listbox_window_new (int lines, int cols, const char *title, const char *help)
|
||||
|
||||
/** Returns the number of the item selected */
|
||||
int
|
||||
listbox_run (Listbox * l)
|
||||
listbox_run (Listbox *l)
|
||||
{
|
||||
int val = -1;
|
||||
|
||||
@ -147,7 +147,7 @@ listbox_run (Listbox * l)
|
||||
* @return the 'data' of the item selected, or NULL if none selected.
|
||||
*/
|
||||
void *
|
||||
listbox_run_with_data (Listbox * l, const void *select)
|
||||
listbox_run_with_data (Listbox *l, const void *select)
|
||||
{
|
||||
void *val = NULL;
|
||||
|
||||
|
@ -90,7 +90,7 @@ listbox_entry_free (void *data)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_drawscroll (const WListbox * l)
|
||||
listbox_drawscroll (const WListbox *l)
|
||||
{
|
||||
const WRect *w = &CONST_WIDGET (l)->rect;
|
||||
int max_line = w->lines - 1;
|
||||
@ -131,7 +131,7 @@ listbox_drawscroll (const WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_draw (WListbox * l, gboolean focused)
|
||||
listbox_draw (WListbox *l, gboolean focused)
|
||||
{
|
||||
Widget *wl = WIDGET (l);
|
||||
const WRect *w = &CONST_WIDGET (l)->rect;
|
||||
@ -198,7 +198,7 @@ listbox_draw (WListbox * l, gboolean focused)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
listbox_check_hotkey (WListbox * l, int key)
|
||||
listbox_check_hotkey (WListbox *l, int key)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -221,7 +221,7 @@ listbox_check_hotkey (WListbox * l, int key)
|
||||
|
||||
/* Calculates the item displayed at screen row 'y' (y==0 being the widget's 1st row). */
|
||||
static int
|
||||
listbox_y_pos (WListbox * l, int y)
|
||||
listbox_y_pos (WListbox *l, int y)
|
||||
{
|
||||
return MIN (l->top + y, LISTBOX_LAST (l));
|
||||
}
|
||||
@ -229,7 +229,7 @@ listbox_y_pos (WListbox * l, int y)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_fwd (WListbox * l, gboolean wrap)
|
||||
listbox_fwd (WListbox *l, gboolean wrap)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -243,7 +243,7 @@ listbox_fwd (WListbox * l, gboolean wrap)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_fwd_n (WListbox * l, int n)
|
||||
listbox_fwd_n (WListbox *l, int n)
|
||||
{
|
||||
listbox_set_current (l, MIN (l->current + n, LISTBOX_LAST (l)));
|
||||
}
|
||||
@ -251,7 +251,7 @@ listbox_fwd_n (WListbox * l, int n)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_back (WListbox * l, gboolean wrap)
|
||||
listbox_back (WListbox *l, gboolean wrap)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -265,7 +265,7 @@ listbox_back (WListbox * l, gboolean wrap)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_back_n (WListbox * l, int n)
|
||||
listbox_back_n (WListbox *l, int n)
|
||||
{
|
||||
listbox_set_current (l, MAX (l->current - n, 0));
|
||||
}
|
||||
@ -273,7 +273,7 @@ listbox_back_n (WListbox * l, int n)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
listbox_execute_cmd (WListbox * l, long command)
|
||||
listbox_execute_cmd (WListbox *l, long command)
|
||||
{
|
||||
cb_ret_t ret = MSG_HANDLED;
|
||||
const WRect *w = &CONST_WIDGET (l)->rect;
|
||||
@ -341,7 +341,7 @@ listbox_execute_cmd (WListbox * l, long command)
|
||||
|
||||
/* Return MSG_HANDLED if we want a redraw */
|
||||
static cb_ret_t
|
||||
listbox_key (WListbox * l, int key)
|
||||
listbox_key (WListbox *l, int key)
|
||||
{
|
||||
long command;
|
||||
|
||||
@ -365,7 +365,7 @@ listbox_key (WListbox * l, int key)
|
||||
|
||||
/* Listbox item adding function */
|
||||
static inline void
|
||||
listbox_add_entry (WListbox * l, WLEntry * e, listbox_append_t pos)
|
||||
listbox_add_entry (WListbox *l, WLEntry *e, listbox_append_t pos)
|
||||
{
|
||||
if (l->list == NULL)
|
||||
{
|
||||
@ -400,7 +400,7 @@ listbox_add_entry (WListbox * l, WLEntry * e, listbox_append_t pos)
|
||||
|
||||
/* Call this whenever the user changes the selected item. */
|
||||
static void
|
||||
listbox_on_change (WListbox * l)
|
||||
listbox_on_change (WListbox *l)
|
||||
{
|
||||
listbox_draw (l, TRUE);
|
||||
send_message (WIDGET (l)->owner, l, MSG_NOTIFY, 0, NULL);
|
||||
@ -409,7 +409,7 @@ listbox_on_change (WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_do_action (WListbox * l)
|
||||
listbox_do_action (WListbox *l)
|
||||
{
|
||||
int action;
|
||||
|
||||
@ -433,7 +433,7 @@ listbox_do_action (WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_run_hotkey (WListbox * l, int pos)
|
||||
listbox_run_hotkey (WListbox *l, int pos)
|
||||
{
|
||||
listbox_set_current (l, pos);
|
||||
listbox_on_change (l);
|
||||
@ -443,7 +443,7 @@ listbox_run_hotkey (WListbox * l, int pos)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
listbox_destroy (WListbox * l)
|
||||
listbox_destroy (WListbox *l)
|
||||
{
|
||||
listbox_remove_list (l);
|
||||
}
|
||||
@ -451,7 +451,7 @@ listbox_destroy (WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
listbox_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WListbox *l = LISTBOX (w);
|
||||
|
||||
@ -503,7 +503,7 @@ listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
listbox_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
listbox_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
WListbox *l = LISTBOX (w);
|
||||
int old_current;
|
||||
@ -579,7 +579,7 @@ listbox_new (int y, int x, int height, int width, gboolean deletable, lcback_fn
|
||||
* Finds item by its label.
|
||||
*/
|
||||
int
|
||||
listbox_search_text (WListbox * l, const char *text)
|
||||
listbox_search_text (WListbox *l, const char *text)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -604,7 +604,7 @@ listbox_search_text (WListbox * l, const char *text)
|
||||
* Finds item by its 'data' slot.
|
||||
*/
|
||||
int
|
||||
listbox_search_data (WListbox * l, const void *data)
|
||||
listbox_search_data (WListbox *l, const void *data)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -627,7 +627,7 @@ listbox_search_data (WListbox * l, const void *data)
|
||||
|
||||
/* Select the first entry and scrolls the list to the top */
|
||||
void
|
||||
listbox_select_first (WListbox * l)
|
||||
listbox_select_first (WListbox *l)
|
||||
{
|
||||
l->current = l->top = 0;
|
||||
}
|
||||
@ -636,7 +636,7 @@ listbox_select_first (WListbox * l)
|
||||
|
||||
/* Selects the last entry and scrolls the list to the bottom */
|
||||
void
|
||||
listbox_select_last (WListbox * l)
|
||||
listbox_select_last (WListbox *l)
|
||||
{
|
||||
int lines = WIDGET (l)->rect.lines;
|
||||
int length;
|
||||
@ -650,7 +650,7 @@ listbox_select_last (WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
listbox_set_current (WListbox * l, int dest)
|
||||
listbox_set_current (WListbox *l, int dest)
|
||||
{
|
||||
GList *le;
|
||||
int pos;
|
||||
@ -688,7 +688,7 @@ listbox_set_current (WListbox * l, int dest)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
listbox_get_length (const WListbox * l)
|
||||
listbox_get_length (const WListbox *l)
|
||||
{
|
||||
return listbox_is_empty (l) ? 0 : (int) g_queue_get_length (l->list);
|
||||
}
|
||||
@ -697,7 +697,7 @@ listbox_get_length (const WListbox * l)
|
||||
|
||||
/* Returns the current string text as well as the associated extra data */
|
||||
void
|
||||
listbox_get_current (WListbox * l, char **string, void **extra)
|
||||
listbox_get_current (WListbox *l, char **string, void **extra)
|
||||
{
|
||||
WLEntry *e = NULL;
|
||||
gboolean ok;
|
||||
@ -717,7 +717,7 @@ listbox_get_current (WListbox * l, char **string, void **extra)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
WLEntry *
|
||||
listbox_get_nth_entry (const WListbox * l, int pos)
|
||||
listbox_get_nth_entry (const WListbox *l, int pos)
|
||||
{
|
||||
if (!listbox_is_empty (l) && pos >= 0)
|
||||
{
|
||||
@ -734,7 +734,7 @@ listbox_get_nth_entry (const WListbox * l, int pos)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
GList *
|
||||
listbox_get_first_link (const WListbox * l)
|
||||
listbox_get_first_link (const WListbox *l)
|
||||
{
|
||||
return (l == NULL || l->list == NULL) ? NULL : g_queue_peek_head_link (l->list);
|
||||
}
|
||||
@ -742,7 +742,7 @@ listbox_get_first_link (const WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
listbox_remove_current (WListbox * l)
|
||||
listbox_remove_current (WListbox *l)
|
||||
{
|
||||
if (!listbox_is_empty (l))
|
||||
{
|
||||
@ -765,7 +765,7 @@ listbox_remove_current (WListbox * l)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
listbox_is_empty (const WListbox * l)
|
||||
listbox_is_empty (const WListbox *l)
|
||||
{
|
||||
return (l == NULL || l->list == NULL || g_queue_is_empty (l->list));
|
||||
}
|
||||
@ -779,7 +779,7 @@ listbox_is_empty (const WListbox * l)
|
||||
* @param list list of WLEntry objects
|
||||
*/
|
||||
void
|
||||
listbox_set_list (WListbox * l, GQueue * list)
|
||||
listbox_set_list (WListbox *l, GQueue *list)
|
||||
{
|
||||
listbox_remove_list (l);
|
||||
|
||||
@ -790,7 +790,7 @@ listbox_set_list (WListbox * l, GQueue * list)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
listbox_remove_list (WListbox * l)
|
||||
listbox_remove_list (WListbox *l)
|
||||
{
|
||||
if (l != NULL)
|
||||
{
|
||||
@ -806,9 +806,44 @@ listbox_remove_list (WListbox * l)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Add new intem to the listbox.
|
||||
*
|
||||
* @param l WListbox object
|
||||
* @param pos position of the item
|
||||
* @param hotkey position of the item
|
||||
* @param text item text. @l takes the copy of @text.
|
||||
* @param data item data
|
||||
* @param free_data if TRUE free the @data when @l is destroyed,
|
||||
*
|
||||
* @returns pointer to copy of @text.
|
||||
*/
|
||||
char *
|
||||
listbox_add_item (WListbox * l, listbox_append_t pos, int hotkey, const char *text, void *data,
|
||||
listbox_add_item (WListbox *l, listbox_append_t pos, int hotkey, const char *text, void *data,
|
||||
gboolean free_data)
|
||||
{
|
||||
return listbox_add_item_take (l, pos, hotkey, g_strdup (text), data, free_data);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Add new intem to the listbox.
|
||||
*
|
||||
* @param l WListbox object
|
||||
* @param pos position of the item
|
||||
* @param hotkey position of the item
|
||||
* @param text item text. Ownership of the text is transferred to the @l.
|
||||
* @param data item data
|
||||
* @param free_data if TRUE free the @data when @l is destroyed,
|
||||
*
|
||||
* After this call, @text belongs to the @l and may no longer be modified by the caller.
|
||||
*
|
||||
* @returns pointer to @text.
|
||||
*/
|
||||
char *
|
||||
listbox_add_item_take (WListbox *l, listbox_append_t pos, int hotkey, char *text, void *data,
|
||||
gboolean free_data)
|
||||
{
|
||||
WLEntry *entry;
|
||||
|
||||
@ -819,7 +854,7 @@ listbox_add_item (WListbox * l, listbox_append_t pos, int hotkey, const char *te
|
||||
return NULL;
|
||||
|
||||
entry = g_new (WLEntry, 1);
|
||||
entry->text = g_strdup (text);
|
||||
entry->text = text;
|
||||
entry->data = data;
|
||||
entry->free_data = free_data;
|
||||
entry->hotkey = hotkey;
|
||||
|
@ -76,6 +76,8 @@ void listbox_set_list (WListbox * l, GQueue * list);
|
||||
void listbox_remove_list (WListbox * l);
|
||||
char *listbox_add_item (WListbox * l, listbox_append_t pos, int hotkey, const char *text,
|
||||
void *data, gboolean free_data);
|
||||
char *listbox_add_item_take (WListbox * l, listbox_append_t pos, int hotkey, char *text,
|
||||
void *data, gboolean free_data);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
|
@ -82,7 +82,7 @@ struct menu_t
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menu_arrange (menu_t * menu, dlg_shortcut_str get_shortcut)
|
||||
menu_arrange (menu_t *menu, dlg_shortcut_str get_shortcut)
|
||||
{
|
||||
if (menu != NULL)
|
||||
{
|
||||
@ -121,7 +121,7 @@ menu_arrange (menu_t * menu, dlg_shortcut_str get_shortcut)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_paint_idx (const WMenuBar * menubar, unsigned int idx, int color)
|
||||
menubar_paint_idx (const WMenuBar *menubar, unsigned int idx, int color)
|
||||
{
|
||||
const WRect *w = &CONST_WIDGET (menubar)->rect;
|
||||
const menu_t *menu = MENU (g_list_nth_data (menubar->menu, menubar->current));
|
||||
@ -179,7 +179,7 @@ menubar_paint_idx (const WMenuBar * menubar, unsigned int idx, int color)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_draw_drop (const WMenuBar * menubar)
|
||||
menubar_draw_drop (const WMenuBar *menubar)
|
||||
{
|
||||
const WRect *w = &CONST_WIDGET (menubar)->rect;
|
||||
const menu_t *menu = MENU (g_list_nth_data (menubar->menu, menubar->current));
|
||||
@ -204,7 +204,7 @@ menubar_draw_drop (const WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_set_color (const WMenuBar * menubar, gboolean current, gboolean hotkey)
|
||||
menubar_set_color (const WMenuBar *menubar, gboolean current, gboolean hotkey)
|
||||
{
|
||||
if (!widget_get_state (CONST_WIDGET (menubar), WST_FOCUSED))
|
||||
tty_setcolor (MENU_INACTIVE_COLOR);
|
||||
@ -217,7 +217,7 @@ menubar_set_color (const WMenuBar * menubar, gboolean current, gboolean hotkey)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_draw (const WMenuBar * menubar)
|
||||
menubar_draw (const WMenuBar *menubar)
|
||||
{
|
||||
const WRect *w = &CONST_WIDGET (menubar)->rect;
|
||||
GList *i;
|
||||
@ -262,7 +262,7 @@ menubar_draw (const WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_remove (WMenuBar * menubar)
|
||||
menubar_remove (WMenuBar *menubar)
|
||||
{
|
||||
Widget *g;
|
||||
|
||||
@ -287,7 +287,7 @@ menubar_remove (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_left (WMenuBar * menubar)
|
||||
menubar_left (WMenuBar *menubar)
|
||||
{
|
||||
menubar_remove (menubar);
|
||||
if (menubar->current == 0)
|
||||
@ -300,7 +300,7 @@ menubar_left (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_right (WMenuBar * menubar)
|
||||
menubar_right (WMenuBar *menubar)
|
||||
{
|
||||
menubar_remove (menubar);
|
||||
menubar->current = (menubar->current + 1) % g_list_length (menubar->menu);
|
||||
@ -310,7 +310,7 @@ menubar_right (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_finish (WMenuBar * menubar)
|
||||
menubar_finish (WMenuBar *menubar)
|
||||
{
|
||||
Widget *w = WIDGET (menubar);
|
||||
|
||||
@ -339,7 +339,7 @@ menubar_finish (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_drop (WMenuBar * menubar, unsigned int selected)
|
||||
menubar_drop (WMenuBar *menubar, unsigned int selected)
|
||||
{
|
||||
menubar->is_dropped = TRUE;
|
||||
menubar->current = selected;
|
||||
@ -349,7 +349,7 @@ menubar_drop (WMenuBar * menubar, unsigned int selected)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_execute (WMenuBar * menubar)
|
||||
menubar_execute (WMenuBar *menubar)
|
||||
{
|
||||
const menu_t *menu = MENU (g_list_nth_data (menubar->menu, menubar->current));
|
||||
const menu_entry_t *entry = MENUENTRY (g_list_nth_data (menu->entries, menu->current));
|
||||
@ -368,7 +368,7 @@ menubar_execute (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_down (WMenuBar * menubar)
|
||||
menubar_down (WMenuBar *menubar)
|
||||
{
|
||||
menu_t *menu = MENU (g_list_nth_data (menubar->menu, menubar->current));
|
||||
const unsigned int len = g_list_length (menu->entries);
|
||||
@ -389,7 +389,7 @@ menubar_down (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_up (WMenuBar * menubar)
|
||||
menubar_up (WMenuBar *menubar)
|
||||
{
|
||||
menu_t *menu = MENU (g_list_nth_data (menubar->menu, menubar->current));
|
||||
const unsigned int len = g_list_length (menu->entries);
|
||||
@ -413,7 +413,7 @@ menubar_up (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_first (WMenuBar * menubar)
|
||||
menubar_first (WMenuBar *menubar)
|
||||
{
|
||||
if (menubar->is_dropped)
|
||||
{
|
||||
@ -450,7 +450,7 @@ menubar_first (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_last (WMenuBar * menubar)
|
||||
menubar_last (WMenuBar *menubar)
|
||||
{
|
||||
if (menubar->is_dropped)
|
||||
{
|
||||
@ -484,7 +484,7 @@ menubar_last (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
menubar_try_drop_menu (WMenuBar * menubar, int hotkey)
|
||||
menubar_try_drop_menu (WMenuBar *menubar, int hotkey)
|
||||
{
|
||||
GList *i;
|
||||
|
||||
@ -505,7 +505,7 @@ menubar_try_drop_menu (WMenuBar * menubar, int hotkey)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
menubar_try_exec_menu (WMenuBar * menubar, int hotkey)
|
||||
menubar_try_exec_menu (WMenuBar *menubar, int hotkey)
|
||||
{
|
||||
menu_t *menu;
|
||||
GList *i;
|
||||
@ -531,7 +531,7 @@ menubar_try_exec_menu (WMenuBar * menubar, int hotkey)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_help (const WMenuBar * menubar)
|
||||
menubar_help (const WMenuBar *menubar)
|
||||
{
|
||||
ev_help_t event_data;
|
||||
|
||||
@ -549,7 +549,7 @@ menubar_help (const WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
menubar_execute_cmd (WMenuBar * menubar, long command)
|
||||
menubar_execute_cmd (WMenuBar *menubar, long command)
|
||||
{
|
||||
cb_ret_t ret = MSG_HANDLED;
|
||||
|
||||
@ -603,7 +603,7 @@ menubar_execute_cmd (WMenuBar * menubar, long command)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
menubar_handle_key (WMenuBar * menubar, int key)
|
||||
menubar_handle_key (WMenuBar *menubar, int key)
|
||||
{
|
||||
long cmd;
|
||||
cb_ret_t ret = MSG_NOT_HANDLED;
|
||||
@ -627,7 +627,7 @@ menubar_handle_key (WMenuBar * menubar, int key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
menubar_refresh (WMenuBar * menubar)
|
||||
menubar_refresh (WMenuBar *menubar)
|
||||
{
|
||||
Widget *w = WIDGET (menubar);
|
||||
|
||||
@ -645,7 +645,7 @@ menubar_refresh (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
menubar_free_menu (WMenuBar * menubar)
|
||||
menubar_free_menu (WMenuBar *menubar)
|
||||
{
|
||||
g_clear_list (&menubar->menu, (GDestroyNotify) menu_free);
|
||||
}
|
||||
@ -653,7 +653,7 @@ menubar_free_menu (WMenuBar * menubar)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
menubar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
menubar_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WMenuBar *menubar = MENUBAR (w);
|
||||
|
||||
@ -708,7 +708,7 @@ menubar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static unsigned int
|
||||
menubar_get_menu_by_x_coord (const WMenuBar * menubar, int x)
|
||||
menubar_get_menu_by_x_coord (const WMenuBar *menubar, int x)
|
||||
{
|
||||
unsigned int i;
|
||||
GList *menu;
|
||||
@ -727,7 +727,7 @@ menubar_get_menu_by_x_coord (const WMenuBar * menubar, int x)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
menubar_mouse_on_menu (const WMenuBar * menubar, int y, int x)
|
||||
menubar_mouse_on_menu (const WMenuBar *menubar, int y, int x)
|
||||
{
|
||||
const WRect *w = &CONST_WIDGET (menubar)->rect;
|
||||
menu_t *menu;
|
||||
@ -753,7 +753,7 @@ menubar_mouse_on_menu (const WMenuBar * menubar, int y, int x)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_change_selected_item (WMenuBar * menubar, int y)
|
||||
menubar_change_selected_item (WMenuBar *menubar, int y)
|
||||
{
|
||||
menu_t *menu;
|
||||
menu_entry_t *entry;
|
||||
@ -773,7 +773,7 @@ menubar_change_selected_item (WMenuBar * menubar, int y)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
menubar_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
menubar_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
static gboolean was_drag = FALSE;
|
||||
|
||||
@ -905,7 +905,7 @@ menu_entry_new (const char *name, long command)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
menu_entry_free (menu_entry_t * entry)
|
||||
menu_entry_free (menu_entry_t *entry)
|
||||
{
|
||||
if (entry != NULL)
|
||||
{
|
||||
@ -918,7 +918,7 @@ menu_entry_free (menu_entry_t * entry)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
menu_t *
|
||||
menu_new (const char *name, GList * entries, const char *help_node)
|
||||
menu_new (const char *name, GList *entries, const char *help_node)
|
||||
{
|
||||
menu_t *menu;
|
||||
|
||||
@ -937,7 +937,7 @@ menu_new (const char *name, GList * entries, const char *help_node)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
menu_set_name (menu_t * menu, const char *name)
|
||||
menu_set_name (menu_t *menu, const char *name)
|
||||
{
|
||||
hotkey_free (menu->text);
|
||||
menu->text = hotkey_new (name);
|
||||
@ -946,7 +946,7 @@ menu_set_name (menu_t * menu, const char *name)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
menu_free (menu_t * menu)
|
||||
menu_free (menu_t *menu)
|
||||
{
|
||||
hotkey_free (menu->text);
|
||||
g_list_free_full (menu->entries, (GDestroyNotify) menu_entry_free);
|
||||
@ -957,7 +957,7 @@ menu_free (menu_t * menu)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
WMenuBar *
|
||||
menubar_new (GList * menu)
|
||||
menubar_new (GList *menu)
|
||||
{
|
||||
WRect r = { 0, 0, 1, COLS };
|
||||
WMenuBar *menubar;
|
||||
@ -977,7 +977,7 @@ menubar_new (GList * menu)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
menubar_set_menu (WMenuBar * menubar, GList * menu)
|
||||
menubar_set_menu (WMenuBar *menubar, GList *menu)
|
||||
{
|
||||
/* delete previous menu */
|
||||
menubar_free_menu (menubar);
|
||||
@ -992,7 +992,7 @@ menubar_set_menu (WMenuBar * menubar, GList * menu)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
menubar_add_menu (WMenuBar * menubar, menu_t * menu)
|
||||
menubar_add_menu (WMenuBar *menubar, menu_t *menu)
|
||||
{
|
||||
if (menu != NULL)
|
||||
{
|
||||
@ -1010,7 +1010,7 @@ menubar_add_menu (WMenuBar * menubar, menu_t * menu)
|
||||
*/
|
||||
|
||||
void
|
||||
menubar_arrange (WMenuBar * menubar)
|
||||
menubar_arrange (WMenuBar *menubar)
|
||||
{
|
||||
int start_x = 1;
|
||||
GList *i;
|
||||
@ -1059,7 +1059,7 @@ menubar_arrange (WMenuBar * menubar)
|
||||
/** Find MenuBar widget in the dialog */
|
||||
|
||||
WMenuBar *
|
||||
menubar_find (const WDialog * h)
|
||||
menubar_find (const WDialog *h)
|
||||
{
|
||||
return MENUBAR (widget_find_by_type (CONST_WIDGET (h), menubar_callback));
|
||||
}
|
||||
@ -1074,7 +1074,7 @@ menubar_find (const WDialog * h)
|
||||
* @which number of active dropdown menu
|
||||
*/
|
||||
void
|
||||
menubar_activate (WMenuBar * menubar, gboolean dropped, int which)
|
||||
menubar_activate (WMenuBar *menubar, gboolean dropped, int which)
|
||||
{
|
||||
Widget *w = WIDGET (menubar);
|
||||
|
||||
|
@ -59,8 +59,8 @@
|
||||
* http://www.fifi.org/cgi-bin/info2www?(gpm)Event+Types
|
||||
*/
|
||||
static void
|
||||
init_mouse_event (mouse_event_t * event, mouse_msg_t msg, const Gpm_Event * global_gpm,
|
||||
const Widget * w)
|
||||
init_mouse_event (mouse_event_t *event, mouse_msg_t msg, const Gpm_Event *global_gpm,
|
||||
const Widget *w)
|
||||
{
|
||||
event->msg = msg;
|
||||
event->x = global_gpm->x - w->rect.x - 1; /* '-1' because Gpm_Event is 1-based. */
|
||||
@ -82,7 +82,7 @@ init_mouse_event (mouse_event_t * event, mouse_msg_t msg, const Gpm_Event * glob
|
||||
* @return high level mouse event
|
||||
*/
|
||||
static mouse_event_t
|
||||
mouse_translate_event (Widget * w, Gpm_Event * event)
|
||||
mouse_translate_event (Widget *w, Gpm_Event *event)
|
||||
{
|
||||
gboolean in_widget;
|
||||
mouse_msg_t msg = MSG_MOUSE_NONE;
|
||||
@ -173,7 +173,7 @@ mouse_translate_event (Widget * w, Gpm_Event * event)
|
||||
* @return result of mouse event handling
|
||||
*/
|
||||
static int
|
||||
mouse_process_event (Widget * w, mouse_event_t * event)
|
||||
mouse_process_event (Widget *w, mouse_event_t *event)
|
||||
{
|
||||
int ret = MOU_UNHANDLED;
|
||||
|
||||
@ -215,7 +215,7 @@ mouse_process_event (Widget * w, mouse_event_t * event)
|
||||
* @return result of mouse event handling
|
||||
*/
|
||||
int
|
||||
mouse_handle_event (Widget * w, Gpm_Event * event)
|
||||
mouse_handle_event (Widget *w, Gpm_Event *event)
|
||||
{
|
||||
mouse_event_t me;
|
||||
|
||||
|
@ -68,7 +68,7 @@ typedef struct
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static WInput *
|
||||
quick_create_input (int y, int x, const quick_widget_t * qw)
|
||||
quick_create_input (int y, int x, const quick_widget_t *qw)
|
||||
{
|
||||
WInput *in;
|
||||
|
||||
@ -84,7 +84,7 @@ quick_create_input (int y, int x, const quick_widget_t * qw)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
quick_create_labeled_input (GArray * widgets, int *y, int x, quick_widget_t * quick_widget,
|
||||
quick_create_labeled_input (GArray *widgets, int *y, int x, quick_widget_t *quick_widget,
|
||||
int *width)
|
||||
{
|
||||
quick_widget_item_t in, label;
|
||||
@ -161,7 +161,7 @@ quick_create_labeled_input (GArray * widgets, int *y, int x, quick_widget_t * qu
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
|
||||
quick_dialog_skip (quick_dialog_t *quick_dlg, int nskip)
|
||||
{
|
||||
int len;
|
||||
int blen = 0;
|
||||
|
@ -346,7 +346,7 @@ int quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip);
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
static inline int
|
||||
quick_dialog (quick_dialog_t * quick_dlg)
|
||||
quick_dialog (quick_dialog_t *quick_dlg)
|
||||
{
|
||||
return quick_dialog_skip (quick_dlg, 1);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ const global_keymap_t *radio_map = NULL;
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
radio_execute_cmd (WRadio * r, long command)
|
||||
radio_execute_cmd (WRadio *r, long command)
|
||||
{
|
||||
cb_ret_t ret = MSG_HANDLED;
|
||||
Widget *w = WIDGET (r);
|
||||
@ -107,7 +107,7 @@ radio_execute_cmd (WRadio * r, long command)
|
||||
|
||||
/* Return MSG_HANDLED if we want a redraw */
|
||||
static cb_ret_t
|
||||
radio_key (WRadio * r, int key)
|
||||
radio_key (WRadio *r, int key)
|
||||
{
|
||||
long command;
|
||||
|
||||
@ -120,7 +120,7 @@ radio_key (WRadio * r, int key)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
radio_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WRadio *r = RADIO (w);
|
||||
int i;
|
||||
@ -188,7 +188,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
radio_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
radio_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ rect_new (int y, int x, int lines, int cols)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_init (WRect * r, int y, int x, int lines, int cols)
|
||||
rect_init (WRect *r, int y, int x, int lines, int cols)
|
||||
{
|
||||
r->y = y;
|
||||
r->x = x;
|
||||
@ -101,7 +101,7 @@ rect_init (WRect * r, int y, int x, int lines, int cols)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_move (WRect * r, int dy, int dx)
|
||||
rect_move (WRect *r, int dy, int dx)
|
||||
{
|
||||
r->y += dy;
|
||||
r->x += dx;
|
||||
@ -117,7 +117,7 @@ rect_move (WRect * r, int dy, int dx)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_resize (WRect * r, int dl, int dc)
|
||||
rect_resize (WRect *r, int dl, int dc)
|
||||
{
|
||||
r->lines += dl;
|
||||
r->cols += dc;
|
||||
@ -137,7 +137,7 @@ rect_resize (WRect * r, int dl, int dc)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_grow (WRect * r, int dl, int dc)
|
||||
rect_grow (WRect *r, int dl, int dc)
|
||||
{
|
||||
r->y -= dl;
|
||||
r->x -= dc;
|
||||
@ -157,7 +157,7 @@ rect_grow (WRect * r, int dl, int dc)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_intersect (WRect * r, const WRect * r1)
|
||||
rect_intersect (WRect *r, const WRect *r1)
|
||||
{
|
||||
int y, x;
|
||||
int y1, x1;
|
||||
@ -193,7 +193,7 @@ rect_intersect (WRect * r, const WRect * r1)
|
||||
*/
|
||||
|
||||
void
|
||||
rect_union (WRect * r, const WRect * r1)
|
||||
rect_union (WRect *r, const WRect *r1)
|
||||
{
|
||||
int x, y;
|
||||
int x1, y1;
|
||||
@ -228,7 +228,7 @@ rect_union (WRect * r, const WRect * r1)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
rects_are_overlapped (const WRect * r1, const WRect * r2)
|
||||
rects_are_overlapped (const WRect *r1, const WRect *r2)
|
||||
{
|
||||
return !((r2->x >= r1->x + r1->cols) || (r1->x >= r2->x + r2->cols)
|
||||
|| (r2->y >= r1->y + r1->lines) || (r1->y >= r2->y + r2->lines));
|
||||
@ -245,7 +245,7 @@ rects_are_overlapped (const WRect * r1, const WRect * r2)
|
||||
*/
|
||||
|
||||
gboolean
|
||||
rects_are_equal (const WRect * r1, const WRect * r2)
|
||||
rects_are_equal (const WRect *r1, const WRect *r2)
|
||||
{
|
||||
return (r1->y == r2->y && r1->x == r2->x && r1->lines == r2->lines && r1->cols == r2->cols);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ widget_set_id (void)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
widget_default_resize (Widget * w, const WRect * r)
|
||||
widget_default_resize (Widget *w, const WRect *r)
|
||||
{
|
||||
if (r == NULL)
|
||||
return MSG_NOT_HANDLED;
|
||||
@ -95,7 +95,7 @@ widget_default_resize (Widget * w, const WRect * r)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
widget_do_focus (Widget * w, gboolean enable)
|
||||
widget_do_focus (Widget *w, gboolean enable)
|
||||
{
|
||||
if (w != NULL && widget_get_state (WIDGET (w->owner), WST_VISIBLE | WST_FOCUSED))
|
||||
widget_set_state (w, WST_FOCUSED, enable);
|
||||
@ -109,7 +109,7 @@ widget_do_focus (Widget * w, gboolean enable)
|
||||
*/
|
||||
|
||||
static void
|
||||
widget_focus (Widget * w)
|
||||
widget_focus (Widget *w)
|
||||
{
|
||||
WGroup *g = w->owner;
|
||||
|
||||
@ -136,7 +136,7 @@ widget_focus (Widget * w)
|
||||
* Put widget on top or bottom of Z-order.
|
||||
*/
|
||||
static void
|
||||
widget_reorder (GList * l, gboolean set_top)
|
||||
widget_reorder (GList *l, gboolean set_top)
|
||||
{
|
||||
WGroup *g = WIDGET (l->data)->owner;
|
||||
|
||||
@ -169,7 +169,7 @@ hotkey_cmp (const char *s1, const char *s2)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
widget_default_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
widget_default_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
/* do nothing */
|
||||
(void) w;
|
||||
@ -180,7 +180,7 @@ widget_default_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * even
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static const int *
|
||||
widget_default_get_colors (const Widget * w)
|
||||
widget_default_get_colors (const Widget *w)
|
||||
{
|
||||
const Widget *owner = CONST_WIDGET (w->owner);
|
||||
|
||||
@ -262,7 +262,7 @@ hotkey_equal (const hotkey_t hotkey1, const hotkey_t hotkey2)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
hotkey_draw (const Widget * w, const hotkey_t hotkey, gboolean focused)
|
||||
hotkey_draw (const Widget *w, const hotkey_t hotkey, gboolean focused)
|
||||
{
|
||||
if (hotkey.start[0] != '\0')
|
||||
{
|
||||
@ -307,7 +307,7 @@ hotkey_get_text (const hotkey_t hotkey)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
widget_init (Widget * w, const WRect * r, widget_cb_fn callback, widget_mouse_cb_fn mouse_callback)
|
||||
widget_init (Widget *w, const WRect *r, widget_cb_fn callback, widget_mouse_cb_fn mouse_callback)
|
||||
{
|
||||
w->id = widget_set_id ();
|
||||
w->rect = *r;
|
||||
@ -345,7 +345,7 @@ widget_init (Widget * w, const WRect * r, widget_cb_fn callback, widget_mouse_cb
|
||||
|
||||
/* Default callback for widgets */
|
||||
cb_ret_t
|
||||
widget_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
widget_default_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
(void) sender;
|
||||
(void) parm;
|
||||
@ -381,7 +381,7 @@ widget_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
||||
* @param enable TRUE if specified options should be added, FALSE if options should be removed
|
||||
*/
|
||||
void
|
||||
widget_set_options (Widget * w, widget_options_t options, gboolean enable)
|
||||
widget_set_options (Widget *w, widget_options_t options, gboolean enable)
|
||||
{
|
||||
if (enable)
|
||||
w->options |= options;
|
||||
@ -392,7 +392,7 @@ widget_set_options (Widget * w, widget_options_t options, gboolean enable)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
widget_adjust_position (widget_pos_flags_t pos_flags, WRect * r)
|
||||
widget_adjust_position (widget_pos_flags_t pos_flags, WRect *r)
|
||||
{
|
||||
if ((pos_flags & WPOS_FULLSCREEN) != 0)
|
||||
{
|
||||
@ -431,7 +431,7 @@ widget_adjust_position (widget_pos_flags_t pos_flags, WRect * r)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_set_size (Widget * w, int y, int x, int lines, int cols)
|
||||
widget_set_size (Widget *w, int y, int x, int lines, int cols)
|
||||
{
|
||||
WRect r = { y, x, lines, cols };
|
||||
|
||||
@ -448,7 +448,7 @@ widget_set_size (Widget * w, int y, int x, int lines, int cols)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_set_size_rect (Widget * w, WRect * r)
|
||||
widget_set_size_rect (Widget *w, WRect *r)
|
||||
{
|
||||
send_message (w, NULL, MSG_RESIZE, 0, r);
|
||||
widget_draw (w);
|
||||
@ -457,7 +457,7 @@ widget_set_size_rect (Widget * w, WRect * r)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
widget_selectcolor (const Widget * w, gboolean focused, gboolean hotkey)
|
||||
widget_selectcolor (const Widget *w, gboolean focused, gboolean hotkey)
|
||||
{
|
||||
int color;
|
||||
const int *colors;
|
||||
@ -477,7 +477,7 @@ widget_selectcolor (const Widget * w, gboolean focused, gboolean hotkey)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
widget_erase (Widget * w)
|
||||
widget_erase (Widget *w)
|
||||
{
|
||||
if (w != NULL)
|
||||
tty_fill_region (w->rect.y, w->rect.x, w->rect.lines, w->rect.cols, ' ');
|
||||
@ -486,7 +486,7 @@ widget_erase (Widget * w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
widget_set_visibility (Widget * w, gboolean make_visible)
|
||||
widget_set_visibility (Widget *w, gboolean make_visible)
|
||||
{
|
||||
if (widget_get_state (w, WST_VISIBLE) != make_visible)
|
||||
widget_set_state (w, WST_VISIBLE, make_visible);
|
||||
@ -526,7 +526,7 @@ widget_is_active (const void *w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
cb_ret_t
|
||||
widget_draw (Widget * w)
|
||||
widget_draw (Widget *w)
|
||||
{
|
||||
cb_ret_t ret = MSG_NOT_HANDLED;
|
||||
|
||||
@ -550,7 +550,7 @@ widget_draw (Widget * w)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_replace (Widget * old_w, Widget * new_w)
|
||||
widget_replace (Widget *old_w, Widget *new_w)
|
||||
{
|
||||
WGroup *g = old_w->owner;
|
||||
gboolean should_focus = FALSE;
|
||||
@ -605,7 +605,7 @@ widget_replace (Widget * old_w, Widget * new_w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
widget_is_focusable (const Widget * w)
|
||||
widget_is_focusable (const Widget *w)
|
||||
{
|
||||
return (widget_get_options (w, WOP_SELECTABLE) && widget_get_state (w, WST_VISIBLE) &&
|
||||
!widget_get_state (w, WST_DISABLED));
|
||||
@ -622,7 +622,7 @@ widget_is_focusable (const Widget * w)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_select (Widget * w)
|
||||
widget_select (Widget *w)
|
||||
{
|
||||
WGroup *g;
|
||||
|
||||
@ -650,7 +650,7 @@ widget_select (Widget * w)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_set_bottom (Widget * w)
|
||||
widget_set_bottom (Widget *w)
|
||||
{
|
||||
widget_reorder (widget_find (WIDGET (w->owner), w), FALSE);
|
||||
}
|
||||
@ -665,7 +665,7 @@ widget_set_bottom (Widget * w)
|
||||
*/
|
||||
|
||||
long
|
||||
widget_lookup_key (Widget * w, int key)
|
||||
widget_lookup_key (Widget *w, int key)
|
||||
{
|
||||
if (w->ext_mode)
|
||||
{
|
||||
@ -687,7 +687,7 @@ widget_lookup_key (Widget * w, int key)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_default_make_global (Widget * w, const WRect * delta)
|
||||
widget_default_make_global (Widget *w, const WRect *delta)
|
||||
{
|
||||
if (delta != NULL)
|
||||
rect_move (&w->rect, delta->y, delta->x);
|
||||
@ -706,7 +706,7 @@ widget_default_make_global (Widget * w, const WRect * delta)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_default_make_local (Widget * w, const WRect * delta)
|
||||
widget_default_make_local (Widget *w, const WRect *delta)
|
||||
{
|
||||
if (delta != NULL)
|
||||
rect_move (&w->rect, -delta->y, -delta->x);
|
||||
@ -725,7 +725,7 @@ widget_default_make_local (Widget * w, const WRect * delta)
|
||||
*/
|
||||
|
||||
GList *
|
||||
widget_default_find (const Widget * w, const Widget * what)
|
||||
widget_default_find (const Widget *w, const Widget *what)
|
||||
{
|
||||
return (w != what
|
||||
|| w->owner == NULL) ? NULL : g_list_find (CONST_GROUP (w->owner)->widgets, what);
|
||||
@ -743,7 +743,7 @@ widget_default_find (const Widget * w, const Widget * what)
|
||||
*/
|
||||
|
||||
Widget *
|
||||
widget_default_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
widget_default_find_by_type (const Widget *w, widget_cb_fn cb)
|
||||
{
|
||||
return (w->callback == cb ? WIDGET (w) : NULL);
|
||||
}
|
||||
@ -759,7 +759,7 @@ widget_default_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
*/
|
||||
|
||||
Widget *
|
||||
widget_default_find_by_id (const Widget * w, unsigned long id)
|
||||
widget_default_find_by_id (const Widget *w, unsigned long id)
|
||||
{
|
||||
return (w->id == id ? WIDGET (w) : NULL);
|
||||
}
|
||||
@ -777,7 +777,7 @@ widget_default_find_by_id (const Widget * w, unsigned long id)
|
||||
*/
|
||||
|
||||
cb_ret_t
|
||||
widget_default_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
widget_default_set_state (Widget *w, widget_state_t state, gboolean enable)
|
||||
{
|
||||
gboolean ret = MSG_HANDLED;
|
||||
Widget *owner = WIDGET (GROUP (w->owner));
|
||||
@ -867,7 +867,7 @@ widget_default_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
*/
|
||||
|
||||
void
|
||||
widget_default_destroy (Widget * w)
|
||||
widget_default_destroy (Widget *w)
|
||||
{
|
||||
send_message (w, NULL, MSG_DESTROY, 0, NULL);
|
||||
g_free (w);
|
||||
@ -877,7 +877,7 @@ widget_default_destroy (Widget * w)
|
||||
/* get mouse pointer location within widget */
|
||||
|
||||
Gpm_Event
|
||||
mouse_get_local (const Gpm_Event * global, const Widget * w)
|
||||
mouse_get_local (const Gpm_Event *global, const Widget *w)
|
||||
{
|
||||
Gpm_Event local;
|
||||
|
||||
@ -894,7 +894,7 @@ mouse_get_local (const Gpm_Event * global, const Widget * w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mouse_global_in_widget (const Gpm_Event * event, const Widget * w)
|
||||
mouse_global_in_widget (const Gpm_Event *event, const Widget *w)
|
||||
{
|
||||
const WRect *r = &w->rect;
|
||||
|
||||
|
@ -267,7 +267,7 @@ send_message (void *w, void *sender, widget_msg_t msg, int parm, void *data)
|
||||
*/
|
||||
|
||||
static inline gboolean
|
||||
widget_get_options (const Widget * w, widget_options_t options)
|
||||
widget_get_options (const Widget *w, widget_options_t options)
|
||||
{
|
||||
return ((w->options & options) == options);
|
||||
}
|
||||
@ -283,7 +283,7 @@ widget_get_options (const Widget * w, widget_options_t options)
|
||||
*/
|
||||
|
||||
static inline gboolean
|
||||
widget_get_state (const Widget * w, widget_state_t state)
|
||||
widget_get_state (const Widget *w, widget_state_t state)
|
||||
{
|
||||
return ((w->state & state) == state);
|
||||
}
|
||||
@ -297,7 +297,7 @@ widget_get_state (const Widget * w, widget_state_t state)
|
||||
*/
|
||||
|
||||
static inline void
|
||||
widget_make_global (Widget * w)
|
||||
widget_make_global (Widget *w)
|
||||
{
|
||||
w->make_global (w, NULL);
|
||||
}
|
||||
@ -311,7 +311,7 @@ widget_make_global (Widget * w)
|
||||
*/
|
||||
|
||||
static inline void
|
||||
widget_make_local (Widget * w)
|
||||
widget_make_local (Widget *w)
|
||||
{
|
||||
w->make_local (w, NULL);
|
||||
}
|
||||
@ -328,7 +328,7 @@ widget_make_local (Widget * w)
|
||||
*/
|
||||
|
||||
static inline GList *
|
||||
widget_find (const Widget * w, const Widget * what)
|
||||
widget_find (const Widget *w, const Widget *what)
|
||||
{
|
||||
return w->find (w, what);
|
||||
}
|
||||
@ -345,7 +345,7 @@ widget_find (const Widget * w, const Widget * what)
|
||||
*/
|
||||
|
||||
static inline Widget *
|
||||
widget_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
widget_find_by_type (const Widget *w, widget_cb_fn cb)
|
||||
{
|
||||
return w->find_by_type (w, cb);
|
||||
}
|
||||
@ -361,7 +361,7 @@ widget_find_by_type (const Widget * w, widget_cb_fn cb)
|
||||
*/
|
||||
|
||||
static inline Widget *
|
||||
widget_find_by_id (const Widget * w, unsigned long id)
|
||||
widget_find_by_id (const Widget *w, unsigned long id)
|
||||
{
|
||||
return w->find_by_id (w, id);
|
||||
}
|
||||
@ -378,7 +378,7 @@ widget_find_by_id (const Widget * w, unsigned long id)
|
||||
*/
|
||||
|
||||
static inline cb_ret_t
|
||||
widget_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
widget_set_state (Widget *w, widget_state_t state, gboolean enable)
|
||||
{
|
||||
return w->set_state (w, state, enable);
|
||||
}
|
||||
@ -391,7 +391,7 @@ widget_set_state (Widget * w, widget_state_t state, gboolean enable)
|
||||
*/
|
||||
|
||||
static inline void
|
||||
widget_destroy (Widget * w)
|
||||
widget_destroy (Widget *w)
|
||||
{
|
||||
w->destroy (w);
|
||||
}
|
||||
@ -405,7 +405,7 @@ widget_destroy (Widget * w)
|
||||
* @return color colors
|
||||
*/
|
||||
static inline const int *
|
||||
widget_get_colors (const Widget * w)
|
||||
widget_get_colors (const Widget *w)
|
||||
{
|
||||
return w->get_colors (w);
|
||||
}
|
||||
@ -420,7 +420,7 @@ widget_get_colors (const Widget * w)
|
||||
*/
|
||||
|
||||
static inline gboolean
|
||||
widget_update_cursor (Widget * w)
|
||||
widget_update_cursor (Widget *w)
|
||||
{
|
||||
return (send_message (w, NULL, MSG_CURSOR, 0, NULL) == MSG_HANDLED);
|
||||
}
|
||||
@ -428,7 +428,7 @@ widget_update_cursor (Widget * w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
widget_show (Widget * w)
|
||||
widget_show (Widget *w)
|
||||
{
|
||||
widget_set_visibility (w, TRUE);
|
||||
}
|
||||
@ -436,7 +436,7 @@ widget_show (Widget * w)
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
widget_hide (Widget * w)
|
||||
widget_hide (Widget *w)
|
||||
{
|
||||
widget_set_visibility (w, FALSE);
|
||||
}
|
||||
@ -452,7 +452,7 @@ widget_hide (Widget * w)
|
||||
*/
|
||||
|
||||
static inline gboolean
|
||||
widget_overlapped (const Widget * a, const Widget * b)
|
||||
widget_overlapped (const Widget *a, const Widget *b)
|
||||
{
|
||||
return rects_are_overlapped (&a->rect, &b->rect);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ static int sel_pos = 0;
|
||||
/** default query callback, used to reposition query */
|
||||
|
||||
static cb_ret_t
|
||||
query_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
query_default_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WDialog *h = DIALOG (w);
|
||||
|
||||
@ -447,7 +447,7 @@ message (int flags, const char *title, const char *text, ...)
|
||||
/** Show error message box */
|
||||
|
||||
gboolean
|
||||
mc_error_message (GError ** mcerror, int *code)
|
||||
mc_error_message (GError **mcerror, int *code)
|
||||
{
|
||||
if (mcerror == NULL || *mcerror == NULL)
|
||||
return FALSE;
|
||||
@ -568,7 +568,7 @@ status_msg_create (const char *title, double delay, status_msg_cb init_cb,
|
||||
*/
|
||||
|
||||
void
|
||||
status_msg_destroy (status_msg_t * sm)
|
||||
status_msg_destroy (status_msg_t *sm)
|
||||
{
|
||||
status_msg_deinit (sm);
|
||||
g_free (sm);
|
||||
@ -587,7 +587,7 @@ status_msg_destroy (status_msg_t * sm)
|
||||
*/
|
||||
|
||||
void
|
||||
status_msg_init (status_msg_t * sm, const char *title, double delay, status_msg_cb init_cb,
|
||||
status_msg_init (status_msg_t *sm, const char *title, double delay, status_msg_cb init_cb,
|
||||
status_msg_update_cb update_cb, status_msg_cb deinit_cb)
|
||||
{
|
||||
gint64 start;
|
||||
@ -625,7 +625,7 @@ status_msg_init (status_msg_t * sm, const char *title, double delay, status_msg_
|
||||
*/
|
||||
|
||||
void
|
||||
status_msg_deinit (status_msg_t * sm)
|
||||
status_msg_deinit (status_msg_t *sm)
|
||||
{
|
||||
if (sm == NULL)
|
||||
return;
|
||||
@ -648,7 +648,7 @@ status_msg_deinit (status_msg_t * sm)
|
||||
*/
|
||||
|
||||
int
|
||||
status_msg_common_update (status_msg_t * sm)
|
||||
status_msg_common_update (status_msg_t *sm)
|
||||
{
|
||||
int c;
|
||||
Gpm_Event event;
|
||||
@ -694,7 +694,7 @@ status_msg_common_update (status_msg_t * sm)
|
||||
*/
|
||||
|
||||
void
|
||||
simple_status_msg_init_cb (status_msg_t * sm)
|
||||
simple_status_msg_init_cb (status_msg_t *sm)
|
||||
{
|
||||
simple_status_msg_t *ssm = SIMPLE_STATUS_MSG (sm);
|
||||
Widget *wd = WIDGET (sm->dlg);
|
||||
|
@ -34,6 +34,11 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
# Yury Zaytsev:
|
||||
# Toggle Werror since at some point clang started treating unknown -W
|
||||
# flags as warnings, succeeding with the build, yet issuing an annoying
|
||||
# warning.
|
||||
|
||||
#serial 6
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
@ -41,7 +46,7 @@ AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 -Werror"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
|
@ -42,6 +42,7 @@
|
||||
# flatten
|
||||
# format
|
||||
# format_arg
|
||||
# gnu_format
|
||||
# gnu_inline
|
||||
# hot
|
||||
# ifunc
|
||||
@ -77,7 +78,7 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 9
|
||||
#serial 13
|
||||
|
||||
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
|
||||
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
|
||||
@ -132,7 +133,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
|
||||
int foo( void ) __attribute__(($1));
|
||||
],
|
||||
[fallthrough], [
|
||||
int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }};
|
||||
void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }};
|
||||
],
|
||||
[flatten], [
|
||||
int foo( void ) __attribute__(($1));
|
||||
@ -140,6 +141,9 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
|
||||
[format], [
|
||||
int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
|
||||
],
|
||||
[gnu_format], [
|
||||
int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2)));
|
||||
],
|
||||
[format_arg], [
|
||||
char *foo(const char *p) __attribute__(($1(1)));
|
||||
],
|
||||
@ -224,7 +228,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
|
||||
dnl GCC doesn't exit with an error if an unknown attribute is
|
||||
dnl provided but only outputs a warning, so accept the attribute
|
||||
dnl only if no warning were issued.
|
||||
[AS_IF([test -s conftest.err],
|
||||
[AS_IF([grep -- -Wattributes conftest.err],
|
||||
[AS_VAR_SET([ac_var], [no])],
|
||||
[AS_VAR_SET([ac_var], [yes])])],
|
||||
[AS_VAR_SET([ac_var], [no])])
|
||||
|
@ -13,18 +13,6 @@ AC_DEFUN([mc_CHECK_CFLAGS],[
|
||||
|
||||
mc_configured_cflags=""
|
||||
|
||||
dnl AC_MSG_CHECKING([CC is $CC])
|
||||
|
||||
dnl https://stackoverflow.com/questions/52557417/how-to-check-support-compile-flag-in-autoconf-for-clang
|
||||
case "$CC" in
|
||||
clang*)
|
||||
EXTRA_OPTION="-Werror"
|
||||
;;
|
||||
*)
|
||||
EXTRA_OPTION=""
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Sorted -f options:
|
||||
case "$CC" in
|
||||
gcc*)
|
||||
|
26
po/af.po
26
po/af.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Midnight Commander\n"
|
||||
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
|
||||
"POT-Creation-Date: 2024-04-07 16:41+0300\n"
|
||||
"POT-Creation-Date: 2024-06-02 12:47+0300\n"
|
||||
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Afrikaans (http://app.transifex.com/mc/mc/language/af/)\n"
|
||||
@ -531,27 +531,9 @@ msgid "Changes to file lost"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s is not a directory\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Directory %s is not owned by you\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot set correct permissions for directory %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot create temporary directory %s: %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will be created in %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will not be created\n"
|
||||
msgid ""
|
||||
"Cannot create temporary directory %s: %s.\n"
|
||||
"Temporary files will not be created\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press any key to continue..."
|
||||
|
26
po/ar.po
26
po/ar.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Midnight Commander\n"
|
||||
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
|
||||
"POT-Creation-Date: 2024-04-07 16:41+0300\n"
|
||||
"POT-Creation-Date: 2024-06-02 12:47+0300\n"
|
||||
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Arabic (http://app.transifex.com/mc/mc/language/ar/)\n"
|
||||
@ -532,27 +532,9 @@ msgid "Changes to file lost"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s is not a directory\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Directory %s is not owned by you\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot set correct permissions for directory %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot create temporary directory %s: %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will be created in %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will not be created\n"
|
||||
msgid ""
|
||||
"Cannot create temporary directory %s: %s.\n"
|
||||
"Temporary files will not be created\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press any key to continue..."
|
||||
|
26
po/az.po
26
po/az.po
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Midnight Commander\n"
|
||||
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
|
||||
"POT-Creation-Date: 2024-04-07 16:41+0300\n"
|
||||
"POT-Creation-Date: 2024-06-02 12:47+0300\n"
|
||||
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
|
||||
"Last-Translator: Slava Zanko <slavazanko@gmail.com>, 2011\n"
|
||||
"Language-Team: Azerbaijani (http://app.transifex.com/mc/mc/language/az/)\n"
|
||||
@ -534,27 +534,9 @@ msgid "Changes to file lost"
|
||||
msgstr "Dəyişiklikləri itirdim"
|
||||
|
||||
#, c-format
|
||||
msgid "%s is not a directory\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Directory %s is not owned by you\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot set correct permissions for directory %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot create temporary directory %s: %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will be created in %s\n"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will not be created\n"
|
||||
msgid ""
|
||||
"Cannot create temporary directory %s: %s.\n"
|
||||
"Temporary files will not be created\n"
|
||||
msgstr ""
|
||||
|
||||
msgid "Press any key to continue..."
|
||||
|
48
po/be.po
48
po/be.po
@ -17,7 +17,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Midnight Commander\n"
|
||||
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
|
||||
"POT-Creation-Date: 2024-04-07 16:41+0300\n"
|
||||
"POT-Creation-Date: 2024-06-02 12:47+0300\n"
|
||||
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
|
||||
"Last-Translator: Viačasłaŭ Chalikin <viachaslavic@outlook.com>, 2023-2024\n"
|
||||
"Language-Team: Belarusian (http://app.transifex.com/mc/mc/language/be/)\n"
|
||||
@ -574,30 +574,12 @@ msgstr "Атрыманне файла"
|
||||
msgid "Changes to file lost"
|
||||
msgstr "Змены ў файле былі страчаныя"
|
||||
|
||||
#, c-format
|
||||
msgid "%s is not a directory\n"
|
||||
msgstr "«%s» — не каталог\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Directory %s is not owned by you\n"
|
||||
msgstr "Вы не валодаеце каталогам «%s»\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot set correct permissions for directory %s\n"
|
||||
msgstr "Немагчыма вызначыць правільныя дазволы каталога «%s»\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot create temporary directory %s: %s\n"
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"Cannot create temporary directory %s: %s.\n"
|
||||
"Temporary files will not be created\n"
|
||||
msgstr "Немагчыма стварыць часовы каталог «%s»: %s\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will be created in %s\n"
|
||||
msgstr "Часовыя файлы будуць стварацца ў «%s»\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will not be created\n"
|
||||
msgstr "Часовыя файлы не будуць стварацца\n"
|
||||
|
||||
msgid "Press any key to continue..."
|
||||
msgstr "Каб працягнуць, націсніце хоць-якую клавішу..."
|
||||
|
||||
@ -4767,3 +4749,23 @@ msgstr "Працягваць ад пачатку?"
|
||||
|
||||
msgid "Cannot fetch a local copy of /ftp://some.host/editme.txt"
|
||||
msgstr "Немагчыма атрымаць лакальную копію /ftp://some.host/editme.txt"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "%s is not a directory\n"
|
||||
#~ msgstr "«%s» — не каталог\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Directory %s is not owned by you\n"
|
||||
#~ msgstr "Вы не валодаеце каталогам «%s»\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Cannot set correct permissions for directory %s\n"
|
||||
#~ msgstr "Немагчыма вызначыць правільныя дазволы каталога «%s»\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Temporary files will be created in %s\n"
|
||||
#~ msgstr "Часовыя файлы будуць стварацца ў «%s»\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Temporary files will not be created\n"
|
||||
#~ msgstr "Часовыя файлы не будуць стварацца\n"
|
||||
|
48
po/bg.po
48
po/bg.po
@ -13,7 +13,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Midnight Commander\n"
|
||||
"Report-Msgid-Bugs-To: https://www.midnight-commander.org/\n"
|
||||
"POT-Creation-Date: 2024-04-07 16:41+0300\n"
|
||||
"POT-Creation-Date: 2024-06-02 12:47+0300\n"
|
||||
"PO-Revision-Date: 2010-12-29 10:19+0000\n"
|
||||
"Last-Translator: Alexander Shopov <ash@kambanaria.org>, 2022\n"
|
||||
"Language-Team: Bulgarian (http://app.transifex.com/mc/mc/language/bg/)\n"
|
||||
@ -565,30 +565,12 @@ msgstr "Получавам файл"
|
||||
msgid "Changes to file lost"
|
||||
msgstr "Промените във файла изгубени"
|
||||
|
||||
#, c-format
|
||||
msgid "%s is not a directory\n"
|
||||
msgstr "%s не е директория\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Directory %s is not owned by you\n"
|
||||
msgstr "Директорията %s не се притежава от вас\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot set correct permissions for directory %s\n"
|
||||
msgstr "Не може да се зададат коректни права за директория %s\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Cannot create temporary directory %s: %s\n"
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"Cannot create temporary directory %s: %s.\n"
|
||||
"Temporary files will not be created\n"
|
||||
msgstr "Не може да се създаде временна директория %s: %s\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will be created in %s\n"
|
||||
msgstr "Временни файлове ще бъдат създадени в %s\n"
|
||||
|
||||
#, c-format
|
||||
msgid "Temporary files will not be created\n"
|
||||
msgstr "Временни файлове няма да бъдат създадени\n"
|
||||
|
||||
msgid "Press any key to continue..."
|
||||
msgstr "Натиснете клавиш, за да продължите…"
|
||||
|
||||
@ -4731,3 +4713,23 @@ msgstr "Да се продължи ли от началото?"
|
||||
|
||||
msgid "Cannot fetch a local copy of /ftp://some.host/editme.txt"
|
||||
msgstr "Не може да се изтегли локално копие на „/ftp://some.host/editme.txt“"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "%s is not a directory\n"
|
||||
#~ msgstr "%s не е директория\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Directory %s is not owned by you\n"
|
||||
#~ msgstr "Директорията %s не се притежава от вас\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Cannot set correct permissions for directory %s\n"
|
||||
#~ msgstr "Не може да се зададат коректни права за директория %s\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Temporary files will be created in %s\n"
|
||||
#~ msgstr "Временни файлове ще бъдат създадени в %s\n"
|
||||
|
||||
#, c-format
|
||||
#~ msgid "Temporary files will not be created\n"
|
||||
#~ msgstr "Временни файлове няма да бъдат създадени\n"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user