blob: 314d51aaff7a9adbee7203a90995f05101403f8b [file] [log] [blame]
Jeff Thompson5d89cb92013-06-27 15:57:15 -07001/*
2 * Author: Jeff Thompson
3 *
4 * BSD license, See the LICENSE file for more information.
5 */
6
7#ifndef NDN_NAME_H
8#define NDN_NAME_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
Jeff Thompsonb0fd64f2013-06-27 16:02:36 -070014struct ndn_NameComponent {
Jeff Thompson5d89cb92013-06-27 15:57:15 -070015 unsigned char *value;
Jeff Thompsonb0fd64f2013-06-27 16:02:36 -070016 unsigned int valueLength;
Jeff Thompson5d89cb92013-06-27 15:57:15 -070017};
18
Jeff Thompsonb0fd64f2013-06-27 16:02:36 -070019static inline void ndn_NameComponent_init(struct ndn_NameComponent *self, unsigned char *value, unsigned int valueLength)
20{
21 self->value = value;
22 self->valueLength = valueLength;
23}
24
Jeff Thompson5d89cb92013-06-27 15:57:15 -070025enum {
26 ndn_Name_MAX_COMPONENTS = 100
27};
28
29struct ndn_Name {
Jeff Thompsonb0fd64f2013-06-27 16:02:36 -070030 struct ndn_NameComponent components[ndn_Name_MAX_COMPONENTS];
Jeff Thompson5d89cb92013-06-27 15:57:15 -070031 unsigned int nComponents;
32};
33
Jeff Thompsonb0fd64f2013-06-27 16:02:36 -070034static inline void ndn_Name_init(struct ndn_Name *self)
35{
36 self->nComponents = 0;
37}
Jeff Thompson5d89cb92013-06-27 15:57:15 -070038
39#ifdef __cplusplus
40}
41#endif
42
43#endif /* NAME_H */
44