GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — netdata/src/dictionary.h at master · gitqueue/netdata

Expand file tree

/

dictionary.h

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
44 lines (33 loc) · 1.43 KB
/

dictionary.h

Copy path

File metadata and controls

44 lines (33 loc) · 1.43 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef NETDATA_DICTIONARY_H
#define NETDATA_DICTIONARY_H 1
struct dictionary_stats {
unsigned long long inserts;
unsigned long long deletes;
unsigned long long searches;
unsigned long long entries;
};
typedef struct name_value {
avl avl; // the index - this has to be first!
uint32_t hash; // a simple hash to speed up searching
// we first compare hashes, and only if the hashes are equal we do string comparisons
char *name;
void *value;
} NAME_VALUE;
typedef struct dictionary {
avl_tree values_index;
uint8_t flags;
struct dictionary_stats *stats;
pthread_rwlock_t *rwlock;
} DICTIONARY;
#define DICTIONARY_FLAG_DEFAULT 0x00000000
#define DICTIONARY_FLAG_SINGLE_THREADED 0x00000001
#define DICTIONARY_FLAG_VALUE_LINK_DONT_CLONE 0x00000002
#define DICTIONARY_FLAG_NAME_LINK_DONT_CLONE 0x00000004
#define DICTIONARY_FLAG_WITH_STATISTICS 0x00000008
extern DICTIONARY *dictionary_create(uint8_t flags);
extern void dictionary_destroy(DICTIONARY *dict);
extern void *dictionary_set(DICTIONARY *dict, const char *name, void *value, size_t value_len);
extern void *dictionary_get(DICTIONARY *dict, const char *name);
extern int dictionary_del(DICTIONARY *dict, const char *name);
extern int dictionary_get_all(DICTIONARY *dict, int (*callback)(void *entry, void *d), void *data);
#endif /* NETDATA_DICTIONARY_H */
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.