KeyView 23.3

# fpGetSubFileMetaData()

DEPRECATED: The function `fpGetSubFileMetaData()` is deprecated in KeyView 23.2.0 and later. OpenText recommends that you use the function fpGetSubFileMetadataList() instead.

This function is still available for existing implementations, but it might be incompatible with new functionality and might be removed in future.

This function extracts metadata from mail stores, mail messages, and non-mail items.

## Syntax

    int (pascal *fpGetSubFileMetaData)  (
    	void                      *pFile,
    	KVGetSubFileMetaArg        metaArg,
    	KVSubFileMetaData         *metaData);

## Arguments

`pFile` | The identifier of the file. This is a file handle returned from fpOpenFile().
`metaArg` | A pointer to the KVGetSubFileMetaArg structure, which defines metadata tags whose values are retrieved. Before you initialize the `KVGetSubFileMetaArg` structure, use the `KVStructInit` macro to initialize the `KVStructHead` structure.
`metaData` | A pointer to the KVSubFileMetaData structure, which contains the retrieved metadata values.

## Returns

- If the metadata is retrieved, the return value is `KVERR_Success`.
- If the metadata is not retrieved, the return value is an error code.

## Discussion

- KeyView can extract a predefined set of common subfile metadata fields for all mail formats, and can extract all metadata from EML, MBX, MIME, NSF, ICS, and DXL files. To extract the common metadata fields, pass in `0` for `metaArg->metaNameCount`, and `NULL` for `metaArg->metaNameArray`. To extract all metadata, pass in `-1` for `metaArg->metaNameCount` and `NULL` for `metaArg->metaNameArray`.
- After the metadata is retrieved, call fpFreeStruct() to free the memory allocated by this function.
- If a field is repeated in an EML or MBX mail header, the values in each instance of the field are concatenated and returned as one field. The values are separated by five pound signs (`#####`) as a delimiter.

## Example

    KVSubFileMetaData  metaData = NULL;

    KVStructInit(&metaArg);

    /* retrieve all the default metadata elements */
    metaArg.metaNameCount = 0;
    metaArg.metaNameArray = NULL;
    metaArg.index = Index;

    error = extractInterface->fpGetSubFileMetaData(pFile,&metaArg,&metaData);
    ...

    extractInterface->fpFreeStruct(pFile,metaData);
    metaData = NULL;

    /* retrieve specific metadata fields */
    KVMetaName   pName[2];
    KVMetaNameRec names[2];

    names[0].type = KVMetaNameType_Integer;
    names[0].name.iname = KVPR_SUBJECT;

    names[1].type = KVMetaNameType_Integer;
    names[1].name.iname = KVPR_DISPLAY_TO;

    pName[0] = &names[0];
    pName[1] = &names[1];

    metaArg.metaNameCount = 2;
    metaArg.metaNameArray = pName;
    metaArg.index = Index;

    error = extractInterface->fpGetSubFileMetaData (pFile,&metaArg,&metaData);
    ...
    extractInterface->fpFreeStruct(pFile,metaData);
    metaData = NULL;

Copyright 2016-2023 Open Text
Version 23.3 | Last updated June 2023

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 swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL KeyView 23.3

Topic Title: fpGetSubFileMetaData()