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