COMMENT @----------------------------------------------------------------------

	Copyright (c) GeoWorks 1992 -- All Rights Reserved

PROJECT:	PC GEOS
MODULE:		Include
FILE:		token.def

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	brianc	5/92		Initial version

DESCRIPTION:
	Routines to manage a database of visual monikers.

	$Id: token.def,v 1.1 97/04/04 14:23:33 newdeal Exp $

------------------------------------------------------------------------------@

SetDef	__TOKEN

;
; Protocol number for acceptable token database files
; (must be defined outside the library segment so it can be used)
;
TOKEN_DATABASE_PROTO_MAJOR	equ	2
TOKEN_DATABASE_PROTO_MINOR	equ	0

StartLibrary	ui

;------------------------------------------------------------------------------
;	Structures and constants for Token Database
;------------------------------------------------------------------------------

;
; Identifier for a token database item
;
TokenDBItem	struct
	TDBI_group	word
	TDBI_item	word
TokenDBItem	ends

;
; The TokenMonikerInfo structure is used by apps which call
; TokenLookupMoniker, store the information returned, and later use
; it to call TokenLockTokenMoniker.
;
TokenMonikerInfo	struct
	TMI_moniker	TokenDBItem <>
	TMI_fileFlag	word		; 0 if token is in shared
					;  token DB file
					; non-0 if it's in local file
TokenMonikerInfo	ends

;
; Flags describing a token
;
TokenFlags	record	TF_NEED_RELOCATION:1, TF_UNUSED:15

;
; A token entry in the map item of the token database
;
TokenEntry	struct
	TE_token	GeodeToken <>
	TE_monikerList	TokenDBItem <>
	TE_flags	TokenFlags
	TE_release	ReleaseNumber <>
	TE_protocol	ProtocolNumber <>
TokenEntry	ends

;
; An entry in the map block of the token database 
;
MonikerGroupEntry	struct
	MGE_type	VisMonikerListEntryType
	MGE_group	word
MonikerGroupEntry	ends

;
; Flags to pass TokenListTokens to specify what range
; of tokens you would like returned.
;
TokenRangeFlags	record
	TRF_ONLY_GSTRING:1
	TRF_ONLY_PASSED_MANUFID:1
	:14
TokenRangeFlags	end

;
; Token database errors
;
TokenError						etype	word, 1
BAD_PROTOCOL_IN_SHARED_TOKEN_DATABASE_FILE		enum	TokenError
ERROR_OPENING_SHARED_TOKEN_DATABASE_FILE		enum	TokenError
ERROR_OPENING_LOCAL_TOKEN_DATABASE_FILE			enum	TokenError

;
; Routines for Token Database
;
global TokenInitTokenDB:far
global TokenExitTokenDB:far
global TokenDefineToken:far
global TokenGetTokenInfo:far
global TokenLookupMoniker:far
global TokenLoadMoniker:far
global TokenRemoveToken:far
global TokenGetTokenStats:far
global TokenLoadToken:far
global TokenLockTokenMoniker:far
global TokenUnlockTokenMoniker:far
global TokenListTokens:far
global TOKENOPENLOCALTOKENDB:far
TokenOpenLocalTokenDB	equ	TOKENOPENLOCALTOKENDB
global TOKENCLOSELOCALTOKENDB:far
TokenCloseLocalTokenDB	equ	TOKENCLOSELOCALTOKENDB

global TOKENDEFINETOKEN:far
global TOKENGETTOKENINFO:far
global TOKENLOOKUPMONIKER:far
global TOKENLOADMONIKERBLOCK:far
global TOKENLOADMONIKERCHUNK:far
global TOKENLOADMONIKERBUFFER:far
global TOKENREMOVETOKEN:far
global TOKENGETTOKENSTATS:far
global TOKENLOADTOKENBLOCK:far
global TOKENLOADTOKENCHUNK:far
global TOKENLOADTOKENBUFFER:far
global TOKENLOCKTOKENMONIKER:far
global TOKENUNLOCKTOKENMONIKER:far
global TOKENLISTTOKENS:far

EndLibrary	ui
