src/platform_unix.h
author Krista Grothoff <krista@pep-project.org>
Fri, 22 Jul 2016 16:15:52 +0200
branchstrl-imp
changeset 919 5d02ed589daa
parent 918 45c80cc4c2ed
child 926 95247f30b919
permissions -rw-r--r--
Added Dirk's define patches for iOS
     1 #define _POSIX_C_SOURCE 200809L
     2 
     3 #include <unistd.h>
     4 #include <strings.h>
     5 #include <sys/select.h>
     6 
     7 #ifdef __cplusplus
     8 extern "C" {
     9 #endif
    10 
    11 const char *unix_local_db(void);
    12 
    13 const char *gpg_conf(void);
    14 const char *gpg_agent_conf(void);
    15 const char *gpg_home(void);
    16 
    17 #ifdef ANDROID
    18 
    19 char *stpncpy(char *, const char *, size_t);
    20 char *stpcpy(char *, const char *);
    21 
    22 // Beware: predictable pseudo random with static seed!
    23 // Only the lowest 31 bits are filled randomly.
    24 long int random(void);
    25 
    26 const char *android_system_db(void);
    27 #define SYSTEM_DB android_system_db()
    28 #define LIBGPGME "libgpgme.so"
    29 
    30 #elif __APPLE__
    31 #include "TargetConditionals.h"
    32 #include <string.h>
    33 #if TARGET_OS_IPHONE
    34 
    35 extern char* SystemDB;
    36 #define SYSTEM_DB SystemDB
    37     
    38 #endif
    39 #endif
    40 
    41 #ifndef BSD
    42 #if !TARGET_OS_IPHONE
    43 size_t strlcpy(char* dst, const	char* src, size_t size);
    44 size_t strlcat(char* dst, const	char* src, size_t size);
    45 #endif
    46 #endif
    47 
    48 #ifdef __cplusplus
    49 }
    50 #endif