src/platform_unix.h
author krista
Fri, 02 Sep 2016 13:30:36 +0200
branchkrista_local_windows
changeset 1126 129b561095a6
parent 1125 89e75396c69a
parent 1095 fe699b711ae6
permissions -rw-r--r--
merged with default.
vb@926
     1
#ifndef __APPLE__
vb@130
     2
#define _POSIX_C_SOURCE 200809L
vb@926
     3
#endif
vb@130
     4
vb@130
     5
#include <unistd.h>
vb@130
     6
#include <strings.h>
vb@130
     7
#include <sys/select.h>
krista@1033
     8
#include <regex.h>
vb@130
     9
vb@130
    10
#ifdef __cplusplus
vb@130
    11
extern "C" {
vb@130
    12
#endif
vb@130
    13
vb@1
    14
const char *unix_local_db(void);
Edouard@347
    15
vb@1
    16
const char *gpg_conf(void);
krista@763
    17
const char *gpg_agent_conf(void);
Edouard@175
    18
const char *gpg_home(void);
vb@130
    19
Edouard@338
    20
#ifdef ANDROID
Edouard@380
    21
Edouard@348
    22
char *stpncpy(char *, const char *, size_t);
Edouard@348
    23
char *stpcpy(char *, const char *);
roker@438
    24
roker@438
    25
// Beware: predictable pseudo random with static seed!
roker@438
    26
// Only the lowest 31 bits are filled randomly.
Edouard@338
    27
long int random(void);
roker@438
    28
Edouard@348
    29
const char *android_system_db(void);
Edouard@348
    30
#define SYSTEM_DB android_system_db()
Edouard@348
    31
#define LIBGPGME "libgpgme.so"
Edouard@380
    32
Edouard@380
    33
#elif __APPLE__
Edouard@380
    34
#include "TargetConditionals.h"
krista@919
    35
#include <string.h>
Edouard@380
    36
#if TARGET_OS_IPHONE
Edouard@380
    37
Edouard@380
    38
extern char* SystemDB;
Edouard@380
    39
#define SYSTEM_DB SystemDB
Edouard@380
    40
    
Edouard@380
    41
#endif
Edouard@338
    42
#endif
Edouard@338
    43
vb@926
    44
#if !defined(BSD) && !defined(__APPLE__)
krista@918
    45
size_t strlcpy(char* dst, const	char* src, size_t size);
krista@918
    46
size_t strlcat(char* dst, const	char* src, size_t size);
krista@1095
    47
krista@1095
    48
// N.B. This is ifdef'd out because NDK users sometimes have trouble finding regex functions in
krista@1095
    49
//      the library in spite of the inclusion of regex.h - this is a FIXME, but since iOS is
krista@1095
    50
//      *currently* the only netpgp user, we will ifdef this so that we don't block Android.
krista@1095
    51
#ifdef USE_NETPGP
krista@1033
    52
int regnexec(const regex_t* preg, const char* string,
krista@1033
    53
             size_t len, size_t nmatch, regmatch_t pmatch[], int eflags);
krista@918
    54
#endif
krista@918
    55
krista@1095
    56
#endif
krista@1095
    57
vb@130
    58
#ifdef __cplusplus
vb@130
    59
}
vb@130
    60
#endif