Up: GEOS SDK TechDocs | Up | Prev: TocNameArrayFind() ... | Next: TokenLoadMonikerBuffer() ...

TokenDefineToken()

word	TokenDefineToken(
        dword		tokenChars,					/* four token characters */
        ManufacturerID		manufacturerID,					/* manufacturer ID for token */
        optr		monikerList,					/* optr of moniker list */
        TokenFlags		flags);					/* token flags */

This routine adds a new token and moniker list to the token database. If the token already exists in the token DB, the old will be replaced with the new. This routine must only be called by a thread that can lock the block in which the passed moniker or moniker list resides. This routine must be passed the following parameters:

tokenChars
The four token characters that identify this moniker or moniker list in the token database. Create this dword value from the four characters with the macro TOKEN_CHARS.
manufacturerID
The manufacturer ID number of the manufacturer responsible for the token database entry.
monikerList
The optr of the moniker list to be added to the token database.
flags
A record of TokenFlags indicating the relocation status of the moniker list.

Warnings: This routine may legally move locked LMem blocks (token database items), thereby invalidating all pointers to token database items.

Include: token.h

TokenGetTokenInfo()

Boolean	TokenGetTokenInfo(
        dword		tokenChars,					/* four characters of token */
        ManufacturerID		manufacturerID,					/* manufacturer ID of token */
        TokenFlags		* flags);					/* returned token flags */

This routine returns information about a specified token. Pass it the following:

tokenChars
The four token characters that identify the token database entry. Create this dword from the four characters with the macro TOKEN_CHARS.
manufacturerID
The manufacturer ID number of the manufacturer responsible for the token database entry.
flags
A pointer to an empty flags record; the flags set (if any) for the specified token (if it exists) will be returned here.

This routine returns a non-zero value if the token was found in the token database. It returns zero if the token was not found.

Include: token.h

TokenListTokens()

dword	TokenListTokens(
        TokenRangeFlags 		tokenRangeFlags,
        word 		headerSize,
        ManufacturerID 		manufacturerID));

This routine lists all the tokens in the token database. It allocates a new block on the global heap and writes in it an array of GeodeToken structures. This routine returns the actual tokens, not the token groups.

The returned dword consists of two values: The high word represents the number of tokens in the returned block and may be extracted with the macro TokenListTokensCountFromDWord() . The low word represents the handle of the newly-allocated block and can be extracted with the macro TokenListTokensHandleFromDWord() .

Include: token.h

TokenListTokensCountFromDWord()

word	TokenListTokensCountFromDWord(d);
        dword	d;

This macro extracts the number of tokens from the value returned by TokenListTokens() .

TokenListTokensHandleFromDWord()

word	TokenListTokensHandleFromDWord(d);
        dword	d;

This routine extracts the MemHandle from the value returned by TokenListTokens() .

TokenLoadMonikerBlock()

Boolean	TokenLoadMonikerBlock(
        dword		tokenChars,					/* four characters of token */
        ManufacturerID		manufacturerID,					/* manufacturer ID of token */
        DisplayType		displayType,					/* type of display for token */
        VisMonikerSearchFlags searchFlags,							/* flags for finding token */
        word		* blockSize,					/* returned block size */
        MemHandle		* blockHandle);					/* returned block handle */

This routine loads a specified token's moniker, allocating a new global memory block for the moniker. The returned Boolean will be false if the moniker was found, true otherwise. Information about the moniker is returned in the values pointed to by blockSize (the size of the newly allocated block) and blockHandle (the handle of the new block). If the moniker is not found, both return pointers will be NULL and no block will be allocated.

Pass this routine the following:

tokenChars
The four token characters that identify the token database entry. Create this dword from the four characters with the macro TOKEN_CHARS.
manufacturerID
The manufacturer ID number of the manufacturer responsible for the token database entry.
displayType
A value of DisplayType indicating the size of the display (used to indicate small-screen devices, primarily).
searchFlags
A record of VisMonikerSearchFlags indicating what type of moniker is being requested.
blockSize
A pointer to a word in which the new block's size will be returned.
blockHandle
A pointer to a handle in which the new block's handle will be returned.

Include: token.h


Up: GEOS SDK TechDocs | Up | Prev: TocNameArrayFind() ... | Next: TokenLoadMonikerBuffer() ...