1/* $Id: ppath.h,v 1.1 2011/08/25 16:15:29 dyoung Exp $ */
2
3/* Copyright (c) 2010 David Young. All rights reserved. */
4
5#ifndef _PPATH_H
6#define _PPATH_H
7
8#include <prop/proplib.h>
9
10#define PPATH_MAX_COMPONENTS 16
11
12struct _ppath;
13struct _ppath_component;
14typedef struct _ppath ppath_t;
15typedef struct _ppath_component ppath_component_t;
16
17ppath_component_t *ppath_idx(unsigned int);
18ppath_component_t *ppath_key(const char *);
19
20ppath_component_t *ppath_component_retain(ppath_component_t *);
21void ppath_component_release(ppath_component_t *);
22
23ppath_t *ppath_create(void);
24unsigned int ppath_length(const ppath_t *);
25int ppath_component_idx(const ppath_component_t *);
26const char *ppath_component_key(const ppath_component_t *);
27ppath_t *ppath_pop(ppath_t *, ppath_component_t **);
28ppath_t *ppath_push(ppath_t *, ppath_component_t *);
29ppath_component_t *ppath_component_at(const ppath_t *, unsigned int);
30ppath_t *ppath_subpath(const ppath_t *, unsigned int, unsigned int);
31ppath_t *ppath_push_idx(ppath_t *, unsigned int);
32ppath_t *ppath_push_key(ppath_t *, const char *);
33ppath_t *ppath_replace_idx(ppath_t *, unsigned int);
34ppath_t *ppath_replace_key(ppath_t *, const char *);
35
36ppath_t *ppath_copy(const ppath_t *);
37ppath_t *ppath_retain(ppath_t *);
38void ppath_release(ppath_t *);
39
40prop_object_t ppath_lookup(prop_object_t, const ppath_t *);
41
42int ppath_copydel_object(prop_object_t, prop_object_t *, const ppath_t *);
43int ppath_copyset_object(prop_object_t, prop_object_t *, const ppath_t *,
44 prop_object_t);
45int ppath_create_object(prop_object_t, const ppath_t *, prop_object_t);
46int ppath_set_object(prop_object_t, const ppath_t *, prop_object_t);
47int ppath_get_object(prop_object_t, const ppath_t *, prop_object_t *);
48int ppath_delete_object(prop_object_t, const ppath_t *);
49
50int ppath_copydel_bool(prop_object_t, prop_object_t *, const ppath_t *);
51int ppath_copyset_bool(prop_object_t, prop_object_t *, const ppath_t *, bool);
52int ppath_create_bool(prop_object_t, const ppath_t *, bool);
53int ppath_create_int64(prop_object_t, const ppath_t *, int64_t);
54int ppath_create_uint64(prop_object_t, const ppath_t *, uint64_t);
55int ppath_create_data(prop_object_t, const ppath_t *, const void *, size_t);
56int ppath_create_string(prop_object_t, const ppath_t *, const char *);
57int ppath_set_bool(prop_object_t, const ppath_t *, bool);
58int ppath_get_bool(prop_object_t, const ppath_t *, bool *);
59int ppath_delete_bool(prop_object_t, const ppath_t *);
60
61int ppath_copydel_data(prop_object_t, prop_object_t *, const ppath_t *);
62int ppath_copyset_data(prop_object_t, prop_object_t *, const ppath_t *,
63 const void *, size_t);
64int ppath_set_data(prop_object_t, const ppath_t *, const void *, size_t);
65int ppath_get_data(prop_object_t, const ppath_t *, const void **, size_t *);
66int ppath_dup_data(prop_object_t, const ppath_t *, void **, size_t *);
67int ppath_delete_data(prop_object_t, const ppath_t *);
68
69int ppath_copydel_int64(prop_object_t, prop_object_t *, const ppath_t *);
70int ppath_copyset_int64(prop_object_t, prop_object_t *, const ppath_t *,
71 int64_t);
72int ppath_set_int64(prop_object_t, const ppath_t *, int64_t);
73int ppath_get_int64(prop_object_t, const ppath_t *, int64_t *);
74int ppath_delete_int64(prop_object_t, const ppath_t *);
75
76int ppath_copydel_string(prop_object_t, prop_object_t *, const ppath_t *);
77int ppath_copyset_string(prop_object_t, prop_object_t *, const ppath_t *,
78 const char *);
79int ppath_set_string(prop_object_t, const ppath_t *, const char *);
80int ppath_get_string(prop_object_t, const ppath_t *, const char **);
81int ppath_dup_string(prop_object_t, const ppath_t *, char **);
82int ppath_delete_string(prop_object_t, const ppath_t *);
83
84int ppath_copydel_uint64(prop_object_t, prop_object_t *, const ppath_t *);
85int ppath_copyset_uint64(prop_object_t, prop_object_t *, const ppath_t *,
86 uint64_t);
87int ppath_set_uint64(prop_object_t, const ppath_t *, uint64_t);
88int ppath_get_uint64(prop_object_t, const ppath_t *, uint64_t *);
89int ppath_delete_uint64(prop_object_t, const ppath_t *);
90
91#endif /* _PPATH_H */
92