From 7b92e4acf6dea29348efeb4c0cc89e3071aee56e Mon Sep 17 00:00:00 2001 From: sappho Date: Fri, 14 Jul 2023 07:19:14 -0400 Subject: ci fixes and repo cleanup + small tweaks and first release (#2) * Update docker_build.yml * Update docker_build.yml * Update docker_build.yml * attempt to lint * use tags * Update docker_build.yml * reorganize repo * correct typo with build dir * hacky chmod/chown for docker builds * more hacks for chmod * try to hack docker to work again * fix invalid syntax * remove extension in repo, remove spaces, fixup gitignore * twiddle around with making releases with commits * more ci testing to use non deprecated actions * Update docker_build.yml * more ci twiddling (ugh) * more lint and run the actual job now * lint more and use deb slim * autogen rel notes (?) * fixup bad quotes * sigh. fix quotes again * save beta autotagging for a later date * gitignore * fix so users don't use removed hash funcs * add max dbg info to ext * update versionings --- extension/define.h | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 extension/define.h (limited to 'extension/define.h') diff --git a/extension/define.h b/extension/define.h new file mode 100644 index 0000000..f56ccda --- /dev/null +++ b/extension/define.h @@ -0,0 +1,177 @@ +#ifndef _INCLUDE_SOURCEMOD_EXTENSION_DEFINE_H_ +#define _INCLUDE_SOURCEMOD_EXTENSION_DEFINE_H_ + +#include +#include + +#ifdef PLATFORM_LINUX +#define INVALID_SOCKET -1 +#endif + +class cURLThread; +struct cURLHandle; + + +enum SendRecv_Act { + SendRecv_Act_NOTHING = 0, + + SendRecv_Act_GOTO_SEND, + SendRecv_Act_GOTO_RECV, + SendRecv_Act_GOTO_WAIT, + SendRecv_Act_GOTO_END, + SendRecv_Act_GOTO_SEND_NO_WAIT, + SendRecv_Act_GOTO_RECV_NO_WAIT, + + SendRecv_Act_LAST, +}; + +enum cURLThread_Type { + cURLThread_Type_NOTHING = 0, + + cURLThread_Type_PERFORM, + cURLThread_Type_SEND_RECV, + + cURLThread_Type_LAST, +}; + +enum cURL_CallBack { + cURL_CallBack_NOTHING = 0, + + cURL_CallBack_COMPLETE, + cURL_CallBack_SEND, + cURL_CallBack_RECV, + + cURL_CallBack_WRITE_FUNCTION, + cURL_CallBack_READ_FUNCTION, + + cURL_CallBack_LAST, +}; + +struct cURLOpt_string { + CURLoption opt; + char *value; +}; + +struct cURLOpt_int { + CURLoption opt; + int value; +}; + +struct cURLOpt_int64 { + CURLoption opt; + curl_off_t value; +}; + +struct cURLOpt_pointer { + CURLoption opt; + void *value; +}; + +enum UserData_Type +{ + UserData_Type_Complete = 0, + UserData_Type_Send_Recv, + UserData_Type_Write_Func, + UserData_Type_Read_Func, +}; + +struct cURLHandle { + cURLHandle():curl(NULL),running(false),lasterror(CURLE_OK),opt_loaded(false), + thread(NULL),is_udp(false),sockextr(INVALID_SOCKET),send_timeout(60000),recv_timeout(60000) + { + } + CURL *curl; + char errorBuffer[CURL_ERROR_SIZE]; + SourceHook::List opt_string_list; + SourceHook::List opt_int_list; + SourceHook::List opt_int64_list; + SourceHook::List opt_pointer_list; + bool running; + CURLcode lasterror; + bool opt_loaded; + IPluginFunction *callback_Function[cURL_CallBack_LAST]; + Handle_t hndl; + int UserData[4]; + cURLThread *thread; + bool is_udp; + + /* use for send & recv */ + long sockextr; + long send_timeout; + long recv_timeout; + + std::string send_buffer; +}; + +class ICloseHelper { +public: + ICloseHelper():_handle(NULL),_marked_delete(false) + { + } + cURLHandle *_handle; + bool _marked_delete; + bool TryDelete(); + virtual void Delete() =0; +}; + +class cURL_slist_pack : public ICloseHelper { +public: + cURL_slist_pack():chunk(NULL) + { + } + curl_slist *chunk; + void Delete(); +}; + +class WebForm : public ICloseHelper { +public: + WebForm():first(NULL), last(NULL) + { + } + curl_httppost *first; + curl_httppost *last; + SourceHook::List slist_record; + void Delete(); +}; + +class cURL_OpenFile : public ICloseHelper { +public: + FILE *pFile; + void Delete(); +}; + + +enum OpensslThread_Type { + OpensslThread_Type_NOTHING = 0, + + OpensslThread_Type_HASH_FILE, + + OpensslThread_Type_LAST, +}; + +enum Openssl_Hash { + Openssl_Hash_MD5 = 0, + Openssl_Hash_MD4, + Openssl_Hash_MD2, + Openssl_Hash_SHA, + Openssl_Hash_SHA1, + Openssl_Hash_SHA224, + Openssl_Hash_SHA256, + Openssl_Hash_SHA384, + Openssl_Hash_SHA512, + Openssl_Hash_RIPEMD160, +}; + +struct Openssl_Hash_pack { + Openssl_Hash_pack():path(NULL), output(NULL) + { + } + IPluginFunction *hash_callback; + int UserData; + char *path; + Openssl_Hash algorithm; + bool success; + char *output; +}; + +#endif -- cgit v1.2.3