src/pEp_internal.h
author vb
Mon, 01 Sep 2014 17:44:19 +0200
changeset 24 50887c6ab78f
child 28 7fc9fc3e680c
permissions -rw-r--r--
...
     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 #ifndef NO_GPG
    47 #include <gpgme.h>
    48 #endif
    49 
    50 #include "sqlite3.h"
    51 
    52 #define _EXPORT_PEP_ENGINE_DLL
    53 #include "pEpEngine.h"
    54 #ifndef NO_GPG
    55 #include "pgp_gpg_internal.h"
    56 #endif
    57 
    58 #define NOT_IMPLEMENTED assert(0)
    59 
    60 typedef struct {
    61     const char *version;
    62 
    63 #ifndef NO_GPG
    64     void *gpgme;
    65     struct gpg_s gpg;
    66     gpgme_ctx_t ctx;
    67 #endif
    68 
    69     sqlite3 *db;
    70     sqlite3 *system_db;
    71 
    72     sqlite3_stmt *log;
    73     sqlite3_stmt *safeword;
    74     sqlite3_stmt *get_identity;
    75     sqlite3_stmt *set_person;
    76     sqlite3_stmt *set_pgp_keypair;
    77     sqlite3_stmt *set_identity;
    78     sqlite3_stmt *set_trust;
    79     sqlite3_stmt *get_trust;
    80 } pEpSession;