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