File ID Specification

The Outside In Technology File ID module uses an extremely fast and accurate proprietary algorithm to inspect data in a file until it can be matched with known data characteristics of a particular file type. This chapter provides an overview of the functions specific to the File ID SDK.

This chapter describes the following functions:

FIDeInit

This function tells the File Identification module that it will not be asked to read additional documents, so it should perform any necessary cleanup tasks. This function should be called at application shutdown time, and only if the module was successfully initialized with a call to FIInit.

Prototype

VTDWORD FIDeInit() 

Return Values

FIGetFirstId

This function is called to get the first of all possible IDs that can be returned by FIIdFile and FIIdFileEx.

Prototype

VTBOOL FIGetFirstId(
   PFIGET   pFiGet,
   VTWORD   * pType,
   VTLPTSTR pTypeName,
   VTWORD   wNameCount);

Parameters

Return Values

FIGetIDString

Returns the string associated with a particular FI ID. If no string is available for the specified ID, a value of zero is returned and the pTypeName buffer is not filled.

Prototype

VTWORD FIGetIDString(
VTWORD     wType,
VTLPTSTR   pTypeName,
VTWORD     wNameCount);

Parameters

Return Values

n: The number of characters filled in pTypeName.

FIGetNextId

This function is called to get the next of all possible IDs that can be returned by FIIdFile and FIIdFileEx.

Prototype

VTBOOL FIGetNextId(
   PFIGET    pFiGet,
   VTWORD    * pType,
   VTLPTSTR  pTypeName,
   VTWORD    wNameCount);

Parameters

Return Values

FIIdFile

This function is called to retrieve the type ID of a file.

Prototype

VTWORD FIIdFile(
   VTDWORD   dwSpecType,
   VTVOID    * pSpec,
   VTDWORD   dwFlags,
   VTWORD    * pType);

Parameters

Return Values

FIIdFileEx

This function is called to retrieve the type ID of a file, including text file types.

Prototype

VTWORD FIIdFileEx(
   VTDWORD   dwSpecType,
   VTVOID    * pSpec,
   VTDWORD   dwFlags,
   VTWORD    * pType,
   VTLPTSTR  pTypeName,
   VTWORD    wNameCount);

Parameters

Return Values

FIInit

This function tells the File Identification module to perform any necessary initialization it needs to prepare for document access. This function must be called before the first time the application uses the module to retrieve data from any document.

FIInit should only be called once per application, at application startup time. Any number of documents can be opened for file identification between calls to FIInit and FIDeInit. If FIInit succeeds, FIDeInit must be called regardless of any other API calls.

Prototype

VTDWORD FIInit()

Return Values

FIThreadInit

Multiple threads are supported only on the Windows, Linux, and Sun Solaris platforms. However, the FIThreadInit function is only implemented on the Sun Solaris and Linux platforms. Windows users can initialize multiple threads without calling this function. Failed initialization of this function does not impair other API calls. If the function is not called or fails, stub functions are called instead of mutex functions.

FIThreadInit initializes the technology, preparing it to be run in a thread. This preparation includes setting up mutex function pointers to prevent threads from clashing in critical sections of the technology’s code. The developer must actually code the threads after this function has been called. FIThreadInit should be called just before the call to FIInit and only once per process. Both functions should be called before the developer’s application begins the thread.

Prototype

VTLONG FIThreadInit(VTSHORT ThreadOption)

Parameters

Return Values

FIThreadInitExt

Note: Multiple threads are supported only on the Windows, Linux and Sun Solaris platforms. However, the FIThreadInitExt function is only implemented on the Sun Solaris and Linux platforms. Windows users can initialize multiple threads without calling this function. Failed initialization of this function does not impair other API calls. If the function is not called or fails, stub functions are called instead of mutex functions.

FIThreadInitExt initializes the technology, preparing it to be run in a thread. This preparation includes setting up mutex function pointers that the caller passes in to prevent threads from clashing in critical sections of the technology’s code. The developer must actually code the threads after this function has been called. FIThreadInitExt should be called just before the call to FIInit and only once per process. Both functions should be called before the developer’s application begins the thread.

Prototype

VTLONG FIThreadInit(VTLONG (*Lock)(VOID *), VTLONG
   (*UnLock)(VOID *))

Parameters

Return Values

FIIdHandle

FIIdHandle does the same thing as the IdFile function, except it works on arbitrary open document or subdocument handles.

Prototype

VTSHORT FIIdHandle(HIOFILE hBlockFile, VTDWORD dwFlags, VTWORD *pType) 

Parameter

Return Values

FIIdSpecial

FIIdSpecial is used to identify whether a file uses special text encodings

Prototype

VTWORD FIIdSpecial(HIOFILE hBlockFile, VTWORD wSpecialFileId)

Parameter

Return Values

Returns the Special File ID