---
name: "mfan"
section: "3hdf"
platform: "linux"
package: "libhdf4g-dev"
version: "4.0.2-6"
release: "Debian 2.0 (Hamm)"
platforms: ["linux"]
url: "https://new.carta.tech/mfan"
---

# mfan(3hdf)

Multi-file Annotation Interface

## NAME

ANstart, ANfileinfo, ANend, ANcreate, ANcreatef, ANselect, ANnumann, ANannlist, ANannlen, ANwriteann, ANreadann, ANendaccess - Multi-file Annotation Interface

## SYNOPSIS

**#include \<mfan.h\>**

**extern int32 ANstart(int32 file\_id);**

**extern intn ANfileinfo**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**int32 \*n\_file\_label,**\
\
 	**int32 \*n\_file\_desc,**\
\
 	**int32 \*n\_obj\_label,**\
\
 	**int32 \*n\_obj\_desc**\
 **);**

**extern int32 ANend(int32 an\_id);**

**extern int32 ANcreate**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**uint16 elem\_tag,**\
\
 	**uint16 elem\_ref,**\
\
 	**ann\_type type**\
 **);**

**extern int32 ANcreatef**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**ann\_type type**\
 **);**

**extern int32 ANselect**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**int32 index,**\
\
 	**ann\_type type**\
 **);**

**extern intn ANnumann**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**ann\_type type,**\
\
 	**uint16 elem\_tag,**\
\
 	**uint16 elem\_ref**\
 **);**

**extern intn ANannlist**\
 **(**\
\
 	**int32 an\_id,**\
\
 	**ann\_type type,**\
\
 	**uint16 elem\_tag,**\
\
 	**uint16 elem\_ref,**\
\
 	**int32 ann\_list\[\]**\
 **);**

**extern int32 ANannlen(int32 ann\_id);**

**extern int32 ANwriteann**\
 **(**\
\
 	**int32 ann\_id,**\
\
 	**char \*ann,**\
\
 	**int32 annlen**\
 **);**

**extern int32 ANreadann**\
 **(**\
\
 	**int32 ann\_id,**\
\
 	**char \*ann,**\
\
 	**int32 maxlen**\
 **);**

**extern intn ANendaccess(int32 ann\_id);**

## PARAMETERS

- **int32 file\_id**

  IN: file to start annotation access on.

- **int32 an\_id** (ANfileinfo)

  IN:  annotation interface id.

- **int32 \*n\_file\_label**

  OUT: the # of file labels.

- **int32 \*n\_file\_desc**

  OUT: the # of file descriptions.

- **int32 \*n\_obj\_label**

  OUT: the # of object labels.

- **int32 \*n\_obj\_desc**

  OUT: the # of object descriptions.

- **int32 an\_id** (ANend)

  IN: Annotation ID of file to close.

- **int32 an\_id** (ANcreate)

  IN: annotation interface ID.

- **uint16 elem\_tag** (ANcreate)

  IN: tag of item to be assigned annotation.

- **uint16 elem\_ref** (ANcreate)

  IN: reference number of itme to be assigned ann.

- **ann\_type type** (ANcreate)

  IN: annotation type.

  Possible values for an **ann\_type** are as follows:

  - **AN\_DATA\_LABEL**

    Data label.

  - **AN\_DATA\_DESC**

    Data description.

- **ann\_type type** (ANcreatef)

  IN:  annotation type.

  Possible values for an **ann\_type** are as follows:

  - **AN\_FILE\_LABEL**

    File label.

  - **AN\_FILE\_DESC**

    File description.

- **int32 index**

  IN: index of annottion to get ID for.

- **int32 an\_id** (ANnumann)

  IN: annotation interface id.

- **uint16 elem\_tag** (ANnumann)

  IN: tag of item of which this is annotation.

- **uint16 elem\_ref** (ANnumann)

  IN: ref of item of which this is annotation.

- **int32 ann\_list\[\]**

  OUT: array of ann\_id's that match criteria.

- **int32 ann\_id** (ANannlen)

  IN: annotation id.

- **char \*ann** (ANwriteann)

  IN: annotation to write.

- **int32 annlen**

  IN: length of annotation.

- **int32 ann\_id** (ANreadann)

  IN: annotation id (handle).

- **char \*ann** (ANreadann)

  OUT: space to return annotation in.

- **int32 maxlen**

  IN: size of space to return annotation in.

## DESCRIPTION

### ANstart

Start annotation handling on the file return a annotation ID to the file.

### ANfileinfo

Reports general information about the number of file and object(i.e. Data) annotations in the file. This routine is generally used to find the range of acceptable indices for ANselect calls.

### ANend

End annotation access to file.

### ANcreate

Creates a data annotation, returns an 'an\_id' to work with the new annotation which can either be a label or description. Valid annotation types are AN\_DATA\_LABEL for data labels and AN\_DATA\_DESC for data descriptions.

### ANcreatef

Creates a file annotation, returns an 'an\_id' to work with the new file annotation which can either be a label or description. Valid annotation types are AN\_FILE\_LABEL for file labels and AN\_FILE\_DESC for file descritpions.

### ANselect

Get an annotation Id from index of 'type'. The position index is ZERO based.

### ANnumann

Find number of annotation of 'type' for the given element tag/ref pair.

### ANannlist

Find and generate list of annotation ids of 'type' for the given element tag/ref pair.

### ANannlen

Uses the annotation id to find ann\_key & file\_id.

### ANwriteann

Checks for pre-existence of given annotation, replacing old one if it exists. Writes out annotation.

### ANreadann

Gets tag and ref of annotation.  Finds DD for that annotation. Reads the annotation, taking care of NULL terminator, if necessary.

### ANendaccess

Terminates access to an annotation. For now does nothing.

## RETURNS

### ANstart

A file ID or FAIL.

### ANfileinfo

Returns SUCCEED if successful and FAIL othewise.

### ANend

SUCCEED if successful and  FAIL otherwise.

### ANcreate

An ID to an annotation which can either be a label or description.

### ANcreatef

An ID to an annotation which can either be a file label or description.

### ANselect

An ID to an annotation type which can either be a label or description.

### ANnumann

Number of annotation found if successful and FAIL (-1) otherwise.

### ANannlist

Number of annotations ids found if successful and FAIL (-1) otherwise.

### ANannlen

Length of annotation if successful and FAIL (-1) otherwise.

### ANwriteann

SUCCEED (0) if successful and FAIL (-1) otherwise.

### ANreadann

SUCCEED (0) if successful and FAIL (-1) otherwise.

### ANendaccess

SUCCEED or FAIL.

## NAME

### ANstart

ANstart - open file for annotation handling.

### ANfileinfo

ANfileinfo - Report high-level information about the ANxxx interface for a given file.

### ANend

ANend - End annotation access to file file.

### ANcreate

ANcreate - create a new element annotation and return a handle(id).

### ANcreatef

ANcreatef - create a new file annotation and return a handle(id).

### ANselect

ANselect - get an annotation ID from index of 'type'.

### ANnumann

ANnumann - find number of annotation of 'type' that  match the given element tag/ref.

### ANannlist

ANannlist - generate list of annotation ids of 'type' that match the given element tag/ref.

### ANannlen

ANannlen - get length of annotation givne annotation id.

### ANwriteann

ANwriteann - write annotation given ann\_id.

### ANreadann

ANreadann - read annotation given ann\_id.

### ANendaccess

ANendaccess - end access to an annotation given it's id.
