---
name: "str_to_gensio_accepter"
section: "3"
platform: "linux"
package: "gensio"
version: "3.0.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/str_to_gensio_accepter"
---

# str\_to\_gensio\_accepter(3)

Create a gensio accepter from a string

## NAME

str\_to\_gensio\_accepter - Create a gensio accepter from a string

## SYNOPSIS

**#include \<gensio/gensio.h\>**

- **int str\_to\_gensio\_accepter(const char \*str,**

  **struct gensio\_os\_funcs \*o,**\
   **gensio\_accepter\_event cb,**\
   **void \*user\_data,**\
   **struct gensio\_accepter \*\*acc);**

- **int str\_to\_gensio\_accepter\_child(struct gensio\_accepter \*child,**

  **const char \*str,**\
   **struct gensio\_os\_funcs \*o,**\
   **gensio\_accepter\_event cb,**\
   **void \*user\_data,**\
   **struct gensio\_accepter \*\*acc);**

- **int gensio\_terminal\_acc\_alloc(const char \*gensiotype,**

  **const void \*gdata,**\
   **const char \* const args\[\],**\
   **struct gensio\_os\_funcs \*o,**\
   **gensio\_accepter\_event cb, void \*user\_data,**\
   **struct gensio\_accepter \*\*accepter);**

- **int gensio\_filter\_acc\_alloc(const char \*gensiotype,**

  **struct gensio\_accepter \*child,**\
   **const char \* const args\[\],**\
   **struct gensio\_os\_funcs \*o,**\
   **gensio\_accepter\_event cb, void \*user\_data,**\
   **struct gensio\_accepter \*\*accepter);**

## DESCRIPTION

**str\_to\_gensio\_accepter** allocates a new gensio accepter stack based upon the given string **str.**

**str\_to\_gensio\_accepter\_child** allocates a new gensio accepter stack based upon the given string **str** and stacks it on top of the given child accepter.

To allocate an accepter directly, use one of **gensio\_terminal\_acc\_alloc** or **gensio\_filter\_acc\_alloc.** A terminal accepter is one at the bottom of the stack.  The **gdata** parameter depends on the particular gensio.  For instance, for tcp it is a pointer to a gensio\_addr structure.  For stdio it is an argv array.  See gensio.5 under "Direct Allocation" for the particular gensio for what gdata is.

A filter accepter is one that has a child.  You can use these two functions to allocate an accepter stack directly, not using a string format.

The **cb** and **user\_data** parameters set a function that will be called when events come in on the gensio accepter. **user\_data** is unused by the gensio stack itself, it is there for the user and may be anything the user wishes.

The new gensio accepter is returned in **acc.** It will be in the shutdown state.

## RETURN VALUES

Zero is returned on success, or a gensio error on failure.

## SEE ALSO

[gensio\_acc\_set\_callback(3)](/gensio_acc_set_callback/3.md), [gensio\_err(3)](/gensio_err/3.md), [gensio(5)](/gensio/5.md)
