src/pEp_internal.h
author Volker Birk <vb@pep-project.org>
Wed, 25 Mar 2015 15:20:25 +0100
changeset 125 5119178815d8
parent 75 b447045162f8
child 130 507895068f83
permissions -rw-r--r--
Windoze fixes
     1 #define PEP_ENGINE_VERSION "0.5.0"
     2 
     3 // this is 20 safewords with 79 chars max
     4 #define MAX_SAFEWORDS_SPACE (20 * 80)
     5 
     6 // XML parameters string
     7 #define PARMS_MAX 32768
     8 
     9 // maximum busy wait time in ms
    10 #define BUSY_WAIT_TIME 5000
    11 
    12 // maximum line length for reading gpg.conf
    13 #define MAX_LINELENGTH 1024
    14 
    15 // default keyserver
    16 #define DEFAULT_KEYSERVER "hkp://keys.gnupg.net"
    17 
    18 #ifdef WIN32
    19 #include "platform_windows.h"
    20 #define LOCAL_DB windoze_local_db()
    21 #define SYSTEM_DB windoze_system_db()
    22 #define LIBGPGME "libgpgme-11.dll"
    23 #else // UNIX
    24 #define _POSIX_C_SOURCE 200809L
    25 #include <dlfcn.h>
    26 #include "platform_unix.h"
    27 #define LOCAL_DB unix_local_db()
    28 #ifndef SYSTEM_DB
    29 #define SYSTEM_DB "/usr/share/pEp/system.db"
    30 #endif
    31 #ifndef LIBGPGME
    32 #define LIBGPGME "libgpgme-pthread.so"
    33 #endif
    34 #endif
    35 
    36 #include <locale.h>
    37 #include <stdlib.h>
    38 #include <string.h>
    39 #include <assert.h>
    40 #include <stdio.h>
    41 
    42 #ifndef NDEBUG
    43 #include <stdio.h>
    44 #endif
    45 
    46 #include "sqlite3.h"
    47 
    48 #define _EXPORT_PEP_ENGINE_DLL
    49 #include "pEpEngine.h"
    50 #ifndef NO_GPG
    51 #include "pgp_gpg_internal.h"
    52 #endif
    53 
    54 #include "cryptotech.h"
    55 #include "transport.h"
    56 
    57 #define NOT_IMPLEMENTED assert(0); return PEP_UNKNOWN_ERROR;
    58 
    59 typedef struct _pEpSession {
    60     const char *version;
    61 #ifndef NO_GPG
    62     gpgme_ctx_t ctx;
    63 #endif
    64 
    65     PEP_cryptotech_t *cryptotech;
    66     PEP_transport_t *transports;
    67 
    68     sqlite3 *db;
    69     sqlite3 *system_db;
    70 
    71     sqlite3_stmt *log;
    72     sqlite3_stmt *safeword;
    73     sqlite3_stmt *get_identity;
    74     sqlite3_stmt *set_person;
    75     sqlite3_stmt *set_pgp_keypair;
    76     sqlite3_stmt *set_identity;
    77     sqlite3_stmt *set_trust;
    78     sqlite3_stmt *get_trust;
    79 } pEpSession;
    80 
    81 PEP_STATUS init_transport_system(PEP_SESSION session, bool in_first);
    82 void release_transport_system(PEP_SESSION session, bool out_last);
    83