globa: Export snd_strlcpy()

Export snd_strlcpy() for use in the Topology2.0 pre-processor
in alsatplg.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
Ranjani Sridharan 2021-03-31 18:54:48 -07:00
parent c90834b8d4
commit 7c6e359954
2 changed files with 13 additions and 1 deletions

View file

@ -153,6 +153,19 @@ typedef struct timeval snd_timestamp_t;
/** Hi-res timestamp */ /** Hi-res timestamp */
typedef struct timespec snd_htimestamp_t; typedef struct timespec snd_htimestamp_t;
/**
* \brief Copy a C-string into a sized buffer
* \param dst Where to copy the string to
* \param src Where to copy the string from
* \param size Size of destination buffer
* \retval The source string length
*
* The result is always a valid NUL-terminated string that fits
* in the buffer (unless, of course, the buffer size is zero).
* It does not pad out the result like strncpy() does.
*/
size_t snd_strlcpy(char *dst, const char *src, size_t size);
/** \} */ /** \} */
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -236,7 +236,6 @@ int safe_strtol(const char *str, long *val);
int snd_send_fd(int sock, void *data, size_t len, int fd); int snd_send_fd(int sock, void *data, size_t len, int fd);
int snd_receive_fd(int sock, void *data, size_t len, int *fd); int snd_receive_fd(int sock, void *data, size_t len, int *fd);
size_t snd_strlcpy(char *dst, const char *src, size_t size);
/* /*
* error messages * error messages