From 1b16f76fccc1fa138b8ab35c8555f44ce720f0c8 Mon Sep 17 00:00:00 2001 From: mazze Date: Wed, 19 Dec 2007 20:14:43 +0000 Subject: [PATCH] Updated to V6.5 (SVN rev. 92) Changes since rev. 90: * docs: added the missing documentation about the CodesetsFreeVecPooled() function and corrected the examples accordingly. This should fix fix bug #1823214. * misc: preparations for upcoming v6.5 release. git-svn-id: https://svn.aros.org:8080/svn/aros/trunk/AROS@27504 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/codesetslib/ChangeLog | 13 +++- .../libs/codesetslib/developer/docs/codesets.doc | 89 +++++++++++++++++----- workbench/libs/codesetslib/src/codesets.c | 3 +- workbench/libs/codesetslib/src/codesets.conf | 4 +- workbench/libs/codesetslib/src/version.h | 6 +- 5 files changed, 90 insertions(+), 25 deletions(-) diff --git a/workbench/libs/codesetslib/ChangeLog b/workbench/libs/codesetslib/ChangeLog index 11da7cd6f..cff12c700 100644 --- a/workbench/libs/codesetslib/ChangeLog +++ b/workbench/libs/codesetslib/ChangeLog @@ -5,9 +5,20 @@ codesets.library - Library for handling different codesets $Id$ $URL$ +#### 6.5 RELEASE ######################################################### + +2007-12-18 Jens Langner + + * misc: preparations for upcoming v6.5 release. + * docs: added the missing documentation about the CodesetsFreeVecPooled() + function and corrected the examples accordingly. This should fix + fix bug #1823214. + 2007-11-25 Matthias Rustler - * AROS port + * misc: ported sources to AROS. The final build is currently only + available with the AROS project itself and this is still work in + progress. 2007-09-05 Thore Böckelmann diff --git a/workbench/libs/codesetslib/developer/docs/codesets.doc b/workbench/libs/codesetslib/developer/docs/codesets.doc index 1e442e111..b4d15de61 100755 --- a/workbench/libs/codesetslib/developer/docs/codesets.doc +++ b/workbench/libs/codesetslib/developer/docs/codesets.doc @@ -6,6 +6,7 @@ codesets.library/CodesetsFindA codesets.library/CodesetsFindBestA codesets.library/CodesetsConvertStrA codesets.library/CodesetsFreeA +codesets.library/CodesetsFreeVecPooledA codesets.library/CodesetsSetDefaultA codesets.library/CodesetsListCreateA codesets.library/CodesetsListDeleteA @@ -491,6 +492,58 @@ codesets.library/CodesetsEncodeB64A codesets.library/CodesetsSupportedA codesets.library/CodesetsConvertStrA + codesets.library/CodesetsFreeVecPooledA + + NAME + CodesetsFreeVecPooledA - frees objects previously allocated + by methods supporting CSA_Pool + + SYNOPSIS + CodesetsFreeVecPooledA(pool, obj, attrs) + A0 A1 A2 + void CodesetsFreeVecPooledA(APTR, APTR, struct TagItem *); + + CodesetsFreeVecPooled(pool, obj, tag1, ...); + A0 A1 A2 + void CodesetsFreeVecPooled(APTR, APTR, Tag, ...); + + FUNCTION + Frees object previously allocated by codesets.library via a + private memory pool which was previously used on codesets + functions via the CSA_Pool tag. + + INPUTS + pool - pointer to the private memory pool + obj - the object to free + attrs - a list of additional tag items. Valid tags are: + + CSA_PoolSem (struct SignalSemaphore *) + A semaphore to lock when using CSA_Pool + + RESULT + no result + + EXAMPLE + + -- cut here -- + UTF8 *utf8; + STRPTR str; + APTR pool; + + if((utf8 = CodesetsUTF8Create(CSA_Source, str, + CSA_Pool, pool, + TAG_DONE))) + { + ... + + CodesetsFreeVecPooledA(pool,utf8,NULL); + } + -- cut here -- + + SEE ALSO + codesets.library/CodesetsUTF8CreateA + codesets.library/CodesetsUTF8ToStrA + codesets.library/CodesetsSetDefaultA NAME @@ -873,12 +926,13 @@ codesets.library/CodesetsEncodeB64A Default: TRUE CSA_Pool (APTR) - If a new destination buffer is to be allocated (it happens + If a new destination buffer needs to be allocated (it happens if and only if CSA_DestHook is not used, CSA_AllocIfNeeded - is TRUE, CSA_Dest buffer is too small for the utf8) this pool - is used. The result is to be freed via FreePooled(pool, utf8). - If it is not supplied, the destination buffer is allocated - from the internal memory pool and must be freed with + is TRUE, or if CSA_Dest buffer is too small for the utf8) this + pool is used. The result must be freed via + CodesetsFreeVecPooledA(pool, utf8, NULL). + If CSA_Pool is not supplied, the destination buffer is allocated + from the internal memory pool and must be freed via CodesetsFreeA(utf8, NULL). CSA_PoolSem (struct SignalSemaphore *) @@ -912,13 +966,13 @@ codesets.library/CodesetsEncodeB64A STRPTR str; APTR pool; - if((utf8 = CodesetsUTF8Create(CSA_Source, str, - CSA_Pool, pool, + if((utf8 = CodesetsUTF8Create(CSA_Source, str, + CSA_Pool, pool, TAG_DONE))) { ... - FreeVecPooled(pool,utf,NULL); + CodesetsFreeVecPooledA(pool,utf8,NULL); } -- cut here -- @@ -930,14 +984,14 @@ codesets.library/CodesetsEncodeB64A APTR pool; struct SignalSemaphore *sem; - if((utf8 = CodesetsUTF8Create(CSA_Source, str, - CSA_Pool, pool, - CSA_PoolSem, sem, + if((utf8 = CodesetsUTF8Create(CSA_Source, str, + CSA_Pool, pool, + CSA_PoolSem, sem, TAG_DONE))) { ... - FreeVecPooled(pool,utf,NULL); + CodesetsFreeVecPooledA(pool,utf8,NULL); } -- cut here -- @@ -1103,12 +1157,13 @@ codesets.library/CodesetsEncodeB64A Default: TRUE CSA_Pool (APTR) - If a new destination buffer is to be allocated (it happens + If a new destination buffer needs to be allocated (it happens if and only if CSA_DestHook is not used, CSA_AllocIfNeeded - is TRUE, CSA_Dest buffer is too small for the string) this pool - is used. The result is to be freed via FreePooled(pool, string). - If it is not supplied, the destination buffer is allocated - from the internal memory pool and must be freed with + is TRUE, or if CSA_Dest buffer is too small for the utf8) this + pool is used. The result must be freed via + CodesetsFreeVecPooledA(pool, string, NULL). + If CSA_Pool is not supplied, the destination buffer is allocated + from the internal memory pool and must be freed via CodesetsFreeA(string, NULL). CSA_PoolSem (struct SignalSemaphore *) diff --git a/workbench/libs/codesetslib/src/codesets.c b/workbench/libs/codesetslib/src/codesets.c index fcffff6c4..a0f816cda 100755 --- a/workbench/libs/codesetslib/src/codesets.c +++ b/workbench/libs/codesetslib/src/codesets.c @@ -5077,10 +5077,9 @@ CodesetsUTF8CreateA(REG(a0, struct TagItem *attrs)) if((pool = (APTR)GetTagData(CSA_Pool, 0, attrs))) { if((sem = (struct SignalSemaphore *)GetTagData(CSA_PoolSem, 0, attrs))) - { ObtainSemaphore(sem); - } + // allocate the destination buffer dest = allocVecPooled(pool,len+1); if(sem) diff --git a/workbench/libs/codesetslib/src/codesets.conf b/workbench/libs/codesetslib/src/codesets.conf index 36ed4d685..6b53fa187 100644 --- a/workbench/libs/codesetslib/src/codesets.conf +++ b/workbench/libs/codesetslib/src/codesets.conf @@ -1,6 +1,6 @@ ##begin config -version 6.4 -date 29.07.2007 +version 6.5 +date 18.12.2007 copyright Copyright (c) 2005-2007 codesets.library Open Source Team libbasetype struct LibraryHeader ##end config diff --git a/workbench/libs/codesetslib/src/version.h b/workbench/libs/codesetslib/src/version.h index a3aaca90b..16142bbef 100755 --- a/workbench/libs/codesetslib/src/version.h +++ b/workbench/libs/codesetslib/src/version.h @@ -28,10 +28,10 @@ #define _VERSION_H_ #define LIB_VERSION 6 -#define LIB_REVISION 4 +#define LIB_REVISION 5 -#define LIB_REV_STRING "6.4" -#define LIB_DATE "29.07.2007" +#define LIB_REV_STRING "6.5" +#define LIB_DATE "18.12.2007" #if defined(__PPC__) #if defined(__MORPHOS__) -- 2.11.4.GIT