src/platform_unix.h
author Volker Birk <vb@pep.foundation>
Sun, 31 Jul 2016 09:04:42 +0200
branchkeysync
changeset 949 779219e99833
parent 948 2c689b7707a9
child 1057 abff13590a4c
permissions -rw-r--r--
...
     1 #ifndef __APPLE__
     2 #define _POSIX_C_SOURCE 200809L
     3 #endif
     4 
     5 #include <unistd.h>
     6 #include <strings.h>
     7 #include <sys/select.h>
     8 #include <uuid/uuid.h>
     9 
    10 #ifdef __cplusplus
    11 extern "C" {
    12 #endif
    13 
    14 const char *unix_local_db(void);
    15 
    16 const char *gpg_conf(void);
    17 const char *gpg_agent_conf(void);
    18 const char *gpg_home(void);
    19 
    20 #ifdef ANDROID
    21 
    22 char *stpncpy(char *, const char *, size_t);
    23 char *stpcpy(char *, const char *);
    24 
    25 // Beware: predictable pseudo random with static seed!
    26 // Only the lowest 31 bits are filled randomly.
    27 long int random(void);
    28 
    29 const char *android_system_db(void);
    30 #define SYSTEM_DB android_system_db()
    31 #define LIBGPGME "libgpgme.so"
    32 
    33 #elif __APPLE__
    34 #include "TargetConditionals.h"
    35 #include <string.h>
    36 #if TARGET_OS_IPHONE
    37 
    38 extern char* SystemDB;
    39 #define SYSTEM_DB SystemDB
    40     
    41 #endif
    42 #endif
    43 
    44 #if !defined(BSD) && !defined(__APPLE__)
    45 size_t strlcpy(char* dst, const	char* src, size_t size);
    46 size_t strlcat(char* dst, const	char* src, size_t size);
    47 #endif
    48 
    49 #ifndef _UUID_STRING_T
    50 #define _UUID_STRING_T
    51 typedef char uuid_string_t[37];
    52 #endif
    53 #ifdef UUID
    54 #undef UUID
    55 #endif
    56 // on *nix, uuid_t is an array and already implements pointer semantics
    57 #define UUID uuid_t
    58 
    59 #ifdef __cplusplus
    60 }
    61 #endif