1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

Link against SQLite and LibEtPan.

This commit is contained in:
B. Petersen 2016-07-13 16:46:54 +02:00
parent 91fc93c39e
commit 63bb7e7af7
4 changed files with 57 additions and 1 deletions

View file

@ -35,6 +35,19 @@ Build
This repository contains only the messenger backend that is used by all
frontends.
The backend requires _LibEtPan_ and _SQLite_ - the usage at a glance on unix
systems:
- _LibEtPan_ is available at https://github.com/dinhviethoa/libetpan ; for
compilation, use eg. the following commands: `./autogen.sh; make;
sudo make install prefix=/usr`
To link against LibEtPan, add `libetpan-config --libs` in backticks to your
project.
- _SQLite_ ( http://sqlite.org/ ) is available on most systems, however, you
will also need the headers, please look for packages as `libsqlite3-dev`.
To link against SQLite, add `-lsqlite3` to your project.
Information about how to build the frontends can be found in the corresponding
repositories as https://github.com/r10s/messenger-android .

View file

@ -27,11 +27,18 @@
#include <iostream>
#include "mrbackend.h"
int main()
{
MrBackend obj;
obj.Init();
std::cout << "Hello world!" << std::endl;
return 0;
}

View file

@ -26,6 +26,30 @@
******************************************************************************/
#include <iostream>
#include <string.h>
#include <libetpan/libetpan.h>
#include <sqlite3.h>
#include "mrbackend.h"
void MrBackend::Init()
{
// test LibEtPan
struct mailimf_mailbox * mb;
char * display_name;
char * address;
display_name = strdup("DINH =?iso-8859-1?Q?Vi=EAt_Ho=E0?=");
address = strdup("dinh.viet.hoa@free.fr");
mb = mailimf_mailbox_new(display_name, address); // mailimf_mailbox_new() takes ownership of the given strings!
mailimf_mailbox_free(mb);
// test sqlite
if( sqlite3_open("~/temp/foobar.db", &m_sqlite) == SQLITE_OK ) {
sqlite3_close(m_sqlite);
}
}

View file

@ -30,5 +30,17 @@
#define __MRBACKEND_H__
#endif // __MRBACKEND_H__
struct sqlite3;
class MrBackend
{
public:
void Init ();
private:
sqlite3* m_sqlite;
};
#endif // __MRBACKEND_H__