Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Up Previous Next 

PATH 
Mac OS 8 and 9 Developer Documentation > Text Encoding Conversion Manager
Programming With the Text Encoding Conversion Manager



TECCreateSniffer

Creates a sniffer object and returns a reference to it.

pascal OSStatus TECCreateSniffer (
                     TECSnifferObjectRef *encodingSniffer,
                     TextEncoding testEncodings[],
                     ItemCount numTextEncodings);
encodingSniffer
A pointer to a sniffer object reference, which is of type TECSnifferObjectRef. On output, the reference pertains to the newly created sniffer object.

testEncodings[]
An array of text encoding specifications supplied by the caller; TECCreateSniffer will attempt to create a sniffer that is capable of sniffing for each of these encodings.

numTextEncodings
A value of type ItemCount that specifies the number of text encoding specifications in the testEncodings[] array.

function result
A result code. See Text Encoding Conversion Manager Result Codes for a list of possible values. If other than noErr, then one of the text conversion plug-ins encountered an error when polled for available sniffers.

DISCUSSION

The TECCreateSniffer function polls plug-ins for available sniffers, creates a sniffer object capable of sniffing each of the specified encodings that it can find a sniffer function for, and returns a reference to it. You use this sniffer object reference with sniffer functions such as TECSniffTextEncoding. If no sniffer function is available for a particular encoding, no error is returned and TECSniffTextEncoding indicates later that the encoding was not examined.

To remove a sniffer object, you must call the function TECDisposeSniffer.

SEE ALSO

The function TECCountAvailableSniffers

The function TECGetAvailableSniffers


© 1999 Apple Computer, Inc. – (Last Updated 13 Dec 99)

Up Previous Next