about summary refs log tree commit diff stats
path: root/gemtext_type.3
blob: 34436c00a4c6f01003d734e3bec63bd2f5d30267 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.Dd 2020-10-22
.Dt gemtext 3
.Os
.Sh NAME
.Nm gemtext_type ,
.Nm gemtext_link_has_label
.Nd read information from gemtext objects
.Sh SYNOPSIS
.In gemtext.h
.Ft int
.Fn gemtext_type "struct gemtext *line"
.Ft int
.Fn gemtext_link_has_label "struct gemtext *line"
.Sh DESCRIPTION
.Fn gemtext_type
returns the type of gemtext object specified in
.Em line .
.Pp
.Fn gemtext_link_has_label
operates under the assumption that
.Em line
is of type
.Em GEMTEXT_LINK
and returns non-zero if link object contained in
.Em line
has a label, or
.Em 0
if it doesn't.
.Sh TYPES
This is a list of all possible return values for
.Fn gemtext_type :
.Bd -literal -offset indent
#define GEMTEXT_TEXT 1 /* plain text line */
#define GEMTEXT_LINK 2 /* link */
#define GEMTEXT_PRE  3 /* preformatted text */
#define GEMTEXT_H1   4 /* heading (level 1) */
#define GEMTEXT_H2   5 /* heading (level 2) */
#define GEMTEXT_H3   6 /* heading (level 3) */
#define GEMTEXT_UL   7 /* unordered list */
#define GEMTEXT_QT   8 /* quoteed text */
.Ed
.Sh ERRORS
.Fn gemtext_type
never fails.
.Sh SEE ALSO
.Xr gemtext_decode 3 ,
.Xr gemtext_encode 3 ,
.Xr gemtext_text_new 3 ,
.Xr gemtext_text_string 3 ,
.Xr gemtext_text_strlen 3 ,
.Xr gemtext_list_append 3 ,
.Xr gemtext_free 3
.Sh AUTHORS
.An Ali Fardan Aq Mt raiz@stellarbound.space