#pragma once
#include <stdlib.h>
#ifdef _MSC_VER
#ifndef MSOC_DONT_AUTO_LINK
#pragma comment(lib, "msoc.lib")
#endif
#ifdef _WIN64
#define MSOC_DLL_EXPORT
#else
#define MSOC_DLL_EXPORT __stdcall
#endif
#else
#define MSOC_DLL_EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define MSOC_NOERR 0
#define MSOC_ERR_NOT_SUPPORT (-1)
#define MSOC_ERR_ALREADY_ENCRYPTED (-2)
#define MSOC_ERR_ALREADY_DECRYPTED (-3)
#define MSOC_ERR_BAD_PASSWORD (-4)
#define MSOC_ERR_BAD_PARAMETER (-5)
#define MSOC_ERR_SMALL_MAX_SIZE (-6)
#define MSOC_ERR_NO_MEMORY (-7)
#define MSOC_ERR_EXCEPTION (-8)
#define MSOC_ERR_TOO_LARGE_FILE (-9)
#define MSOC_ERR_INFILE_IS_EMPTY (-10)
#define MSOC_ERR_OUTFILE_IS_EMPTY (-11)
#define MSOC_ERR_PASS_IS_EMPTY (-12)
const char * MSOC_DLL_EXPORT MSOC_getErrMessage(int err);
typedef struct msoc_opt msoc_opt;
#ifdef _MSC_VER
int MSOC_DLL_EXPORT MSOC_encrypt(const wchar_t *outFile, const wchar_t *inFile, const wchar_t *pass, const msoc_opt *opt);
int MSOC_DLL_EXPORT MSOC_decrypt(const wchar_t *outFile, const wchar_t *inFile, const wchar_t *pass, msoc_opt *opt);
#endif
int MSOC_DLL_EXPORT MSOC_encryptA(const char *outFile, const char *inFile, const char *pass, const msoc_opt *opt);
int MSOC_DLL_EXPORT MSOC_decryptA(const char *outFile, const char *inFile, const char *pass, msoc_opt *opt);
#define MSOC_OPT_TYPE_SPIN_COUNT 1
#define MSOC_OPT_TYPE_SECRET_KEY 2
msoc_opt * MSOC_DLL_EXPORT MSOC_createOpt(void);
void MSOC_DLL_EXPORT MSOC_destroyOpt(msoc_opt *msoc);
int MSOC_DLL_EXPORT MSOC_getInt(int *value, const msoc_opt *opt, int optType);
int MSOC_DLL_EXPORT MSOC_setInt(msoc_opt *opt, int optType, int value);
int MSOC_DLL_EXPORT MSOC_getStr(char *str, size_t maxSize, const msoc_opt *opt, int optType);
int MSOC_DLL_EXPORT MSOC_setStr(msoc_opt *opt, int optType, const char *str);
#ifdef __cplusplus
}
#endif