ucl.h (275223) | ucl.h (279549) |
---|---|
1/* Copyright (c) 2013, Vsevolod Stakhov 2 * All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above copyright --- 178 unchanged lines hidden (view full) --- 187typedef struct ucl_object_s { 188 /** 189 * Variant value type 190 */ 191 union { 192 int64_t iv; /**< Int value of an object */ 193 const char *sv; /**< String value of an object */ 194 double dv; /**< Double value of an object */ | 1/* Copyright (c) 2013, Vsevolod Stakhov 2 * All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above copyright --- 178 unchanged lines hidden (view full) --- 187typedef struct ucl_object_s { 188 /** 189 * Variant value type 190 */ 191 union { 192 int64_t iv; /**< Int value of an object */ 193 const char *sv; /**< String value of an object */ 194 double dv; /**< Double value of an object */ |
195 struct ucl_object_s *av; /**< Array */ | 195 void *av; /**< Array */ |
196 void *ov; /**< Object */ 197 void* ud; /**< Opaque user data */ 198 } value; 199 const char *key; /**< Key of an object */ 200 struct ucl_object_s *next; /**< Array handle */ 201 struct ucl_object_s *prev; /**< Array handle */ 202 uint32_t keylen; /**< Lenght of a key */ 203 uint32_t len; /**< Size of an object */ --- 506 unchanged lines hidden (view full) --- 710 * @param obj object to iterate 711 * @param iter opaque iterator, must be set to NULL on the first call: 712 * ucl_object_iter_t it = NULL; 713 * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... 714 * @return the next object or NULL 715 */ 716UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, 717 ucl_object_iter_t *iter, bool expand_values); | 196 void *ov; /**< Object */ 197 void* ud; /**< Opaque user data */ 198 } value; 199 const char *key; /**< Key of an object */ 200 struct ucl_object_s *next; /**< Array handle */ 201 struct ucl_object_s *prev; /**< Array handle */ 202 uint32_t keylen; /**< Lenght of a key */ 203 uint32_t len; /**< Size of an object */ --- 506 unchanged lines hidden (view full) --- 710 * @param obj object to iterate 711 * @param iter opaque iterator, must be set to NULL on the first call: 712 * ucl_object_iter_t it = NULL; 713 * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... 714 * @return the next object or NULL 715 */ 716UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, 717 ucl_object_iter_t *iter, bool expand_values); |
718 719/** 720 * Create new safe iterator for the specified object 721 * @param obj object to iterate 722 * @return new iterator object that should be used with safe iterators API only 723 */ 724UCL_EXTERN ucl_object_iter_t ucl_object_iterate_new (const ucl_object_t *obj) 725 UCL_WARN_UNUSED_RESULT; 726/** 727 * Reset initialized iterator to a new object 728 * @param obj new object to iterate 729 * @return modified iterator object 730 */ 731UCL_EXTERN ucl_object_iter_t ucl_object_iterate_reset (ucl_object_iter_t it, 732 const ucl_object_t *obj); 733 734/** 735 * Get the next object from the `obj`. This fucntion iterates over arrays, objects 736 * and implicit arrays 737 * @param iter safe iterator 738 * @return the next object in sequence 739 */ 740UCL_EXTERN const ucl_object_t* ucl_object_iterate_safe (ucl_object_iter_t iter, 741 bool expand_values); 742 743/** 744 * Free memory associated with the safe iterator 745 * @param it safe iterator object 746 */ 747UCL_EXTERN void ucl_object_iterate_free (ucl_object_iter_t it); 748 |
|
718/** @} */ 719 720 721/** 722 * @defgroup parser Parsing functions 723 * These functions are used to parse UCL objects 724 * 725 * @{ --- 123 unchanged lines hidden (view full) --- 849 */ 850UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); 851 852/** 853 * Get the error string if failing 854 * @param parser parser object 855 */ 856UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); | 749/** @} */ 750 751 752/** 753 * @defgroup parser Parsing functions 754 * These functions are used to parse UCL objects 755 * 756 * @{ --- 123 unchanged lines hidden (view full) --- 880 */ 881UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); 882 883/** 884 * Get the error string if failing 885 * @param parser parser object 886 */ 887UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); |
888 |
|
857/** | 889/** |
890 * Clear the error in the parser 891 * @param parser parser object 892 */ 893UCL_EXTERN void ucl_parser_clear_error(struct ucl_parser *parser); 894 895/** |
|
858 * Free ucl parser object 859 * @param parser parser object 860 */ 861UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); 862 863/** 864 * Add new public key to parser for signatures check 865 * @param parser parser object --- 241 unchanged lines hidden --- | 896 * Free ucl parser object 897 * @param parser parser object 898 */ 899UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); 900 901/** 902 * Add new public key to parser for signatures check 903 * @param parser parser object --- 241 unchanged lines hidden --- |