From 9b8384b209987f4b1b918f8cb1364c1e1a1d9c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 3 Feb 2007 22:46:13 +0000 Subject: [PATCH] Allow mapping using heim_octet_string. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20170 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/file.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/hx509/file.c b/lib/hx509/file.c index 39497fc3a..1152af242 100644 --- a/lib/hx509/file.c +++ b/lib/hx509/file.c @@ -34,6 +34,27 @@ #include "hx_locl.h" RCSID("$ID$"); +int +_hx509_map_file_os(const char *fn, heim_octet_string *os, struct stat *rsb) +{ + size_t length; + void *data; + int ret; + + ret = _hx509_map_file(fn, &data, &length, rsb); + + os->data = data; + os->length = length; + + return ret; +} + +void +_hx509_unmap_file_os(heim_octet_string *os) +{ + _hx509_unmap_file(os->data, os->length); +} + int _hx509_map_file(const char *fn, void **data, size_t *length, struct stat *rsb) {