Open and Close
[API's]


Detailed Description

The HotSync Change Manager calls these functions to open or close a logical DataStore.


Functions

alp_status_t alp_hsds_close (AlpHsDataStoreHandle hDs)
 Close a DataStore.
alp_status_t alp_hsds_get_db_handle (AlpHsDataStoreHandle hDs, AlpHsDbPtr pDb, AlpHsDbHandle *phDb)
 Get a pointer to a datastore's database handle.
alp_status_t alp_hsds_open (const _TCHAR *locURI, uint32_t userId, AlpHsDbPtr *ppDb, AlpHsDataStoreHandle *phDs)
 Open a DataStore.


Function Documentation

alp_status_t alp_hsds_close AlpHsDataStoreHandle  hDs  ) 
 

Close a DataStore.

Parameters:
[in] hDs Handle to an open datastore
Remarks:
When the ChangeMgr calls this routine during a sync session, it should close the database pointer that was opened by alp_hsds_open().
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.

alp_status_t alp_hsds_get_db_handle AlpHsDataStoreHandle  hDs,
AlpHsDbPtr  pDb,
AlpHsDbHandle phDb
 

Get a pointer to a datastore's database handle.

Parameters:
[in] hDs Handle to an open datastore
[in] pDb Pointer to a database
[out] phDb Pointer to a database handle
Remarks:
When the DataStore registered with a supported database type, the ChangeMgr calls this routine immediately after alp_hsds_open() to retrieve a handle to the underlying database. The ChangeMgr then casts this pointer to the relevant type. For example, if the DataStore registered with type kDbTypeSQLite, the ChangeMgr will cast the value returned in phDb to an sqlite handle of type sqlite3*.

This routine allows a calling application or datastore to place additional state in the database pointer. For example, an application can call alp_hscm_open() with a pointer that contains state information along with the database handle. The datastore can then take advantage of the additional state, as long as it can provide a valid handle to the ChangeMgr.

Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.

alp_status_t alp_hsds_open const _TCHAR *  locURI,
uint32_t  userId,
AlpHsDbPtr ppDb,
AlpHsDataStoreHandle phDs
 

Open a DataStore.

Parameters:
[in] locURI The datastore's locURI.
[in] userId Desktop only.
[in,out] ppDb Pointer to a database pointer
[out] phDs Pointer to a datastore handle
Remarks:
userId is for Desktop use only. It is set to zero when the DataStore is on an ALP device.

When the ChangeMgr opens the DataStore outside of a sync session ppDb should contain a pointer to a valid database pointer provided the DataStore registered with a supported database type. When the ChangeMgr opens the DataStore during a sync session, ppDb will contain a pointer to zero; when the DataStore registered with a supported database type, the ChangeMgr will expect it to open its content database and return the resulting pointer in *ppDb.

The AlpHsDataStoreHandle is provided for use by the DataStore; for example, the DataStore implementer must save the database pointer inside phDs so its available on subsequent calls.

When the open succeeds, pHDs must contain a non-null value.

Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.


Generated on Wed Jul 30 07:06:41 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.