---
name: "properties_free"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/properties_free"
---

# properties\_free(3)

functions to allow creating simple property lists from ASCII file data

## NAME

**properties\_read**, **property\_find**, **properties\_free** – functions to allow creating simple property lists from ASCII file data

## LIBRARY

System Utilities Library (libutil, -lutil)

## SYNOPSIS

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

*properties*\

**properties\_read**(*int fd*);

*char* *\**\

**property\_find**(*properties list*, *const char \*name*);

*void*\

**properties\_free**(*properties list*);

## DESCRIPTION

```
typedef struct _properties {
	struct _properties *next;
	char *name;
	char *value;
} *properties;
```

The function **properties\_read**() reads *name*, *=*, *value* pairs from the file descriptor passed in *fd* and returns the head of a new property list, assuming that the file's contents have been parsed properly, or NULL in case of error.

The **property\_find**() function returns the associated value string for the property named *name* if found, otherwise NULL. The value returned may be up to PROPERTY\_MAX\_VALUE bytes in length.

The **properties\_free**() function is used to free the structure returned by **properties\_read**() when it is no longer needed.

## FILE FORMAT

Each property in the file is assumed to have the format of *name*, *=*, *value* where *name* is an alphanumeric string (and any punctuation not including the \`=' character) and *value* is an arbitrary string of text terminated by a newline character. If newlines are desired, the entire value should be enclosed in { } (curly-bracket) characters. Any line beginning with a # or ; character is assumed to be a comment and will be ignored.

## AUTHORS

Jordan Hubbard

## BUGS

Simplistic.
