2 * This file is part of buxton.
4 * Copyright (C) 2013 Intel Corporation
6 * buxton is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1
9 * of the License, or (at your option) any later version.
19 #include "buxtonstring.h"
22 * Stores values in Buxton, may have only one value
24 typedef union BuxtonDataStore {
25 BuxtonString d_string; /**<Stores a string value */
26 int32_t d_int32; /**<Stores an int32_t value */
27 uint32_t d_uint32; /**<Stores an uint32_t value */
28 int64_t d_int64; /**<Stores a int64_t value */
29 uint64_t d_uint64; /**<Stores a uint64_t value */
30 float d_float; /**<Stores a float value */
31 double d_double; /**<Stores a double value */
32 bool d_boolean; /**<Stores a boolean value */
36 * Represents data in Buxton
38 * In Buxton we operate on all data using BuxtonData, for both set and
39 * get operations. The type must be set to the type of value being set
40 * in the BuxtonDataStore
42 typedef struct BuxtonData {
43 BuxtonDataType type; /**<Type of data stored */
44 BuxtonDataStore store; /**<Contains one value, correlating to
48 static inline void buxton_string_to_data(BuxtonString *s, BuxtonData *d)
51 d->store.d_string.value = s->value;
52 d->store.d_string.length = s->length;
56 * Editor modelines - http://www.wireshark.org/tools/modelines.html
64 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
65 * :indentSize=8:tabSize=8:noTabs=false: