summaryrefslogtreecommitdiff
path: root/src/modules/mega/mega.h
blob: 2a9967d6cf5c784cd41adfb5b9ca838295a4d607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <skypunch_private.h>
#include <aes.h>
#include <cencode.h>
#include <cJSON.h>


typedef struct _Mega
{
   Skypunch *skypunch;
   Ecore_Con_Url *ecu;

   struct
   {
      const char *email,
                 *password;
   } info;

   struct
   {
      char password[16];
      unsigned int id;
   } session;

   struct
   {
      Ecore_Event_Handler *ed,
                          *ec;
   } ev;
} Mega;

Eina_Bool mega_event_data(void *data, int type, void *event_info);
Eina_Bool mega_event_complete(void *data, int type, void *event_info);


Eina_Bool mega_login_send(Mega *mega, const char *json);
const char * mega_login_json(const char *email, const char *hash);
const char * mega_login_encode(Mega *mega, const char *auth);

void mega_utils_print(const char *s, int len);
char * mega_utils_base64_encode(const unsigned char *string, size_t len, size_t *size);
const char * mega_utils_key_encode(const char *s);
const char * mega_utils_login_hash(const char *email, const char *password);