diff --git a/cmdline/cmdline.c b/cmdline/cmdline.c index 3ab3dc3f..ca7204e8 100644 --- a/cmdline/cmdline.c +++ b/cmdline/cmdline.c @@ -25,11 +25,11 @@ your library */ #include -#include "../src/mrmailbox_internal.h" -#include "../src/mraheader.h" -#include "../src/mrapeerstate.h" -#include "../src/mrkey.h" -#include "../src/mrpgp.h" +#include "../src/dc_context.h" +#include "../src/dc_aheader.h" +#include "../src/dc_apeerstate.h" +#include "../src/dc_key.h" +#include "../src/dc_pgp.h" diff --git a/cmdline/main.c b/cmdline/main.c index 7e562d0e..fb8c7fe0 100644 --- a/cmdline/main.c +++ b/cmdline/main.c @@ -30,8 +30,8 @@ all further options can be set using the set-command (type ? for help). */ #include #include -#include "../src/mrmailbox.h" -#include "../src/mrmailbox_internal.h" +#include "../src/deltachat.h" +#include "../src/dc_context.h" #include "cmdline.h" #include "stress.h" diff --git a/cmdline/stress.c b/cmdline/stress.c index 32b6f03f..8bce906b 100644 --- a/cmdline/stress.c +++ b/cmdline/stress.c @@ -28,14 +28,14 @@ $ valgrind --leak-check=full --tool=memcheck ./deltachat-core #include #include -#include "../src/mrmailbox_internal.h" -#include "../src/mrsimplify.h" -#include "../src/mrmimeparser.h" -#include "../src/mrmimefactory.h" -#include "../src/mrpgp.h" -#include "../src/mrapeerstate.h" -#include "../src/mraheader.h" -#include "../src/mrkeyring.h" +#include "../src/dc_context.h" +#include "../src/dc_simplify.h" +#include "../src/dc_mimeparser.h" +#include "../src/dc_mimefactory.h" +#include "../src/dc_pgp.h" +#include "../src/dc_apeerstate.h" +#include "../src/dc_aheader.h" +#include "../src/dc_keyring.h" /* some data used for testing diff --git a/deltachat-core.cbp b/deltachat-core.cbp index 1ebbb5ba..46ab165e 100644 --- a/deltachat-core.cbp +++ b/deltachat-core.cbp @@ -423,126 +423,121 @@ - + - + - + - + - + - + - + - - + - + - + - + - + - + - + - + - - + - + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + diff --git a/src/mraheader.c b/src/dc_aheader.c similarity index 98% rename from src/mraheader.c rename to src/dc_aheader.c index c6fe7b6b..6b1e7da7 100644 --- a/src/mraheader.c +++ b/src/dc_aheader.c @@ -21,10 +21,10 @@ #include -#include "mrmailbox_internal.h" -#include "mraheader.h" -#include "mrapeerstate.h" -#include "mrmimeparser.h" +#include "dc_context.h" +#include "dc_aheader.h" +#include "dc_apeerstate.h" +#include "dc_mimeparser.h" /** diff --git a/src/mraheader.h b/src/dc_aheader.h similarity index 98% rename from src/mraheader.h rename to src/dc_aheader.h index d7c1a3f0..5d67f9d7 100644 --- a/src/mraheader.h +++ b/src/dc_aheader.h @@ -27,7 +27,7 @@ extern "C" { #endif -#include "mrkey.h" +#include "dc_key.h" /** diff --git a/src/mrapeerstate.c b/src/dc_apeerstate.c similarity index 99% rename from src/mrapeerstate.c rename to src/dc_apeerstate.c index 28c87b63..8aa28614 100644 --- a/src/mrapeerstate.c +++ b/src/dc_apeerstate.c @@ -20,10 +20,10 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrapeerstate.h" -#include "mraheader.h" -#include "mrhash.h" +#include "dc_context.h" +#include "dc_apeerstate.h" +#include "dc_aheader.h" +#include "dc_hash.h" /******************************************************************************* diff --git a/src/mrapeerstate.h b/src/dc_apeerstate.h similarity index 99% rename from src/mrapeerstate.h rename to src/dc_apeerstate.h index 1798e633..ed10212d 100644 --- a/src/mrapeerstate.h +++ b/src/dc_apeerstate.h @@ -27,7 +27,7 @@ extern "C" { #endif -#include "mrkey.h" +#include "dc_key.h" typedef struct mraheader_t mraheader_t; diff --git a/src/mrarray.c b/src/dc_array.c similarity index 99% rename from src/mrarray.c rename to src/dc_array.c index 1056c5e8..4cd949d5 100644 --- a/src/mrarray.c +++ b/src/dc_array.c @@ -20,8 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrarray-private.h" +#include "dc_context.h" +#include "dc_array.h" #define MR_ARRAY_MAGIC 0x000a11aa diff --git a/src/mrarray-private.h b/src/dc_array.h similarity index 100% rename from src/mrarray-private.h rename to src/dc_array.h diff --git a/src/mrchat.c b/src/dc_chat.c similarity index 99% rename from src/mrchat.c rename to src/dc_chat.c index 999329c6..46e46d2f 100644 --- a/src/mrchat.c +++ b/src/dc_chat.c @@ -20,12 +20,12 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrapeerstate.h" -#include "mrjob.h" -#include "mrsmtp.h" -#include "mrimap.h" -#include "mrmimefactory.h" +#include "dc_context.h" +#include "dc_job.h" +#include "dc_smtp.h" +#include "dc_imap.h" +#include "dc_mimefactory.h" + #define MR_CHAT_MAGIC 0xc4a7c4a7 diff --git a/src/mrchat-private.h b/src/dc_chat.h similarity index 100% rename from src/mrchat-private.h rename to src/dc_chat.h diff --git a/src/mrchatlist.c b/src/dc_chatlist.c similarity index 99% rename from src/mrchatlist.c rename to src/dc_chatlist.c index 687e18dd..f4f077c4 100644 --- a/src/mrchatlist.c +++ b/src/dc_chatlist.c @@ -20,7 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" +#include "dc_context.h" + #define MR_CHATLIST_MAGIC 0xc4a71157 diff --git a/src/mrchatlist-private.h b/src/dc_chatlist.h similarity index 100% rename from src/mrchatlist-private.h rename to src/dc_chatlist.h diff --git a/src/mrmailbox_configure.c b/src/dc_configure.c similarity index 99% rename from src/mrmailbox_configure.c rename to src/dc_configure.c index d162267c..1ed6eb75 100644 --- a/src/mrmailbox_configure.c +++ b/src/dc_configure.c @@ -22,13 +22,12 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrloginparam.h" -#include "mrimap.h" -#include "mrsmtp.h" -#include "mrosnative.h" -#include "mrsaxparser.h" -#include "mrjob.h" +#include "dc_context.h" +#include "dc_loginparam.h" +#include "dc_imap.h" +#include "dc_smtp.h" +#include "dc_saxparser.h" +#include "dc_job.h" /******************************************************************************* diff --git a/src/mrcontact.c b/src/dc_contact.c similarity index 99% rename from src/mrcontact.c rename to src/dc_contact.c index bb9cf838..08c35403 100644 --- a/src/mrcontact.c +++ b/src/dc_contact.c @@ -20,9 +20,10 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrcontact.h" -#include "mrapeerstate.h" +#include "dc_context.h" +#include "dc_contact.h" +#include "dc_apeerstate.h" + #define MR_CONTACT_MAGIC 0x0c047ac7 diff --git a/src/mrcontact-private.h b/src/dc_contact.h similarity index 100% rename from src/mrcontact-private.h rename to src/dc_contact.h diff --git a/src/mrmailbox.c b/src/dc_context.c similarity index 99% rename from src/mrmailbox.c rename to src/dc_context.c index 3586b50b..925f09dd 100644 --- a/src/mrmailbox.c +++ b/src/dc_context.c @@ -25,15 +25,15 @@ #include /* for getpid() */ #include #include -#include "mrmailbox_internal.h" -#include "mrimap.h" -#include "mrsmtp.h" -#include "mrmimefactory.h" -#include "mrtools.h" -#include "mrjob.h" -#include "mrkey.h" -#include "mrpgp.h" -#include "mrapeerstate.h" +#include "dc_context.h" +#include "dc_imap.h" +#include "dc_smtp.h" +#include "dc_mimefactory.h" +#include "dc_tools.h" +#include "dc_job.h" +#include "dc_key.h" +#include "dc_pgp.h" +#include "dc_apeerstate.h" /******************************************************************************* diff --git a/src/mrmailbox-private.h b/src/dc_context.h similarity index 95% rename from src/mrmailbox-private.h rename to src/dc_context.h index b4720046..71384a54 100644 --- a/src/mrmailbox-private.h +++ b/src/dc_context.h @@ -27,6 +27,27 @@ extern "C" { #endif +/* Includes that are used frequently. This file may also be used to create predefined headers. */ +#include +#include +#include +#include +#include "deltachat.h" +#include "mrmailbox.h" +#include "dc_sqlite3.h" +#include "dc_tools.h" +#include "dc_strbuilder.h" +#include "dc_strencode.h" +#include "dc_param.h" +#include "dc_stock.h" +#include "dc_array.h" +#include "dc_chat.h" +#include "dc_chatlist.h" +#include "dc_lot.h" +#include "dc_msg.h" +#include "dc_contact.h" + + typedef struct mrimap_t mrimap_t; typedef struct mrsmtp_t mrsmtp_t; typedef struct mrsqlite3_t mrsqlite3_t; diff --git a/src/mrdehtml.c b/src/dc_dehtml.c similarity index 97% rename from src/mrdehtml.c rename to src/dc_dehtml.c index 510689da..b77284d1 100644 --- a/src/mrdehtml.c +++ b/src/dc_dehtml.c @@ -22,11 +22,11 @@ #include #include -#include "mrmailbox.h" -#include "mrdehtml.h" -#include "mrsaxparser.h" -#include "mrtools.h" -#include "mrstrbuilder.h" +#include "dc_context.h" +#include "dc_dehtml.h" +#include "dc_saxparser.h" +#include "dc_tools.h" +#include "dc_strbuilder.h" diff --git a/src/mrdehtml.h b/src/dc_dehtml.h similarity index 100% rename from src/mrdehtml.h rename to src/dc_dehtml.h diff --git a/src/mrmailbox_e2ee.c b/src/dc_e2ee.c similarity index 99% rename from src/mrmailbox_e2ee.c rename to src/dc_e2ee.c index 9b8b3546..2cd836fe 100644 --- a/src/mrmailbox_e2ee.c +++ b/src/dc_e2ee.c @@ -20,12 +20,12 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrpgp.h" -#include "mrapeerstate.h" -#include "mraheader.h" -#include "mrkeyring.h" -#include "mrmimeparser.h" +#include "dc_context.h" +#include "dc_pgp.h" +#include "dc_aheader.h" +#include "dc_keyring.h" +#include "dc_mimeparser.h" +#include "dc_apeerstate.h" /******************************************************************************* diff --git a/src/mrhash.c b/src/dc_hash.c similarity index 99% rename from src/mrhash.c rename to src/dc_hash.c index 8806d515..9f323836 100644 --- a/src/mrhash.c +++ b/src/dc_hash.c @@ -20,13 +20,13 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" #include #include #include #include #include -#include "mrhash.h" +#include "dc_context.h" +#include "dc_hash.h" /* diff --git a/src/mrhash.h b/src/dc_hash.h similarity index 100% rename from src/mrhash.h rename to src/dc_hash.h diff --git a/src/mrimap.c b/src/dc_imap.c similarity index 99% rename from src/mrimap.c rename to src/dc_imap.c index 8b4c07f0..798b82d5 100644 --- a/src/mrimap.c +++ b/src/dc_imap.c @@ -24,12 +24,11 @@ #include #include #include -#include /* for sleep() */ -#include "mrmailbox_internal.h" -#include "mrimap.h" -#include "mrjob.h" -#include "mrosnative.h" -#include "mrloginparam.h" +#include +#include "dc_context.h" +#include "dc_imap.h" +#include "dc_job.h" +#include "dc_loginparam.h" static int setup_handle_if_needed__ (mrimap_t*); diff --git a/src/mrimap.h b/src/dc_imap.h similarity index 100% rename from src/mrimap.h rename to src/dc_imap.h diff --git a/src/mrmailbox_imex.c b/src/dc_imex.c similarity index 99% rename from src/mrmailbox_imex.c rename to src/dc_imex.c index 003f11a7..0650c528 100644 --- a/src/mrmailbox_imex.c +++ b/src/dc_imex.c @@ -26,14 +26,13 @@ #include #include #include -#include "mrmailbox_internal.h" -#include "mrmimeparser.h" -#include "mrosnative.h" -#include "mrloginparam.h" -#include "mraheader.h" -#include "mrapeerstate.h" -#include "mrpgp.h" -#include "mrmimefactory.h" +#include "dc_context.h" +#include "dc_mimeparser.h" +#include "dc_loginparam.h" +#include "dc_aheader.h" +#include "dc_apeerstate.h" +#include "dc_pgp.h" +#include "dc_mimefactory.h" /******************************************************************************* diff --git a/src/mrjob.c b/src/dc_job.c similarity index 99% rename from src/mrjob.c rename to src/dc_job.c index 9c12a911..73b48241 100644 --- a/src/mrjob.c +++ b/src/dc_job.c @@ -22,12 +22,12 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrloginparam.h" -#include "mrjob.h" -#include "mrimap.h" -#include "mrsmtp.h" -#include "mrmimefactory.h" +#include "dc_context.h" +#include "dc_loginparam.h" +#include "dc_job.h" +#include "dc_imap.h" +#include "dc_smtp.h" +#include "dc_mimefactory.h" /******************************************************************************* diff --git a/src/mrjob.h b/src/dc_job.h similarity index 100% rename from src/mrjob.h rename to src/dc_job.h diff --git a/src/mrkey.c b/src/dc_key.c similarity index 99% rename from src/mrkey.c rename to src/dc_key.c index 5613f6bd..dc13a322 100644 --- a/src/mrkey.c +++ b/src/dc_key.c @@ -22,10 +22,10 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrkey.h" -#include "mrpgp.h" -#include "mrtools.h" +#include "dc_context.h" +#include "dc_key.h" +#include "dc_pgp.h" +#include "dc_tools.h" /******************************************************************************* diff --git a/src/mrkey.h b/src/dc_key.h similarity index 100% rename from src/mrkey.h rename to src/dc_key.h diff --git a/src/mrmailbox_keyhistory.c b/src/dc_keyhistory.c similarity index 97% rename from src/mrmailbox_keyhistory.c rename to src/dc_keyhistory.c index e8d5ad64..35cfef6b 100644 --- a/src/mrmailbox_keyhistory.c +++ b/src/dc_keyhistory.c @@ -20,7 +20,7 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" +#include "dc_context.h" void mrmailbox_add_to_keyhistory__(mrmailbox_t* mailbox, const char* rfc724_mid, time_t sending_time, const char* addr, const char* fingerprint) diff --git a/src/mrkeyring.c b/src/dc_keyring.c similarity index 96% rename from src/mrkeyring.c rename to src/dc_keyring.c index 53b38d53..998f713c 100644 --- a/src/mrkeyring.c +++ b/src/dc_keyring.c @@ -20,11 +20,11 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" #include -#include "mrkey.h" -#include "mrkeyring.h" -#include "mrtools.h" +#include "dc_context.h" +#include "dc_key.h" +#include "dc_keyring.h" +#include "dc_tools.h" /******************************************************************************* diff --git a/src/mrkeyring.h b/src/dc_keyring.h similarity index 100% rename from src/mrkeyring.h rename to src/dc_keyring.h diff --git a/src/mrmailbox_log.c b/src/dc_log.c similarity index 99% rename from src/mrmailbox_log.c rename to src/dc_log.c index 44db865a..2dfc2cf2 100644 --- a/src/mrmailbox_log.c +++ b/src/dc_log.c @@ -31,7 +31,7 @@ are usually logged by mrmailbox_log_warning(). */ #include #include -#include "mrmailbox_internal.h" +#include "dc_context.h" /******************************************************************************* diff --git a/src/mrloginparam.c b/src/dc_loginparam.c similarity index 99% rename from src/mrloginparam.c rename to src/dc_loginparam.c index 2477982d..1b9d064d 100644 --- a/src/mrloginparam.c +++ b/src/dc_loginparam.c @@ -20,8 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrloginparam.h" +#include "dc_context.h" +#include "dc_loginparam.h" /******************************************************************************* diff --git a/src/mrloginparam.h b/src/dc_loginparam.h similarity index 100% rename from src/mrloginparam.h rename to src/dc_loginparam.h diff --git a/src/mrlot.c b/src/dc_lot.c similarity index 99% rename from src/mrlot.c rename to src/dc_lot.c index 8bb0074f..89777a97 100644 --- a/src/mrlot.c +++ b/src/dc_lot.c @@ -20,7 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" +#include "dc_context.h" + #define MR_LOT_MAGIC 0x00107107 diff --git a/src/mrlot-private.h b/src/dc_lot.h similarity index 100% rename from src/mrlot-private.h rename to src/dc_lot.h diff --git a/src/mrmimefactory.c b/src/dc_mimefactory.c similarity index 99% rename from src/mrmimefactory.c rename to src/dc_mimefactory.c index a768430a..88bd60b2 100644 --- a/src/mrmimefactory.c +++ b/src/dc_mimefactory.c @@ -20,9 +20,10 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrmimefactory.h" -#include "mrapeerstate.h" +#include "dc_context.h" +#include "dc_mimefactory.h" +#include "dc_apeerstate.h" + #define LINEEND "\r\n" /* lineend used in IMF */ diff --git a/src/mrmimefactory.h b/src/dc_mimefactory.h similarity index 100% rename from src/mrmimefactory.h rename to src/dc_mimefactory.h diff --git a/src/mrmimeparser.c b/src/dc_mimeparser.c similarity index 99% rename from src/mrmimeparser.c rename to src/dc_mimeparser.c index 415f398b..4292c103 100644 --- a/src/mrmimeparser.c +++ b/src/dc_mimeparser.c @@ -20,12 +20,12 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrmimeparser.h" -#include "mrmimefactory.h" -#include "mruudecode.h" -#include "mrpgp.h" -#include "mrsimplify.h" +#include "dc_context.h" +#include "dc_mimeparser.h" +#include "dc_mimefactory.h" +#include "dc_uudecode.h" +#include "dc_pgp.h" +#include "dc_simplify.h" /******************************************************************************* diff --git a/src/mrmimeparser.h b/src/dc_mimeparser.h similarity index 99% rename from src/mrmimeparser.h rename to src/dc_mimeparser.h index d6a6ebe6..05852b44 100644 --- a/src/mrmimeparser.h +++ b/src/dc_mimeparser.h @@ -32,8 +32,8 @@ extern "C" { #endif -#include "mrhash.h" -#include "mrparam.h" +#include "dc_hash.h" +#include "dc_param.h" typedef struct mrmailbox_e2ee_helper_t mrmailbox_e2ee_helper_t; diff --git a/src/mrmsg.c b/src/dc_msg.c similarity index 99% rename from src/mrmsg.c rename to src/dc_msg.c index 7150dd18..8da34e40 100644 --- a/src/mrmsg.c +++ b/src/dc_msg.c @@ -20,12 +20,12 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrimap.h" -#include "mrsmtp.h" -#include "mrjob.h" -#include "mrpgp.h" -#include "mrmimefactory.h" +#include "dc_context.h" +#include "dc_imap.h" +#include "dc_smtp.h" +#include "dc_job.h" +#include "dc_pgp.h" +#include "dc_mimefactory.h" #define MR_MSG_MAGIC 0x11561156 diff --git a/src/mrmsg-private.h b/src/dc_msg.h similarity index 100% rename from src/mrmsg-private.h rename to src/dc_msg.h diff --git a/src/mrparam.c b/src/dc_param.c similarity index 99% rename from src/mrparam.c rename to src/dc_param.c index a8ae198e..56a64994 100644 --- a/src/mrparam.c +++ b/src/dc_param.c @@ -23,8 +23,8 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrtools.h" +#include "dc_context.h" +#include "dc_tools.h" static char* find_param(char* ths, int key, char** ret_p2) diff --git a/src/mrparam.h b/src/dc_param.h similarity index 100% rename from src/mrparam.h rename to src/dc_param.h diff --git a/src/mrpgp.c b/src/dc_pgp.c similarity index 99% rename from src/mrpgp.c rename to src/dc_pgp.c index 43a3cb56..ad106879 100644 --- a/src/mrpgp.c +++ b/src/dc_pgp.c @@ -41,11 +41,11 @@ one :-) */ #include #include #include -#include "mrmailbox_internal.h" -#include "mrkey.h" -#include "mrkeyring.h" -#include "mrpgp.h" -#include "mrhash.h" +#include "dc_context.h" +#include "dc_key.h" +#include "dc_keyring.h" +#include "dc_pgp.h" +#include "dc_hash.h" static pgp_io_t s_io; diff --git a/src/mrpgp.h b/src/dc_pgp.h similarity index 100% rename from src/mrpgp.h rename to src/dc_pgp.h diff --git a/src/mrmailbox_qr.c b/src/dc_qr.c similarity index 99% rename from src/mrmailbox_qr.c rename to src/dc_qr.c index 31563392..03414ab8 100644 --- a/src/mrmailbox_qr.c +++ b/src/dc_qr.c @@ -22,8 +22,8 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrapeerstate.h" +#include "dc_context.h" +#include "dc_apeerstate.h" #define MAILTO_SCHEME "mailto:" diff --git a/src/mrmailbox_receive_imf.c b/src/dc_receive_imf.c similarity index 99% rename from src/mrmailbox_receive_imf.c rename to src/dc_receive_imf.c index ca4749e7..ec3c29d7 100644 --- a/src/mrmailbox_receive_imf.c +++ b/src/dc_receive_imf.c @@ -21,14 +21,14 @@ #include -#include "mrmailbox_internal.h" -#include "mrmimeparser.h" -#include "mrmimefactory.h" -#include "mrapeerstate.h" -#include "mrimap.h" -#include "mrjob.h" -#include "mrarray-private.h" #include +#include "dc_context.h" +#include "dc_mimeparser.h" +#include "dc_mimefactory.h" +#include "dc_imap.h" +#include "dc_job.h" +#include "dc_array.h" +#include "dc_apeerstate.h" /******************************************************************************* diff --git a/src/mrsaxparser.c b/src/dc_saxparser.c similarity index 99% rename from src/mrsaxparser.c rename to src/dc_saxparser.c index 1d384bc5..f97b8328 100644 --- a/src/mrsaxparser.c +++ b/src/dc_saxparser.c @@ -37,9 +37,9 @@ and spits out all text and tags found. #include #include #include -#include "mrmailbox.h" -#include "mrtools.h" -#include "mrsaxparser.h" +#include "dc_context.h" +#include "dc_tools.h" +#include "dc_saxparser.h" /******************************************************************************* diff --git a/src/mrsaxparser.h b/src/dc_saxparser.h similarity index 100% rename from src/mrsaxparser.h rename to src/dc_saxparser.h diff --git a/src/mrmailbox_securejoin.c b/src/dc_securejoin.c similarity index 99% rename from src/mrmailbox_securejoin.c rename to src/dc_securejoin.c index bad6ada9..3c1f6a06 100644 --- a/src/mrmailbox_securejoin.c +++ b/src/dc_securejoin.c @@ -22,13 +22,14 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrkey.h" -#include "mrapeerstate.h" -#include "mrmimeparser.h" -#include "mrmimefactory.h" -#include "mrjob.h" -#include "mrtoken.h" +#include "dc_context.h" +#include "dc_key.h" +#include "dc_apeerstate.h" +#include "dc_mimeparser.h" +#include "dc_mimefactory.h" +#include "dc_job.h" +#include "dc_token.h" + #define LOCK { mrsqlite3_lock (mailbox->m_sql); locked = 1; } #define UNLOCK if( locked ) { mrsqlite3_unlock(mailbox->m_sql); locked = 0; } diff --git a/src/mrsimplify.c b/src/dc_simplify.c similarity index 98% rename from src/mrsimplify.c rename to src/dc_simplify.c index d4edcd62..4706146b 100644 --- a/src/mrsimplify.c +++ b/src/dc_simplify.c @@ -22,12 +22,12 @@ #include #include -#include "mrmailbox.h" -#include "mrsimplify.h" -#include "mrtools.h" -#include "mrdehtml.h" -#include "mrmimeparser.h" -#include "mrstrbuilder.h" +#include "dc_context.h" +#include "dc_simplify.h" +#include "dc_tools.h" +#include "dc_dehtml.h" +#include "dc_mimeparser.h" +#include "dc_strbuilder.h" /******************************************************************************* diff --git a/src/mrsimplify.h b/src/dc_simplify.h similarity index 100% rename from src/mrsimplify.h rename to src/dc_simplify.h diff --git a/src/mrsmtp.c b/src/dc_smtp.c similarity index 99% rename from src/mrsmtp.c rename to src/dc_smtp.c index 18cab2f6..6340a4dc 100644 --- a/src/mrsmtp.c +++ b/src/dc_smtp.c @@ -21,9 +21,9 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrsmtp.h" -#include "mrjob.h" +#include "dc_context.h" +#include "dc_smtp.h" +#include "dc_job.h" #ifndef DEBUG_SMTP diff --git a/src/mrsmtp.h b/src/dc_smtp.h similarity index 98% rename from src/mrsmtp.h rename to src/dc_smtp.h index 32653f2f..0623bd18 100644 --- a/src/mrsmtp.h +++ b/src/dc_smtp.h @@ -27,7 +27,7 @@ extern "C" { #endif -#include "mrloginparam.h" +#include "dc_loginparam.h" /*** library-private **********************************************************/ diff --git a/src/mrsqlite3.c b/src/dc_sqlite3.c similarity index 99% rename from src/mrsqlite3.c rename to src/dc_sqlite3.c index a22cc167..8ecbe0ec 100644 --- a/src/mrsqlite3.c +++ b/src/dc_sqlite3.c @@ -20,8 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrapeerstate.h" +#include "dc_context.h" +#include "dc_apeerstate.h" /* This class wraps around SQLite. Some hints to the underlying database: diff --git a/src/mrsqlite3.h b/src/dc_sqlite3.h similarity index 100% rename from src/mrsqlite3.h rename to src/dc_sqlite3.h diff --git a/src/mrstock.c b/src/dc_stock.c similarity index 99% rename from src/mrstock.c rename to src/dc_stock.c index cad00745..d7ac0ea0 100644 --- a/src/mrstock.c +++ b/src/dc_stock.c @@ -25,7 +25,7 @@ As the logging functions may use these strings, do not log any errors from here. */ -#include "mrmailbox_internal.h" +#include "dc_context.h" /******************************************************************************* diff --git a/src/mrstock.h b/src/dc_stock.h similarity index 100% rename from src/mrstock.h rename to src/dc_stock.h diff --git a/src/mrstrbuilder.c b/src/dc_strbuilder.c similarity index 96% rename from src/mrstrbuilder.c rename to src/dc_strbuilder.c index a1ec73e4..33ceafec 100644 --- a/src/mrstrbuilder.c +++ b/src/dc_strbuilder.c @@ -20,7 +20,7 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" +#include "dc_context.h" /** @@ -34,10 +34,10 @@ * When you're done with string building, the ready-to-use, null-terminates * string can be found at mrstrbuilder_t::m_buf, you can do whatever you like * with this buffer, however, never forget to call free() when done. - * + * * @param strbuilder The object to initialze. * - * @param init_bytes The number of bytes to reserve for the string. If you have an + * @param init_bytes The number of bytes to reserve for the string. If you have an * idea about how long the resulting string will be, you can give this as a hint here; * this avoids some reallocations; if the string gets longer, reallocation is done. * If you do not know how larget the string will be, give 0 here. @@ -51,12 +51,12 @@ void mrstrbuilder_init(mrstrbuilder_t* strbuilder, int init_bytes) } strbuilder->m_allocated = MR_MAX(init_bytes, 128); /* use a small default minimum, we may use _many_ of these objects at the same time */ - strbuilder->m_buf = malloc(strbuilder->m_allocated); - + strbuilder->m_buf = malloc(strbuilder->m_allocated); + if( strbuilder->m_buf==NULL ) { exit(38); } - + strbuilder->m_buf[0] = 0; strbuilder->m_free = strbuilder->m_allocated - 1 /*the nullbyte! */; strbuilder->m_eos = strbuilder->m_buf; @@ -76,7 +76,7 @@ void mrstrbuilder_init(mrstrbuilder_t* strbuilder, int init_bytes) * @return Returns a pointer to the copy of the given text. * The returned pointer is a pointer inside mrstrbuilder_t::m_buf and MUST NOT * be freed. If the string-builder was empty before, the returned - * pointer is equal to mrstrbuilder_t::m_buf. + * pointer is equal to mrstrbuilder_t::m_buf. * If the given text is NULL, NULL is returned and the string-builder-object is not modified. */ char* mrstrbuilder_cat(mrstrbuilder_t* strbuilder, const char* text) @@ -94,11 +94,11 @@ char* mrstrbuilder_cat(mrstrbuilder_t* strbuilder, const char* text) strbuilder->m_allocated = strbuilder->m_allocated + add_bytes; strbuilder->m_buf = realloc(strbuilder->m_buf, strbuilder->m_allocated+add_bytes); - + if( strbuilder->m_buf==NULL ) { exit(39); } - + strbuilder->m_free = strbuilder->m_free + add_bytes; strbuilder->m_eos = strbuilder->m_buf + old_offset; } diff --git a/src/mrstrbuilder.h b/src/dc_strbuilder.h similarity index 100% rename from src/mrstrbuilder.h rename to src/dc_strbuilder.h diff --git a/src/mrstrencode.c b/src/dc_strencode.c similarity index 99% rename from src/mrstrencode.c rename to src/dc_strencode.c index 2e0a6fc1..2551717d 100644 --- a/src/mrstrencode.c +++ b/src/dc_strencode.c @@ -22,8 +22,8 @@ #include #include -#include "mrmailbox_internal.h" -#include "mrstrencode.h" +#include "dc_context.h" +#include "dc_strencode.h" /******************************************************************************* diff --git a/src/mrstrencode.h b/src/dc_strencode.h similarity index 100% rename from src/mrstrencode.h rename to src/dc_strencode.h diff --git a/src/mrtoken.c b/src/dc_token.c similarity index 98% rename from src/mrtoken.c rename to src/dc_token.c index 6970fa90..35a8a459 100644 --- a/src/mrtoken.c +++ b/src/dc_token.c @@ -20,8 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mrtoken.h" +#include "dc_context.h" +#include "dc_token.h" void mrtoken_save__(mrmailbox_t* mailbox, mrtokennamespc_t namespc, uint32_t foreign_id, const char* token) diff --git a/src/mrtoken.h b/src/dc_token.h similarity index 100% rename from src/mrtoken.h rename to src/dc_token.h diff --git a/src/mrtools.c b/src/dc_tools.c similarity index 99% rename from src/mrtools.c rename to src/dc_tools.c index 8922e91f..425caf1d 100644 --- a/src/mrtools.c +++ b/src/dc_tools.c @@ -30,7 +30,7 @@ #include #include #include -#include "mrmailbox_internal.h" +#include "dc_context.h" /******************************************************************************* diff --git a/src/mrtools.h b/src/dc_tools.h similarity index 100% rename from src/mrtools.h rename to src/dc_tools.h diff --git a/src/mruudecode.c b/src/dc_uudecode.c similarity index 98% rename from src/mruudecode.c rename to src/dc_uudecode.c index 6949a932..c3545590 100644 --- a/src/mruudecode.c +++ b/src/dc_uudecode.c @@ -20,8 +20,8 @@ ******************************************************************************/ -#include "mrmailbox_internal.h" -#include "mruudecode.h" +#include "dc_context.h" +#include "dc_uudecode.h" /** diff --git a/src/mruudecode.h b/src/dc_uudecode.h similarity index 100% rename from src/mruudecode.h rename to src/dc_uudecode.h diff --git a/src/meson.build b/src/meson.build index 26df4dba..b0fadf8a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,78 +1,68 @@ lib_src = [ - 'mraheader.c', - 'mrapeerstate.c', - 'mrarray.c', - 'mrchat.c', - 'mrchatlist.c', - 'mrcontact.c', - 'mrdehtml.c', - 'mrhash.c', - 'mrimap.c', - 'mrjob.c', - 'mrkey.c', - 'mrkeyring.c', - 'mrloginparam.c', - 'mrlot.c', - 'mrmailbox.c', - 'mrmailbox_configure.c', - 'mrmailbox_connect.c', - 'mrmailbox_e2ee.c', - 'mrmailbox_imex.c', - 'mrmailbox_keyhistory.c', - 'mrmailbox_log.c', - 'mrmailbox_qr.c', - 'mrmailbox_receive_imf.c', - 'mrmailbox_securejoin.c', - 'mrmimefactory.c', - 'mrmimeparser.c', - 'mrmsg.c', - 'mrosnative.c', - 'mrparam.c', - 'mrpgp.c', - 'mrsaxparser.c', - 'mrsimplify.c', - 'mrsmtp.c', - 'mrsqlite3.c', - 'mrstock.c', - 'mrstrbuilder.c', - 'mrstrencode.c', - 'mrtoken.c', - 'mrtools.c', - 'mruudecode.c', + 'dc_aheader.c', + 'dc_apeerstate.c', + 'dc_array.c', + 'dc_chat.c', + 'dc_chatlist.c', + 'dc_contact.c', + 'dc_dehtml.c', + 'dc_hash.c', + 'dc_imap.c', + 'dc_job.c', + 'dc_key.c', + 'dc_keyring.c', + 'dc_loginparam.c', + 'dc_lot.c', + 'dc_context.c', + 'dc_configure.c', + 'dc_e2ee.c', + 'dc_imex.c', + 'dc_keyhistory.c', + 'dc_log.c', + 'dc_qr.c', + 'dc_receive_imf.c', + 'dc_securejoin.c', + 'dc_mimefactory.c', + 'dc_mimeparser.c', + 'dc_msg.c', + 'dc_param.c', + 'dc_pgp.c', + 'dc_saxparser.c', + 'dc_simplify.c', + 'dc_smtp.c', + 'dc_sqlite3.c', + 'dc_stock.c', + 'dc_strbuilder.c', + 'dc_strencode.c', + 'dc_token.c', + 'dc_tools.c', + 'dc_uudecode.c', ] lib_hdr = [ - 'mraheader.h', - 'mrapeerstate.h', - 'mrarray.h', - 'mrchat.h', - 'mrchatlist.h', - 'mrcontact.h', - 'mrdehtml.h', - 'mrevent.h', - 'mrerror.h', - 'mrhash.h', - 'mrimap.h', - 'mrjob.h', - 'mrkey.h', - 'mrkeyring.h', - 'mrloginparam.h', - 'mrlot.h', - 'mrmailbox.h', - 'mrmailbox_internal.h', - 'mrmimefactory.h', - 'mrmimeparser.h', - 'mrmsg.h', - 'mrosnative.h', - 'mrparam.h', - 'mrpgp.h', - 'mrsaxparser.h', - 'mrsimplify.h', - 'mrsmtp.h', - 'mrsqlite3.h', - 'mrstock.h', - 'mrstrbuilder.h', - 'mrstrencode.h', - 'mrtools.h', + 'deltachat.h', + 'dc_apeerstate.h', + 'dc_dehtml.h', + 'dc_hash.h', + 'dc_imap.h', + 'dc_job.h', + 'dc_key.h', + 'dc_keyring.h', + 'dc_loginparam.h', + 'dc_lot.h', + 'dc_context.h', + 'dc_mimefactory.h', + 'dc_mimeparser.h', + 'dc_msg.h', + 'dc_param.h', + 'dc_pgp.h', + 'dc_saxparser.h', + 'dc_simplify.h', + 'dc_smtp.h', + 'dc_sqlite3.h', + 'dc_stock.h', + 'dc_strbuilder.h', + 'dc_strencode.h', + 'dc_tools.h', ] lib_inc = include_directories('.') diff --git a/src/mrarray.h b/src/mrarray.h deleted file mode 100644 index 4f2d992b..00000000 --- a/src/mrarray.h +++ /dev/null @@ -1,4 +0,0 @@ -// deprecated file - -#include "mrmailbox.h" - diff --git a/src/mrchat.h b/src/mrchat.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrchat.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrchatlist.h b/src/mrchatlist.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrchatlist.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrcontact.h b/src/mrcontact.h deleted file mode 100644 index f0f12c51..00000000 --- a/src/mrcontact.h +++ /dev/null @@ -1,3 +0,0 @@ -// deprecated -#include "mrmailbox.h" - diff --git a/src/mrerror.h b/src/mrerror.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrerror.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrevent.h b/src/mrevent.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrevent.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrlot.h b/src/mrlot.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrlot.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrmailbox_connect.c b/src/mrmailbox_connect.c deleted file mode 100644 index bec92f79..00000000 --- a/src/mrmailbox_connect.c +++ /dev/null @@ -1 +0,0 @@ -// 2018-06-14 13:18 deprecated diff --git a/src/mrmailbox_internal.h b/src/mrmailbox_internal.h deleted file mode 100644 index f606f67e..00000000 --- a/src/mrmailbox_internal.h +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * - * Delta Chat Core - * Copyright (C) 2017 Björn Petersen - * Contact: r10s@b44t.com, http://b44t.com - * - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/ . - * - ******************************************************************************/ - - -#ifndef __MRMAILBOX_INTERNAL_H__ -#define __MRMAILBOX_INTERNAL_H__ -#ifdef __cplusplus -extern "C" { -#endif - - -/* Includes that are used frequently. This file may also be used to create predefined headers. */ -#include "mrmailbox.h" -#include -#include -#include "mrsqlite3.h" -#include "mrtools.h" -#include "mrstrbuilder.h" -#include "mrstrencode.h" -#include "mrparam.h" -#include "mrstock.h" -#include "mrarray-private.h" -#include "mrchat-private.h" -#include "mrchatlist-private.h" -#include "mrlot-private.h" -#include "mrmsg-private.h" -#include "mrcontact-private.h" -#include "mrmailbox-private.h" - - -#ifdef __cplusplus -} /* /extern "C" */ -#endif -#endif /* __MRMAILBOX_INTERNAL_H__ */ - diff --git a/src/mrmsg.h b/src/mrmsg.h deleted file mode 100644 index 13afc92c..00000000 --- a/src/mrmsg.h +++ /dev/null @@ -1,2 +0,0 @@ -// deprecated -#include "mrmailbox.h" diff --git a/src/mrosnative.c b/src/mrosnative.c deleted file mode 100644 index db62c508..00000000 --- a/src/mrosnative.c +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * - * Delta Chat Core - * Copyright (C) 2017 Björn Petersen - * Contact: r10s@b44t.com, http://b44t.com - * - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) any later - * version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see http://www.gnu.org/licenses/ . - * - ******************************************************************************/ - - -/* Some functions that are called by the backend under certain -circumstances. The frontents should create a copy of this file -and implement the functions as needed, eg. for attaching threads in JNI. */ - - -#include -#include "mrmailbox.h" -#include "mrosnative.h" - - diff --git a/src/mrosnative.h b/src/mrosnative.h deleted file mode 100644 index f9f9065a..00000000 --- a/src/mrosnative.h +++ /dev/null @@ -1 +0,0 @@ -// deprecated \ No newline at end of file diff --git a/src/mrpoortext.c b/src/mrpoortext.c deleted file mode 100644 index d80095ef..00000000 --- a/src/mrpoortext.c +++ /dev/null @@ -1,2 +0,0 @@ -/* deprecated */ - diff --git a/src/mrpoortext.h b/src/mrpoortext.h deleted file mode 100644 index d80095ef..00000000 --- a/src/mrpoortext.h +++ /dev/null @@ -1,2 +0,0 @@ -/* deprecated */ -