mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-03 17:07:00 +03:00
* view.c (view_init): Constify "_command" argument.
(view): Likewise. (do_view_init): Likewise. (init_growing_view): Constify "name" and "filename" args. * view.h: Fix declarations and comment.
This commit is contained in:
parent
35931b119e
commit
3058921b75
@ -1,5 +1,11 @@
|
||||
2003-09-09 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* view.c (view_init): Constify "_command" argument.
|
||||
(view): Likewise.
|
||||
(do_view_init): Likewise.
|
||||
(init_growing_view): Constify "name" and "filename" args.
|
||||
* view.h: Fix declarations and comment.
|
||||
|
||||
* user.c (execute_menu_command: Fix rare segmentation violation
|
||||
if last line in menu file contain space(s) only and no trailing
|
||||
newline.
|
||||
|
@ -516,7 +516,7 @@ set_view_init_error (WView *view, const char *msg)
|
||||
|
||||
/* return values: NULL for success, else points to error message */
|
||||
static char *
|
||||
init_growing_view (WView *view, char *name, char *filename)
|
||||
init_growing_view (WView *view, const char *name, const char *filename)
|
||||
{
|
||||
char *err_msg = NULL;
|
||||
|
||||
@ -605,7 +605,7 @@ load_view_file (WView *view, int fd)
|
||||
|
||||
/* Return zero on success, -1 on failure */
|
||||
static int
|
||||
do_view_init (WView *view, char *_command, const char *_file,
|
||||
do_view_init (WView *view, const char *_command, const char *_file,
|
||||
int start_line)
|
||||
{
|
||||
char *error = 0;
|
||||
@ -758,7 +758,7 @@ view_update_bytes_per_line (WView *view)
|
||||
/* Both views */
|
||||
/* Return zero on success, -1 on failure */
|
||||
int
|
||||
view_init (WView *view, char *_command, const char *_file, int start_line)
|
||||
view_init (WView *view, const char *_command, const char *_file, int start_line)
|
||||
{
|
||||
if (!view->view_active || strcmp (_file, view->filename)
|
||||
|| altered_magic_flag)
|
||||
@ -2623,7 +2623,7 @@ view_dialog_callback (Dlg_head *h, dlg_msg_t msg, int parm)
|
||||
|
||||
/* Real view only */
|
||||
int
|
||||
view (char *_command, const char *_file, int *move_dir_p, int start_line)
|
||||
view (const char *_command, const char *_file, int *move_dir_p, int start_line)
|
||||
{
|
||||
int error;
|
||||
WView *wview;
|
||||
|
10
src/view.h
10
src/view.h
@ -6,15 +6,15 @@ typedef struct WView WView;
|
||||
|
||||
/* Creation/initialization of a new view widget */
|
||||
WView *view_new (int y, int x, int cols, int lines, int is_panel);
|
||||
int view_init (WView *view, char *_command, const char *_file,
|
||||
int view_init (WView *view, const char *_command, const char *_file,
|
||||
int start_line);
|
||||
|
||||
void view_update_bytes_per_line (WView *view);
|
||||
|
||||
/* Command: view a file, if _command != NULL we use popen on _command */
|
||||
/* move direction should be apointer that will hold the direction in which the user */
|
||||
/* wants to move (-1 previous file, 1 next file, 0 do nothing) */
|
||||
int view (char *_command, const char *_file, int *move_direction,
|
||||
/* Command: view a _file, if _command != NULL we use popen on _command */
|
||||
/* move direction should be a pointer that will hold the direction in which */
|
||||
/* the user wants to move (-1 previous file, 1 next file, 0 do nothing) */
|
||||
int view (const char *_command, const char *_file, int *move_direction,
|
||||
int start_line);
|
||||
|
||||
extern int mouse_move_pages_viewer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user