diff options
Diffstat (limited to 'include/m_db_int.h')
| -rw-r--r-- | include/m_db_int.h | 57 | 
1 files changed, 57 insertions, 0 deletions
diff --git a/include/m_db_int.h b/include/m_db_int.h index df6671a486..cd498c5330 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -31,8 +31,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  ///////////////////////////////////////////////////////////////////////////////
  // basic database interface
 +struct DBCachedGlobalValue
 +{
 +	char* name;
 +	DBVARIANT value;
 +};
 +
 +struct DBCachedContactValue
 +{
 +	char* name;
 +	DBVARIANT value;
 +	DBCachedContactValue* next;
 +};
 +
 +struct DBCachedContact
 +{
 +	HANDLE hContact;
 +	HANDLE hNext;
 +	DBCachedContactValue* first;
 +	DBCachedContactValue* last;
 +};
 +
 +interface MIDatabaseCache
 +{
 +	STDMETHOD_(DBCachedContact*,AddContactToCache)(HANDLE hContact) PURE;
 +	STDMETHOD_(DBCachedContact*,GetCachedContact)(HANDLE hContact) PURE;
 +	STDMETHOD_(void,FreeCachedContact)(HANDLE hContact) PURE;
 +
 +	STDMETHOD_(char*,InsertCachedSetting)(const char *szName, int) PURE;
 +	STDMETHOD_(char*,GetCachedSetting)(const char *szModuleName, const char *szSettingName, int, int) PURE;
 +	STDMETHOD_(void,SetCachedVariant)(DBVARIANT *s, DBVARIANT *d) PURE;
 +	STDMETHOD_(DBVARIANT*,GetCachedValuePtr)(HANDLE hContact, char *szSetting, int bAllocate) PURE;
 +};
 +
  interface MIDatabase
  {
 +	MIDatabaseCache* m_cache;
 +
  	STDMETHOD_(void,SetCacheSafetyMode)(BOOL) PURE;
  	STDMETHOD_(LONG,GetContactCount)(void) PURE;
 @@ -194,4 +229,26 @@ __forceinline MIDatabase* GetCurrentDatabase(void)  {	return (MIDatabase*)CallService(MS_DB_GET_CURRENT, 0, 0);
  }
 +// MS_DB_INIT_INSTANCE : initializes a database instance
 +// wParam : 0 (unused)
 +// lParam : MIDatabase* = pointer to a database instance
 +// returns 0
 +
 +#define MS_DB_INIT_INSTANCE "DB/InitDbInstance"
 +
 +__forceinline void InitDbInstance(MIDatabase* pDatabase)
 +{	CallService(MS_DB_INIT_INSTANCE, 0, (LPARAM)pDatabase);
 +}
 +
 +// MS_DB_DESTROY_INSTANCE : destroys a database instance
 +// wParam : 0 (unused)
 +// lParam : MIDatabase* = pointer to a database instance
 +// returns 0
 +
 +#define MS_DB_DESTROY_INSTANCE "DB/DestroyDbInstance"
 +
 +__forceinline void DestroyDbInstance(MIDatabase* pDatabase)
 +{	CallService(MS_DB_DESTROY_INSTANCE, 0, (LPARAM)pDatabase);
 +}
 +
  #endif // M_DB_INT_H__
  | 
