Mercurial > irccd
annotate man/libirccd-hook.3 @ 1171:7d84776f902e
irccd: make lex/yacc more POSIX, closes #2538 @1h
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 28 Apr 2022 09:23:15 +0200 |
parents | c165e975f144 |
children | 1845a0509a93 |
rev | line source |
---|---|
1013
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 .\" |
1136
f06e9761cc90
misc: update copyright years
David Demelier <markand@malikania.fr>
parents:
1073
diff
changeset
|
2 .\" Copyright (c) 2013-2022 David Demelier <markand@malikania.fr> |
1013
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 .\" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 .\" Permission to use, copy, modify, and/or distribute this software for any |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 .\" purpose with or without fee is hereby granted, provided that the above |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 .\" copyright notice and this permission notice appear in all copies. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 .\" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 .\" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 .Dd @IRCCD_MAN_DATE@ |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 .Dt LIBIRCCD-HOOK 3 |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 .Os |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 .\" NAME |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 .Sh NAME |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 .Nm libirccd-hook |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 .Nd manipulate hooks |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 .\" SYNOPSIS |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 .Sh SYNOPSIS |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 .In irccd/hook.h |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 .Ft struct irc_hook * |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 .Fn irc_hook_new "const char *name, const char *path" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 .Ft void |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 .Fn irc_hook_invoke "struct irc_hook *hook, const struct irc_event *ev" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 .Ft void |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 .Fn irc_hook_finish "struct irc_hook *" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 .\" DESCRIPTION |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 .Sh DESCRIPTION |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 This header provides functions to create new hook or to invoke them. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 .Pp |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 The |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 .Vt "struct irc_hook" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 is declared as: |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 .Bd -literal |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 struct irc_hook { |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 char name[IRC_ID_LEN]; |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 char path[PATH_MAX]; |
1073
f18988efb96b
man: update documentation
David Demelier <markand@malikania.fr>
parents:
1013
diff
changeset
|
43 struct irc_hook *next; |
1013
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 }; |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 .Ed |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 .Pp |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 The fields of |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 .Vt "struct irc_hook" |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 are: |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 .Bl -tag -width name |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 .It Va name |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 Name to identify this hook. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 .It Va path |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 Absolute path to the hook. |
1073
f18988efb96b
man: update documentation
David Demelier <markand@malikania.fr>
parents:
1013
diff
changeset
|
55 .It Va next |
f18988efb96b
man: update documentation
David Demelier <markand@malikania.fr>
parents:
1013
diff
changeset
|
56 Pointer to the next hook. |
1013
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
57 .El |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 .Pp |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
59 The |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
60 .Fn irc_hook_new |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
61 allocates a new hook with the identifer |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
62 .Fa name |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
63 on the given |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
64 .Fa path . |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
65 Those arguments will be copied into the returned structure fields of the same |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
66 name. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
67 .Pp |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
68 The |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
69 .Fn irc_hook_invoke |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 will invoke the |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
71 .Fa hook |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
72 with the current IRC event pointed by |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
73 .Fa ev . |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
74 .Pp |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
75 The |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
76 .Fn irc_hook_finish |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
77 clears resources allocated for the |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
78 .Fa hook . |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
79 Make sure to remove it from the linked list where it is attached to before |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
80 calling this function. |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
81 .\" SEE ALSO |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
82 .Sh SEE ALSO |
efeb73a9918b
man: add C API for what is mostly stabilized
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
83 .Xr libirccd 3 |
1137 | 84 .\" AUTHORS |
85 .Sh AUTHORS | |
86 The | |
87 .Nm irccd | |
88 daemon was written by | |
89 .An David Demelier Aq Mt markand@malikania.fr . |