src/platform_unix.h
author Krista Grothoff <krista@pep-project.org>
Fri, 22 Jul 2016 12:29:06 +0200
branchstrl-imp
changeset 918 45c80cc4c2ed
parent 763 9c0e286f0a23
child 919 5d02ed589daa
permissions -rw-r--r--
work on fix #36: conditional strlcpy/strcat impl for non-BSD systems. Branched to make testing on other OSs easier before merge to default.
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);
krista@763
    14
const char *gpg_agent_conf(void);
Edouard@175
    15
const char *gpg_home(void);
vb@130
    16
Edouard@338
    17
#ifdef ANDROID
Edouard@380
    18
Edouard@348
    19
char *stpncpy(char *, const char *, size_t);
Edouard@348
    20
char *stpcpy(char *, const char *);
roker@438
    21
roker@438
    22
// Beware: predictable pseudo random with static seed!
roker@438
    23
// Only the lowest 31 bits are filled randomly.
Edouard@338
    24
long int random(void);
roker@438
    25
Edouard@348
    26
const char *android_system_db(void);
Edouard@348
    27
#define SYSTEM_DB android_system_db()
Edouard@348
    28
#define LIBGPGME "libgpgme.so"
Edouard@380
    29
Edouard@380
    30
#elif __APPLE__
Edouard@380
    31
#include "TargetConditionals.h"
Edouard@380
    32
#if TARGET_OS_IPHONE
Edouard@380
    33
Edouard@380
    34
extern char* SystemDB;
Edouard@380
    35
#define SYSTEM_DB SystemDB
Edouard@380
    36
    
Edouard@380
    37
#endif
Edouard@338
    38
#endif
Edouard@338
    39
krista@918
    40
#ifndef BSD
krista@918
    41
size_t strlcpy(char* dst, const	char* src, size_t size);
krista@918
    42
size_t strlcat(char* dst, const	char* src, size_t size);
krista@918
    43
#endif
krista@918
    44
vb@130
    45
#ifdef __cplusplus
vb@130
    46
}
vb@130
    47
#endif