1/**
2 * \file
3 * \brief Dictionary type
4 */
5
6/*
7 * Copyright (c) 2008, 2011, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
13 */
14#ifndef DICTIONARY_H_
15#define DICTIONARY_H_
16
17#include <barrelfish/barrelfish.h>
18
19typedef enum uint8_t {
20    TYPE_STRING = 1,
21    TYPE_WORD,
22    TYPE_OPAQUE,
23    TYPE_CAPABILITY,
24} ENTRY_TYPE;
25
26/**
27 * \brief dictionary_t is the abstract type of
28 *   datastructures that are able to store key/value pairs
29 */
30struct dictionary {
31    int (*put_word)(struct dictionary*, const char*, size_t, uintptr_t);
32    int (*put_capability)(struct dictionary*, char*, struct capref);
33    ENTRY_TYPE (*get)(struct dictionary*, const char*, size_t, void**);
34    ENTRY_TYPE (*get_capability)(struct dictionary*, char*, struct capref*);
35    int (*size)(struct dictionary*);
36    int (*remove)(struct dictionary*, const char*, size_t);
37};
38
39#endif /*DICTIONARY_H_*/
40