ATBTariffCalculator/CalculatorCInterface/calculator_c_interface_lib.h

43 lines
2.3 KiB
C

#ifndef CALCULATOR_C_INTERFACE_LIB_H_INCLUDED
#define CALCULATOR_C_INTERFACE_LIB_H_INCLUDED
#include "calculator_c_interface_lib_global.h"
#include "tariff_calculator.h"
typedef TariffCalculator *TariffCalculatorHandle;
#ifdef __cplusplus
extern "C" {
#endif
void DeleteMem(char *p) CALCULATOR_C_INTERFACE_LIB_EXPORT;
void SetReposRootDirectoryInternal(char const *p) CALCULATOR_C_INTERFACE_LIB_EXPORT;
char const *GetReposRootDirectoryInternal() CALCULATOR_C_INTERFACE_LIB_EXPORT;
char const *GetLocalRepositoryPathInternal(char const *localRepo) CALCULATOR_C_INTERFACE_LIB_EXPORT;
// interface for menu of webpage
char const *GetFileMenuInternal(char const *localRepo) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int32_t GetFileMenuSizeInternal(char const *localRepo) CALCULATOR_C_INTERFACE_LIB_EXPORT;
char const *GetFileNameInternal(char const *localRepo, char const *fileId) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int32_t GetFileSize(char const *localRepo, char const *fileId) CALCULATOR_C_INTERFACE_LIB_EXPORT;
char const *GetFileInternal(char const *localRepo, char const *fileId) CALCULATOR_C_INTERFACE_LIB_EXPORT;
bool SetFileInternal(char const *localRepo, char const *fileId, char const *json, int size) CALCULATOR_C_INTERFACE_LIB_EXPORT;
TariffCalculatorHandle NewTariffCalculator(void) CALCULATOR_C_INTERFACE_LIB_EXPORT;
void DeleteTariffCalculator(TariffCalculatorHandle handle) CALCULATOR_C_INTERFACE_LIB_EXPORT;
// libgit2
int InitGitLibraryInternal(void) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int ShutdownGitLibraryInternal(void) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int CloneRepositoryInternal(char const *url, char const *local_path) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int CheckoutRepositoryInternal(char const *url, char const *localRepoName, char const *branchName) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int CommitFileInternal(char const *local_path, char const *branch_name, char const *file_name, char const *commit_message) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int PushRepositoryInternal(char const *local_path, char const *branch_name, char const *user, char const *password) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int PullRepositoryInternal(char const *localRepoName, char const *remoteRepoName) CALCULATOR_C_INTERFACE_LIB_EXPORT;
#ifdef __cplusplus
}
#endif
#endif // CALCULATOR_C_INTERFACE_LIB_H_INCLUDED