src/platform_unix.h
author Roker <roker@pep-project.org>
Sat, 30 Jan 2016 11:20:54 +0100
changeset 438 106b9765559d
parent 380 2e4c5a2e752c
child 763 9c0e286f0a23
permissions -rw-r--r--
fix random() implementation for Android, so not always the same number is returned. Add comment that random() is predictive and non-secure
vb@130
     1
#define _POSIX_C_SOURCE 200809L
vb@130
     2
vb@130
     3
#include <unistd.h>
vb@130
     4
#include <strings.h>
vb@130
     5
#include <sys/select.h>
vb@130
     6
vb@130
     7
#ifdef __cplusplus
vb@130
     8
extern "C" {
vb@130
     9
#endif
vb@130
    10
vb@1
    11
const char *unix_local_db(void);
Edouard@347
    12
vb@1
    13
const char *gpg_conf(void);
Edouard@175
    14
const char *gpg_home(void);
vb@130
    15
Edouard@338
    16
#ifdef ANDROID
Edouard@380
    17
Edouard@348
    18
char *stpncpy(char *, const char *, size_t);
Edouard@348
    19
char *stpcpy(char *, const char *);
roker@438
    20
roker@438
    21
// Beware: predictable pseudo random with static seed!
roker@438
    22
// Only the lowest 31 bits are filled randomly.
Edouard@338
    23
long int random(void);
roker@438
    24
Edouard@348
    25
const char *android_system_db(void);
Edouard@348
    26
#define SYSTEM_DB android_system_db()
Edouard@348
    27
#define LIBGPGME "libgpgme.so"
Edouard@380
    28
Edouard@380
    29
#elif __APPLE__
Edouard@380
    30
#include "TargetConditionals.h"
Edouard@380
    31
#if TARGET_OS_IPHONE
Edouard@380
    32
Edouard@380
    33
extern char* SystemDB;
Edouard@380
    34
#define SYSTEM_DB SystemDB
Edouard@380
    35
    
Edouard@380
    36
#endif
Edouard@338
    37
#endif
Edouard@338
    38
vb@130
    39
#ifdef __cplusplus
vb@130
    40
}
vb@130
    41
#endif