add load and store to dutils, and implement with stubs

This commit is contained in:
Eric House 2018-07-06 06:56:54 -07:00
parent 3437ae2ebc
commit 1941642607
3 changed files with 47 additions and 0 deletions

View file

@ -458,6 +458,20 @@ and_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XP_U16 stringCode, XP_U16 qu
return result;
}
static void
and_dutil_store( XW_DUtilCtxt* duc, const XP_UCHAR* key, XWStreamCtxt* data )
{
XP_LOGF( "%s() NOT IMPLEMENTED", __func__ );
// XP_ASSERT(0);
}
static void
and_dutil_load( XW_DUtilCtxt* duc, const XP_UCHAR* key,XWStreamCtxt* inOut )
{
XP_LOGF( "%s() NOT IMPLEMENTED", __func__ );
// XP_ASSERT(0);
}
static void
and_util_notifyIllegalWords( XW_UtilCtxt* uc, BadWordInfo* bwi,
XP_U16 turn, XP_Bool turnLost )
@ -809,6 +823,8 @@ makeDUtil( MPFORMAL EnvThreadInfo* ti, jobject jdutil, VTableMgr* vtMgr,
SET_DPROC(getCurSeconds);
SET_DPROC(getUserString);
SET_DPROC(getUserQuantityString);
SET_DPROC(store);
SET_DPROC(load);
# ifdef XWFEATURE_DEVID
SET_DPROC(getDevID);
SET_DPROC(deviceRegistered);

View file

@ -33,6 +33,11 @@ typedef struct _DUtilVtable {
const XP_UCHAR* (*m_dutil_getUserQuantityString)( XW_DUtilCtxt* duc,
XP_U16 stringCode,
XP_U16 quantity );
void (*m_dutil_store)( XW_DUtilCtxt* duc, const XP_UCHAR* key,
XWStreamCtxt* data );
/* Pass in an empty stream, and it'll be returned full */
void (*m_dutil_load)( XW_DUtilCtxt* duc, const XP_UCHAR* key,
XWStreamCtxt* inOut );
#ifdef XWFEATURE_SMS
XP_Bool (*m_dutil_phoneNumbersSame)( XW_DUtilCtxt* uc, const XP_UCHAR* p1,
const XP_UCHAR* p2 );
@ -67,6 +72,11 @@ struct XW_DUtilCtxt {
#define dutil_getUserQuantityString( duc, c, q ) \
(duc)->vtable.m_dutil_getUserQuantityString((duc),(c),(q))
#define dutil_stor(duc, k, v) \
(duc)->vtable.m_dutil_store((duc), (k), (v));
#define dutil_load(uc, k, s) \
(duc)->vtable.m_dutil_load((duc), (k), (s));
#ifdef XWFEATURE_SMS
# define dutil_phoneNumbersSame(duc,p1,p2) \
(duc)->vtable.m_dutil_phoneNumbersSame( (duc), (p1), (p2) )

View file

@ -30,6 +30,9 @@ static const XP_UCHAR* linux_dutil_getUserString( XW_DUtilCtxt* duc, XP_U16 code
static const XP_UCHAR* linux_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XP_U16 code,
XP_U16 quantity );
static void linux_dutil_store( XW_DUtilCtxt* duc, const XP_UCHAR* key,
XWStreamCtxt* data );
static void linux_dutil_load( XW_DUtilCtxt* duc, const XP_UCHAR* key, XWStreamCtxt* inOut );
#ifdef XWFEATURE_SMS
static XP_Bool linux_dutil_phoneNumbersSame( XW_DUtilCtxt* duc,
const XP_UCHAR* p1,
@ -60,6 +63,8 @@ dutils_init( MPFORMAL VTableMgr* vtMgr, void* closure )
SET_PROC(getCurSeconds);
SET_PROC(getUserString);
SET_PROC(getUserQuantityString);
SET_PROC(store);
SET_PROC(load);
#ifdef XWFEATURE_SMS
SET_PROC(phoneNumbersSame);
@ -174,6 +179,22 @@ linux_dutil_getUserQuantityString( XW_DUtilCtxt* duc, XP_U16 code,
return linux_dutil_getUserString( duc, code );
}
static void
linux_dutil_store( XW_DUtilCtxt* duc, const XP_UCHAR* key, XWStreamCtxt* data )
{
XP_LOGF( "%s(key=%s)", __func__, key );
XP_USE( duc );
XP_USE( data );
}
static void
linux_dutil_load( XW_DUtilCtxt* duc, const XP_UCHAR* key, XWStreamCtxt* inOut )
{
XP_LOGF( "%s(key=%s)", __func__, key );
XP_USE( duc );
XP_USE( inOut );
}
#ifdef XWFEATURE_SMS
static XP_Bool
linux_dutil_phoneNumbersSame( XW_DUtilCtxt* duc, const XP_UCHAR* p1,