str_dup

3

str_dup

str_dup_new

str_dup_zt

string duplication functions

    #include <cds/sstr.h>

      int str_dup
      str_t *dst
      const str_t *src

      int str_dup_new
      str_t *dst
      const char *src

      int str_dup_zt
      const str_t *src

## Description

All these functions allocates necessary memory using `cds_malloc`.

`str_dup` takes as source the string given in `src`

`str_dup_zt` takes as source zero-terminated string given in `src`

`str_dup_new` works like `str_dup` with the difference, that it allocates not only the data buffer, but the destination str_t structure too.

## Return value

All these functions return 0 if successful, nonzero otherwise.