aboutsummaryrefslogtreecommitdiffstats
path: root/include/installmgr.h
blob: 8491fdf9947e3566c99731d57b714de944bee3dc (plain) (blame)
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
44
45
46
47
48
49
50
51
#ifndef INSTALLMGR_H
#define INSTALLMGR_H

#include <stdio.h>
#include <vector>
#include <defs.h>

SWORD_NAMESPACE_START


// move this include to cpp once struct ftpparse isn't exposed anymore
extern "C" {
#include <ftpparse.h>
}


// initialize/cleanup SYSTEMWIDE library with life of this static.
class InstallMgr_init {
public:
	InstallMgr_init();
	~InstallMgr_init();
};


struct FtpFile {
  const char *filename;
  FILE *stream;
};

int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);

//public stuff


// probably change to group these ftp functions into some kind of FTPSession
// class, and open/close functions become c_tor/d_tor.

void *FTPOpenSession();
void FTPCloseSession(void *session);
char FTPURLGetFile(void *session, const char *dest, const char *sourceurl, bool passive = true, void (*status_callback)(double dltotal, double dlnow)=0);

// probably change to not expose struct ftpparse.  We probably need our
// own FTPFile class or something that contains things like file name,
// size, type (dir, file, special).  Then change to vector of this class
// instead of ftpparse
std::vector<struct ftpparse> FTPURLGetDir(void *session, const char *dirurl, bool passive = true);

SWORD_NAMESPACE_END

#endif