PROPERTIES(3)
π PROPERTIES(3) π
Okay so this is the PROPERTIES(3) manual page bestie, and it's literally all about the property list functions from the System Utilities Library β you know, libutil, link it with -lutil π«Ά. These functions are here to let you create simple property lists from ASCII file data, and honestly? It's giving useful. π
β¨ LIBRARY β¨
So this whole situation lives in the System Utilities Library β that's libutil, and you link against it with -lutil. Periodt. π
π¦ SYNOPSIS π¦
Here's the whole vibe in code form, keep it exact bestie:
#include <libutil.h>
properties
properties_read(int fd);
char *
property_find(properties list, const char *name);
void
properties_free(properties list);
π DESCRIPTION π
First up, the struct β this is the whole personality of the thing:
typedef struct _properties {
struct _properties *next;
char *name;
char *value;
} *properties;
Now let me walk you through the functions because they're literally so straightforward:
properties_read(int fd)β so this one readsname = valuepairs from the file descriptor you pass infd, and it returns the head of a brand new property list. Assuming everything parsed properly, of course. If something goes wrong? You getNULLback. No cap. πproperty_find(properties list, const char *name)β this one's the lookup bestie. Give it the property list and aname, and it returns the associated value string if it finds it. If not?NULL. And heads up β the value you get back may be up toPROPERTY_MAX_VALUEbytes in length, so don't get caught lacking. π₯properties_free(properties list)β when you're done with the structure thatproperties_read()returned, this is the one that frees it. Clean up after yourself, queen. π
π FILE FORMAT π
Okay so the tea on how files should be formatted: 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. Simple enough, right? π
But wait β if you want newlines inside your value? You gotta enclose the entire value in { } (curly-bracket) characters. That's the trick. π¦
And any line beginning with a # or ; character is assumed to be a comment and will be ignored. Iconic. β¨
π AUTHORS π
This masterpiece was written by Jordan Hubbard. We stan. π«Ά
π BUGS π
Okay so the bug section is literally just one word: Simplistic. That's it. That's the whole bug report. I'm not even kidding. π
That's the whole page bestie! This came from the Debian version, dated October 7, 1998 β like, a literal relic from the 90s and we're still using it. Vintage icon behavior. π Stay slaying with those property lists! π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1998 Jordan Hubbard
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms