mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 21:24:28 -08:00
add const qualifiers to some variables
This commit is contained in:
@@ -22,36 +22,52 @@
|
||||
|
||||
#include "mfshell.h"
|
||||
|
||||
int mfshell_cmd_help(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_help(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_debug(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_debug(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_host(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_host(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_auth(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_auth(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_whomai(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_whomai(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_list(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_list(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_chdir(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_chdir(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_pwd(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_pwd(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_lpwd(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_lpwd(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_lcd(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_lcd(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_file(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_file(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_links(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_links(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_mkdir(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_mkdir(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_get(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_get(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_whoami(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_whoami(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
int mfshell_cmd_rmdir(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_cmd_rmdir(mfshell * mfshell, int argc,
|
||||
char *const argv[]);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ static char *_get_login_from_user(void);
|
||||
|
||||
static char *_get_passwd_from_user(void);
|
||||
|
||||
int mfshell_cmd_auth(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_auth(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
char *username;
|
||||
char *password;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_chdir(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_chdir(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
mffolder *folder_new;
|
||||
const char *folder_curr;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_debug(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_debug(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
if (argc != 1) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_file(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_file(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
mffile *file;
|
||||
int len;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_get(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_get(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
mffile *file;
|
||||
int len;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "../mfshell.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_help(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_help(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
unsigned int column1_width = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
static char *_get_host_from_user(void);
|
||||
|
||||
int mfshell_cmd_host(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_host(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
char *alt_host = NULL;
|
||||
char *host;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../mfshell.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_lcd(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_lcd(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
int retval;
|
||||
const char *dir;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_links(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_links(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
mffile *file;
|
||||
int len;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_list(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_list(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
int retval;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../mfshell.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_lpwd(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_lpwd(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
if (mfshell == NULL)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_mkdir(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_mkdir(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
int retval;
|
||||
const char *folder_curr;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../../mfapi/folder.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_pwd(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_pwd(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
const char *folder_name;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_rmdir(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_rmdir(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
int retval;
|
||||
const char *folderkey;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "../../mfapi/mfconn.h"
|
||||
#include "../commands.h" // IWYU pragma: keep
|
||||
|
||||
int mfshell_cmd_whoami(mfshell * mfshell, int argc, char **argv)
|
||||
int mfshell_cmd_whoami(mfshell * mfshell, int argc, char *const argv[])
|
||||
{
|
||||
(void)argv;
|
||||
int retval;
|
||||
|
||||
@@ -31,7 +31,7 @@ static void mfshell_run(mfshell * shell);
|
||||
|
||||
static void mfshell_parse_commands(mfshell * shell, char *command);
|
||||
|
||||
void print_help(char *cmd)
|
||||
void print_help(const char *cmd)
|
||||
{
|
||||
fprintf(stderr, "A shell to access a MediaFire account.\n");
|
||||
fprintf(stderr, "\n");
|
||||
@@ -61,7 +61,7 @@ void print_help(char *cmd)
|
||||
}
|
||||
|
||||
void
|
||||
parse_argv(int argc, char **argv, char **username,
|
||||
parse_argv(int argc, char *const argv[], char **username,
|
||||
char **password, char **server, char **command)
|
||||
{
|
||||
static struct option long_options[] = {
|
||||
@@ -117,7 +117,7 @@ parse_argv(int argc, char **argv, char **username,
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char *const argv[])
|
||||
{
|
||||
mfshell *shell;
|
||||
char *server = "www.mediafire.com";
|
||||
|
||||
@@ -85,7 +85,7 @@ mfshell *mfshell_create(int app_id, char *app_key, char *server)
|
||||
return shell;
|
||||
}
|
||||
|
||||
int mfshell_exec(mfshell * shell, int argc, char **argv)
|
||||
int mfshell_exec(mfshell * shell, int argc, char *const argv[])
|
||||
{
|
||||
mfcmd *curr_cmd;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ struct mfcmd {
|
||||
char *name;
|
||||
char *argstring;
|
||||
char *help;
|
||||
int (*handler) (mfshell * mfshell, int argc, char **argv);
|
||||
int (*handler) (mfshell * mfshell, int argc, char *const argv[]);
|
||||
};
|
||||
|
||||
struct mfshell {
|
||||
@@ -57,7 +57,7 @@ mfshell *mfshell_create(int app_id, char *app_key, char *server);
|
||||
|
||||
int mfshell_authenticate_user(mfshell * mfshell);
|
||||
|
||||
int mfshell_exec(mfshell * mfshell, int argc, char **argv);
|
||||
int mfshell_exec(mfshell * mfshell, int argc, char *const argv[]);
|
||||
|
||||
int mfshell_exec_shell_command(mfshell * mfshell, char *command);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user