---
name: "af_histories"
section: "3"
platform: "linux"
package: "atfs-dev"
version: "1.4pl6-15+b1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/af_history"
---

# af\_histories(3)

AtFS history functions

Part of [af\_history(3)](/af_history/3.md).

## NAME

af\_histories, af\_access - AtFS history functions

## SYNOPSIS

\#include \<atfs.h\>

char\*\*	af\_histories (char \*path, char \*pattern)

char\*\*	af\_cachenames (char \*path, char \*pattern);

int	af\_access (char \*path, char \*name, char \*type, int mode)

## DESCRIPTION

*af\_histories* returns a list of source history names from the directory pointed to by *path*, that match the given *pattern*. Histories in a directory are represented by at least one version. The pattern must be [ed(1)](/ed/1.md) patterns, processable by [re\_comp(3)](/re_comp/3.md) and [re\_exec(3)](/re_exec/3.md). The resulting list of af\_histories resides in allocated memory. Use [free(3)](/free/3.md) to free the memory for further allocation. af\_histories returns an empty list (not a NULL pointer !), when no histories are found.

*af\_cachenames* does the same as af\_histories but on derived object caches.

*af\_access* determines the existence of an object history. If any ASO (any version) with the given *path*, *name* and *type* attributes exists, af\_access returns zero, otherwise -1. The *mode* argument can either be

- AF\_CLASS\_SOURCE

  indicating that only source objects shall be searched or

- AF\_CLASS\_DERIVED

  which means that only the derived object cache shall be searched for existence of a matching ASO.

## SEE ALSO

[ed(1)](/ed/1.md), [re\_comp(3)](/re_comp/3.md), [re\_exec(3)](/re_exec/3.md), [free(3)](/free/3.md)

## DIAGNOSTICS

Upon error, -1 or a null pointer (depending on the return type) is returned and *af\_errno* is set to the corresponding error number.
