src/pEp_internal.h
changeset 24 50887c6ab78f
child 28 7fc9fc3e680c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/pEp_internal.h	Mon Sep 01 17:44:19 2014 +0200
     1.3 @@ -0,0 +1,80 @@
     1.4 +#define PEP_ENGINE_VERSION "0.5.0"
     1.5 +
     1.6 +// this is 20 safewords with 79 chars max
     1.7 +#define MAX_SAFEWORDS_SPACE (20 * 80)
     1.8 +
     1.9 +// XML parameters string
    1.10 +#define PARMS_MAX 32768
    1.11 +
    1.12 +// maximum busy wait time in ms
    1.13 +#define BUSY_WAIT_TIME 5000
    1.14 +
    1.15 +// maximum line length for reading gpg.conf
    1.16 +#define MAX_LINELENGTH 1024
    1.17 +
    1.18 +// default keyserver
    1.19 +#define DEFAULT_KEYSERVER "hkp://keys.gnupg.net"
    1.20 +
    1.21 +#ifdef WIN32
    1.22 +#include "platform_windows.h"
    1.23 +#define LOCAL_DB windoze_local_db()
    1.24 +#define SYSTEM_DB windoze_system_db()
    1.25 +#define LIBGPGME "libgpgme-11.dll"
    1.26 +#else // UNIX
    1.27 +#define _POSIX_C_SOURCE 200809L
    1.28 +#include <dlfcn.h>
    1.29 +#include "platform_unix.h"
    1.30 +#define LOCAL_DB unix_local_db()
    1.31 +#ifndef SYSTEM_DB
    1.32 +#define SYSTEM_DB "/usr/share/pEp/system.db"
    1.33 +#endif
    1.34 +#ifndef LIBGPGME
    1.35 +#define LIBGPGME "libgpgme-pthread.so"
    1.36 +#endif
    1.37 +#endif
    1.38 +
    1.39 +#include <locale.h>
    1.40 +#include <stdlib.h>
    1.41 +#include <string.h>
    1.42 +#include <assert.h>
    1.43 +#include <stdio.h>
    1.44 +
    1.45 +#ifndef NDEBUG
    1.46 +#include <stdio.h>
    1.47 +#endif
    1.48 +
    1.49 +#ifndef NO_GPG
    1.50 +#include <gpgme.h>
    1.51 +#endif
    1.52 +
    1.53 +#include "sqlite3.h"
    1.54 +
    1.55 +#define _EXPORT_PEP_ENGINE_DLL
    1.56 +#include "pEpEngine.h"
    1.57 +#ifndef NO_GPG
    1.58 +#include "pgp_gpg_internal.h"
    1.59 +#endif
    1.60 +
    1.61 +#define NOT_IMPLEMENTED assert(0)
    1.62 +
    1.63 +typedef struct {
    1.64 +    const char *version;
    1.65 +
    1.66 +#ifndef NO_GPG
    1.67 +    void *gpgme;
    1.68 +    struct gpg_s gpg;
    1.69 +    gpgme_ctx_t ctx;
    1.70 +#endif
    1.71 +
    1.72 +    sqlite3 *db;
    1.73 +    sqlite3 *system_db;
    1.74 +
    1.75 +    sqlite3_stmt *log;
    1.76 +    sqlite3_stmt *safeword;
    1.77 +    sqlite3_stmt *get_identity;
    1.78 +    sqlite3_stmt *set_person;
    1.79 +    sqlite3_stmt *set_pgp_keypair;
    1.80 +    sqlite3_stmt *set_identity;
    1.81 +    sqlite3_stmt *set_trust;
    1.82 +    sqlite3_stmt *get_trust;
    1.83 +} pEpSession;