KeyView 24.3

# Basic Steps

The basic steps for developing a custom reader are as follows.

To develop a custom reader

1. Design the global context structure.

2. Write the basic API functions:

   - xxxAllocateContext()
   - xxxInitDoc()
   - xxxFillBuffer()
   - xxxFreeContext()
   - xxxCharSet()
   - xxxsrAutoDet()

   From within the `xxxFillBuffer()` function, it is necessary to call other functions that repeatedly read a chunk of a source file, parse the chunk, and generate a token stream until the entire source file is processed.

3. Map all but the last function to the `TPReaderInterface` structure.
4. Write the module definition file (`*.def`), exporting the reader interface and format detection functions.

5. Modify the `formats.ini` file to identify the custom reader and its associated format detection function. See xxxsrAutoDet(). For example, the following lines would be added to the `[Formats]` section of the `formats.ini` file for the UTF-8 reader:

       514.1.0.0=utf8
       [CustomFilters]
       1=utf8sr

Copyright 1997-2024 Open Text
Version 24.3 | Last updated June 2024

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: IDOL KeyView 24.3

Topic Title: Basic Steps