Skip to content

Commit

Permalink
- misc: final 6.8 release preparations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jens-maus committed Jan 4, 2009
1 parent 7480076 commit 1b1c6fe
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 38 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ codesets.library - Library for handling different codesets
$Id$
$URL$

#### 6.8 RELEASE #########################################################

2009-01-04 Jens Langner <[email protected]>

* misc: final 6.8 release preparations.

2009-01-02 Ilkka Lehtoranta <[email protected]>

* codesets.c: MorphOS code was using LocaleBase before it was initialised
Expand Down
74 changes: 39 additions & 35 deletions src/codesets.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,49 +998,53 @@ codesetsInit(struct codesetList *csList)

#if defined(__MORPHOS__)
{
struct Library *KeymapBase = OpenLibrary("keymap.library", 51);
struct Library *LocaleBase = OpenLibrary("locale.library", 51);
struct Library *KeymapBase;
struct Library *LocaleBase;

if(KeymapBase != NULL && LocaleBase != NULL)
if((KeymapBase = OpenLibrary("keymap.library", 51)) != NULL)
{
struct KeyMap *keymap = AskKeyMapDefault();
CONST_STRPTR name = GetKeyMapCodepage(keymap);

if(name != NULL && keymap != NULL) // Legacy keymaps dont have codepage or Unicode mappings
if((LocaleBase = OpenLibrary("locale.library", 51)) != NULL)
{
D(DBF_STARTUP, "loading charset '%s' from keymap.library...", name);
struct KeyMap *keymap = AskKeyMapDefault();
CONST_STRPTR name = GetKeyMapCodepage(keymap);

if((codeset = allocVecPooled(CodesetsBase->pool, sizeof(struct codeset))) != NULL)
if(name != NULL && keymap != NULL) // Legacy keymaps dont have codepage or Unicode mappings
{
codeset->name = mystrdup(name);
codeset->alt_name = NULL;
codeset->characterization = mystrdup(name); // No more information available
codeset->read_only = 0;

for(i=0; i<256; i++)
{
UTF8 *dest_ptr = &codeset->table[i].utf8[1];
LONG rc;

codeset->table[i].code = i;
codeset->table[i].ucs4 = src = ToUCS4(i, keymap);
rc = ConvertUCS4ToUTF8((CONST_WSTRPTR)&src, dest_ptr, 1);
dest_ptr[rc] = 0;
codeset->table[i].utf8[0] = rc;
}

memcpy(codeset->table_sorted,codeset->table,sizeof(codeset->table));
qsort(codeset->table_sorted,256,sizeof(codeset->table[0]),(int (*)(const void *arg1, const void *arg2))codesetsCmpUnicode);

AddTail((struct List *)csList, (struct Node *)&codeset->node);
D(DBF_STARTUP, "loading charset '%s' from keymap.library...", name);

if((codeset = allocVecPooled(CodesetsBase->pool, sizeof(struct codeset))) != NULL)
{
codeset->name = mystrdup(name);
codeset->alt_name = NULL;
codeset->characterization = mystrdup(name); // No more information available
codeset->read_only = 0;

for(i=0; i<256; i++)
{
UTF8 *dest_ptr = &codeset->table[i].utf8[1];
LONG rc;

codeset->table[i].code = i;
codeset->table[i].ucs4 = src = ToUCS4(i, keymap);
rc = ConvertUCS4ToUTF8((CONST_WSTRPTR)&src, dest_ptr, 1);
dest_ptr[rc] = 0;
codeset->table[i].utf8[0] = rc;
}

memcpy(codeset->table_sorted,codeset->table,sizeof(codeset->table));
qsort(codeset->table_sorted,256,sizeof(codeset->table[0]),(int (*)(const void *arg1, const void *arg2))codesetsCmpUnicode);

AddTail((struct List *)csList, (struct Node *)&codeset->node);
}
else
goto end;
}
else
goto end;

CloseLibrary(LocaleBase);
}
}

CloseLibrary(LocaleBase);
CloseLibrary(KeymapBase);
CloseLibrary(KeymapBase);
}
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

// for setting all necessary version information
#define LIB_VERSION 6
#define LIB_REVISION 7
#define LIB_DATE "20.12.2008"
#define LIB_COPYRIGHT "Copyright (c) 2005-2008 codesets.library Open Source Team"
#define LIB_REVISION 8
#define LIB_DATE "04.01.2009"
#define LIB_COPYRIGHT "Copyright (c) 2005-2009 codesets.library Open Source Team"

// set the LIB_REV_STRING
#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION)
Expand Down

0 comments on commit 1b1c6fe

Please sign in to comment.