
#ifdef __cplusplus
extern "C" {
#endif

struct TCFSAppCertification {
    char appid[128];
    long long timestamp;
    char sign[64];
};

struct TCFSUserCertification { // 用户签发的证书
    char address[64]; // 用户身份标识
    long long timestamp; // 签名的过期时间点（秒）
    char sign[128]; // 对结构体中成员的签名，用于对用户身份进行自校验
};

void Init(const char* appid);
void Uninit();

int AddFile(TCFSAppCertification* app, TCFSUserCertification* address, const char* srcPath, const char* destPath, char* taskID, int length);
int GetFile(TCFSAppCertification* app, TCFSUserCertification* address, const char* tcfsPath, const char* destLocalPath, char* taskID, int length);
int CopyFile(TCFSAppCertification* app, TCFSUserCertification* address, const char* tcfsPath, const char* destPath);
int DeleteFile(TCFSAppCertification* app, TCFSUserCertification* address, const char* needDeletePath);
int Dir(TCFSAppCertification* app, TCFSUserCertification* address, const char* tcfsPath, int start, int length, char* node, int lengthNode);
int GetTaskStatus(TCFSAppCertification* app, TCFSUserCertification* address, const char* taskID, char* status, int length);

int UserSign(const char* keyJson, const char* passwd, const char* data, char* sign, int length);



#ifdef __cplusplus
}
#endif