aboutsummaryrefslogtreecommitdiffstats
path: root/include/installmgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/installmgr.h')
-rw-r--r--include/installmgr.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/installmgr.h b/include/installmgr.h
new file mode 100644
index 0000000..8491fdf
--- /dev/null
+++ b/include/installmgr.h
@@ -0,0 +1,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