2014-09-15 20:22:02 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2013 Bryan Christ <bryan.christ@mediafire.com>
|
2014-09-16 12:40:52 +02:00
|
|
|
* 2014 Johannes Schauer <j.schauer@email.de>
|
2014-09-15 20:22:02 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License version 2, as published by
|
|
|
|
|
* the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc., 51
|
|
|
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2014-09-20 09:40:59 +02:00
|
|
|
#ifndef _MFAPI_APICALLS_H_
|
|
|
|
|
#define _MFAPI_APICALLS_H_
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-18 09:11:00 +02:00
|
|
|
#include <stdint.h>
|
2014-12-04 16:07:12 +01:00
|
|
|
#include <stdio.h>
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-18 09:11:00 +02:00
|
|
|
#include "file.h"
|
|
|
|
|
#include "folder.h"
|
2014-12-01 16:30:32 +01:00
|
|
|
#include "patch.h"
|
2014-09-18 09:11:00 +02:00
|
|
|
#include "mfconn.h"
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-27 13:53:44 +02:00
|
|
|
#define MFAPI_MAX_LEN_KEY 15
|
|
|
|
|
#define MFAPI_MAX_LEN_NAME 255
|
|
|
|
|
|
2014-09-25 21:51:42 +02:00
|
|
|
enum mfconn_device_change_type {
|
|
|
|
|
MFCONN_DEVICE_CHANGE_DELETED_FOLDER,
|
|
|
|
|
MFCONN_DEVICE_CHANGE_DELETED_FILE,
|
|
|
|
|
MFCONN_DEVICE_CHANGE_UPDATED_FOLDER,
|
2014-09-27 13:53:44 +02:00
|
|
|
MFCONN_DEVICE_CHANGE_UPDATED_FILE,
|
|
|
|
|
MFCONN_DEVICE_CHANGE_END
|
2014-09-25 21:51:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct mfconn_device_change {
|
|
|
|
|
enum mfconn_device_change_type change;
|
2014-09-27 13:53:44 +02:00
|
|
|
char key[16];
|
2014-09-25 21:51:42 +02:00
|
|
|
uint64_t revision;
|
2014-09-27 13:53:44 +02:00
|
|
|
char parent[16];
|
2014-09-25 21:51:42 +02:00
|
|
|
};
|
|
|
|
|
|
2014-09-20 10:59:54 +02:00
|
|
|
int mfconn_api_file_get_info(mfconn * conn, mffile * file,
|
2014-09-29 16:48:26 +02:00
|
|
|
const char *quickkey);
|
2014-09-16 12:40:52 +02:00
|
|
|
|
2014-09-20 10:59:54 +02:00
|
|
|
int mfconn_api_file_get_links(mfconn * conn, mffile * file,
|
2014-09-29 16:48:26 +02:00
|
|
|
const char *quickkey);
|
2014-09-16 12:40:52 +02:00
|
|
|
|
2014-09-24 09:34:56 +02:00
|
|
|
int mfconn_api_folder_create(mfconn * conn, const char *parent,
|
|
|
|
|
const char *name);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-20 10:59:54 +02:00
|
|
|
long mfconn_api_folder_get_content(mfconn * conn, int mode,
|
2014-09-25 13:05:17 +02:00
|
|
|
const char *folderkey,
|
2014-09-25 19:34:03 +02:00
|
|
|
mffolder *** folder_result,
|
|
|
|
|
mffile *** file_result);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-20 10:59:54 +02:00
|
|
|
int mfconn_api_folder_get_info(mfconn * conn, mffolder * folder,
|
2014-09-24 09:34:56 +02:00
|
|
|
const char *folderkey);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-20 10:59:54 +02:00
|
|
|
int mfconn_api_user_get_info(mfconn * conn);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-21 15:59:52 +02:00
|
|
|
int mfconn_api_user_get_session_token(mfconn * conn,
|
|
|
|
|
const char *server,
|
|
|
|
|
const char *username,
|
|
|
|
|
const char *password,
|
|
|
|
|
int app_id,
|
|
|
|
|
const char *app_key,
|
2014-09-20 10:59:54 +02:00
|
|
|
uint32_t * secret_key,
|
|
|
|
|
char **secret_time,
|
|
|
|
|
char **session_token);
|
2014-09-15 20:00:05 +02:00
|
|
|
|
2014-09-20 14:37:24 +02:00
|
|
|
int mfconn_api_folder_delete(mfconn * conn, const char *folderkey);
|
|
|
|
|
|
2014-12-02 10:18:12 +01:00
|
|
|
int mfconn_api_file_delete(mfconn * conn, const char *quickkey);
|
|
|
|
|
|
2014-09-25 19:34:03 +02:00
|
|
|
int mfconn_api_device_get_status(mfconn * conn,
|
|
|
|
|
uint64_t * revision);
|
2014-09-25 13:04:40 +02:00
|
|
|
|
2014-09-25 21:51:42 +02:00
|
|
|
int mfconn_api_device_get_changes(mfconn * conn, uint64_t revision, struct mfconn_device_change
|
|
|
|
|
**changes);
|
2014-09-24 18:33:04 +02:00
|
|
|
|
2014-12-01 16:30:32 +01:00
|
|
|
int mfconn_api_device_get_updates(mfconn * conn,
|
|
|
|
|
const char *quickkey,
|
|
|
|
|
uint64_t revision,
|
|
|
|
|
uint64_t target_revision,
|
|
|
|
|
mfpatch *** patches);
|
|
|
|
|
|
|
|
|
|
int mfconn_api_device_get_patch(mfconn * conn, mfpatch * patch,
|
|
|
|
|
const char *quickkey,
|
|
|
|
|
uint64_t source_revision,
|
|
|
|
|
uint64_t target_revision);
|
|
|
|
|
|
2014-12-04 10:34:54 +01:00
|
|
|
int mfconn_api_upload_simple(mfconn * conn, const char *folderkey,
|
2014-12-04 16:07:12 +01:00
|
|
|
FILE * fh, const char *file_name,
|
2014-12-04 10:34:54 +01:00
|
|
|
char **upload_key);
|
|
|
|
|
|
|
|
|
|
int mfconn_api_upload_poll_upload(mfconn * conn,
|
|
|
|
|
const char *upload_key,
|
|
|
|
|
int *status, int *fileerror);
|
|
|
|
|
|
2014-09-18 09:11:00 +02:00
|
|
|
#endif
|