File Content Extraction 25.2
Filter SDK C Programming Guide

# xxxsrAutoDet()

This function analyzes the source document and determines whether the detected file format requires the custom reader. It is called only when the `[CustomFilters]` section of the `formats.ini` file contains an entry identifying the complete file name of the custom reader. For more information on the `formats.ini` file, see Obtain Format Information.

## Syntax

    Bool pascal _export xxxsrAutoDet(
        adTPDocInfo    *pTPDocInfo,
        KPTPIOobj      *pIO)

## Arguments

`pTPDocInfo` | A pointer to the `adTPDocInfo` structure provided by the structured access layer.
`pIO` | A pointer to the I/O stream object for the document processed.

## Returns

- `TRUE` if the file format matches that of the custom reader.
- `FALSE` if the file format does not match that of the custom reader.

## Discussion

- Typically, only the first 1 KB of the file is read into a buffer and analyzed to determine if it matches the file format of the custom reader. If a match is determined, the following four members of the `adTPDocInfo` structure must be assigned before returning `TRUE`:

  `adClass` | Must be set to `1`.
  `adFormat` | A numerical value assigned to this reader in the `[Formats]` section of the `formats.ini` file.
  `descStr` | A string describing the file format.
  `mMnmemStr` | The initial part of the custom reader file name with the "`sr`" excluded.

- If the return value is `TRUE`, the custom reader is used to parse the file and generate the token stream.
- If the return value is `FALSE`, all other readers in the `[CustomFilters]` section of the `formats.ini` file are tried. If no match is found, the file detection process continues checking for the formats supported by Filter SDK.
- The entry in the `[Formats]` section of the `formats.ini` file should be of the form `aaa.bbb.ccc.ddd`, where `aaa` is the value used for the `adFormat` parameter, `bbb` is the value of the file class, `ccc` is the value of the minor format, and `ddd` is the value of the major version.

Copyright 1997-2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 25.2

Topic Title: xxxsrAutoDet()