summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSend.h
diff options
context:
space:
mode:
authorRené Schümann <white06tiger@gmail.com>2014-06-28 23:29:27 +0000
committerRené Schümann <white06tiger@gmail.com>2014-06-28 23:29:27 +0000
commit814ff2e2b838bdefb42f2af358f358446025c8d0 (patch)
tree78ff09fb8b3748f4a308491d9c4ac2e11dc9610b /plugins/SendScreenshotPlus/src/CSend.h
parentc6e1bedfc18495b3e083069f8d03c2218f6f6b78 (diff)
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
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSend.h')
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.h13
1 files changed, 10 insertions, 3 deletions
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)
};