diff options
| author | Mister Oyster <oysterized@gmail.com> | 2017-11-24 15:31:59 +0100 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-11-24 15:33:14 +0100 |
| commit | 4c3a67975657f7e94361c43fc296f3d34eece2a9 (patch) | |
| tree | 612e08113e9ce81244b8075ef1a6bb45c8b57baf /libshims/agps | |
| parent | 298502b93802ac74f2fc69b1b1e7550ad2428c04 (diff) | |
shim: add libshims from N device tree
Diffstat (limited to 'libshims/agps')
| -rw-r--r-- | libshims/agps/crypto.c | 13 | ||||
| -rw-r--r-- | libshims/agps/icu53.c | 72 | ||||
| -rw-r--r-- | libshims/agps/ssl.c | 24 |
3 files changed, 109 insertions, 0 deletions
diff --git a/libshims/agps/crypto.c b/libshims/agps/crypto.c new file mode 100644 index 0000000..c3a4e43 --- /dev/null +++ b/libshims/agps/crypto.c @@ -0,0 +1,13 @@ +#include <malloc.h> + +void CRYPTO_free(void *str) { + free(str); +} + +void *CRYPTO_malloc(int num, const char *file, int line) { + return malloc(num); +} + +void CRYPTO_lock(int mode, int type, const char *file, int line) { + CRYPTO_lock(mode, type, file, line); +} diff --git a/libshims/agps/icu53.c b/libshims/agps/icu53.c new file mode 100644 index 0000000..a7752fd --- /dev/null +++ b/libshims/agps/icu53.c @@ -0,0 +1,72 @@ +#include "unicode/ucnv.h" + +U_STABLE UConverter* U_EXPORT2 +ucnv_open_53(const char *converterName, UErrorCode *err) +{ + return ucnv_open(converterName, err); +} + +U_STABLE void U_EXPORT2 +ucnv_close_53(UConverter * converter) +{ + return ucnv_close(converter); +} + +U_STABLE void U_EXPORT2 UCNV_TO_U_CALLBACK_STOP_53( + const void *context, + UConverterToUnicodeArgs *toUArgs, + const char* codeUnits, + int32_t length, + UConverterCallbackReason reason, + UErrorCode * err) +{ + UCNV_TO_U_CALLBACK_STOP(context, toUArgs, codeUnits, length, reason, err); +} + +U_STABLE void U_EXPORT2 UCNV_FROM_U_CALLBACK_STOP_53( + const void *context, + UConverterFromUnicodeArgs *fromUArgs, + const UChar* codeUnits, + int32_t length, + UChar32 codePoint, + UConverterCallbackReason reason, + UErrorCode * err) +{ + UCNV_FROM_U_CALLBACK_STOP (context, fromUArgs, codeUnits, length, codePoint, reason, err); +} + +U_STABLE void U_EXPORT2 +ucnv_setToUCallBack_53(UConverter * converter, + UConverterToUCallback newAction, + const void* newContext, + UConverterToUCallback *oldAction, + const void** oldContext, + UErrorCode * err) +{ + ucnv_setToUCallBack(converter, newAction, newContext, oldAction, oldContext, err); +} + +U_STABLE void U_EXPORT2 +ucnv_setFromUCallBack_53(UConverter * converter, + UConverterFromUCallback newAction, + const void *newContext, + UConverterFromUCallback *oldAction, + const void **oldContext, + UErrorCode * err) +{ + ucnv_setFromUCallBack(converter, newAction, newContext, oldAction, oldContext, err); +} + +U_STABLE void U_EXPORT2 +ucnv_convertEx_53(UConverter *targetCnv, UConverter *sourceCnv, + char **target, const char *targetLimit, + const char **source, const char *sourceLimit, + UChar *pivotStart, UChar **pivotSource, + UChar **pivotTarget, const UChar *pivotLimit, + UBool reset, UBool flush, + UErrorCode *pErrorCode) +{ + ucnv_convertEx(targetCnv, sourceCnv, target, targetLimit, source, sourceLimit, + pivotStart, pivotSource, pivotTarget, pivotLimit, reset, flush, + pErrorCode); +} diff --git a/libshims/agps/ssl.c b/libshims/agps/ssl.c new file mode 100644 index 0000000..f028d98 --- /dev/null +++ b/libshims/agps/ssl.c @@ -0,0 +1,24 @@ +#include <openssl/ssl.h> + +long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) { + switch (cmd) { + case 8: { /* SSL_CTRL_GET_SESSION_REUSED */ + return SSL_session_reused(s); + } + default: break; + } + return -1; +} + +long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) { + switch (cmd) { + case 32: { /* SSL_CTRL_OPTIONS */ + return SSL_CTX_set_options(ctx, larg); + } + case 44: { /* SSL_CTRL_SET_SESS_CACHE_MODE */ + return SSL_CTX_set_session_cache_mode(ctx, larg); + } + default: break; + } + return -1; +} |
