diff options
Diffstat (limited to 'gemtext_decode.3')
-rw-r--r-- | gemtext_decode.3 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gemtext_decode.3 b/gemtext_decode.3 new file mode 100644 index 0000000..9241a65 --- /dev/null +++ b/gemtext_decode.3 @@ -0,0 +1,51 @@ +.Dd 2020-10-22 +.Dt gemtext 3 +.Os +.Sh NAME +.Nm gemtext_decode , +.Nm gemtext_decode_fd , +.Nm gemtext_decode_file +.Nd Gemini text parsing functions +.Sh SYNOPSIS +.In gemtext.h +.Ft struct gemtext ** +.Fn gemtext_decode "char *text" +.Ft struct gemtext ** +.Fn gemtext_decode_fd "int fd" +.Ft struct gemtext ** +.Fn gemtext_decode_file "const char *path" +.Sh DESCRIPTION +.Fn gemtext_decode +takes a string of type +.Nm text/gemini +and returns a list of +.Nm struct gemtext* +terminated by a NULL pointer. +.Pp +.Fn gemtext_decode_fd +and +.Fn gemtext_decode_file +are wrappers for +.Fn gemtext_decode +where the former takes input from file descriptor, and the latter reads input from file specified in +.Em file . +.Pp +pointers returned by +.Fn gemtext_decode +and it's wrappers should be freed using +.Xr gemtext_list_free(3) . +.Sh RETURN VALUES +.Fn gemtext_decode , +.Fn gemtext_decode_fd +and +.Fn gemtext_decode_file +return a pointer pointing to the first item in the list of items parsed from +.Em text +on success, or NULL on error. +.Sh SEE ALSO +.Xr gemtext_encode 3 , +.Xr gemtext_encode_fd 3 , +.Xr gemtext_encode_file 3 , +.Xr gemtext_list_free 3 . +.Sh AUTHORS +.An Ali Fardan Aq Mt raiz@stellarbound.space |