mirror of https://github.com/MidnightCommander/mc
Indentation using GNU indent-2.2.13.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ce299bbee9
commit
6718b3ec26
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -310,7 +310,7 @@ 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)
|
||||
mc_g_string_append_c_len (GString *s, gchar c, guint len)
|
||||
{
|
||||
g_return_val_if_fail (s != NULL, NULL);
|
||||
|
||||
|
|
|
@ -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,7 +47,7 @@
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GString *
|
||||
mc_search__glob_translate_to_regex (const GString * astr)
|
||||
mc_search__glob_translate_to_regex (const GString *astr)
|
||||
{
|
||||
GString *buff;
|
||||
gsize loop;
|
||||
|
@ -166,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;
|
||||
|
||||
|
@ -187,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);
|
||||
}
|
||||
|
@ -196,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;
|
||||
|
||||
|
@ -83,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);
|
||||
|
@ -93,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;
|
||||
|
@ -281,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);
|
||||
}
|
||||
|
@ -289,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);
|
||||
}
|
||||
|
@ -297,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);
|
||||
}
|
||||
|
@ -305,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;
|
||||
|
||||
|
@ -320,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);
|
||||
}
|
||||
|
@ -328,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);
|
||||
|
@ -340,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);
|
||||
}
|
||||
|
@ -749,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);
|
||||
}
|
||||
|
@ -757,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);
|
||||
}
|
||||
|
@ -987,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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
27
lib/util.c
27
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;
|
||||
|
@ -452,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;
|
||||
|
@ -593,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;
|
||||
|
@ -1025,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;
|
||||
|
@ -1096,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;
|
||||
|
||||
|
@ -1136,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;
|
||||
|
@ -1227,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;
|
||||
|
@ -1271,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;
|
||||
|
@ -1474,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)
|
||||
{
|
||||
|
@ -1500,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)
|
||||
{
|
||||
|
@ -1529,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;
|
||||
|
@ -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;
|
||||
|
|
|
@ -240,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;
|
||||
|
@ -540,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)
|
||||
|
@ -635,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;
|
||||
|
@ -727,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);
|
||||
}
|
||||
|
@ -814,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;
|
||||
}
|
||||
|
@ -827,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);
|
||||
|
@ -848,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;
|
||||
|
||||
|
@ -882,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);
|
||||
|
||||
|
@ -915,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;
|
||||
|
@ -946,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;
|
||||
|
@ -980,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;
|
||||
|
@ -1022,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;
|
||||
|
||||
|
@ -1080,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);
|
||||
}
|
||||
|
@ -1095,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;
|
||||
|
||||
|
@ -1131,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;
|
||||
|
@ -1186,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;
|
||||
|
@ -1295,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;
|
||||
|
@ -1329,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;
|
||||
|
@ -1373,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;
|
||||
|
@ -1417,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;
|
||||
|
@ -1499,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;
|
||||
|
@ -1525,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;
|
||||
|
||||
|
@ -1574,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;
|
||||
|
||||
|
@ -1605,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;
|
||||
|
@ -1633,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;
|
||||
|
@ -1659,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;
|
||||
|
@ -1677,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;
|
||||
|
||||
|
@ -607,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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -398,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];
|
||||
|
@ -794,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;
|
||||
|
@ -834,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, '`');
|
||||
|
@ -865,7 +865,7 @@ try_complete_find_start_sign (try_complete_automation_state_t * state)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GPtrArray *
|
||||
try_complete_all_possible (try_complete_automation_state_t * state, char *text, int *lc_start)
|
||||
try_complete_all_possible (try_complete_automation_state_t *state, char *text, int *lc_start)
|
||||
{
|
||||
GPtrArray *matches = NULL;
|
||||
|
||||
|
@ -936,7 +936,7 @@ try_complete_all_possible (try_complete_automation_state_t * state, char *text,
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
insert_text (WInput * in, const char *text, ssize_t size)
|
||||
insert_text (WInput *in, const char *text, ssize_t size)
|
||||
{
|
||||
size_t text_len;
|
||||
int buff_len;
|
||||
|
@ -986,7 +986,7 @@ insert_text (WInput * in, const 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;
|
||||
|
||||
|
@ -1166,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);
|
||||
|
@ -1377,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;
|
||||
|
@ -1416,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;
|
||||
|
||||
|
@ -1440,7 +1440,7 @@ input_complete (WInput * in)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
input_complete_free (WInput * in)
|
||||
input_complete_free (WInput *in)
|
||||
{
|
||||
if (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)
|
||||
{
|
||||
|
@ -819,7 +819,7 @@ listbox_remove_list (WListbox * l)
|
|||
* @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);
|
||||
|
@ -842,7 +842,7 @@ listbox_add_item (WListbox * l, listbox_append_t pos, int hotkey, const char *te
|
|||
* @returns pointer to @text.
|
||||
*/
|
||||
char *
|
||||
listbox_add_item_take (WListbox * l, listbox_append_t pos, int hotkey, char *text, void *data,
|
||||
listbox_add_item_take (WListbox *l, listbox_append_t pos, int hotkey, char *text, void *data,
|
||||
gboolean free_data)
|
||||
{
|
||||
WLEntry *entry;
|
||||
|
|
|
@ -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);
|
||||
|
|
14
src/args.c
14
src/args.c
|
@ -423,8 +423,8 @@ mc_args_add_extended_info_to_help (void)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static GString *
|
||||
mc_args__convert_help_to_syscharset (const gchar * charset, const gchar * error_message_str,
|
||||
const gchar * help_str)
|
||||
mc_args__convert_help_to_syscharset (const gchar *charset, const gchar *error_message_str,
|
||||
const gchar *help_str)
|
||||
{
|
||||
GString *buffer;
|
||||
GIConv conv;
|
||||
|
@ -445,8 +445,7 @@ mc_args__convert_help_to_syscharset (const gchar * charset, const gchar * error_
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
parse_mc_e_argument (const gchar * option_name, const gchar * value, gpointer data,
|
||||
GError ** mcerror)
|
||||
parse_mc_e_argument (const gchar *option_name, const gchar *value, gpointer data, GError **mcerror)
|
||||
{
|
||||
(void) option_name;
|
||||
(void) value;
|
||||
|
@ -462,8 +461,7 @@ parse_mc_e_argument (const gchar * option_name, const gchar * value, gpointer da
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
parse_mc_v_argument (const gchar * option_name, const gchar * value, gpointer data,
|
||||
GError ** mcerror)
|
||||
parse_mc_v_argument (const gchar *option_name, const gchar *value, gpointer data, GError **mcerror)
|
||||
{
|
||||
(void) option_name;
|
||||
(void) value;
|
||||
|
@ -618,7 +616,7 @@ mc_setup_run_mode (char **argv)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_args_parse (int *argc, char ***argv, const char *translation_domain, GError ** mcerror)
|
||||
mc_args_parse (int *argc, char ***argv, const char *translation_domain, GError **mcerror)
|
||||
{
|
||||
const gchar *_system_codepage;
|
||||
gboolean ok = TRUE;
|
||||
|
@ -734,7 +732,7 @@ mc_args_show_info (void)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
mc_setup_by_args (int argc, char **argv, GError ** mcerror)
|
||||
mc_setup_by_args (int argc, char **argv, GError **mcerror)
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ TaskList *task_list = NULL;
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
register_task_running (file_op_context_t * ctx, pid_t pid, int fd, int to_child, char *info)
|
||||
register_task_running (file_op_context_t *ctx, pid_t pid, int fd, int to_child, char *info)
|
||||
{
|
||||
TaskList *new;
|
||||
|
||||
|
@ -404,7 +404,7 @@ background_attention (int fd, void *closure)
|
|||
*/
|
||||
|
||||
static void
|
||||
parent_call_header (void *routine, int argc, enum ReturnType type, file_op_context_t * ctx)
|
||||
parent_call_header (void *routine, int argc, enum ReturnType type, file_op_context_t *ctx)
|
||||
{
|
||||
int have_ctx;
|
||||
ssize_t ret;
|
||||
|
@ -518,7 +518,7 @@ unregister_task_with_pid (pid_t pid)
|
|||
* -1 on failure
|
||||
*/
|
||||
int
|
||||
do_background (file_op_context_t * ctx, char *info)
|
||||
do_background (file_op_context_t *ctx, char *info)
|
||||
{
|
||||
int comm[2]; /* control connection stream */
|
||||
int back_comm[2]; /* back connection */
|
||||
|
@ -594,7 +594,7 @@ do_background (file_op_context_t * ctx, char *info)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
parent_call (void *routine, file_op_context_t * ctx, int argc, ...)
|
||||
parent_call (void *routine, file_op_context_t *ctx, int argc, ...)
|
||||
{
|
||||
int ret;
|
||||
va_list ap;
|
||||
|
@ -625,7 +625,7 @@ parent_call_string (void *routine, int argc, ...)
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
background_parent_call (const gchar * event_group_name, const gchar * event_name,
|
||||
background_parent_call (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
ev_background_parent_call_t *event_data = (ev_background_parent_call_t *) data;
|
||||
|
@ -644,7 +644,7 @@ background_parent_call (const gchar * event_group_name, const gchar * event_name
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
background_parent_call_string (const gchar * event_group_name, const gchar * event_name,
|
||||
background_parent_call_string (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
ev_background_parent_call_t *event_data = (ev_background_parent_call_t *) data;
|
||||
|
|
|
@ -69,7 +69,7 @@ static const mode_t clip_open_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
clipboard_file_to_ext_clip (const gchar * event_group_name, const gchar * event_name,
|
||||
clipboard_file_to_ext_clip (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
char *tmp, *cmd;
|
||||
|
@ -97,7 +97,7 @@ clipboard_file_to_ext_clip (const gchar * event_group_name, const gchar * event_
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
clipboard_file_from_ext_clip (const gchar * event_group_name, const gchar * event_name,
|
||||
clipboard_file_from_ext_clip (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
mc_pipe_t *p;
|
||||
|
@ -171,7 +171,7 @@ clipboard_file_from_ext_clip (const gchar * event_group_name, const gchar * even
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
clipboard_text_to_file (const gchar * event_group_name, const gchar * event_name,
|
||||
clipboard_text_to_file (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
int file;
|
||||
|
@ -208,7 +208,7 @@ clipboard_text_to_file (const gchar * event_group_name, const gchar * event_name
|
|||
|
||||
/* event callback */
|
||||
gboolean
|
||||
clipboard_text_from_file (const gchar * event_group_name, const gchar * event_name,
|
||||
clipboard_text_from_file (const gchar *event_group_name, const gchar *event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
char buf[BUF_LARGE];
|
||||
|
|
|
@ -145,7 +145,7 @@ send_contents (char *buffer, unsigned int columns, unsigned int rows)
|
|||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void __attribute__ ((noreturn)) die (void)
|
||||
static void __attribute__((noreturn)) die (void)
|
||||
{
|
||||
unsigned char zero = 0;
|
||||
ssize_t ret;
|
||||
|
|
|
@ -72,7 +72,7 @@ static mcdiffview_search_options_t mcdiffview_search_options = {
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mcdiffview_dialog_search (WDiff * dview)
|
||||
mcdiffview_dialog_search (WDiff *dview)
|
||||
{
|
||||
char *exp = NULL;
|
||||
int qd_result;
|
||||
|
@ -144,7 +144,7 @@ mcdiffview_dialog_search (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
mcdiffview_do_search_backward (WDiff * dview)
|
||||
mcdiffview_do_search_backward (WDiff *dview)
|
||||
{
|
||||
ssize_t ind;
|
||||
|
||||
|
@ -179,7 +179,7 @@ mcdiffview_do_search_backward (WDiff * dview)
|
|||
|
||||
|
||||
static gboolean
|
||||
mcdiffview_do_search_forward (WDiff * dview)
|
||||
mcdiffview_do_search_forward (WDiff *dview)
|
||||
{
|
||||
size_t ind;
|
||||
|
||||
|
@ -191,7 +191,7 @@ mcdiffview_do_search_forward (WDiff * dview)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
for (ind = (size_t)++ dview->search.last_accessed_num_line; ind < dview->a[dview->ord]->len;
|
||||
for (ind = (size_t) ++dview->search.last_accessed_num_line; ind < dview->a[dview->ord]->len;
|
||||
ind++)
|
||||
{
|
||||
DIFFLN *p;
|
||||
|
@ -213,7 +213,7 @@ mcdiffview_do_search_forward (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
mcdiffview_do_search (WDiff * dview)
|
||||
mcdiffview_do_search (WDiff *dview)
|
||||
{
|
||||
gboolean present_result = FALSE;
|
||||
|
||||
|
@ -242,7 +242,7 @@ mcdiffview_do_search (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dview_search_cmd (WDiff * dview)
|
||||
dview_search_cmd (WDiff *dview)
|
||||
{
|
||||
if (dview->dsrc != DATA_SRC_MEM)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ dview_search_cmd (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
dview_continue_search_cmd (WDiff * dview)
|
||||
dview_continue_search_cmd (WDiff *dview)
|
||||
{
|
||||
if (dview->dsrc != DATA_SRC_MEM)
|
||||
error_dialog (_("Search"), _("Search is disabled"));
|
||||
|
|
|
@ -135,7 +135,7 @@ fill_by_space (char *buf, size_t n, gboolean zero_terminate)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
rewrite_backup_content (const vfs_path_t * from_file_name_vpath, const char *to_file_name)
|
||||
rewrite_backup_content (const vfs_path_t *from_file_name_vpath, const char *to_file_name)
|
||||
{
|
||||
FILE *backup_fd;
|
||||
char *contents;
|
||||
|
@ -235,7 +235,7 @@ dview_fdopen (int fd)
|
|||
*/
|
||||
|
||||
static int
|
||||
dview_ffree (FBUF * fs)
|
||||
dview_ffree (FBUF *fs)
|
||||
{
|
||||
int rv = 0;
|
||||
|
||||
|
@ -326,7 +326,7 @@ dview_fopen (const char *filename, int flags)
|
|||
*/
|
||||
|
||||
static size_t
|
||||
dview_fgets (char *buf, size_t size, FBUF * fs)
|
||||
dview_fgets (char *buf, size_t size, FBUF *fs)
|
||||
{
|
||||
size_t j = 0;
|
||||
|
||||
|
@ -368,7 +368,7 @@ dview_fgets (char *buf, size_t size, FBUF * fs)
|
|||
*/
|
||||
|
||||
static off_t
|
||||
dview_fseek (FBUF * fs, off_t off, int whence)
|
||||
dview_fseek (FBUF *fs, off_t off, int whence)
|
||||
{
|
||||
off_t rv;
|
||||
|
||||
|
@ -407,7 +407,7 @@ dview_fseek (FBUF * fs, off_t off, int whence)
|
|||
*/
|
||||
|
||||
static off_t
|
||||
dview_freset (FBUF * fs)
|
||||
dview_freset (FBUF *fs)
|
||||
{
|
||||
off_t rv;
|
||||
|
||||
|
@ -431,7 +431,7 @@ dview_freset (FBUF * fs)
|
|||
*/
|
||||
|
||||
static ssize_t
|
||||
dview_fwrite (FBUF * fs, const char *buf, size_t size)
|
||||
dview_fwrite (FBUF *fs, const char *buf, size_t size)
|
||||
{
|
||||
ssize_t rv;
|
||||
|
||||
|
@ -453,7 +453,7 @@ dview_fwrite (FBUF * fs, const char *buf, size_t size)
|
|||
*/
|
||||
|
||||
static off_t
|
||||
dview_ftrunc (FBUF * fs)
|
||||
dview_ftrunc (FBUF *fs)
|
||||
{
|
||||
off_t off;
|
||||
|
||||
|
@ -482,7 +482,7 @@ dview_ftrunc (FBUF * fs)
|
|||
*/
|
||||
|
||||
static int
|
||||
dview_fclose (FBUF * fs)
|
||||
dview_fclose (FBUF *fs)
|
||||
{
|
||||
int rv = -1;
|
||||
|
||||
|
@ -547,7 +547,7 @@ dview_popen (const char *cmd, int flags)
|
|||
*/
|
||||
|
||||
static int
|
||||
dview_pclose (FBUF * fs)
|
||||
dview_pclose (FBUF *fs)
|
||||
{
|
||||
int rv = -1;
|
||||
|
||||
|
@ -690,7 +690,7 @@ scan_deci (const char **str, int *n)
|
|||
*/
|
||||
|
||||
static int
|
||||
scan_line (const char *p, GArray * ops)
|
||||
scan_line (const char *p, GArray *ops)
|
||||
{
|
||||
DIFFCMD op;
|
||||
|
||||
|
@ -765,7 +765,7 @@ scan_line (const char *p, GArray * ops)
|
|||
*/
|
||||
|
||||
static int
|
||||
scan_diff (FBUF * f, GArray * ops)
|
||||
scan_diff (FBUF *f, GArray *ops)
|
||||
{
|
||||
int sz;
|
||||
char buf[BUFSIZ];
|
||||
|
@ -804,8 +804,7 @@ scan_diff (FBUF * f, GArray * ops)
|
|||
*/
|
||||
|
||||
static int
|
||||
dff_execute (const char *args, const char *extra, const char *file1, const char *file2,
|
||||
GArray * ops)
|
||||
dff_execute (const char *args, const char *extra, const char *file1, const char *file2, GArray *ops)
|
||||
{
|
||||
static const char *opt =
|
||||
" --old-group-format='%df%(f=l?:,%dl)d%dE\n'"
|
||||
|
@ -847,7 +846,7 @@ dff_execute (const char *args, const char *extra, const char *file1, const char
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
printer_for (char ch, DFUNC printer, void *ctx, FBUF * f, int *line, off_t * off)
|
||||
printer_for (char ch, DFUNC printer, void *ctx, FBUF *f, int *line, off_t *off)
|
||||
{
|
||||
size_t sz;
|
||||
char buf[BUFSIZ];
|
||||
|
@ -891,7 +890,7 @@ printer_for (char ch, DFUNC printer, void *ctx, FBUF * f, int *line, off_t * off
|
|||
*/
|
||||
|
||||
static int
|
||||
dff_reparse (diff_place_t ord, const char *filename, const GArray * ops, DFUNC printer, void *ctx)
|
||||
dff_reparse (diff_place_t ord, const char *filename, const GArray *ops, DFUNC printer, void *ctx)
|
||||
{
|
||||
size_t i;
|
||||
FBUF *f;
|
||||
|
@ -1000,7 +999,7 @@ dff_reparse (diff_place_t ord, const char *filename, const GArray * ops, DFUNC p
|
|||
*/
|
||||
|
||||
static int
|
||||
lcsubstr (const char *s, int m, const char *t, int n, GArray * ret, int min)
|
||||
lcsubstr (const char *s, int m, const char *t, int n, GArray *ret, int min)
|
||||
{
|
||||
int i, j;
|
||||
int *Lprev, *Lcurr;
|
||||
|
@ -1097,7 +1096,7 @@ lcsubstr (const char *s, int m, const char *t, int n, GArray * ret, int min)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
hdiff_multi (const char *s, const char *t, const BRACKET bracket, int min, GArray * hdiff,
|
||||
hdiff_multi (const char *s, const char *t, const BRACKET bracket, int min, GArray *hdiff,
|
||||
unsigned int depth)
|
||||
{
|
||||
BRACKET p;
|
||||
|
@ -1175,7 +1174,7 @@ hdiff_multi (const char *s, const char *t, const BRACKET bracket, int min, GArra
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
hdiff_scan (const char *s, int m, const char *t, int n, int min, GArray * hdiff, unsigned int depth)
|
||||
hdiff_scan (const char *s, int m, const char *t, int n, int min, GArray *hdiff, unsigned int depth)
|
||||
{
|
||||
int i;
|
||||
BRACKET b;
|
||||
|
@ -1210,7 +1209,7 @@ hdiff_scan (const char *s, int m, const char *t, int n, int min, GArray * hdiff,
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
is_inside (int k, GArray * hdiff, diff_place_t ord)
|
||||
is_inside (int k, GArray *hdiff, diff_place_t ord)
|
||||
{
|
||||
size_t i;
|
||||
BRACKET *b;
|
||||
|
@ -1422,7 +1421,7 @@ cvt_mget (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int
|
|||
|
||||
static int
|
||||
cvt_mgeta (const char *src, size_t srcsize, char *dst, int dstsize, int skip, int ts,
|
||||
gboolean show_cr, GArray * hdiff, diff_place_t ord, char *att)
|
||||
gboolean show_cr, GArray *hdiff, diff_place_t ord, char *att)
|
||||
{
|
||||
int sz = 0;
|
||||
|
||||
|
@ -1519,7 +1518,7 @@ cvt_mgeta (const char *src, size_t srcsize, char *dst, int dstsize, int skip, in
|
|||
*/
|
||||
|
||||
static int
|
||||
cvt_fget (FBUF * f, off_t off, char *dst, size_t dstsize, int skip, int ts, gboolean show_cr)
|
||||
cvt_fget (FBUF *f, off_t off, char *dst, size_t dstsize, int skip, int ts, gboolean show_cr)
|
||||
{
|
||||
int base = 0;
|
||||
int old_base = base;
|
||||
|
@ -1682,7 +1681,7 @@ printer (void *ctx, int ch, int line, off_t off, size_t sz, const char *str)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
redo_diff (WDiff * dview)
|
||||
redo_diff (WDiff *dview)
|
||||
{
|
||||
FBUF *const *f = dview->f;
|
||||
PRINTER_CTX ctx;
|
||||
|
@ -1781,7 +1780,7 @@ redo_diff (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
destroy_hdiff (WDiff * dview)
|
||||
destroy_hdiff (WDiff *dview)
|
||||
{
|
||||
if (dview->hdiff != NULL)
|
||||
{
|
||||
|
@ -1823,7 +1822,7 @@ get_digits (unsigned int n)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
get_line_numbers (const GArray * a, size_t pos, int *linenum, int *lineofs)
|
||||
get_line_numbers (const GArray *a, size_t pos, int *linenum, int *lineofs)
|
||||
{
|
||||
const DIFFLN *p;
|
||||
|
||||
|
@ -1858,7 +1857,7 @@ get_line_numbers (const GArray * a, size_t pos, int *linenum, int *lineofs)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
calc_nwidth (const GArray * const *a)
|
||||
calc_nwidth (const GArray *const *a)
|
||||
{
|
||||
int l1, o1;
|
||||
int l2, o2;
|
||||
|
@ -1873,7 +1872,7 @@ calc_nwidth (const GArray * const *a)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
find_prev_hunk (const GArray * a, int pos)
|
||||
find_prev_hunk (const GArray *a, int pos)
|
||||
{
|
||||
#if 1
|
||||
for (; pos > 0 && ((DIFFLN *) & g_array_index (a, DIFFLN, pos))->ch != EQU_CH; pos--)
|
||||
|
@ -1897,7 +1896,7 @@ find_prev_hunk (const GArray * a, int pos)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static size_t
|
||||
find_next_hunk (const GArray * a, size_t pos)
|
||||
find_next_hunk (const GArray *a, size_t pos)
|
||||
{
|
||||
for (; pos < a->len && ((DIFFLN *) & g_array_index (a, DIFFLN, pos))->ch != EQU_CH; pos++)
|
||||
;
|
||||
|
@ -1919,7 +1918,7 @@ find_next_hunk (const GArray * a, size_t pos)
|
|||
*/
|
||||
|
||||
static int
|
||||
get_current_hunk (WDiff * dview, int *start_line1, int *end_line1, int *start_line2, int *end_line2)
|
||||
get_current_hunk (WDiff *dview, int *start_line1, int *end_line1, int *start_line2, int *end_line2)
|
||||
{
|
||||
const GArray *a0 = dview->a[DIFF_LEFT];
|
||||
const GArray *a1 = dview->a[DIFF_RIGHT];
|
||||
|
@ -1987,7 +1986,7 @@ get_current_hunk (WDiff * dview, int *start_line1, int *end_line1, int *start_li
|
|||
*/
|
||||
|
||||
static void
|
||||
dview_remove_hunk (WDiff * dview, FILE * merge_file, int from1, int to1,
|
||||
dview_remove_hunk (WDiff *dview, FILE *merge_file, int from1, int to1,
|
||||
action_direction_t merge_direction)
|
||||
{
|
||||
int line;
|
||||
|
@ -2024,7 +2023,7 @@ dview_remove_hunk (WDiff * dview, FILE * merge_file, int from1, int to1,
|
|||
*/
|
||||
|
||||
static void
|
||||
dview_add_hunk (WDiff * dview, FILE * merge_file, int from1, int from2, int to2,
|
||||
dview_add_hunk (WDiff *dview, FILE *merge_file, int from1, int from2, int to2,
|
||||
action_direction_t merge_direction)
|
||||
{
|
||||
int line;
|
||||
|
@ -2071,7 +2070,7 @@ dview_add_hunk (WDiff * dview, FILE * merge_file, int from1, int from2, int to2,
|
|||
*/
|
||||
|
||||
static void
|
||||
dview_replace_hunk (WDiff * dview, FILE * merge_file, int from1, int to1, int from2, int to2,
|
||||
dview_replace_hunk (WDiff *dview, FILE *merge_file, int from1, int to1, int from2, int to2,
|
||||
action_direction_t merge_direction)
|
||||
{
|
||||
int line1, line2;
|
||||
|
@ -2116,7 +2115,7 @@ dview_replace_hunk (WDiff * dview, FILE * merge_file, int from1, int to1, int fr
|
|||
*/
|
||||
|
||||
static void
|
||||
do_merge_hunk (WDiff * dview, action_direction_t merge_direction)
|
||||
do_merge_hunk (WDiff *dview, action_direction_t merge_direction)
|
||||
{
|
||||
int from1, to1, from2, to2;
|
||||
int hunk;
|
||||
|
@ -2192,7 +2191,7 @@ do_merge_hunk (WDiff * dview, action_direction_t merge_direction)
|
|||
/* view routines and callbacks ********************************************** */
|
||||
|
||||
static void
|
||||
dview_compute_split (WDiff * dview, int i)
|
||||
dview_compute_split (WDiff *dview, int i)
|
||||
{
|
||||
dview->bias += i;
|
||||
if (dview->bias < 2 - dview->half1)
|
||||
|
@ -2204,7 +2203,7 @@ dview_compute_split (WDiff * dview, int i)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_compute_areas (WDiff * dview)
|
||||
dview_compute_areas (WDiff *dview)
|
||||
{
|
||||
Widget *w = WIDGET (dview);
|
||||
|
||||
|
@ -2218,7 +2217,7 @@ dview_compute_areas (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_reread (WDiff * dview)
|
||||
dview_reread (WDiff *dview)
|
||||
{
|
||||
int ndiff;
|
||||
|
||||
|
@ -2242,7 +2241,7 @@ dview_reread (WDiff * dview)
|
|||
|
||||
#ifdef HAVE_CHARSET
|
||||
static void
|
||||
dview_set_codeset (WDiff * dview)
|
||||
dview_set_codeset (WDiff *dview)
|
||||
{
|
||||
const char *encoding_id = NULL;
|
||||
|
||||
|
@ -2268,7 +2267,7 @@ dview_set_codeset (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_select_encoding (WDiff * dview)
|
||||
dview_select_encoding (WDiff *dview)
|
||||
{
|
||||
if (do_select_codepage ())
|
||||
dview_set_codeset (dview);
|
||||
|
@ -2281,7 +2280,7 @@ dview_select_encoding (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_load_options (WDiff * dview)
|
||||
dview_load_options (WDiff *dview)
|
||||
{
|
||||
gboolean show_numbers;
|
||||
int tab_size;
|
||||
|
@ -2316,7 +2315,7 @@ dview_load_options (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_save_options (WDiff * dview)
|
||||
dview_save_options (WDiff *dview)
|
||||
{
|
||||
mc_config_set_bool (mc_global.main_config, "DiffView", "show_symbols", dview->display_symbols);
|
||||
mc_config_set_bool (mc_global.main_config, "DiffView", "show_numbers",
|
||||
|
@ -2340,7 +2339,7 @@ dview_save_options (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_diff_options (WDiff * dview)
|
||||
dview_diff_options (WDiff *dview)
|
||||
{
|
||||
const char *quality_str[] = {
|
||||
N_("No&rmal"),
|
||||
|
@ -2380,7 +2379,7 @@ dview_diff_options (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
dview_init (WDiff * dview, const char *args, const char *file1, const char *file2,
|
||||
dview_init (WDiff *dview, const char *args, const char *file1, const char *file2,
|
||||
const char *label1, const char *label2, DSRC dsrc)
|
||||
{
|
||||
FBUF *f[DIFF_COUNT];
|
||||
|
@ -2461,7 +2460,7 @@ dview_init (WDiff * dview, const char *args, const char *file1, const char *file
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_fini (WDiff * dview)
|
||||
dview_fini (WDiff *dview)
|
||||
{
|
||||
if (dview->dsrc != DATA_SRC_MEM)
|
||||
{
|
||||
|
@ -2493,7 +2492,7 @@ dview_fini (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
dview_display_file (const WDiff * dview, diff_place_t ord, int r, int c, int height, int width)
|
||||
dview_display_file (const WDiff *dview, diff_place_t ord, int r, int c, int height, int width)
|
||||
{
|
||||
size_t i, k;
|
||||
int j;
|
||||
|
@ -2725,7 +2724,7 @@ dview_display_file (const WDiff * dview, diff_place_t ord, int r, int c, int hei
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_status (const WDiff * dview, diff_place_t ord, int width, int c)
|
||||
dview_status (const WDiff *dview, diff_place_t ord, int width, int c)
|
||||
{
|
||||
const char *buf;
|
||||
int filename_width;
|
||||
|
@ -2758,7 +2757,7 @@ dview_status (const WDiff * dview, diff_place_t ord, int width, int c)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_redo (WDiff * dview)
|
||||
dview_redo (WDiff *dview)
|
||||
{
|
||||
if (dview->display_numbers != 0)
|
||||
{
|
||||
|
@ -2774,7 +2773,7 @@ dview_redo (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_update (WDiff * dview)
|
||||
dview_update (WDiff *dview)
|
||||
{
|
||||
int height = dview->height;
|
||||
int width1, width2;
|
||||
|
@ -2858,7 +2857,7 @@ dview_update (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_edit (WDiff * dview, diff_place_t ord)
|
||||
dview_edit (WDiff *dview, diff_place_t ord)
|
||||
{
|
||||
Widget *h;
|
||||
gboolean h_modal;
|
||||
|
@ -2894,7 +2893,7 @@ dview_edit (WDiff * dview, diff_place_t ord)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_goto_cmd (WDiff * dview, diff_place_t ord)
|
||||
dview_goto_cmd (WDiff *dview, diff_place_t ord)
|
||||
{
|
||||
static gboolean first_run = TRUE;
|
||||
|
||||
|
@ -2941,7 +2940,7 @@ dview_goto_cmd (WDiff * dview, diff_place_t ord)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_labels (WDiff * dview)
|
||||
dview_labels (WDiff *dview)
|
||||
{
|
||||
Widget *d = WIDGET (dview);
|
||||
WButtonBar *b;
|
||||
|
@ -2960,7 +2959,7 @@ dview_labels (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
dview_save (WDiff * dview)
|
||||
dview_save (WDiff *dview)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
||||
|
@ -2980,7 +2979,7 @@ dview_save (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_do_save (WDiff * dview)
|
||||
dview_do_save (WDiff *dview)
|
||||
{
|
||||
(void) dview_save (dview);
|
||||
}
|
||||
|
@ -2992,7 +2991,7 @@ dview_do_save (WDiff * dview)
|
|||
* ask user.
|
||||
*/
|
||||
static gboolean
|
||||
dview_ok_to_exit (WDiff * dview)
|
||||
dview_ok_to_exit (WDiff *dview)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
int act;
|
||||
|
@ -3034,7 +3033,7 @@ dview_ok_to_exit (WDiff * dview)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dview_execute_cmd (WDiff * dview, long command)
|
||||
dview_execute_cmd (WDiff *dview, long command)
|
||||
{
|
||||
cb_ret_t res = MSG_HANDLED;
|
||||
|
||||
|
@ -3198,7 +3197,7 @@ dview_execute_cmd (WDiff * dview, long command)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dview_handle_key (WDiff * dview, int key)
|
||||
dview_handle_key (WDiff *dview, int key)
|
||||
{
|
||||
long command;
|
||||
|
||||
|
@ -3216,7 +3215,7 @@ dview_handle_key (WDiff * dview, int key)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
dview_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WDiff *dview = (WDiff *) w;
|
||||
WDialog *h = DIALOG (w->owner);
|
||||
|
@ -3268,7 +3267,7 @@ dview_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
dview_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
dview_mouse_callback (Widget *w, mouse_msg_t msg, mouse_event_t *event)
|
||||
{
|
||||
WDiff *dview = (WDiff *) w;
|
||||
|
||||
|
@ -3295,7 +3294,7 @@ dview_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
dview_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
dview_dialog_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WDiff *dview;
|
||||
WDialog *h = DIALOG (w);
|
||||
|
@ -3325,7 +3324,7 @@ dview_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
dview_get_title (const WDialog * h, size_t len)
|
||||
dview_get_title (const WDialog *h, size_t len)
|
||||
{
|
||||
const WDiff *dview;
|
||||
const char *modified = " (*) ";
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
by book_mark_found() i.e. last in is the one seen */
|
||||
|
||||
static edit_book_mark_t *
|
||||
double_marks (WEdit * edit, edit_book_mark_t * p)
|
||||
double_marks (WEdit *edit, edit_book_mark_t *p)
|
||||
{
|
||||
(void) edit;
|
||||
|
||||
|
@ -79,7 +79,7 @@ double_marks (WEdit * edit, edit_book_mark_t * p)
|
|||
/** returns the first bookmark on or before this line */
|
||||
|
||||
edit_book_mark_t *
|
||||
book_mark_find (WEdit * edit, long line)
|
||||
book_mark_find (WEdit *edit, long line)
|
||||
{
|
||||
edit_book_mark_t *p;
|
||||
|
||||
|
@ -151,7 +151,7 @@ book_mark_find (WEdit * edit, long line)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
book_mark_query_color (WEdit * edit, long line, int c)
|
||||
book_mark_query_color (WEdit *edit, long line, int c)
|
||||
{
|
||||
if (edit->book_mark != NULL)
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ book_mark_query_color (WEdit * edit, long line, int c)
|
|||
/** insert a bookmark at this line */
|
||||
|
||||
void
|
||||
book_mark_insert (WEdit * edit, long line, int c)
|
||||
book_mark_insert (WEdit *edit, long line, int c)
|
||||
{
|
||||
edit_book_mark_t *p, *q;
|
||||
|
||||
|
@ -215,7 +215,7 @@ book_mark_insert (WEdit * edit, long line, int c)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
book_mark_clear (WEdit * edit, long line, int c)
|
||||
book_mark_clear (WEdit *edit, long line, int c)
|
||||
{
|
||||
edit_book_mark_t *p, *q;
|
||||
gboolean r = FALSE;
|
||||
|
@ -249,7 +249,7 @@ book_mark_clear (WEdit * edit, long line, int c)
|
|||
/** clear all bookmarks matching this color, if c is -1 clears all */
|
||||
|
||||
void
|
||||
book_mark_flush (WEdit * edit, int c)
|
||||
book_mark_flush (WEdit *edit, int c)
|
||||
{
|
||||
edit_book_mark_t *p, *q;
|
||||
|
||||
|
@ -280,7 +280,7 @@ book_mark_flush (WEdit * edit, int c)
|
|||
/** shift down bookmarks after this line */
|
||||
|
||||
void
|
||||
book_mark_inc (WEdit * edit, long line)
|
||||
book_mark_inc (WEdit *edit, long line)
|
||||
{
|
||||
if (edit->book_mark != NULL)
|
||||
{
|
||||
|
@ -296,7 +296,7 @@ book_mark_inc (WEdit * edit, long line)
|
|||
/** shift up bookmarks after this line */
|
||||
|
||||
void
|
||||
book_mark_dec (WEdit * edit, long line)
|
||||
book_mark_dec (WEdit *edit, long line)
|
||||
{
|
||||
if (edit->book_mark != NULL)
|
||||
{
|
||||
|
@ -312,7 +312,7 @@ book_mark_dec (WEdit * edit, long line)
|
|||
/** prepare line positions of bookmarks to be saved to file */
|
||||
|
||||
void
|
||||
book_mark_serialize (WEdit * edit, int color)
|
||||
book_mark_serialize (WEdit *edit, int color)
|
||||
{
|
||||
if (edit->serialized_bookmarks != NULL)
|
||||
g_array_set_size (edit->serialized_bookmarks, 0);
|
||||
|
@ -335,7 +335,7 @@ book_mark_serialize (WEdit * edit, int color)
|
|||
/** restore bookmarks from saved line positions */
|
||||
|
||||
void
|
||||
book_mark_restore (WEdit * edit, int color)
|
||||
book_mark_restore (WEdit *edit, int color)
|
||||
{
|
||||
if (edit->serialized_bookmarks != NULL)
|
||||
{
|
||||
|
|
|
@ -264,7 +264,7 @@ int editcmd_dialog_raw_key_query (const char *heading, const char *query, gboole
|
|||
* @return TRUE on success, FALSE on failure.
|
||||
*/
|
||||
static inline gboolean
|
||||
edit_reload (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
edit_reload (WEdit *edit, const vfs_path_t *filename_vpath)
|
||||
{
|
||||
edit_arg_t arg;
|
||||
|
||||
|
|
|
@ -134,8 +134,7 @@ const char VERTICAL_MAGIC[] = { '\1', '\1', '\1', '\1', '\n' };
|
|||
static const struct edit_filters
|
||||
{
|
||||
const char *read, *write, *extension;
|
||||
} all_filters[] =
|
||||
{
|
||||
} all_filters[] = {
|
||||
/* *INDENT-OFF* */
|
||||
{ "xz -cd %s 2>&1", "xz > %s", ".xz"},
|
||||
{ "zstd -cd %s 2>&1", "zstd > %s", ".zst"},
|
||||
|
@ -156,7 +155,7 @@ static const off_t filesize_default_threshold = 64 * 1024 * 1024; /* 64 MB
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
edit_load_status_update_cb (status_msg_t * sm)
|
||||
edit_load_status_update_cb (status_msg_t *sm)
|
||||
{
|
||||
simple_status_msg_t *ssm = SIMPLE_STATUS_MSG (sm);
|
||||
edit_buffer_read_file_status_msg_t *rsm = (edit_buffer_read_file_status_msg_t *) sm;
|
||||
|
@ -193,7 +192,7 @@ edit_load_status_update_cb (status_msg_t * sm)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
edit_load_file_fast (edit_buffer_t * buf, const vfs_path_t * filename_vpath)
|
||||
edit_load_file_fast (edit_buffer_t *buf, const vfs_path_t *filename_vpath)
|
||||
{
|
||||
int file;
|
||||
gboolean ret;
|
||||
|
@ -240,7 +239,7 @@ edit_load_file_fast (edit_buffer_t * buf, const vfs_path_t * filename_vpath)
|
|||
/** Return index of the filter or -1 is there is no appropriate filter */
|
||||
|
||||
static int
|
||||
edit_find_filter (const vfs_path_t * filename_vpath)
|
||||
edit_find_filter (const vfs_path_t *filename_vpath)
|
||||
{
|
||||
if (filename_vpath != NULL)
|
||||
{
|
||||
|
@ -260,7 +259,7 @@ edit_find_filter (const vfs_path_t * filename_vpath)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static char *
|
||||
edit_get_filter (const vfs_path_t * filename_vpath)
|
||||
edit_get_filter (const vfs_path_t *filename_vpath)
|
||||
{
|
||||
int i;
|
||||
char *quoted_name;
|
||||
|
@ -283,7 +282,7 @@ edit_get_filter (const vfs_path_t * filename_vpath)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static off_t
|
||||
edit_insert_stream (WEdit * edit, FILE * f)
|
||||
edit_insert_stream (WEdit *edit, FILE *f)
|
||||
{
|
||||
int c;
|
||||
off_t i;
|
||||
|
@ -305,7 +304,7 @@ edit_insert_stream (WEdit * edit, FILE * f)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat *st)
|
||||
check_file_access (WEdit *edit, const vfs_path_t *filename_vpath, struct stat *st)
|
||||
{
|
||||
static uintmax_t threshold = UINTMAX_MAX;
|
||||
int file;
|
||||
|
@ -407,7 +406,7 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat
|
|||
* @return TRUE if file was successfully opened and loaded to buffers, FALSE otherwise
|
||||
*/
|
||||
static gboolean
|
||||
edit_load_file (WEdit * edit)
|
||||
edit_load_file (WEdit *edit)
|
||||
{
|
||||
gboolean fast_load = TRUE;
|
||||
|
||||
|
@ -481,7 +480,7 @@ edit_load_file (WEdit * edit)
|
|||
*/
|
||||
|
||||
static void
|
||||
edit_load_position (WEdit * edit, gboolean load_position)
|
||||
edit_load_position (WEdit *edit, gboolean load_position)
|
||||
{
|
||||
long line, column;
|
||||
off_t offset;
|
||||
|
@ -519,7 +518,7 @@ edit_load_position (WEdit * edit, gboolean load_position)
|
|||
/** Save cursor position in the file */
|
||||
|
||||
static void
|
||||
edit_save_position (WEdit * edit)
|
||||
edit_save_position (WEdit *edit)
|
||||
{
|
||||
if (edit->filename_vpath == NULL
|
||||
|| *(vfs_path_get_by_index (edit->filename_vpath, 0)->path) == '\0')
|
||||
|
@ -535,7 +534,7 @@ edit_save_position (WEdit * edit)
|
|||
/** Clean the WEdit stricture except the widget part */
|
||||
|
||||
static void
|
||||
edit_purge_widget (WEdit * edit)
|
||||
edit_purge_widget (WEdit *edit)
|
||||
{
|
||||
size_t len = sizeof (WEdit) - sizeof (Widget);
|
||||
char *start = (char *) edit + sizeof (Widget);
|
||||
|
@ -550,7 +549,7 @@ edit_purge_widget (WEdit * edit)
|
|||
*/
|
||||
|
||||
static long
|
||||
edit_pop_undo_action (WEdit * edit)
|
||||
edit_pop_undo_action (WEdit *edit)
|
||||
{
|
||||
long c;
|
||||
unsigned long sp = edit->undo_stack_pointer;
|
||||
|
@ -585,7 +584,7 @@ edit_pop_undo_action (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static long
|
||||
edit_pop_redo_action (WEdit * edit)
|
||||
edit_pop_redo_action (WEdit *edit)
|
||||
{
|
||||
long c;
|
||||
unsigned long sp = edit->redo_stack_pointer;
|
||||
|
@ -616,7 +615,7 @@ edit_pop_redo_action (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static long
|
||||
get_prev_undo_action (WEdit * edit)
|
||||
get_prev_undo_action (WEdit *edit)
|
||||
{
|
||||
long c;
|
||||
unsigned long sp = edit->undo_stack_pointer;
|
||||
|
@ -640,7 +639,7 @@ get_prev_undo_action (WEdit * edit)
|
|||
/** is called whenever a modification is made by one of the four routines below */
|
||||
|
||||
static void
|
||||
edit_modification (WEdit * edit)
|
||||
edit_modification (WEdit *edit)
|
||||
{
|
||||
edit->caches_valid = FALSE;
|
||||
|
||||
|
@ -661,7 +660,7 @@ edit_modification (WEdit * edit)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
is_in_indent (const edit_buffer_t * buf)
|
||||
is_in_indent (const edit_buffer_t *buf)
|
||||
{
|
||||
off_t p;
|
||||
|
||||
|
@ -682,7 +681,7 @@ is_in_indent (const edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
is_blank (const edit_buffer_t * buf, off_t offset)
|
||||
is_blank (const edit_buffer_t *buf, off_t offset)
|
||||
{
|
||||
off_t s, f;
|
||||
|
||||
|
@ -703,7 +702,7 @@ is_blank (const edit_buffer_t * buf, off_t offset)
|
|||
/** returns the offset of line i */
|
||||
|
||||
static off_t
|
||||
edit_find_line (WEdit * edit, long line)
|
||||
edit_find_line (WEdit *edit, long line)
|
||||
{
|
||||
long i;
|
||||
long j = 0;
|
||||
|
@ -759,7 +758,7 @@ edit_find_line (WEdit * edit, long line)
|
|||
before a non-blank line is reached */
|
||||
|
||||
static void
|
||||
edit_move_up_paragraph (WEdit * edit, gboolean do_scroll)
|
||||
edit_move_up_paragraph (WEdit *edit, gboolean do_scroll)
|
||||
{
|
||||
long i = 0;
|
||||
|
||||
|
@ -796,7 +795,7 @@ edit_move_up_paragraph (WEdit * edit, gboolean do_scroll)
|
|||
before a non-blank line is reached */
|
||||
|
||||
static void
|
||||
edit_move_down_paragraph (WEdit * edit, gboolean do_scroll)
|
||||
edit_move_down_paragraph (WEdit *edit, gboolean do_scroll)
|
||||
{
|
||||
long i;
|
||||
|
||||
|
@ -829,7 +828,7 @@ edit_move_down_paragraph (WEdit * edit, gboolean do_scroll)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_begin_page (WEdit * edit)
|
||||
edit_begin_page (WEdit *edit)
|
||||
{
|
||||
edit_update_curs_row (edit);
|
||||
edit_move_up (edit, edit->curs_row, FALSE);
|
||||
|
@ -838,7 +837,7 @@ edit_begin_page (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_end_page (WEdit * edit)
|
||||
edit_end_page (WEdit *edit)
|
||||
{
|
||||
edit_update_curs_row (edit);
|
||||
edit_move_down (edit, WIDGET (edit)->rect.lines - edit->curs_row - 1, FALSE);
|
||||
|
@ -849,7 +848,7 @@ edit_end_page (WEdit * edit)
|
|||
/** goto beginning of text */
|
||||
|
||||
static void
|
||||
edit_move_to_top (WEdit * edit)
|
||||
edit_move_to_top (WEdit *edit)
|
||||
{
|
||||
if (edit->buffer.curs_line != 0)
|
||||
{
|
||||
|
@ -865,7 +864,7 @@ edit_move_to_top (WEdit * edit)
|
|||
/** goto end of text */
|
||||
|
||||
static void
|
||||
edit_move_to_bottom (WEdit * edit)
|
||||
edit_move_to_bottom (WEdit *edit)
|
||||
{
|
||||
if (edit->buffer.curs_line < edit->buffer.lines)
|
||||
{
|
||||
|
@ -881,7 +880,7 @@ edit_move_to_bottom (WEdit * edit)
|
|||
/** goto beginning of line */
|
||||
|
||||
static void
|
||||
edit_cursor_to_bol (WEdit * edit)
|
||||
edit_cursor_to_bol (WEdit *edit)
|
||||
{
|
||||
off_t b;
|
||||
|
||||
|
@ -896,7 +895,7 @@ edit_cursor_to_bol (WEdit * edit)
|
|||
/** goto end of line */
|
||||
|
||||
static void
|
||||
edit_cursor_to_eol (WEdit * edit)
|
||||
edit_cursor_to_eol (WEdit *edit)
|
||||
{
|
||||
off_t b;
|
||||
|
||||
|
@ -954,7 +953,7 @@ my_type_of (int c)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_left_word_move (WEdit * edit, int s)
|
||||
edit_left_word_move (WEdit *edit, int s)
|
||||
{
|
||||
while (TRUE)
|
||||
{
|
||||
|
@ -986,7 +985,7 @@ edit_left_word_move (WEdit * edit, int s)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_left_word_move_cmd (WEdit * edit)
|
||||
edit_left_word_move_cmd (WEdit *edit)
|
||||
{
|
||||
edit_left_word_move (edit, 0);
|
||||
edit->force |= REDRAW_PAGE;
|
||||
|
@ -995,7 +994,7 @@ edit_left_word_move_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_right_word_move (WEdit * edit, int s)
|
||||
edit_right_word_move (WEdit *edit, int s)
|
||||
{
|
||||
while (TRUE)
|
||||
{
|
||||
|
@ -1027,7 +1026,7 @@ edit_right_word_move (WEdit * edit, int s)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_right_word_move_cmd (WEdit * edit)
|
||||
edit_right_word_move_cmd (WEdit *edit)
|
||||
{
|
||||
edit_right_word_move (edit, 0);
|
||||
edit->force |= REDRAW_PAGE;
|
||||
|
@ -1036,7 +1035,7 @@ edit_right_word_move_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_right_char_move_cmd (WEdit * edit)
|
||||
edit_right_char_move_cmd (WEdit *edit)
|
||||
{
|
||||
int char_length = 1;
|
||||
int c;
|
||||
|
@ -1061,7 +1060,7 @@ edit_right_char_move_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_left_char_move_cmd (WEdit * edit)
|
||||
edit_left_char_move_cmd (WEdit *edit)
|
||||
{
|
||||
int char_length = 1;
|
||||
|
||||
|
@ -1092,7 +1091,7 @@ edit_left_char_move_cmd (WEdit * edit)
|
|||
*/
|
||||
|
||||
static void
|
||||
edit_move_updown (WEdit * edit, long lines, gboolean do_scroll, gboolean direction)
|
||||
edit_move_updown (WEdit *edit, long lines, gboolean do_scroll, gboolean direction)
|
||||
{
|
||||
long p;
|
||||
long l = direction ? edit->buffer.curs_line : edit->buffer.lines - edit->buffer.curs_line;
|
||||
|
@ -1135,7 +1134,7 @@ edit_move_updown (WEdit * edit, long lines, gboolean do_scroll, gboolean directi
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_right_delete_word (WEdit * edit)
|
||||
edit_right_delete_word (WEdit *edit)
|
||||
{
|
||||
while (edit->buffer.curs1 < edit->buffer.size)
|
||||
{
|
||||
|
@ -1157,7 +1156,7 @@ edit_right_delete_word (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_left_delete_word (WEdit * edit)
|
||||
edit_left_delete_word (WEdit *edit)
|
||||
{
|
||||
while (edit->buffer.curs1 > 0)
|
||||
{
|
||||
|
@ -1183,7 +1182,7 @@ edit_left_delete_word (WEdit * edit)
|
|||
*/
|
||||
|
||||
static void
|
||||
edit_do_undo (WEdit * edit)
|
||||
edit_do_undo (WEdit *edit)
|
||||
{
|
||||
long ac;
|
||||
long count = 0;
|
||||
|
@ -1269,7 +1268,7 @@ edit_do_undo (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_do_redo (WEdit * edit)
|
||||
edit_do_redo (WEdit *edit)
|
||||
{
|
||||
long ac;
|
||||
long count = 0;
|
||||
|
@ -1352,7 +1351,7 @@ edit_do_redo (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_group_undo (WEdit * edit)
|
||||
edit_group_undo (WEdit *edit)
|
||||
{
|
||||
long ac = KEY_PRESS;
|
||||
long cur_ac = KEY_PRESS;
|
||||
|
@ -1373,7 +1372,7 @@ edit_group_undo (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_delete_to_line_end (WEdit * edit)
|
||||
edit_delete_to_line_end (WEdit *edit)
|
||||
{
|
||||
while (edit_buffer_get_current_byte (&edit->buffer) != '\n' && edit->buffer.curs2 != 0)
|
||||
edit_delete (edit, TRUE);
|
||||
|
@ -1382,7 +1381,7 @@ edit_delete_to_line_end (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_delete_to_line_begin (WEdit * edit)
|
||||
edit_delete_to_line_begin (WEdit *edit)
|
||||
{
|
||||
while (edit_buffer_get_previous_byte (&edit->buffer) != '\n' && edit->buffer.curs1 != 0)
|
||||
edit_backspace (edit, TRUE);
|
||||
|
@ -1391,7 +1390,7 @@ edit_delete_to_line_begin (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
is_aligned_on_a_tab (WEdit * edit)
|
||||
is_aligned_on_a_tab (WEdit *edit)
|
||||
{
|
||||
long curs_col;
|
||||
|
||||
|
@ -1403,7 +1402,7 @@ is_aligned_on_a_tab (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
right_of_four_spaces (WEdit * edit)
|
||||
right_of_four_spaces (WEdit *edit)
|
||||
{
|
||||
int i;
|
||||
int ch = 0;
|
||||
|
@ -1417,7 +1416,7 @@ right_of_four_spaces (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
left_of_four_spaces (WEdit * edit)
|
||||
left_of_four_spaces (WEdit *edit)
|
||||
{
|
||||
int i, ch = 0;
|
||||
|
||||
|
@ -1430,7 +1429,7 @@ left_of_four_spaces (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_auto_indent (WEdit * edit)
|
||||
edit_auto_indent (WEdit *edit)
|
||||
{
|
||||
off_t p;
|
||||
|
||||
|
@ -1452,7 +1451,7 @@ edit_auto_indent (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
edit_double_newline (WEdit * edit)
|
||||
edit_double_newline (WEdit *edit)
|
||||
{
|
||||
edit_insert (edit, '\n');
|
||||
if (edit_buffer_get_current_byte (&edit->buffer) == '\n'
|
||||
|
@ -1465,7 +1464,7 @@ edit_double_newline (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
insert_spaces_tab (WEdit * edit, gboolean half)
|
||||
insert_spaces_tab (WEdit *edit, gboolean half)
|
||||
{
|
||||
long i;
|
||||
|
||||
|
@ -1481,7 +1480,7 @@ insert_spaces_tab (WEdit * edit, gboolean half)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
edit_tab_cmd (WEdit * edit)
|
||||
edit_tab_cmd (WEdit *edit)
|
||||
{
|
||||
if (edit_options.fake_half_tabs && is_in_indent (&edit->buffer))
|
||||
{
|
||||
|
@ -1508,7 +1507,7 @@ edit_tab_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
check_and_wrap_line (WEdit * edit)
|
||||
check_and_wrap_line (WEdit *edit)
|
||||
{
|
||||
off_t curs;
|
||||
|
||||
|
@ -1551,7 +1550,7 @@ check_and_wrap_line (WEdit * edit)
|
|||
*/
|
||||
|
||||
static off_t
|
||||
edit_get_bracket (WEdit * edit, gboolean in_screen, unsigned long furthest_bracket_search)
|
||||
edit_get_bracket (WEdit *edit, gboolean in_screen, unsigned long furthest_bracket_search)
|
||||
{
|
||||
const char *const b = "{}{[][()(", *p;
|
||||
int i = 1, inc = -1, c, d, n = 0;
|
||||
|
@ -1606,7 +1605,7 @@ edit_get_bracket (WEdit * edit, gboolean in_screen, unsigned long furthest_brack
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
edit_goto_matching_bracket (WEdit * edit)
|
||||
edit_goto_matching_bracket (WEdit *edit)
|
||||
{
|
||||
off_t q;
|
||||
|
||||
|
@ -1622,7 +1621,7 @@ edit_goto_matching_bracket (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_move_block_to_right (WEdit * edit)
|
||||
edit_move_block_to_right (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
long cur_bol, start_bol;
|
||||
|
@ -1662,7 +1661,7 @@ edit_move_block_to_right (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_move_block_to_left (WEdit * edit)
|
||||
edit_move_block_to_left (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
off_t cur_bol, start_bol;
|
||||
|
@ -1714,7 +1713,7 @@ edit_move_block_to_left (WEdit * edit)
|
|||
*/
|
||||
|
||||
static size_t
|
||||
edit_print_string (WEdit * e, const char *s)
|
||||
edit_print_string (WEdit *e, const char *s)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
@ -1728,7 +1727,7 @@ edit_print_string (WEdit * e, const char *s)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static off_t
|
||||
edit_insert_column_from_file (WEdit * edit, int file, off_t * start_pos, off_t * end_pos,
|
||||
edit_insert_column_from_file (WEdit *edit, int file, off_t *start_pos, off_t *end_pos,
|
||||
long *col1, long *col2)
|
||||
{
|
||||
off_t cursor;
|
||||
|
@ -1801,7 +1800,7 @@ edit_insert_column_from_file (WEdit * edit, int file, off_t * start_pos, off_t *
|
|||
/** User edit menu, like user menu (F2) but only in editor. */
|
||||
|
||||
void
|
||||
edit_user_menu (WEdit * edit, const char *menu_file, int selected_entry)
|
||||
edit_user_menu (WEdit *edit, const char *menu_file, int selected_entry)
|
||||
{
|
||||
char *block_file;
|
||||
gboolean mark;
|
||||
|
@ -1852,7 +1851,7 @@ edit_user_menu (WEdit * edit, const char *menu_file, int selected_entry)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
char *
|
||||
edit_get_write_filter (const vfs_path_t * write_name_vpath, const vfs_path_t * filename_vpath)
|
||||
edit_get_write_filter (const vfs_path_t *write_name_vpath, const vfs_path_t *filename_vpath)
|
||||
{
|
||||
int i;
|
||||
const char *write_name;
|
||||
|
@ -1881,7 +1880,7 @@ edit_get_write_filter (const vfs_path_t * write_name_vpath, const vfs_path_t * f
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_write_stream (WEdit * edit, FILE * f)
|
||||
edit_write_stream (WEdit *edit, FILE *f)
|
||||
{
|
||||
long i;
|
||||
|
||||
|
@ -1990,7 +1989,7 @@ is_break_char (char c)
|
|||
/** inserts a file at the cursor, returns count of inserted bytes on success */
|
||||
|
||||
off_t
|
||||
edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
edit_insert_file (WEdit *edit, const vfs_path_t *filename_vpath)
|
||||
{
|
||||
char *p;
|
||||
off_t current;
|
||||
|
@ -2119,7 +2118,7 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
|||
*/
|
||||
|
||||
WEdit *
|
||||
edit_init (WEdit * edit, const WRect * r, const edit_arg_t * arg)
|
||||
edit_init (WEdit *edit, const WRect *r, const edit_arg_t *arg)
|
||||
{
|
||||
gboolean to_free = FALSE;
|
||||
long line;
|
||||
|
@ -2233,7 +2232,7 @@ edit_init (WEdit * edit, const WRect * r, const edit_arg_t * arg)
|
|||
|
||||
/** Clear the edit struct, freeing everything in it. Return TRUE on success */
|
||||
gboolean
|
||||
edit_clean (WEdit * edit)
|
||||
edit_clean (WEdit *edit)
|
||||
{
|
||||
if (edit == NULL)
|
||||
return FALSE;
|
||||
|
@ -2283,7 +2282,7 @@ edit_clean (WEdit * edit)
|
|||
* @return TRUE on success, FALSE on failure.
|
||||
*/
|
||||
gboolean
|
||||
edit_reload_line (WEdit * edit, const edit_arg_t * arg)
|
||||
edit_reload_line (WEdit *edit, const edit_arg_t *arg)
|
||||
{
|
||||
Widget *w = WIDGET (edit);
|
||||
WEdit *e;
|
||||
|
@ -2311,7 +2310,7 @@ edit_reload_line (WEdit * edit, const edit_arg_t * arg)
|
|||
|
||||
#ifdef HAVE_CHARSET
|
||||
void
|
||||
edit_set_codeset (WEdit * edit)
|
||||
edit_set_codeset (WEdit *edit)
|
||||
{
|
||||
const char *cp_id;
|
||||
|
||||
|
@ -2383,7 +2382,7 @@ edit_set_codeset (WEdit * edit)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_push_undo_action (WEdit * edit, long c)
|
||||
edit_push_undo_action (WEdit *edit, long c)
|
||||
{
|
||||
unsigned long sp = edit->undo_stack_pointer;
|
||||
unsigned long spm1;
|
||||
|
@ -2474,7 +2473,7 @@ edit_push_undo_action (WEdit * edit, long c)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_push_redo_action (WEdit * edit, long c)
|
||||
edit_push_redo_action (WEdit *edit, long c)
|
||||
{
|
||||
unsigned long sp = edit->redo_stack_pointer;
|
||||
unsigned long spm1;
|
||||
|
@ -2561,7 +2560,7 @@ edit_push_redo_action (WEdit * edit, long c)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_insert (WEdit * edit, int c)
|
||||
edit_insert (WEdit *edit, int c)
|
||||
{
|
||||
/* first we must update the position of the display window */
|
||||
if (edit->buffer.curs1 < edit->start_display)
|
||||
|
@ -2602,7 +2601,7 @@ edit_insert (WEdit * edit, int c)
|
|||
/** same as edit_insert and move left */
|
||||
|
||||
void
|
||||
edit_insert_ahead (WEdit * edit, int c)
|
||||
edit_insert_ahead (WEdit *edit, int c)
|
||||
{
|
||||
if (edit->buffer.curs1 < edit->start_display)
|
||||
{
|
||||
|
@ -2633,7 +2632,7 @@ edit_insert_ahead (WEdit * edit, int c)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_insert_over (WEdit * edit)
|
||||
edit_insert_over (WEdit *edit)
|
||||
{
|
||||
long i;
|
||||
|
||||
|
@ -2646,7 +2645,7 @@ edit_insert_over (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
edit_delete (WEdit * edit, gboolean byte_delete)
|
||||
edit_delete (WEdit *edit, gboolean byte_delete)
|
||||
{
|
||||
int p = 0;
|
||||
int char_length = 1;
|
||||
|
@ -2707,7 +2706,7 @@ edit_delete (WEdit * edit, gboolean byte_delete)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
edit_backspace (WEdit * edit, gboolean byte_delete)
|
||||
edit_backspace (WEdit *edit, gboolean byte_delete)
|
||||
{
|
||||
int p = 0;
|
||||
int char_length = 1;
|
||||
|
@ -2769,7 +2768,7 @@ edit_backspace (WEdit * edit, gboolean byte_delete)
|
|||
/** moves the cursor right or left: increment positive or negative respectively */
|
||||
|
||||
void
|
||||
edit_cursor_move (WEdit * edit, off_t increment)
|
||||
edit_cursor_move (WEdit *edit, off_t increment)
|
||||
{
|
||||
if (increment < 0)
|
||||
{
|
||||
|
@ -2814,7 +2813,7 @@ edit_cursor_move (WEdit * edit, off_t increment)
|
|||
/* If upto is zero returns index of cols across from current. */
|
||||
|
||||
off_t
|
||||
edit_move_forward3 (const WEdit * edit, off_t current, long cols, off_t upto)
|
||||
edit_move_forward3 (const WEdit *edit, off_t current, long cols, off_t upto)
|
||||
{
|
||||
off_t p, q;
|
||||
long col;
|
||||
|
@ -2884,7 +2883,7 @@ edit_move_forward3 (const WEdit * edit, off_t current, long cols, off_t upto)
|
|||
/** returns the current offset of the cursor from the beginning of a file */
|
||||
|
||||
off_t
|
||||
edit_get_cursor_offset (const WEdit * edit)
|
||||
edit_get_cursor_offset (const WEdit *edit)
|
||||
{
|
||||
return edit->buffer.curs1;
|
||||
}
|
||||
|
@ -2893,7 +2892,7 @@ edit_get_cursor_offset (const WEdit * edit)
|
|||
/** returns the current column position of the cursor */
|
||||
|
||||
long
|
||||
edit_get_col (const WEdit * edit)
|
||||
edit_get_col (const WEdit *edit)
|
||||
{
|
||||
off_t b;
|
||||
|
||||
|
@ -2906,7 +2905,7 @@ edit_get_col (const WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_update_curs_row (WEdit * edit)
|
||||
edit_update_curs_row (WEdit *edit)
|
||||
{
|
||||
edit->curs_row = edit->buffer.curs_line - edit->start_line;
|
||||
}
|
||||
|
@ -2914,7 +2913,7 @@ edit_update_curs_row (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_update_curs_col (WEdit * edit)
|
||||
edit_update_curs_col (WEdit *edit)
|
||||
{
|
||||
off_t b;
|
||||
|
||||
|
@ -2925,7 +2924,7 @@ edit_update_curs_col (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
long
|
||||
edit_get_curs_col (const WEdit * edit)
|
||||
edit_get_curs_col (const WEdit *edit)
|
||||
{
|
||||
return edit->curs_col;
|
||||
}
|
||||
|
@ -2934,7 +2933,7 @@ edit_get_curs_col (const WEdit * edit)
|
|||
/** moves the display start position up by i lines */
|
||||
|
||||
void
|
||||
edit_scroll_upward (WEdit * edit, long i)
|
||||
edit_scroll_upward (WEdit *edit, long i)
|
||||
{
|
||||
long lines_above = edit->start_line;
|
||||
|
||||
|
@ -2954,7 +2953,7 @@ edit_scroll_upward (WEdit * edit, long i)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_scroll_downward (WEdit * edit, long i)
|
||||
edit_scroll_downward (WEdit *edit, long i)
|
||||
{
|
||||
long lines_below;
|
||||
|
||||
|
@ -2975,7 +2974,7 @@ edit_scroll_downward (WEdit * edit, long i)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_scroll_right (WEdit * edit, long i)
|
||||
edit_scroll_right (WEdit *edit, long i)
|
||||
{
|
||||
edit->force |= REDRAW_PAGE;
|
||||
edit->force &= (0xfff - REDRAW_CHAR_ONLY);
|
||||
|
@ -2985,7 +2984,7 @@ edit_scroll_right (WEdit * edit, long i)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_scroll_left (WEdit * edit, long i)
|
||||
edit_scroll_left (WEdit *edit, long i)
|
||||
{
|
||||
if (edit->start_col)
|
||||
{
|
||||
|
@ -3002,7 +3001,7 @@ edit_scroll_left (WEdit * edit, long i)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_move_to_prev_col (WEdit * edit, off_t p)
|
||||
edit_move_to_prev_col (WEdit *edit, off_t p)
|
||||
{
|
||||
long prev = edit->prev_col;
|
||||
long over = edit->over_col;
|
||||
|
@ -3071,7 +3070,7 @@ edit_move_to_prev_col (WEdit * edit, off_t p)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_line_is_blank (WEdit * edit, long line)
|
||||
edit_line_is_blank (WEdit *edit, long line)
|
||||
{
|
||||
return is_blank (&edit->buffer, edit_find_line (edit, line));
|
||||
}
|
||||
|
@ -3080,7 +3079,7 @@ edit_line_is_blank (WEdit * edit, long line)
|
|||
/** move cursor to line 'line' */
|
||||
|
||||
void
|
||||
edit_move_to_line (WEdit * e, long line)
|
||||
edit_move_to_line (WEdit *e, long line)
|
||||
{
|
||||
if (line < e->buffer.curs_line)
|
||||
edit_move_up (e, e->buffer.curs_line - line, FALSE);
|
||||
|
@ -3093,7 +3092,7 @@ edit_move_to_line (WEdit * e, long line)
|
|||
/** scroll window so that first visible line is 'line' */
|
||||
|
||||
void
|
||||
edit_move_display (WEdit * e, long line)
|
||||
edit_move_display (WEdit *e, long line)
|
||||
{
|
||||
if (line < e->start_line)
|
||||
edit_scroll_upward (e, e->start_line - line);
|
||||
|
@ -3105,7 +3104,7 @@ edit_move_display (WEdit * e, long line)
|
|||
/** save markers onto undo stack */
|
||||
|
||||
void
|
||||
edit_push_markers (WEdit * edit)
|
||||
edit_push_markers (WEdit *edit)
|
||||
{
|
||||
edit_push_undo_action (edit, MARK_1 + edit->mark1);
|
||||
edit_push_undo_action (edit, MARK_2 + edit->mark2);
|
||||
|
@ -3115,7 +3114,7 @@ edit_push_markers (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_set_markers (WEdit * edit, off_t m1, off_t m2, long c1, long c2)
|
||||
edit_set_markers (WEdit *edit, off_t m1, off_t m2, long c1, long c2)
|
||||
{
|
||||
edit->mark1 = m1;
|
||||
edit->mark2 = m2;
|
||||
|
@ -3131,7 +3130,7 @@ edit_set_markers (WEdit * edit, off_t m1, off_t m2, long c1, long c2)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
eval_marks (WEdit * edit, off_t * start_mark, off_t * end_mark)
|
||||
eval_marks (WEdit *edit, off_t *start_mark, off_t *end_mark)
|
||||
{
|
||||
long end_mark_curs;
|
||||
|
||||
|
@ -3193,7 +3192,7 @@ eval_marks (WEdit * edit, off_t * start_mark, off_t * end_mark)
|
|||
/** highlight marker toggle */
|
||||
|
||||
void
|
||||
edit_mark_cmd (WEdit * edit, gboolean unmark)
|
||||
edit_mark_cmd (WEdit *edit, gboolean unmark)
|
||||
{
|
||||
edit_push_markers (edit);
|
||||
if (unmark)
|
||||
|
@ -3220,7 +3219,7 @@ edit_mark_cmd (WEdit * edit, gboolean unmark)
|
|||
/** highlight the word under cursor */
|
||||
|
||||
void
|
||||
edit_mark_current_word_cmd (WEdit * edit)
|
||||
edit_mark_current_word_cmd (WEdit *edit)
|
||||
{
|
||||
long pos;
|
||||
|
||||
|
@ -3256,7 +3255,7 @@ edit_mark_current_word_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_mark_current_line_cmd (WEdit * edit)
|
||||
edit_mark_current_line_cmd (WEdit *edit)
|
||||
{
|
||||
edit->mark1 = edit_buffer_get_current_bol (&edit->buffer);
|
||||
edit->mark2 = edit_buffer_get_current_eol (&edit->buffer);
|
||||
|
@ -3267,7 +3266,7 @@ edit_mark_current_line_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_delete_line (WEdit * edit)
|
||||
edit_delete_line (WEdit *edit)
|
||||
{
|
||||
/*
|
||||
* Delete right part of the line.
|
||||
|
@ -3295,7 +3294,7 @@ edit_delete_line (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_push_key_press (WEdit * edit)
|
||||
edit_push_key_press (WEdit *edit)
|
||||
{
|
||||
edit_push_undo_action (edit, KEY_PRESS + edit->start_display);
|
||||
if (edit->mark2 == -1)
|
||||
|
@ -3308,7 +3307,7 @@ edit_push_key_press (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_find_bracket (WEdit * edit)
|
||||
edit_find_bracket (WEdit *edit)
|
||||
{
|
||||
edit->bracket = edit_get_bracket (edit, 1, 10000);
|
||||
if (edit->last_bracket != edit->bracket)
|
||||
|
@ -3328,7 +3327,7 @@ edit_find_bracket (WEdit * edit)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_execute_key_command (WEdit * edit, long command, int char_for_insertion)
|
||||
edit_execute_key_command (WEdit *edit, long command, int char_for_insertion)
|
||||
{
|
||||
if (command == CK_MacroStartRecord || command == CK_RepeatStartRecord
|
||||
|| (macro_index < 0
|
||||
|
@ -3377,7 +3376,7 @@ edit_execute_key_command (WEdit * edit, long command, int char_for_insertion)
|
|||
all of them. It also does not check for the Undo command.
|
||||
*/
|
||||
void
|
||||
edit_execute_cmd (WEdit * edit, long command, int char_for_insertion)
|
||||
edit_execute_cmd (WEdit *edit, long command, int char_for_insertion)
|
||||
{
|
||||
WRect *w = &WIDGET (edit)->rect;
|
||||
|
||||
|
@ -4163,7 +4162,7 @@ edit_stack_free (void)
|
|||
/** move i lines */
|
||||
|
||||
void
|
||||
edit_move_up (WEdit * edit, long i, gboolean do_scroll)
|
||||
edit_move_up (WEdit *edit, long i, gboolean do_scroll)
|
||||
{
|
||||
edit_move_updown (edit, i, do_scroll, TRUE);
|
||||
}
|
||||
|
@ -4172,7 +4171,7 @@ edit_move_up (WEdit * edit, long i, gboolean do_scroll)
|
|||
/** move i lines */
|
||||
|
||||
void
|
||||
edit_move_down (WEdit * edit, long i, gboolean do_scroll)
|
||||
edit_move_down (WEdit *edit, long i, gboolean do_scroll)
|
||||
{
|
||||
edit_move_updown (edit, i, do_scroll, FALSE);
|
||||
}
|
||||
|
@ -4187,7 +4186,7 @@ edit_move_down (WEdit * edit, long i, gboolean do_scroll)
|
|||
*/
|
||||
|
||||
edit_arg_t *
|
||||
edit_arg_vpath_new (vfs_path_t * file_vpath, long line_number)
|
||||
edit_arg_vpath_new (vfs_path_t *file_vpath, long line_number)
|
||||
{
|
||||
edit_arg_t *arg;
|
||||
|
||||
|
@ -4223,7 +4222,7 @@ edit_arg_new (const char *file_name, long line_number)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_arg_init (edit_arg_t * arg, vfs_path_t * vpath, long line)
|
||||
edit_arg_init (edit_arg_t *arg, vfs_path_t *vpath, long line)
|
||||
{
|
||||
arg->file_vpath = (vfs_path_t *) vpath;
|
||||
arg->line_number = line;
|
||||
|
@ -4239,7 +4238,7 @@ edit_arg_init (edit_arg_t * arg, vfs_path_t * vpath, long line)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_arg_assign (edit_arg_t * arg, vfs_path_t * vpath, long line)
|
||||
edit_arg_assign (edit_arg_t *arg, vfs_path_t *vpath, long line)
|
||||
{
|
||||
vfs_path_free (arg->file_vpath, TRUE);
|
||||
edit_arg_init (arg, vpath, line);
|
||||
|
@ -4253,7 +4252,7 @@ edit_arg_assign (edit_arg_t * arg, vfs_path_t * vpath, long line)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_arg_free (edit_arg_t * arg)
|
||||
edit_arg_free (edit_arg_t *arg)
|
||||
{
|
||||
vfs_path_free (arg->file_vpath, TRUE);
|
||||
g_free (arg);
|
||||
|
@ -4262,7 +4261,7 @@ edit_arg_free (edit_arg_t * arg)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
const char *
|
||||
edit_get_file_name (const WEdit * edit)
|
||||
edit_get_file_name (const WEdit *edit)
|
||||
{
|
||||
return vfs_path_as_str (edit->filename_vpath);
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
* @return NULL if byte_index is negative or larger than file size; pointer to byte otherwise.
|
||||
*/
|
||||
static char *
|
||||
edit_buffer_get_byte_ptr (const edit_buffer_t * buf, off_t byte_index)
|
||||
edit_buffer_get_byte_ptr (const edit_buffer_t *buf, off_t byte_index)
|
||||
{
|
||||
void *b;
|
||||
|
||||
|
@ -144,7 +144,7 @@ edit_buffer_get_byte_ptr (const edit_buffer_t * buf, off_t byte_index)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_buffer_init (edit_buffer_t * buf, off_t size)
|
||||
edit_buffer_init (edit_buffer_t *buf, off_t size)
|
||||
{
|
||||
buf->b1 = g_ptr_array_new_full (32, g_free);
|
||||
buf->b2 = g_ptr_array_new_full (32, g_free);
|
||||
|
@ -164,7 +164,7 @@ edit_buffer_init (edit_buffer_t * buf, off_t size)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_buffer_clean (edit_buffer_t * buf)
|
||||
edit_buffer_clean (edit_buffer_t *buf)
|
||||
{
|
||||
if (buf->b1 != NULL)
|
||||
g_ptr_array_free (buf->b1, TRUE);
|
||||
|
@ -184,7 +184,7 @@ edit_buffer_clean (edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_get_byte (const edit_buffer_t * buf, off_t byte_index)
|
||||
edit_buffer_get_byte (const edit_buffer_t *buf, off_t byte_index)
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
@ -209,7 +209,7 @@ edit_buffer_get_byte (const edit_buffer_t * buf, off_t byte_index)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_get_utf (const edit_buffer_t * buf, off_t byte_index, int *char_length)
|
||||
edit_buffer_get_utf (const edit_buffer_t *buf, off_t byte_index, int *char_length)
|
||||
{
|
||||
gchar *str = NULL;
|
||||
gunichar res;
|
||||
|
@ -272,7 +272,7 @@ edit_buffer_get_utf (const edit_buffer_t * buf, off_t byte_index, int *char_leng
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_get_prev_utf (const edit_buffer_t * buf, off_t byte_index, int *char_length)
|
||||
edit_buffer_get_prev_utf (const edit_buffer_t *buf, off_t byte_index, int *char_length)
|
||||
{
|
||||
size_t i;
|
||||
gchar utf8_buf[3 * UTF8_CHAR_LEN + 1];
|
||||
|
@ -323,7 +323,7 @@ edit_buffer_get_prev_utf (const edit_buffer_t * buf, off_t byte_index, int *char
|
|||
*/
|
||||
|
||||
long
|
||||
edit_buffer_count_lines (const edit_buffer_t * buf, off_t first, off_t last)
|
||||
edit_buffer_count_lines (const edit_buffer_t *buf, off_t first, off_t last)
|
||||
{
|
||||
long lines = 0;
|
||||
|
||||
|
@ -348,7 +348,7 @@ edit_buffer_count_lines (const edit_buffer_t * buf, off_t first, off_t last)
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_get_bol (const edit_buffer_t * buf, off_t current)
|
||||
edit_buffer_get_bol (const edit_buffer_t *buf, off_t current)
|
||||
{
|
||||
if (current <= 0)
|
||||
return 0;
|
||||
|
@ -370,7 +370,7 @@ edit_buffer_get_bol (const edit_buffer_t * buf, off_t current)
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_get_eol (const edit_buffer_t * buf, off_t current)
|
||||
edit_buffer_get_eol (const edit_buffer_t *buf, off_t current)
|
||||
{
|
||||
if (current >= buf->size)
|
||||
return buf->size;
|
||||
|
@ -394,8 +394,7 @@ edit_buffer_get_eol (const edit_buffer_t * buf, off_t current)
|
|||
*/
|
||||
|
||||
GString *
|
||||
edit_buffer_get_word_from_pos (const edit_buffer_t * buf, off_t start_pos, off_t * start,
|
||||
gsize * cut)
|
||||
edit_buffer_get_word_from_pos (const edit_buffer_t *buf, off_t start_pos, off_t *start, gsize *cut)
|
||||
{
|
||||
off_t word_start;
|
||||
gsize cut_len = 0;
|
||||
|
@ -440,7 +439,7 @@ edit_buffer_get_word_from_pos (const edit_buffer_t * buf, off_t start_pos, off_t
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_buffer_find_word_start (const edit_buffer_t * buf, off_t * word_start, gsize * word_len)
|
||||
edit_buffer_find_word_start (const edit_buffer_t *buf, off_t *word_start, gsize *word_len)
|
||||
{
|
||||
int c;
|
||||
off_t i;
|
||||
|
@ -489,7 +488,7 @@ edit_buffer_find_word_start (const edit_buffer_t * buf, off_t * word_start, gsiz
|
|||
*/
|
||||
|
||||
void
|
||||
edit_buffer_insert (edit_buffer_t * buf, int c)
|
||||
edit_buffer_insert (edit_buffer_t *buf, int c)
|
||||
{
|
||||
void *b;
|
||||
off_t i;
|
||||
|
@ -521,7 +520,7 @@ edit_buffer_insert (edit_buffer_t * buf, int c)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_buffer_insert_ahead (edit_buffer_t * buf, int c)
|
||||
edit_buffer_insert_ahead (edit_buffer_t *buf, int c)
|
||||
{
|
||||
void *b;
|
||||
off_t i;
|
||||
|
@ -553,7 +552,7 @@ edit_buffer_insert_ahead (edit_buffer_t * buf, int c)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_delete (edit_buffer_t * buf)
|
||||
edit_buffer_delete (edit_buffer_t *buf)
|
||||
{
|
||||
void *b;
|
||||
unsigned char c;
|
||||
|
@ -593,7 +592,7 @@ edit_buffer_delete (edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_backspace (edit_buffer_t * buf)
|
||||
edit_buffer_backspace (edit_buffer_t *buf)
|
||||
{
|
||||
void *b;
|
||||
unsigned char c;
|
||||
|
@ -638,7 +637,7 @@ edit_buffer_backspace (edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_get_forward_offset (const edit_buffer_t * buf, off_t current, long lines, off_t upto)
|
||||
edit_buffer_get_forward_offset (const edit_buffer_t *buf, off_t current, long lines, off_t upto)
|
||||
{
|
||||
if (upto != 0)
|
||||
return (off_t) edit_buffer_count_lines (buf, current, upto);
|
||||
|
@ -670,7 +669,7 @@ edit_buffer_get_forward_offset (const edit_buffer_t * buf, off_t current, long l
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_get_backward_offset (const edit_buffer_t * buf, off_t current, long lines)
|
||||
edit_buffer_get_backward_offset (const edit_buffer_t *buf, off_t current, long lines)
|
||||
{
|
||||
lines = MAX (lines, 0);
|
||||
current = edit_buffer_get_bol (buf, current);
|
||||
|
@ -693,8 +692,8 @@ edit_buffer_get_backward_offset (const edit_buffer_t * buf, off_t current, long
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_read_file (edit_buffer_t * buf, int fd, off_t size,
|
||||
edit_buffer_read_file_status_msg_t * sm, gboolean * aborted)
|
||||
edit_buffer_read_file (edit_buffer_t *buf, int fd, off_t size,
|
||||
edit_buffer_read_file_status_msg_t *sm, gboolean *aborted)
|
||||
{
|
||||
off_t ret = 0;
|
||||
off_t i, j;
|
||||
|
@ -807,7 +806,7 @@ edit_buffer_read_file (edit_buffer_t * buf, int fd, off_t size,
|
|||
*/
|
||||
|
||||
off_t
|
||||
edit_buffer_write_file (edit_buffer_t * buf, int fd)
|
||||
edit_buffer_write_file (edit_buffer_t *buf, int fd)
|
||||
{
|
||||
off_t ret = 0;
|
||||
off_t i;
|
||||
|
@ -881,7 +880,7 @@ edit_buffer_write_file (edit_buffer_t * buf, int fd)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_buffer_calc_percent (const edit_buffer_t * buf, off_t offset)
|
||||
edit_buffer_calc_percent (const edit_buffer_t *buf, off_t offset)
|
||||
{
|
||||
int percent;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ int edit_buffer_calc_percent (const edit_buffer_t * buf, off_t offset);
|
|||
/*** inline functions ****************************************************************************/
|
||||
|
||||
static inline int
|
||||
edit_buffer_get_current_byte (const edit_buffer_t * buf)
|
||||
edit_buffer_get_current_byte (const edit_buffer_t *buf)
|
||||
{
|
||||
return edit_buffer_get_byte (buf, buf->curs1);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ edit_buffer_get_current_byte (const edit_buffer_t * buf)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline int
|
||||
edit_buffer_get_previous_byte (const edit_buffer_t * buf)
|
||||
edit_buffer_get_previous_byte (const edit_buffer_t *buf)
|
||||
{
|
||||
return edit_buffer_get_byte (buf, buf->curs1 - 1);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ edit_buffer_get_previous_byte (const edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
static inline off_t
|
||||
edit_buffer_get_current_bol (const edit_buffer_t * buf)
|
||||
edit_buffer_get_current_bol (const edit_buffer_t *buf)
|
||||
{
|
||||
return edit_buffer_get_bol (buf, buf->curs1);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ edit_buffer_get_current_bol (const edit_buffer_t * buf)
|
|||
*/
|
||||
|
||||
static inline off_t
|
||||
edit_buffer_get_current_eol (const edit_buffer_t * buf)
|
||||
edit_buffer_get_current_eol (const edit_buffer_t *buf)
|
||||
{
|
||||
return edit_buffer_get_eol (buf, buf->curs1);
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ static unsigned long edit_save_mode_radio_id, edit_save_mode_input_id;
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
edit_save_mode_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
edit_save_mode_callback (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ edit_save_mode_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
|||
/* returns 0 on error, -1 on abort */
|
||||
|
||||
static int
|
||||
edit_save_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
||||
edit_save_file (WEdit *edit, const vfs_path_t *filename_vpath)
|
||||
{
|
||||
char *p;
|
||||
gchar *tmp;
|
||||
|
@ -368,7 +368,7 @@ edit_save_file (WEdit * edit, const vfs_path_t * filename_vpath)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static gboolean
|
||||
edit_check_newline (const edit_buffer_t * buf)
|
||||
edit_check_newline (const edit_buffer_t *buf)
|
||||
{
|
||||
return !(edit_options.check_nl_at_eof && buf->size > 0
|
||||
&& edit_buffer_get_byte (buf, buf->size - 1) != '\n'
|
||||
|
@ -380,7 +380,7 @@ edit_check_newline (const edit_buffer_t * buf)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static vfs_path_t *
|
||||
edit_get_save_file_as (WEdit * edit)
|
||||
edit_get_save_file_as (WEdit *edit)
|
||||
{
|
||||
static LineBreaks cur_lb = LB_ASIS;
|
||||
char *filename_res;
|
||||
|
@ -432,7 +432,7 @@ edit_get_save_file_as (WEdit * edit)
|
|||
/** returns TRUE on success */
|
||||
|
||||
static gboolean
|
||||
edit_save_cmd (WEdit * edit)
|
||||
edit_save_cmd (WEdit *edit)
|
||||
{
|
||||
int res, save_lock = 0;
|
||||
|
||||
|
@ -462,7 +462,7 @@ edit_save_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_delete_column_of_text (WEdit * edit, off_t m1, off_t m2)
|
||||
edit_delete_column_of_text (WEdit *edit, off_t m1, off_t m2)
|
||||
{
|
||||
off_t n;
|
||||
off_t r;
|
||||
|
@ -504,7 +504,7 @@ edit_delete_column_of_text (WEdit * edit, off_t m1, off_t m2)
|
|||
/** if success return TRUE */
|
||||
|
||||
static gboolean
|
||||
edit_block_delete (WEdit * edit, off_t start_mark, off_t end_mark)
|
||||
edit_block_delete (WEdit *edit, off_t start_mark, off_t end_mark)
|
||||
{
|
||||
off_t curs_pos;
|
||||
long curs_line, c1, c2;
|
||||
|
@ -572,7 +572,7 @@ edit_block_delete (WEdit * edit, off_t start_mark, off_t end_mark)
|
|||
/** Return a null terminated length of text. Result must be g_free'd */
|
||||
|
||||
static unsigned char *
|
||||
edit_get_block (WEdit * edit, off_t start, off_t finish, off_t * l)
|
||||
edit_get_block (WEdit *edit, off_t start, off_t finish, off_t *l)
|
||||
{
|
||||
unsigned char *s, *r;
|
||||
|
||||
|
@ -616,7 +616,7 @@ edit_get_block (WEdit * edit, off_t start, off_t finish, off_t * l)
|
|||
/** copies a block to clipboard file */
|
||||
|
||||
static gboolean
|
||||
edit_save_block_to_clip_file (WEdit * edit, off_t start, off_t finish)
|
||||
edit_save_block_to_clip_file (WEdit *edit, off_t start, off_t finish)
|
||||
{
|
||||
gboolean ret;
|
||||
gchar *tmp;
|
||||
|
@ -631,7 +631,7 @@ edit_save_block_to_clip_file (WEdit * edit, off_t start, off_t finish)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
pipe_mail (const edit_buffer_t * buf, char *to, char *subject, char *cc)
|
||||
pipe_mail (const edit_buffer_t *buf, char *to, char *subject, char *cc)
|
||||
{
|
||||
FILE *p = 0;
|
||||
char *s = NULL;
|
||||
|
@ -677,8 +677,8 @@ pipe_mail (const edit_buffer_t * buf, char *to, char *subject, char *cc)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_insert_column_of_text (WEdit * edit, unsigned char *data, off_t size, long width,
|
||||
off_t * start_pos, off_t * end_pos, long *col1, long *col2)
|
||||
edit_insert_column_of_text (WEdit *edit, unsigned char *data, off_t size, long width,
|
||||
off_t *start_pos, off_t *end_pos, long *col1, long *col2)
|
||||
{
|
||||
off_t i, cursor;
|
||||
long col;
|
||||
|
@ -756,8 +756,7 @@ edit_syntax_onoff_cb (void *data, void *user_data)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static cb_ret_t
|
||||
editcmd_dialog_raw_key_query_cb (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
void *data)
|
||||
editcmd_dialog_raw_key_query_cb (Widget *w, Widget *sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WDialog *h = DIALOG (w);
|
||||
|
||||
|
@ -792,7 +791,7 @@ edit_refresh_cmd (void)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_syntax_onoff_cmd (WDialog * h)
|
||||
edit_syntax_onoff_cmd (WDialog *h)
|
||||
{
|
||||
edit_options.syntax_highlighting = !edit_options.syntax_highlighting;
|
||||
g_list_foreach (GROUP (h)->widgets, edit_syntax_onoff_cb, NULL);
|
||||
|
@ -807,7 +806,7 @@ edit_syntax_onoff_cmd (WDialog * h)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_show_tabs_tws_cmd (WDialog * h)
|
||||
edit_show_tabs_tws_cmd (WDialog *h)
|
||||
{
|
||||
enable_show_tabs_tws = !enable_show_tabs_tws;
|
||||
widget_draw (WIDGET (h));
|
||||
|
@ -821,7 +820,7 @@ edit_show_tabs_tws_cmd (WDialog * h)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_show_margin_cmd (WDialog * h)
|
||||
edit_show_margin_cmd (WDialog *h)
|
||||
{
|
||||
edit_options.show_right_margin = !edit_options.show_right_margin;
|
||||
widget_draw (WIDGET (h));
|
||||
|
@ -835,7 +834,7 @@ edit_show_margin_cmd (WDialog * h)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_show_numbers_cmd (WDialog * h)
|
||||
edit_show_numbers_cmd (WDialog *h)
|
||||
{
|
||||
edit_options.line_state = !edit_options.line_state;
|
||||
edit_options.line_state_width = edit_options.line_state ? LINE_STATE_WIDTH : 0;
|
||||
|
@ -895,7 +894,7 @@ edit_save_mode_cmd (void)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_set_filename (WEdit * edit, const vfs_path_t * name_vpath)
|
||||
edit_set_filename (WEdit *edit, const vfs_path_t *name_vpath)
|
||||
{
|
||||
vfs_path_free (edit->filename_vpath, TRUE);
|
||||
edit->filename_vpath = vfs_path_clone (name_vpath);
|
||||
|
@ -909,7 +908,7 @@ edit_set_filename (WEdit * edit, const vfs_path_t * name_vpath)
|
|||
but only if they have made a change to the filename */
|
||||
/* returns TRUE on success */
|
||||
gboolean
|
||||
edit_save_as_cmd (WEdit * edit)
|
||||
edit_save_as_cmd (WEdit *edit)
|
||||
{
|
||||
/* This heads the 'Save As' dialog box */
|
||||
vfs_path_t *exp_vpath;
|
||||
|
@ -1014,7 +1013,7 @@ edit_save_as_cmd (WEdit * edit)
|
|||
/** returns TRUE on success */
|
||||
|
||||
gboolean
|
||||
edit_save_confirm_cmd (WEdit * edit)
|
||||
edit_save_confirm_cmd (WEdit *edit)
|
||||
{
|
||||
if (edit->filename_vpath == NULL)
|
||||
return edit_save_as_cmd (edit);
|
||||
|
@ -1046,7 +1045,7 @@ edit_save_confirm_cmd (WEdit * edit)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_load_cmd (WDialog * h)
|
||||
edit_load_cmd (WDialog *h)
|
||||
{
|
||||
char *exp;
|
||||
gboolean ret = TRUE; /* possible cancel */
|
||||
|
@ -1083,7 +1082,7 @@ edit_load_cmd (WDialog * h)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_load_file_from_filename (WDialog * h, const edit_arg_t * arg)
|
||||
edit_load_file_from_filename (WDialog *h, const edit_arg_t *arg)
|
||||
{
|
||||
WRect r = WIDGET (h)->rect;
|
||||
|
||||
|
@ -1100,7 +1099,7 @@ edit_load_file_from_filename (WDialog * h, const edit_arg_t * arg)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_load_file_from_history (WDialog * h)
|
||||
edit_load_file_from_history (WDialog *h)
|
||||
{
|
||||
char *exp;
|
||||
int action;
|
||||
|
@ -1131,7 +1130,7 @@ edit_load_file_from_history (WDialog * h)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_load_syntax_file (WDialog * h)
|
||||
edit_load_syntax_file (WDialog *h)
|
||||
{
|
||||
vfs_path_t *extdir_vpath;
|
||||
int dir = 0;
|
||||
|
@ -1181,7 +1180,7 @@ edit_load_syntax_file (WDialog * h)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_load_menu_file (WDialog * h)
|
||||
edit_load_menu_file (WDialog *h)
|
||||
{
|
||||
vfs_path_t *buffer_vpath;
|
||||
vfs_path_t *menufile_vpath;
|
||||
|
@ -1249,7 +1248,7 @@ edit_load_menu_file (WDialog * h)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_close_cmd (WEdit * edit)
|
||||
edit_close_cmd (WEdit *edit)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
|
@ -1285,7 +1284,7 @@ edit_close_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_block_copy_cmd (WEdit * edit)
|
||||
edit_block_copy_cmd (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark, current = edit->buffer.curs1;
|
||||
off_t mark1 = 0, mark2 = 0;
|
||||
|
@ -1337,7 +1336,7 @@ edit_block_copy_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_block_move_cmd (WEdit * edit)
|
||||
edit_block_move_cmd (WEdit *edit)
|
||||
{
|
||||
off_t current;
|
||||
unsigned char *copy_buf = NULL;
|
||||
|
@ -1442,7 +1441,7 @@ edit_block_move_cmd (WEdit * edit)
|
|||
/** returns FALSE if canceelled by user */
|
||||
|
||||
gboolean
|
||||
edit_block_delete_cmd (WEdit * edit)
|
||||
edit_block_delete_cmd (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
|
||||
|
@ -1462,7 +1461,7 @@ edit_block_delete_cmd (WEdit * edit)
|
|||
*/
|
||||
|
||||
gboolean
|
||||
edit_ok_to_exit (WEdit * edit)
|
||||
edit_ok_to_exit (WEdit *edit)
|
||||
{
|
||||
const char *fname = N_("[NoName]");
|
||||
char *msg;
|
||||
|
@ -1523,7 +1522,7 @@ edit_ok_to_exit (WEdit * edit)
|
|||
/** save block, returns TRUE on success */
|
||||
|
||||
gboolean
|
||||
edit_save_block (WEdit * edit, const char *filename, off_t start, off_t finish)
|
||||
edit_save_block (WEdit *edit, const char *filename, off_t start, off_t finish)
|
||||
{
|
||||
int file;
|
||||
off_t len = 1;
|
||||
|
@ -1584,7 +1583,7 @@ edit_save_block (WEdit * edit, const char *filename, off_t start, off_t finish)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_paste_from_history (WEdit * edit)
|
||||
edit_paste_from_history (WEdit *edit)
|
||||
{
|
||||
(void) edit;
|
||||
edit_error_dialog (_("Error"), _("This function is not implemented"));
|
||||
|
@ -1593,7 +1592,7 @@ edit_paste_from_history (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_copy_to_X_buf_cmd (WEdit * edit)
|
||||
edit_copy_to_X_buf_cmd (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
|
||||
|
@ -1617,7 +1616,7 @@ edit_copy_to_X_buf_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_cut_to_X_buf_cmd (WEdit * edit)
|
||||
edit_cut_to_X_buf_cmd (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
|
||||
|
@ -1641,7 +1640,7 @@ edit_cut_to_X_buf_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_paste_from_X_buf_cmd (WEdit * edit)
|
||||
edit_paste_from_X_buf_cmd (WEdit *edit)
|
||||
{
|
||||
vfs_path_t *tmp;
|
||||
gboolean ret;
|
||||
|
@ -1662,7 +1661,7 @@ edit_paste_from_X_buf_cmd (WEdit * edit)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_goto_cmd (WEdit * edit)
|
||||
edit_goto_cmd (WEdit *edit)
|
||||
{
|
||||
static gboolean first_run = TRUE;
|
||||
|
||||
|
@ -1700,7 +1699,7 @@ edit_goto_cmd (WEdit * edit)
|
|||
/** Return TRUE on success */
|
||||
|
||||
gboolean
|
||||
edit_save_block_cmd (WEdit * edit)
|
||||
edit_save_block_cmd (WEdit *edit)
|
||||
{
|
||||
off_t start_mark, end_mark;
|
||||
char *exp, *tmp;
|
||||
|
@ -1735,7 +1734,7 @@ edit_save_block_cmd (WEdit * edit)
|
|||
|
||||
/** returns TRUE on success */
|
||||
gboolean
|
||||
edit_insert_file_cmd (WEdit * edit)
|
||||
edit_insert_file_cmd (WEdit *edit)
|
||||
{
|
||||
char *tmp;
|
||||
char *exp;
|
||||
|
@ -1770,7 +1769,7 @@ edit_insert_file_cmd (WEdit * edit)
|
|||
/** sorts a block, returns -1 on system fail, 1 on cancel and 0 on success */
|
||||
|
||||
int
|
||||
edit_sort_cmd (WEdit * edit)
|
||||
edit_sort_cmd (WEdit *edit)
|
||||
{
|
||||
char *exp, *tmp, *tmp_edit_block_name, *tmp_edit_temp_name;
|
||||
off_t start_mark, end_mark;
|
||||
|
@ -1844,7 +1843,7 @@ edit_sort_cmd (WEdit * edit)
|
|||
*/
|
||||
|
||||
int
|
||||
edit_ext_cmd (WEdit * edit)
|
||||
edit_ext_cmd (WEdit *edit)
|
||||
{
|
||||
char *exp, *tmp, *tmp_edit_temp_file;
|
||||
int e;
|
||||
|
@ -1891,7 +1890,7 @@ edit_ext_cmd (WEdit * edit)
|
|||
command, that just produces some output which is to be inserted */
|
||||
|
||||
void
|
||||
edit_block_process_cmd (WEdit * edit, int macro_number)
|
||||
edit_block_process_cmd (WEdit *edit, int macro_number)
|
||||
{
|
||||
char *fname;
|
||||
char *macros_fname = NULL;
|
||||
|
@ -1907,7 +1906,7 @@ edit_block_process_cmd (WEdit * edit, int macro_number)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_mail_dialog (WEdit * edit)
|
||||
edit_mail_dialog (WEdit *edit)
|
||||
{
|
||||
char *mail_to, *mail_subject, *mail_cc;
|
||||
|
||||
|
@ -1948,7 +1947,7 @@ edit_mail_dialog (WEdit * edit)
|
|||
|
||||
#ifdef HAVE_CHARSET
|
||||
void
|
||||
edit_select_codepage_cmd (WEdit * edit)
|
||||
edit_select_codepage_cmd (WEdit *edit)
|
||||
{
|
||||
if (do_select_codepage ())
|
||||
edit_set_codeset (edit);
|
||||
|
@ -1961,7 +1960,7 @@ edit_select_codepage_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_insert_literal_cmd (WEdit * edit)
|
||||
edit_insert_literal_cmd (WEdit *edit)
|
||||
{
|
||||
int char_for_insertion;
|
||||
|
||||
|
@ -1973,7 +1972,7 @@ edit_insert_literal_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_load_forward_cmd (WEdit * edit)
|
||||
edit_load_forward_cmd (WEdit *edit)
|
||||
{
|
||||
if (edit->modified
|
||||
&& edit_query_dialog2 (_("Warning"),
|
||||
|
@ -2001,7 +2000,7 @@ edit_load_forward_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_load_back_cmd (WEdit * edit)
|
||||
edit_load_back_cmd (WEdit *edit)
|
||||
{
|
||||
if (edit->modified
|
||||
&& edit_query_dialog2 (_("Warning"),
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
*/
|
||||
|
||||
static GString *
|
||||
edit_collect_completions_get_current_word (edit_search_status_msg_t * esm, mc_search_t * srch,
|
||||
edit_collect_completions_get_current_word (edit_search_status_msg_t *esm, mc_search_t *srch,
|
||||
off_t word_start)
|
||||
{
|
||||
WEdit *edit = esm->edit;
|
||||
|
@ -105,10 +105,10 @@ edit_collect_completions_get_current_word (edit_search_status_msg_t * esm, mc_se
|
|||
*/
|
||||
|
||||
static void
|
||||
edit_collect_completion_from_one_buffer (gboolean active_buffer, GQueue ** compl,
|
||||
mc_search_t * srch, edit_search_status_msg_t * esm,
|
||||
edit_collect_completion_from_one_buffer (gboolean active_buffer, GQueue **compl,
|
||||
mc_search_t *srch, edit_search_status_msg_t *esm,
|
||||
off_t word_start, gsize word_len, off_t last_byte,
|
||||
GString * current_word, int *max_width)
|
||||
GString *current_word, int *max_width)
|
||||
{
|
||||
GString *temp = NULL;
|
||||
gsize len = 0;
|
||||
|
@ -218,7 +218,7 @@ edit_collect_completion_from_one_buffer (gboolean active_buffer, GQueue ** compl
|
|||
*/
|
||||
|
||||
static GQueue *
|
||||
edit_collect_completions (WEdit * edit, off_t word_start, gsize word_len,
|
||||
edit_collect_completions (WEdit *edit, off_t word_start, gsize word_len,
|
||||
const char *match_expr, int *max_width)
|
||||
{
|
||||
GQueue *compl = NULL;
|
||||
|
@ -321,7 +321,7 @@ edit_collect_completions (WEdit * edit, off_t word_start, gsize word_len,
|
|||
*/
|
||||
|
||||
static void
|
||||
edit_complete_word_insert_recoded_completion (WEdit * edit, char *completion, gsize word_len)
|
||||
edit_complete_word_insert_recoded_completion (WEdit *edit, char *completion, gsize word_len)
|
||||
{
|
||||
#ifdef HAVE_CHARSET
|
||||
GString *temp;
|
||||
|
@ -354,7 +354,7 @@ edit_completion_string_free (gpointer data)
|
|||
|
||||
/* Public function for unit tests */
|
||||
char *
|
||||
edit_completion_dialog_show (const WEdit * edit, GQueue * compl, int max_width)
|
||||
edit_completion_dialog_show (const WEdit *edit, GQueue *compl, int max_width)
|
||||
{
|
||||
const WRect *we = &CONST_WIDGET (edit)->rect;
|
||||
int start_x, start_y, offset;
|
||||
|
@ -424,7 +424,7 @@ edit_completion_dialog_show (const WEdit * edit, GQueue * compl, int max_width)
|
|||
*/
|
||||
|
||||
void
|
||||
edit_complete_word_cmd (WEdit * edit)
|
||||
edit_complete_word_cmd (WEdit *edit)
|
||||
{
|
||||
off_t word_start = 0;
|
||||
gsize word_len = 0;
|
||||
|
|
|
@ -98,7 +98,7 @@ printwstr (const char *s, int len)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
status_string (WEdit * edit, char *s, int w)
|
||||
status_string (WEdit *edit, char *s, int w)
|
||||
{
|
||||
char byte_str[16];
|
||||
|
||||
|
@ -179,7 +179,7 @@ status_string (WEdit * edit, char *s, int w)
|
|||
*/
|
||||
|
||||
static inline void
|
||||
edit_status_fullscreen (WEdit * edit, int color)
|
||||
edit_status_fullscreen (WEdit *edit, int color)
|
||||
{
|
||||
Widget *h = WIDGET (WIDGET (edit)->owner);
|
||||
const int w = h->rect.cols;
|
||||
|
@ -243,7 +243,7 @@ edit_status_fullscreen (WEdit * edit, int color)
|
|||
*/
|
||||
|
||||
static inline void
|
||||
edit_status_window (WEdit * edit)
|
||||
edit_status_window (WEdit *edit)
|
||||
{
|
||||
Widget *w = WIDGET (edit);
|
||||
int y, x;
|
||||
|
@ -334,7 +334,7 @@ edit_status_window (WEdit * edit)
|
|||
*/
|
||||
|
||||
static inline void
|
||||
edit_draw_frame (const WEdit * edit, int color, gboolean active)
|
||||
edit_draw_frame (const WEdit *edit, int color, gboolean active)
|
||||
{
|
||||
const Widget *w = CONST_WIDGET (edit);
|
||||
|
||||
|
@ -360,7 +360,7 @@ edit_draw_frame (const WEdit * edit, int color, gboolean active)
|
|||
*/
|
||||
|
||||
static inline void
|
||||
edit_draw_window_icons (const WEdit * edit, int color)
|
||||
edit_draw_window_icons (const WEdit *edit, int color)
|
||||
{
|
||||
const Widget *w = CONST_WIDGET (edit);
|
||||
char tmp[17];
|
||||
|
@ -377,7 +377,7 @@ edit_draw_window_icons (const WEdit * edit, int color)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
|
||||
print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
|
||||
long end_col, line_s line[], char *status, int bookmarked)
|
||||
{
|
||||
Widget *w = WIDGET (edit);
|
||||
|
@ -492,7 +492,7 @@ print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
|
|||
/** b is a pointer to the beginning of the line */
|
||||
|
||||
static void
|
||||
edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_col)
|
||||
edit_draw_this_line (WEdit *edit, off_t b, long row, long start_col, long end_col)
|
||||
{
|
||||
Widget *w = WIDGET (edit);
|
||||
line_s line[MAX_LINE_LEN];
|
||||
|
@ -820,7 +820,7 @@ edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
edit_draw_this_char (WEdit * edit, off_t curs, long row, long start_column, long end_column)
|
||||
edit_draw_this_char (WEdit *edit, off_t curs, long row, long start_column, long end_column)
|
||||
{
|
||||
off_t b;
|
||||
|
||||
|
@ -832,7 +832,7 @@ edit_draw_this_char (WEdit * edit, off_t curs, long row, long start_column, long
|
|||
/** cursor must be in screen for other than REDRAW_PAGE passed in force */
|
||||
|
||||
static inline void
|
||||
render_edit_text (WEdit * edit, long start_row, long start_column, long end_row, long end_column)
|
||||
render_edit_text (WEdit *edit, long start_row, long start_column, long end_row, long end_column)
|
||||
{
|
||||
static long prev_curs_row = 0;
|
||||
static off_t prev_curs = 0;
|
||||
|
@ -995,7 +995,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline void
|
||||
edit_render (WEdit * edit, int page, int row_start, int col_start, int row_end, int col_end)
|
||||
edit_render (WEdit *edit, int page, int row_start, int col_start, int row_end, int col_end)
|
||||
{
|
||||
if (page != 0) /* if it was an expose event, 'page' would be set */
|
||||
edit->force |= REDRAW_PAGE | REDRAW_IN_BOUNDS;
|
||||
|
@ -1016,7 +1016,7 @@ edit_render (WEdit * edit, int page, int row_start, int col_start, int row_end,
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_status (WEdit * edit, gboolean active)
|
||||
edit_status (WEdit *edit, gboolean active)
|
||||
{
|
||||
int color;
|
||||
|
||||
|
@ -1040,7 +1040,7 @@ edit_status (WEdit * edit, gboolean active)
|
|||
|
||||
/** this scrolls the text so that cursor is on the screen */
|
||||
void
|
||||
edit_scroll_screen_over_cursor (WEdit * edit)
|
||||
edit_scroll_screen_over_cursor (WEdit *edit)
|
||||
{
|
||||
WRect *w = &WIDGET (edit)->rect;
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ edit_scroll_screen_over_cursor (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_render_keypress (WEdit * edit)
|
||||
edit_render_keypress (WEdit *edit)
|
||||
{
|
||||
edit_render (edit, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
edit_macro_comparator (gconstpointer * macro1, gconstpointer * macro2)
|
||||
edit_macro_comparator (gconstpointer *macro1, gconstpointer *macro2)
|
||||
{
|
||||
const macros_t *m1 = (const macros_t *) macro1;
|
||||
const macros_t *m2 = (const macros_t *) macro2;
|
||||
|
@ -72,7 +72,7 @@ edit_macro_sort_by_hotkey (void)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static int
|
||||
edit_get_macro (WEdit * edit, int hotkey)
|
||||
edit_get_macro (WEdit *edit, int hotkey)
|
||||
{
|
||||
macros_t *array_start;
|
||||
macros_t *result;
|
||||
|
@ -97,7 +97,7 @@ edit_get_macro (WEdit * edit, int hotkey)
|
|||
|
||||
/** returns FALSE on error */
|
||||
static gboolean
|
||||
edit_delete_macro (WEdit * edit, int hotkey)
|
||||
edit_delete_macro (WEdit *edit, int hotkey)
|
||||
{
|
||||
mc_config_t *macros_config = NULL;
|
||||
const char *section_name = "editor";
|
||||
|
@ -137,7 +137,7 @@ edit_delete_macro (WEdit * edit, int hotkey)
|
|||
|
||||
/** returns FALSE on error */
|
||||
gboolean
|
||||
edit_store_macro_cmd (WEdit * edit)
|
||||
edit_store_macro_cmd (WEdit *edit)
|
||||
{
|
||||
int i;
|
||||
int hotkey;
|
||||
|
@ -223,7 +223,7 @@ edit_store_macro_cmd (WEdit * edit)
|
|||
/** return FALSE on error */
|
||||
|
||||
gboolean
|
||||
edit_load_macro_cmd (WEdit * edit)
|
||||
edit_load_macro_cmd (WEdit *edit)
|
||||
{
|
||||
mc_config_t *macros_config = NULL;
|
||||
gchar **profile_keys, **keys;
|
||||
|
@ -316,7 +316,7 @@ edit_load_macro_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_delete_macro_cmd (WEdit * edit)
|
||||
edit_delete_macro_cmd (WEdit *edit)
|
||||
{
|
||||
int hotkey;
|
||||
|
||||
|
@ -329,7 +329,7 @@ edit_delete_macro_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_repeat_macro_cmd (WEdit * edit)
|
||||
edit_repeat_macro_cmd (WEdit *edit)
|
||||
{
|
||||
gboolean ok;
|
||||
char *f;
|
||||
|
@ -371,7 +371,7 @@ edit_repeat_macro_cmd (WEdit * edit)
|
|||
|
||||
/** returns FALSE on error */
|
||||
gboolean
|
||||
edit_execute_macro (WEdit * edit, int hotkey)
|
||||
edit_execute_macro (WEdit *edit, int hotkey)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
|
||||
|
@ -409,7 +409,7 @@ edit_execute_macro (WEdit * edit, int hotkey)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_begin_end_macro_cmd (WEdit * edit)
|
||||
edit_begin_end_macro_cmd (WEdit *edit)
|
||||
{
|
||||
/* edit is a pointer to the widget */
|
||||
if (edit != NULL)
|
||||
|
@ -423,7 +423,7 @@ edit_begin_end_macro_cmd (WEdit * edit)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_begin_end_repeat_cmd (WEdit * edit)
|
||||
edit_begin_end_repeat_cmd (WEdit *edit)
|
||||
{
|
||||
/* edit is a pointer to the widget */
|
||||
if (edit != NULL)
|
||||
|
|
|
@ -256,7 +256,7 @@ create_options_menu (void)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
edit_drop_menu_cmd (WDialog * h, int which)
|
||||
edit_drop_menu_cmd (WDialog *h, int which)
|
||||
{
|
||||
WMenuBar *menubar;
|
||||
|
||||
|
@ -269,7 +269,7 @@ edit_drop_menu_cmd (WDialog * h, int which)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_init_menu (WMenuBar * menubar)
|
||||
edit_init_menu (WMenuBar *menubar)
|
||||
{
|
||||
menubar_add_menu (menubar,
|
||||
menu_new (_("&File"), create_file_menu (), "[Internal File Editor]"));
|
||||
|
@ -291,7 +291,7 @@ edit_init_menu (WMenuBar * menubar)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
edit_menu_cmd (WDialog * h)
|
||||
edit_menu_cmd (WDialog *h)
|
||||
{
|
||||
edit_drop_menu_cmd (h, -1);
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ edit_menu_cmd (WDialog * h)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
edit_drop_hotkey_menu (WDialog * h, int key)
|
||||
edit_drop_hotkey_menu (WDialog *h, int key)
|
||||
{
|
||||
int m = 0;
|
||||
switch (key)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue