search for: iconv_cache

Displaying 3 results from an estimated 3 matches for "iconv_cache".

2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
...clude <pthread.h> + #ifdef HAVE_MMAP #include <sys/mman.h> #else @@ -62,6 +65,32 @@ header_checksum (const hive_h *h) #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +iconv_t * +_hivex_get_iconv (hive_h *h, recode_type t) +{ + pthread_mutex_lock (&h->iconv_cache[t].mutex); + if (h->iconv_cache[t].handle == NULL) { + if (t == utf8_to_latin1) + h->iconv_cache[t].handle = iconv_open ("LATIN1", "UTF-8"); + else if (t == latin1_to_utf8) + h->iconv_cache[t].handle = iconv_open ("UTF-8", "LATIN1");...
2018 Feb 09
0
Re: [PATCH] Add a cache for iconv_t handles to hive_t
...#include <sys/mman.h> > #else > @@ -62,6 +65,32 @@ header_checksum (const hive_h *h) > > #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) > > +iconv_t * > +_hivex_get_iconv (hive_h *h, recode_type t) > +{ > + pthread_mutex_lock (&h->iconv_cache[t].mutex); > + if (h->iconv_cache[t].handle == NULL) { > + if (t == utf8_to_latin1) > + h->iconv_cache[t].handle = iconv_open ("LATIN1", "UTF-8"); > + else if (t == latin1_to_utf8) > + h->iconv_cache[t].handle = iconv_open ("UTF-8&qu...
2018 Feb 09
2
[PATCH] Add a cache for iconv_t handles to hive_t
...nclude <glthread/lock.h> #ifdef HAVE_MMAP #include <sys/mman.h> @@ -62,6 +64,32 @@ header_checksum (const hive_h *h) #define HIVEX_OPEN_MSGLVL_MASK (HIVEX_OPEN_VERBOSE|HIVEX_OPEN_DEBUG) +iconv_t * +_hivex_get_iconv (hive_h *h, recode_type t) +{ + glthread_lock_lock (&h->iconv_cache[t].mutex); + if (h->iconv_cache[t].handle == NULL) { + if (t == utf8_to_latin1) + h->iconv_cache[t].handle = iconv_open ("LATIN1", "UTF-8"); + else if (t == latin1_to_utf8) + h->iconv_cache[t].handle = iconv_open ("UTF-8", "LATIN1");...