mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
load md5sum if present
This commit is contained in:
parent
14a77ff7f1
commit
077560bcd3
1 changed files with 17 additions and 6 deletions
|
@ -265,6 +265,18 @@ splitFaces_via_java( JNIEnv* env, AndDictionaryCtxt* ctxt, const XP_U8* ptr,
|
||||||
ctxt->super.facePtrs = ptrs;
|
ctxt->super.facePtrs = ptrs;
|
||||||
} /* splitFaces_via_java */
|
} /* splitFaces_via_java */
|
||||||
|
|
||||||
|
static XP_UCHAR*
|
||||||
|
getNullTermParam( AndDictionaryCtxt* dctx, const XP_U8** ptr,
|
||||||
|
XP_U16* headerLen )
|
||||||
|
{
|
||||||
|
XP_U16 len = 1 + XP_STRLEN( (XP_UCHAR*)*ptr );
|
||||||
|
XP_UCHAR* result = XP_MALLOC( dctx->super.mpool, len );
|
||||||
|
XP_MEMCPY( result, *ptr, len );
|
||||||
|
*ptr += len;
|
||||||
|
*headerLen -= len;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
parseDict( AndDictionaryCtxt* ctxt, XP_U8 const* ptr, XP_U32 dictLength,
|
parseDict( AndDictionaryCtxt* ctxt, XP_U8 const* ptr, XP_U32 dictLength,
|
||||||
XP_U32* numEdges )
|
XP_U32* numEdges )
|
||||||
|
@ -294,12 +306,10 @@ parseDict( AndDictionaryCtxt* ctxt, XP_U8 const* ptr, XP_U32 dictLength,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 1 <= headerLen ) { /* have description? */
|
if ( 1 <= headerLen ) { /* have description? */
|
||||||
XP_U16 len = 1 + XP_STRLEN( (XP_UCHAR*)ptr );
|
ctxt->super.desc = getNullTermParam( ctxt, &ptr, &headerLen );
|
||||||
ctxt->super.desc =
|
}
|
||||||
(XP_UCHAR*)XP_MALLOC(ctxt->super.mpool, len);
|
if ( 1 <= headerLen ) { /* have md5sum? */
|
||||||
XP_MEMCPY( ctxt->super.desc, ptr, len );
|
ctxt->super.md5Sum = getNullTermParam( ctxt, &ptr, &headerLen );
|
||||||
ptr += len;
|
|
||||||
headerLen -= len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PTR( ptr, headerLen, end );
|
CHECK_PTR( ptr, headerLen, end );
|
||||||
|
@ -440,6 +450,7 @@ and_dictionary_destroy( DictionaryCtxt* dict )
|
||||||
XP_FREE( ctxt->super.mpool, ctxt->super.bitmaps );
|
XP_FREE( ctxt->super.mpool, ctxt->super.bitmaps );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XP_FREEP( ctxt->super.mpool, &ctxt->super.md5Sum );
|
||||||
XP_FREEP( ctxt->super.mpool, &ctxt->super.desc );
|
XP_FREEP( ctxt->super.mpool, &ctxt->super.desc );
|
||||||
XP_FREEP( ctxt->super.mpool, &ctxt->super.faces );
|
XP_FREEP( ctxt->super.mpool, &ctxt->super.faces );
|
||||||
XP_FREEP( ctxt->super.mpool, &ctxt->super.facePtrs );
|
XP_FREEP( ctxt->super.mpool, &ctxt->super.facePtrs );
|
||||||
|
|
Loading…
Reference in a new issue