mirror of https://github.com/MidnightCommander/mc
Cleanup: args.c: recude function scope for mcedit_arg_*.
Reduce to scope for mcedit_arg_new (const char *file_name, long line_number) mcedit_arg_vpath_new (vfs_path_t * file_vpath, long line_number) and move to file scope section. Signed-off-by: Andreas Mohr <and@gmx.li> Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
7146508b31
commit
78db983626
72
src/args.c
72
src/args.c
|
@ -469,6 +469,42 @@ parse_mc_v_argument (const gchar * option_name, const gchar * value, gpointer da
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Create mcedit_arg_t object from vfs_path_t object and the line number.
|
||||
*
|
||||
* @param file_vpath file path object
|
||||
* @param line_number line number. If value is 0, try to restore saved position.
|
||||
* @return mcedit_arg_t object
|
||||
*/
|
||||
|
||||
static mcedit_arg_t *
|
||||
mcedit_arg_vpath_new (vfs_path_t * file_vpath, long line_number)
|
||||
{
|
||||
mcedit_arg_t *arg;
|
||||
|
||||
arg = g_new (mcedit_arg_t, 1);
|
||||
arg->file_vpath = file_vpath;
|
||||
arg->line_number = line_number;
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Create mcedit_arg_t object from file name and the line number.
|
||||
*
|
||||
* @param file_name file name
|
||||
* @param line_number line number. If value is 0, try to restore saved position.
|
||||
* @return mcedit_arg_t object
|
||||
*/
|
||||
|
||||
static mcedit_arg_t *
|
||||
mcedit_arg_new (const char *file_name, long line_number)
|
||||
{
|
||||
return mcedit_arg_vpath_new (vfs_path_from_str (file_name), line_number);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Get list of filenames (and line numbers) from command line, when mc called as editor
|
||||
|
@ -793,42 +829,6 @@ mc_setup_by_args (int argc, char **argv, GError ** mcerror)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Create mcedit_arg_t object from file name and the line number.
|
||||
*
|
||||
* @param file_name file name
|
||||
* @param line_number line number. If value is 0, try to restore saved position.
|
||||
* @return mcedit_arg_t object
|
||||
*/
|
||||
|
||||
mcedit_arg_t *
|
||||
mcedit_arg_new (const char *file_name, long line_number)
|
||||
{
|
||||
return mcedit_arg_vpath_new (vfs_path_from_str (file_name), line_number);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Create mcedit_arg_t object from vfs_path_t object and the line number.
|
||||
*
|
||||
* @param file_vpath file path object
|
||||
* @param line_number line number. If value is 0, try to restore saved position.
|
||||
* @return mcedit_arg_t object
|
||||
*/
|
||||
|
||||
mcedit_arg_t *
|
||||
mcedit_arg_vpath_new (vfs_path_t * file_vpath, long line_number)
|
||||
{
|
||||
mcedit_arg_t *arg;
|
||||
|
||||
arg = g_new (mcedit_arg_t, 1);
|
||||
arg->file_vpath = file_vpath;
|
||||
arg->line_number = line_number;
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Free the mcedit_arg_t object.
|
||||
|
|
|
@ -50,8 +50,6 @@ gboolean mc_args_parse (int *argc, char ***argv, const char *translation_domain,
|
|||
gboolean mc_args_show_info (void);
|
||||
gboolean mc_setup_by_args (int argc, char **argv, GError ** mcerror);
|
||||
|
||||
mcedit_arg_t *mcedit_arg_new (const char *file_name, long line_number);
|
||||
mcedit_arg_t *mcedit_arg_vpath_new (vfs_path_t * file_vpath, long line_number);
|
||||
void mcedit_arg_free (mcedit_arg_t * arg);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue