/*
* crash-manager
- * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012-2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
return str;
}
+bool string_ends_with(const char *string, const char *suffix)
+{
+ const size_t string_len = strlen(string);
+ const size_t suffix_len = strlen(suffix);
+
+ return (string_len >= suffix_len) && !strcmp(string + string_len - suffix_len, suffix);
+}
+
/**
* @}
*/
#ifndef __DEF_UTIL_H__
#define __DEF_UTIL_H__
+#include <stdbool.h>
+
#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
#ifndef __CONSTRUCTOR__
char* concatenate(char *const vec[]);
+bool string_ends_with(const char *string, const char *suffix);
+
#ifdef __cplusplus
}
#endif