diff options
author | Kay Sievers <kay@vrfy.org> | 2013-01-09 19:06:46 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-01-09 19:06:46 +0100 |
commit | d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d (patch) | |
tree | 6b1c9b2355d2f40fd083eb91411748310a3308dd /src/shared/strxcpyx.h | |
parent | 0908dd2fd5536cf15d75780980ac2eca37ff800f (diff) |
udev: move string copy functions to shared/
Diffstat (limited to 'src/shared/strxcpyx.h')
-rw-r--r-- | src/shared/strxcpyx.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/shared/strxcpyx.h b/src/shared/strxcpyx.h new file mode 100644 index 0000000000..1229a4821d --- /dev/null +++ b/src/shared/strxcpyx.h @@ -0,0 +1,31 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2013 Kay Sievers + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see <http://www.gnu.org/licenses/>. +***/ + +#include <stdarg.h> +#include <stdbool.h> + +size_t strpcpy(char **dest, size_t size, const char *src); +size_t strpcpyf(char **dest, size_t size, const char *src, ...) __attribute__((format(printf, 3, 4))); +size_t strpcpyl(char **dest, size_t size, const char *src, ...) __attribute__((sentinel)); +size_t strscpy(char *dest, size_t size, const char *src); +size_t strscpyl(char *dest, size_t size, const char *src, ...) __attribute__((sentinel)); |