From ec445ea5b3047b688fa515abbddf82534474222f Mon Sep 17 00:00:00 2001 From: mazze Date: Sun, 25 Nov 2007 14:26:32 +0000 Subject: [PATCH] Init library base CodesetsBase. Copy charsets to libs:charsets. Added REAME.aros. Cleanup. git-svn-id: https://svn.aros.org:8080/svn/aros/trunk/AROS@27300 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/codesetslib/README.aros | 19 ++++++ workbench/libs/codesetslib/charsets/mmakefile.src | 13 ++++ .../codesetslib/developer/examples/mmakefile.src | 2 +- .../libs/codesetslib/developer/examples/test.c | 69 ---------------------- workbench/libs/codesetslib/src/libinit-aros.c | 5 ++ 5 files changed, 38 insertions(+), 70 deletions(-) create mode 100644 workbench/libs/codesetslib/README.aros create mode 100644 workbench/libs/codesetslib/charsets/mmakefile.src delete mode 100644 workbench/libs/codesetslib/developer/examples/test.c diff --git a/workbench/libs/codesetslib/README.aros b/workbench/libs/codesetslib/README.aros new file mode 100644 index 000000000..8833dab6c --- /dev/null +++ b/workbench/libs/codesetslib/README.aros @@ -0,0 +1,19 @@ +README.aros +=========== + +The codesets.library is hosted on Sourceforge: +http://sourceforge.net/projects/codesetslib/ + +Avoid by all means that the AROS port is modified independently from +the original Sourceforge project. + +TODO +---- +* Tests (endianness etc.) +* Adopt SDI macros to AROS and remove AROS compatibility macros +* Use stackswap code from libint.c for AROS +* Merge libinit-aros.c into libinit.c + +LEGAL +----- +codesets.library is released under the GNU Lesser General Public License. diff --git a/workbench/libs/codesetslib/charsets/mmakefile.src b/workbench/libs/codesetslib/charsets/mmakefile.src new file mode 100644 index 000000000..c38d6ced8 --- /dev/null +++ b/workbench/libs/codesetslib/charsets/mmakefile.src @@ -0,0 +1,13 @@ +# $Id$ + +# AROS metamakefile for codesetslib + +include $(TOP)/config/make.cfg + +#MM- workbench-libs-codesets : workbench-libs-codesets-charsets + +#MM workbench-libs-codesets-charsets + +%copy_dir_recursive mmake=workbench-libs-codesets-charsets src=$(TOP)/$(CURDIR) dst=$(AROS_LIBS)/Charsets + +%common diff --git a/workbench/libs/codesetslib/developer/examples/mmakefile.src b/workbench/libs/codesetslib/developer/examples/mmakefile.src index 970da9af8..afd707ebe 100644 --- a/workbench/libs/codesetslib/developer/examples/mmakefile.src +++ b/workbench/libs/codesetslib/developer/examples/mmakefile.src @@ -8,7 +8,7 @@ include $(TOP)/config/make.cfg #MM workbench-libs-codesets-test : linklibs includes workbench-libs-codesets-lib -FILES := test b64d b64e DetectCodeset UTF8ToStrHook +FILES := b64d b64e DetectCodeset UTF8ToStrHook # demo1 needs TextInput.mcc diff --git a/workbench/libs/codesetslib/developer/examples/test.c b/workbench/libs/codesetslib/developer/examples/test.c deleted file mode 100644 index 4bbf0104a..000000000 --- a/workbench/libs/codesetslib/developer/examples/test.c +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - - codesets.library - Amiga shared library for handling different codesets - Copyright (C) 2001-2005 by Alfonso [alfie] Ranieri . - Copyright (C) 2005-2007 by codesets.library Open Source Team - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - codesets.library project: http://sourceforge.net/projects/codesetslib/ - - Most of the code included in this file was relicensed from GPL to LGPL - from the source code of SimpleMail (http://www.sf.net/projects/simplemail) - with full permissions by its authors. - - $Id$ - -***************************************************************************/ - -#include -#include -#include -#include - - -int main(int argc,char **argv) -{ - int res = 0; - if((CodesetsBase = OpenLibrary(CODESETSNAME,CODESETSVER))) - { -#if 0 - char *str; - - if(argc>1) - str = argv[1]; - else - str = STR; - - // check that the string only contains UTF8 - // sequences. - if(CodesetsIsValidUTF8(str)) - { - CodesetsUTF8ToStr(CSA_Source, str, - CSA_DestLen, 32, - CSA_DestHook, &destHook, - TAG_DONE); - } - else - printf("Error: example string wasn't recognized as UTF8!\n"); - - res = 0; -#endif - CloseLibrary(CodesetsBase); - CodesetsBase = NULL; - } - else - { - printf("can't open %s %d+\n",CODESETSNAME,CODESETSVER); - res = 20; - } - return res; -} diff --git a/workbench/libs/codesetslib/src/libinit-aros.c b/workbench/libs/codesetslib/src/libinit-aros.c index 57bc68add..4aed9e027 100644 --- a/workbench/libs/codesetslib/src/libinit-aros.c +++ b/workbench/libs/codesetslib/src/libinit-aros.c @@ -40,6 +40,9 @@ BOOL LibInit(struct LibraryHeader *base) { BOOL success = FALSE; + // Init global library base + CodesetsBase = base; + InitSemaphore(&base->libSem); InitSemaphore(&base->poolSem); @@ -70,6 +73,8 @@ void LibExpunge(struct LibraryHeader *base) // unprotect ReleaseSemaphore(&base->libSem); + + CodesetsBase = NULL; } /****************************************************************************/ -- 2.11.4.GIT