X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Futils.h;h=d5dc9d01af1b467ac1a4aa91f208388bab81f654;hp=27a6f4849aced6cac50ea2e9ce7e4b0e36ee1693;hb=1831ae68b70dece8e9b847081526495adbbf05e5;hpb=ce9ee1fb2847b1603c4382c82aef95121f0e3d07 diff --git a/src/common/utils.h b/src/common/utils.h index 27a6f4849..d5dc9d01a 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -1,18 +1,8 @@ /* - * Copyright (C) 2012 - David Goulet + * Copyright (C) 2012 David Goulet * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program 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 General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _COMMON_UTILS_H @@ -65,4 +55,16 @@ int utils_get_memory_available(size_t *value); int utils_get_memory_total(size_t *value); int utils_change_working_directory(const char *path); +/* + * Parse `str` as an unsigned long long value. + * + * Return 0 on success. Return -1 on failure which can be because: + * + * - `str` is zero length + * - `str` contains invalid + */ +LTTNG_HIDDEN +int utils_parse_unsigned_long_long(const char *str, + unsigned long long *value); + #endif /* _COMMON_UTILS_H */