acrn-hypervisor/misc/tools/acrn-crashlog/common/include/strutils.h
Terry Zou a9c38a5cfb HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build

Tracked-On: #3482
Signed-off-by: Terry Zou <terry.zou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-07-29 22:58:24 +08:00

23 lines
718 B
C

/*
* Copyright (C) 2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __STRUTILS_H__
#define __STRUTILS_H__
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define s_not_expect(res, size) (res < 0 || (size_t)res >= size)
char *get_line(const char *str, size_t str_size,
const char *area, size_t area_size,
const char *search_from, size_t *len);
ssize_t strlinelen(const char *str, size_t size);
char *strrstr(const char *s, const char *str);
char *strtrim(char *str, size_t len);
int strcnt(char *str, char c);
char *strings_ind(char *strings, size_t size, int index, size_t *slen);
int str_split_ere(const char *str, size_t slen,
const char *fmt, size_t flen, ...);
#endif