Vips.Foreign.map
Description: Reference for Vips.Foreign.map

### Function

# Vips Foreignmap

#### Declaration [src]

    void*
    vips_foreign_map (
      const char* base,
      VipsSListMap2Fn fn,
      void* a,
      void* b
    )

#### Description [src]

Apply a function to every `VipsForeign` that VIPS knows about. Foreigns are presented to the function in priority order.

Like all VIPS map functions, if `fn` returns `NULL`, iteration continues. If it returns non-`NULL`, iteration terminates and that value is returned. The map function returns `NULL` if all calls return `NULL`.

See also

`vips_slist_map2()`.

#### Parameters

`base`

  Type: `const char*`

  Base class to search below (eg. “VipsForeignLoad”).

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`fn`

  Type: `VipsSListMap2Fn`

  Function to apply to each `VipsForeign`.

`a`

  Type: `void*`

  User data.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`b`

  Type: `void*`

  User data.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `void*`

The result of iteration.

The data is owned by the called function.
The return value can be `NULL`.