diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-04-06 09:30:01 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-04-06 15:59:21 -0400 |
commit | 548fb76622cacbdf4416f07b718f1bdd93924a9f (patch) | |
tree | 5b65b939ec4877cbd1e8f3b7a84897bb579eca0a /collection/collection_priv.h | |
download | ding-libs-548fb76622cacbdf4416f07b718f1bdd93924a9f.tar.gz ding-libs-548fb76622cacbdf4416f07b718f1bdd93924a9f.tar.xz ding-libs-548fb76622cacbdf4416f07b718f1bdd93924a9f.zip |
First commit of basic collection API.
Diffstat (limited to 'collection/collection_priv.h')
-rw-r--r-- | collection/collection_priv.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/collection/collection_priv.h b/collection/collection_priv.h new file mode 100644 index 0000000..8dd6d80 --- /dev/null +++ b/collection/collection_priv.h @@ -0,0 +1,70 @@ +/* + COLLECTION LIBRARY + + Header file for internal structures used by the collection interface. + + Copyright (C) Dmitri Pal <dpal@redhat.com> 2009 + + Collection Library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Collection Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with Collection Library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef COLLECTION_PRIV_H +#define COLLECTION_PRIV_H + +/* Define real strcutures */ +/* Structure that holds one property. + * This structure should never be assumed and used directly other than + * inside the collection.c that contains actual implementation or + * collection_tools.c or collection_utils.c. + */ +struct collection_item { + /* Member that contains element linking information. + * This member should never be directly accessed by an application. + */ + struct collection_item *next; + + /* Your implementation can assume that these members + * will always be members of the collection_item. + * but you should use get_item_xxx functions to get them. + */ + char *property; + int property_len; + int type; + int length; + void *data; +}; + + +/* Internal iterator structure - exposed for reference. + * Never access internals of this structure in your application. + */ +struct collection_iterator { + struct collection_item *top; + struct collection_item **stack; + unsigned stack_size; + unsigned stack_depth; + int flags; +}; + + +/* Special type of data that stores collection header information. */ +struct collection_header { + struct collection_item *last; + unsigned reference_count; + unsigned count; + unsigned class; +}; + +#endif + |