1str_to_gensio_accepter(3) Library Functions Manual str_to_gensio_accepter(3)
2
3
4
6 str_to_gensio_accepter - Create a gensio accepter from a string
7
9 #include <gensio/gensio.h>
10
11 int str_to_gensio_accepter(const char *str,
12 struct gensio_os_funcs *o,
13 gensio_accepter_event cb,
14 void *user_data,
15 struct gensio_accepter **acc);
16
17 int str_to_gensio_accepter_child(struct gensio_accepter *child,
18 const char *str,
19 struct gensio_os_funcs *o,
20 gensio_accepter_event cb,
21 void *user_data,
22 struct gensio_accepter **acc);
23
24 int gensio_terminal_acc_alloc(const char *gensiotype,
25 const void *gdata,
26 const char * const args[],
27 struct gensio_os_funcs *o,
28 gensio_accepter_event cb, void *user_data,
29 struct gensio_accepter **accepter);
30
31 int gensio_filter_acc_alloc(const char *gensiotype,
32 struct gensio_accepter *child,
33 const char * const args[],
34 struct gensio_os_funcs *o,
35 gensio_accepter_event cb, void *user_data,
36 struct gensio_accepter **accepter);
37
39 str_to_gensio_accepter allocates a new gensio accepter stack based upon
40 the given string str.
41
42 str_to_gensio_accepter_child allocates a new gensio accepter stack
43 based upon the given string str and stacks it on top of the given child
44 accepter.
45
46 To allocate an accepter directly, use one of gensio_terminal_acc_alloc
47 or gensio_filter_acc_alloc. A terminal accepter is one at the bottom
48 of the stack. The gdata parameter depends on the particular gensio.
49 For instance, for tcp it is a pointer to a gensio_addr structure. For
50 stdio it is an argv array. See gensio.5 under "Direct Allocation" for
51 the particular gensio for what gdata is.
52
53 A filter accepter is one that has a child. You can use these two func‐
54 tions to allocate an accepter stack directly, not using a string for‐
55 mat.
56
57 The cb and user_data parameters set a function that will be called when
58 events come in on the gensio accepter. user_data is unused by the gen‐
59 sio stack itself, it is there for the user and may be anything the user
60 wishes.
61
62 The new gensio accepter is returned in acc. It will be in the shutdown
63 state.
64
66 Zero is returned on success, or a gensio error on failure.
67
69 gensio_acc_set_callback(3), gensio_err(3), gensio(5)
70
71
72
73 27 Feb 2019 str_to_gensio_accepter(3)