mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 13:14:29 -08:00
add const qualifiers to some variables
This commit is contained in:
@@ -32,7 +32,7 @@ static int _decode_file_get_info(mfhttp * conn, void *data);
|
||||
|
||||
int mfconn_api_file_get_info(mfconn * conn, mffile * file, char *quickkey)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
int len;
|
||||
mfhttp *http;
|
||||
@@ -59,7 +59,7 @@ int mfconn_api_file_get_info(mfconn * conn, mffile * file, char *quickkey)
|
||||
retval = http_get_buf(http, api_call, _decode_file_get_info, file);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -86,15 +86,15 @@ static int _decode_file_get_info(mfhttp * conn, void *data)
|
||||
|
||||
quickkey = json_object_get(node, "quickkey");
|
||||
if (quickkey != NULL)
|
||||
file_set_key(file, (char *)json_string_value(quickkey));
|
||||
file_set_key(file, json_string_value(quickkey));
|
||||
|
||||
file_name = json_object_get(node, "filename");
|
||||
if (file_name != NULL)
|
||||
file_set_name(file, (char *)json_string_value(file_name));
|
||||
file_set_name(file, json_string_value(file_name));
|
||||
|
||||
file_hash = json_object_get(node, "hash");
|
||||
if (file_hash != NULL) {
|
||||
file_set_hash(file, (char *)json_string_value(file_hash));
|
||||
file_set_hash(file, json_string_value(file_hash));
|
||||
}
|
||||
|
||||
if (quickkey == NULL)
|
||||
|
||||
@@ -32,7 +32,7 @@ static int _decode_file_get_links(mfhttp * conn, void *data);
|
||||
|
||||
int mfconn_api_file_get_links(mfconn * conn, mffile * file, char *quickkey)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
int len;
|
||||
mfhttp *http;
|
||||
@@ -59,7 +59,7 @@ int mfconn_api_file_get_links(mfconn * conn, mffile * file, char *quickkey)
|
||||
retval = http_get_buf(http, api_call, _decode_file_get_links, file);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -96,15 +96,15 @@ static int _decode_file_get_links(mfhttp * conn, void *data)
|
||||
|
||||
quickkey = json_object_get(node, "quickkey");
|
||||
if (quickkey != NULL)
|
||||
file_set_key(file, (char *)json_string_value(quickkey));
|
||||
file_set_key(file, json_string_value(quickkey));
|
||||
|
||||
share_link = json_object_get(node, "normal_download");
|
||||
if (share_link != NULL)
|
||||
file_set_share_link(file, (char *)json_string_value(share_link));
|
||||
file_set_share_link(file, json_string_value(share_link));
|
||||
|
||||
direct_link = json_object_get(node, "direct_download");
|
||||
if (direct_link != NULL) {
|
||||
file_set_direct_link(file, (char *)json_string_value(direct_link));
|
||||
file_set_direct_link(file, json_string_value(direct_link));
|
||||
}
|
||||
|
||||
onetime_link = json_object_get(node, "one_time_download");
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
int mfconn_api_folder_create(mfconn * conn, char *parent, char *name)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
mfhttp *http;
|
||||
|
||||
@@ -64,7 +64,7 @@ int mfconn_api_folder_create(mfconn * conn, char *parent, char *name)
|
||||
retval = http_get_buf(http, api_call, NULL, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
int mfconn_api_folder_delete(mfconn * conn, const char *folderkey)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
mfhttp *http;
|
||||
|
||||
@@ -48,7 +48,7 @@ int mfconn_api_folder_delete(mfconn * conn, const char *folderkey)
|
||||
retval = http_get_buf(http, api_call, NULL, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ static int _decode_folder_get_content_files(mfhttp * conn, void *data);
|
||||
long
|
||||
mfconn_api_folder_get_content(mfconn * conn, int mode, mffolder * folder_curr)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
char *content_type;
|
||||
mfhttp *http;
|
||||
@@ -75,7 +75,7 @@ mfconn_api_folder_get_content(mfconn * conn, int mode, mffolder * folder_curr)
|
||||
_decode_folder_get_content_files, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static int _decode_folder_get_info(mfhttp * conn, void *data);
|
||||
int
|
||||
mfconn_api_folder_get_info(mfconn * conn, mffolder * folder, char *folderkey)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
mfhttp *http;
|
||||
|
||||
@@ -59,7 +59,7 @@ mfconn_api_folder_get_info(mfconn * conn, mffolder * folder, char *folderkey)
|
||||
retval = http_get_buf(http, api_call, _decode_folder_get_info, folder);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -86,15 +86,15 @@ static int _decode_folder_get_info(mfhttp * conn, void *data)
|
||||
|
||||
folderkey = json_object_get(node, "folderkey");
|
||||
if (folderkey != NULL)
|
||||
folder_set_key(folder, (char *)json_string_value(folderkey));
|
||||
folder_set_key(folder, json_string_value(folderkey));
|
||||
|
||||
folder_name = json_object_get(node, "name");
|
||||
if (folder_name != NULL)
|
||||
folder_set_name(folder, (char *)json_string_value(folder_name));
|
||||
folder_set_name(folder, json_string_value(folder_name));
|
||||
|
||||
parent_folder = json_object_get(node, "parent_folderkey");
|
||||
if (parent_folder != NULL) {
|
||||
folder_set_parent(folder, (char *)json_string_value(parent_folder));
|
||||
folder_set_parent(folder, json_string_value(parent_folder));
|
||||
}
|
||||
// infer that the parent folder must be "myfiles" root
|
||||
if (parent_folder == NULL && folderkey != NULL)
|
||||
|
||||
@@ -30,7 +30,7 @@ static int _decode_user_get_info(mfhttp * conn, void *data);
|
||||
|
||||
int mfconn_api_user_get_info(mfconn * conn)
|
||||
{
|
||||
char *api_call;
|
||||
const char *api_call;
|
||||
int retval;
|
||||
mfhttp *http;
|
||||
|
||||
@@ -46,7 +46,7 @@ int mfconn_api_user_get_info(mfconn * conn)
|
||||
retval = http_get_buf(http, api_call, _decode_user_get_info, NULL);
|
||||
http_destroy(http);
|
||||
|
||||
free(api_call);
|
||||
free((void *)api_call);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -69,15 +69,15 @@ static int _decode_user_get_info(mfhttp * conn, void *data)
|
||||
|
||||
email = json_object_get(node, "email");
|
||||
if (email != NULL)
|
||||
printf("Email: %s\n\r", (char *)json_string_value(email));
|
||||
printf("Email: %s\n\r", json_string_value(email));
|
||||
|
||||
first_name = json_object_get(node, "first_name");
|
||||
if (first_name != NULL)
|
||||
printf("Name: %s ", (char *)json_string_value(first_name));
|
||||
printf("Name: %s ", json_string_value(first_name));
|
||||
|
||||
last_name = json_object_get(node, "last_name");
|
||||
if (node != NULL)
|
||||
printf("%s", (char *)json_string_value(last_name));
|
||||
printf("%s", json_string_value(last_name));
|
||||
|
||||
printf("\n\r");
|
||||
|
||||
|
||||
@@ -38,15 +38,16 @@ struct user_get_session_token_response {
|
||||
};
|
||||
|
||||
int
|
||||
mfconn_api_user_get_session_token(mfconn * conn, char *server,
|
||||
char *username, char *password,
|
||||
int app_id, char *app_key,
|
||||
mfconn_api_user_get_session_token(mfconn * conn, const char *server,
|
||||
const char *username, const char *password,
|
||||
int app_id, const char *app_key,
|
||||
uint32_t * secret_key,
|
||||
char **secret_time, char **session_token)
|
||||
char **secret_time,
|
||||
char **session_token)
|
||||
{
|
||||
char *login_url;
|
||||
char *post_args;
|
||||
char *user_signature;
|
||||
const char *user_signature;
|
||||
int retval;
|
||||
struct user_get_session_token_response response;
|
||||
mfhttp *http;
|
||||
@@ -69,7 +70,7 @@ mfconn_api_user_get_session_token(mfconn * conn, char *server,
|
||||
"&token_version=2"
|
||||
"&response_format=json",
|
||||
username, password, user_signature);
|
||||
free(user_signature);
|
||||
free((void *)user_signature);
|
||||
|
||||
http = http_create();
|
||||
retval =
|
||||
|
||||
Reference in New Issue
Block a user