From 814ff2e2b838bdefb42f2af358f358446025c8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCmann?= Date: Sat, 28 Jun 2014 23:29:27 +0000 Subject: SendSS v0.8.6.0: + imgur.com support by user requests (anonymous upload only) (CSendHost_imgur,CSend,global.h,UMainForm) this also include basic functions for JSON parsing (currently only JSON without spaces and arrays) (CSend) SSL/HTTPS support for HTTPFormCreate (CSend) support for custom headers in HTTPFormCreate (CSend) * updated ImageShack related filenames. * very minor misc code changes and improvements (comments, error messages) git-svn-id: http://svn.miranda-ng.org/main/trunk@9606 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/CSend.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/CSend.h') diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 16ab0f192e..e9e57a9199 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -42,8 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define GC_RESULT_ERROR 202 #define GC_RESULT_NOSESSION 209 -#define SS_ERR_INIT LPGENT("Unable to initiate %s.") -#define SS_ERR_MAPI LPGENT("MAPI error (%i):\n%s.") +const TCHAR SS_ERR_INIT[] =LPGENT("Unable to initiate %s."); +const TCHAR SS_ERR_MAPI[] =LPGENT("MAPI error (%i):\n%s."); +const TCHAR SS_ERR_RESPONSE[] =LPGENT("Unknown response from %s (%i)"); +const TCHAR SS_ERR_NORESPONSE[] =LPGENT("Got no response from %s (%i)"); //--------------------------------------------------------------------------- class CSend { @@ -102,15 +104,17 @@ class CSend { /// HTTP upload helper stuff enum HTTPFormFlags{ + HTTPFF_HEADER=0x80, HTTPFF_TEXT =0x00, HTTPFF_8BIT =0x01, HTTPFF_FILE =0x02, HTTPFF_INT =0x04, }; + #define HTTPFORM_HEADER(str) str,HTTPFF_HEADER #define HTTPFORM_TEXT(str) str,HTTPFF_TEXT #define HTTPFORM_8BIT(str) str,HTTPFF_8BIT #define HTTPFORM_FILE(str) str,HTTPFF_FILE - #define HTTPFORM_INT(int) (const char*)int,HTTPFF_INT + #define HTTPFORM_INT(int) (const char*)(int),HTTPFF_INT struct HTTPFormData{ const char* name; union{ @@ -120,6 +124,9 @@ class CSend { int flags; }; static const char* GetHTMLContent(char* str, const char* startTag, const char* endTag); /// changes "str", can be successfully used only once + static int GetJSONString(const char* json, size_t jsonlen, const char* variable, char* value, size_t valuesize); + static int GetJSONInteger(const char* json, size_t jsonlen, const char* variable,int defvalue); + static bool GetJSONBool(const char* json, size_t jsonlen, const char* variable); void HTTPFormDestroy(NETLIBHTTPREQUEST* nlhr); /// use to free data inside "nlhr" created by HTTPFormCreate int HTTPFormCreate(NETLIBHTTPREQUEST* nlhr,int requestType,char* url,HTTPFormData* frm,size_t frmNum); /// returns "0" on success, Exit() will be called on failure (stop processing) }; -- cgit v1.2.3