properties_free(3)

properties_free3

Functions to allow creating simple property lists from ascii file data

Usage

#include <libutil.h>

properties

properties_read(int fd);

char *

property_find(properties list, const char *name);

void

properties_free(properties list);

Library

System Utilities Library (libutil, -lutil)

Overview

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.

Releases

77 releases since FreeBSD 3.0-RELEASE; the text changed 46 times.

  1. 3.0
  2. 3.1
  3. 3.2
  4. 3.3
  5. 3.4
  6. 3.5–3.5.1
  7. 4.0
  8. 4.1–4.2
  9. 4.3
  10. 4.4
  11. 4.5–4.11
  12. 5.0
  13. 5.1–5.2.1
  14. 5.3–5.5
  15. 6.0–6.3
  16. 6.4
  17. 7.0
  18. 7.1
  19. 7.2
  20. 7.3
  21. 7.4
  22. 8.0
  23. 8.1
  24. 8.2
  25. 8.3
  26. 8.4
  27. 9.0
  28. 9.1
  29. 9.2
  30. 9.3
  31. 10.0
  32. 10.1
  33. 10.2
  34. 10.3
  35. 10.4
  36. 11.0
  37. 11.1
  38. 11.2
  39. 11.3
  40. 11.4
  41. 12.0
  42. 12.1
  43. 12.2
  44. 12.3
  45. 12.4
  46. 13.0–13.2
  47. 13.3–16.0

Authors

Jordan Hubbard

Bugs

Simplistic.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.