GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GFSDKBasic.h
1 
29 #pragma once
30 
31 #include <cstddef>
32 #include <cstdint>
33 
34 #include "GFSDKExport.h"
35 
36 extern "C" {
37 
38 constexpr int32_t kGfStrlenMax = static_cast<const int32_t>(1024 * 8);
39 
40 using GFCommandExeucteCallback = void (*)(void* data, int errcode,
41  const char* out, const char* err);
42 
43 using GFCommandExecuteContext = struct {
44  const char* cmd;
45  int32_t argc;
46  const char** argv;
47  GFCommandExeucteCallback cb;
48  void* data;
49 };
50 
57 auto GPGFRONTEND_MODULE_SDK_EXPORT GFAllocateMemory(uint32_t size) -> void*;
58 
64 auto GPGFRONTEND_MODULE_SDK_EXPORT GFProjectVersion() -> const char*;
65 
71 auto GPGFRONTEND_MODULE_SDK_EXPORT GFQtEnvVersion() -> const char*;
72 
77 void GPGFRONTEND_MODULE_SDK_EXPORT GFFreeMemory(void*);
78 
88 void GPGFRONTEND_MODULE_SDK_EXPORT
89 GFExecuteCommandSync(const char* cmd, int32_t argc, const char** argv,
90  GFCommandExeucteCallback cb, void* data);
91 
98 void GPGFRONTEND_MODULE_SDK_EXPORT GFExecuteCommandBatchSync(
99  int32_t context_size, const GFCommandExecuteContext* context);
100 
106 auto GPGFRONTEND_MODULE_SDK_EXPORT GFModuleStrDup(const char*) -> char*;
107 }