shithub: vcardfs

Download patch

ref: a0054fa2fc711277c267fbd7d6b48bff6e0d4a82
parent: ff810eacaefe6dc6544b8f98862961eec8cb490b
author: sirjofri <[email protected]>
date: Tue Oct 22 08:50:12 EDT 2024

adds man pages

diff: cannot open b/man//null: file does not exist: 'b/man//null'
--- /dev/null
+++ b/man/mkfile
@@ -1,0 +1,8 @@
+install:VQ:
+	for(file in *){
+		parts=`.{echo -n $file}
+		if (~ $#parts 2){
+			echo /sys/man/^$parts(2)^/^$parts(1)
+			cp $file /sys/man/^$parts(2)^/^$parts(1)
+		}
+	}
--- /dev/null
+++ b/man/vcard.2
@@ -1,0 +1,99 @@
+.TH VCARD 2
+.SH NAME
+vcparse, vcparsefile, vcmserialize, vcfreeparams, vcfreelines, vcfreecards \- vcard library
+.SH SYNOPSIS
+.ft L
+.nf
+#include "vcard.h"
+.fi
+.PP
+.ft L
+.nf
+typedef struct Vcard Vcard;
+typedef struct Vline Vline;
+typedef struct Vparam Vparam;
+.fi
+.PP
+.ft L
+.nf
+.ta \w'    'u +\w'Vparam 'u +\w'Vparam 'u
+struct Vcard {
+	Vline	*content;
+	Vcard	*next;
+};
+.fi
+.PP
+.ft L
+.nf
+struct Vline {
+	char	*name;
+	char	*value;
+	char	*group;
+	Vparam	*params;
+.fi
+.B };
+.PP
+.ft L
+.nf
+struct Vparam {
+	char	*name;
+	char	*value;
+	Vparam	*next;
+};
+.fi
+.PP
+.ft L
+.nf
+.ta \w'Vparam 'u +\w'Vparam 'u +\w'Vparam 'u
+Vcard*	vcparse(char *string);
+Vcard*	vcparsefile(char *file);
+char*	vcmserialize(Vcard*);
+.fi
+.PP
+.ft L
+.nf
+void	vcfreeparams(Vparam*);
+void	vcfreelines(Vline*);
+void	vcfreecards(Vcard*);
+.fi
+.SH DESCRIPTION
+This library provides parsing functionality for vcard files based on the specification for version 4.0 of the vcard file format.
+The parsing functionality is generic enough to be able to parse all common versions of vcard, it does no semantic validation.
+.PP
+.I Vcparse
+and
+.I vcparsefile
+parse
+.I string
+or
+.I file
+respectively. They return a valid allocated
+.I Vcard
+structure, or
+.I nil
+on error.
+.PP
+.IR Vcfreeparams ,
+.IR vcfreelines and
+.I vcfreecards
+free the specified chain of structures.
+If you only want to free a single structure, it is necessary to set the
+.I next
+pointer to
+.IR nil .
+.PP
+.I Vcmserialize
+returns an allocated string of the supplied chain of
+.I Vcard
+structures.
+.SH SOURCE
+.B https://shithub.us/sirjofri/vcardfs - libvcard
+.br
+.B https://git.sr.ht/~sirjofri/vcardfs - libvcard
+.SH SEE ALSO
+.IR vcardfs (1)
+.SH DIAGNOSTICS
+Sets
+.IR errstr .
+.SH BUGS
+Sure.
--- /dev/null
+++ b/man/vcardfs.1
@@ -1,0 +1,100 @@
+.TH VCARDFS 1
+.SH NAME
+vcardfs \- vcard filesystem
+.SH SYNOPSIS
+.B vcardfs
+[
+.B -s
+.I srv
+] [
+.B -m
+.I mtpt
+] [
+.I file
+]
+.SH DESCRIPTION
+.I Vcardfs
+manages a vcard file using a filesystem hierarchy.
+For that, it opens the supplied
+.I file
+or the standard file
+.BR /usr/$user/lib/vcarddb.vcf .
+.PP
+By default, the filesystem will be mounted at
+.IR /mnt/vcard ,
+if not other specified.
+.PP
+The filesystem presents the following files:
+.IP "\fIctl\fR"
+By writing to this file, the user can create new vcard entries and write the in-memory data to the disk. The
+.B ctl
+file wants one command per write.
+.IP
+To create a new entry, use the command
+.IR new ,
+followed by a space and the name (FN) of the new entry.
+.IP
+Use the command
+.I write
+to save the data to the database vcard file.
+.IP "\fIexport\fR"
+.IP
+This readonly file provides a full vcard representation of all the loaded vcard entries.
+.IP "\fIimport\fR"
+.IP
+To import new data, open the file and write the data to it. After closing the file, the data will be parsed and integrated.
+.PP
+In addition to these static files, each loaded entry will present a folder within the filesystem. The name of that folder is either the
+.I FN
+property (if exists), or generated from the
+.I N
+property of that entry.
+These entry folders contain a file called
+.B export
+which yields a full vcard representation of this single entry.
+.PP
+Each entry folder also contains a folder for each property, named using the property name. The folder name will be prefixed with the group name, if the property is associated with a group.
+.PP
+Each property folder the following files:
+.IP "\fIdata\fR"
+.IP
+This RW file contains the value of the property.
+.IP "\fIgroup\fR"
+.IP
+This RW file contains the associated group. If it doesn't exist, it can be manually created. An empty string is equivalent to the absence of the file; both mean that the property has no group association.
+.IP "\fIparams\fR"
+.IP
+This folder contains a RW file for each parameter.
+.SH EXAMPLE
+This is a sample filesystem structure:
+.EX
+.ta \w'   'u +\w'   'u +\w'   'u +\w'   'u
+/mnt/vcard/
+	ctl
+	export
+	import
+	John_Doe/
+		export
+		fn/
+			data
+			params/
+		n/
+			data
+			params/
+		tel/
+			data
+			params/
+				type
+.EE
+.SH FILES
+.B /usr/$user/lib/vcarddb.vcf
+.SH SOURCE
+.B https://shithub.us/sirjofri/vcardfs
+.br
+.B https://git.sr.ht/~sirjofri/vcardfs
+.SH SEE ALSO
+.IR vcard (2)
+.SH BUGS
+It is not clear yet how to handle multiple lines of the same property, for example multiple
+.I tel
+properties with different parameters.