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

# atUnlock(3)

log and lock handling

Part of [atlog(3)](/atlog/3.md).

## NAME

atSetComment, atUnlock - log and lock handling

## SYNOPSIS

\#include \<atfs.h\>\
 \#include \<atfstk.h\>

int atSetComment (Af\_key \*aso, int commentType, char \*commentText, int mode);

int atUnlock (Af\_key \*aso);

## DESCRIPTION

*atSetComment* sets a comment attribute for the attributed software object *aso*. Valid *commentType*s are

- AT\_COMMENT\_INTENT

  for expressing a change intent describing planned modifications.

- AT\_COMMENT\_DESCR

  for issuing a descriptive text expressing the purpose of the document.

- AT\_COMMENT\_LOG

  for writing a change log describing the changes made.

With the argument *commentText*, a default text may be given. According to the mode (see below), the user will be asked for  entering the comment attribute value. When a default text is given,  this will be offered for modification. With an commentText argument, the previous of the according comment attribute is taken as default text.

With the *mode* field, the behavior of atSetComment can be influenced. Three flags may me set:

- AT\_FROMSTDIN

  advises atSetComment to read the user input from standard input, otherwise an editor will be started.

- AT\_REUSE

  causes reuse of the comment text expressed during the previous invocation of atSetComment, if there was any.

- AT\_CONFIRM

  lets the user confirm, that an comment shall be expressed. Otherwise, atSetComment asks for the comment text without prior confirmation. This flag is ignored, when AT\_FROMSTDIN is set and the change comment is taken from standard input.

*atUnlock* unlocks *aso* by calling af\_unlock (manual page [af\_lock(3)](/af_lock/3.md)). If a change intent was previously set for *aso*, this will be eliminated.

## DIAGNOSTICS

atSetComment and atUnlock return FALSE (zero) on error. Additionally, the *atError* variable is set and *afErrMsg* holds a diagnostic message.

## ENVIRONMENT

EDITOR - the default editor to be called.

## SEE ALSO

[af\_lock(3)](/af_lock/3.md)
