⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
netdata
/
src
/
libnetdata
/
string
/
View File Name :
string.h
#ifndef NETDATA_STRING_H #define NETDATA_STRING_H 1 #include "../libnetdata.h" // ---------------------------------------------------------------------------- // STRING implementation typedef struct netdata_string STRING; STRING *string_strdupz(const char *str); STRING *string_strndupz(const char *str, size_t len); STRING *string_dup(STRING *string); void string_freez(STRING *string); size_t string_strlen(STRING *string); const char *string2str(STRING *string) NEVERNULL; // keep common prefix/suffix and replace everything else with [x] STRING *string_2way_merge(STRING *a, STRING *b); static inline int string_cmp(STRING *s1, STRING *s2) { // STRINGs are deduplicated, so the same strings have the same pointer // when they differ, we do the typical strcmp() comparison return (s1 == s2)?0:strcmp(string2str(s1), string2str(s2)); } static inline int string_strcmp(STRING *string, const char *s) { return strcmp(string2str(string), s); } void string_statistics(size_t *inserts, size_t *deletes, size_t *searches, size_t *entries, size_t *references, size_t *memory, size_t *duplications, size_t *releases); int string_unittest(size_t entries); #endif