diff options
Diffstat (limited to 'collection/elapi_collection.h')
-rw-r--r-- | collection/elapi_collection.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/collection/elapi_collection.h b/collection/elapi_collection.h index 361c0c6..1451484 100644 --- a/collection/elapi_collection.h +++ b/collection/elapi_collection.h @@ -55,6 +55,10 @@ #define ELAPI_TRAVERSE_END 0x00000002 /* Call handler once more when end of the collection is reached - good for processing nested collections */ #define ELAPI_TRAVERSE_IGNORE 0x00000004 /* Ignore sub collections at all as if there are none */ +/* Time stamp property name */ +#define TS_NAME "timestamp" +/* Time property name */ +#define T_NAME "time" /* Match values */ #define ELAPI_NOMATCH 0 @@ -110,6 +114,29 @@ int add_any_property(struct collection_item *ci, /* Collection to find things void *data, /* Pointer to the new data */ int length); /* Length of the data. For strings should include trailing 0 */ +/* The functions that add an item and immediately return you this item in the ret_ref paramter */ +int add_str_property_with_ref(struct collection_item *ci,char *subcollection, char *property,char *string,int length, + struct collection_item **ret_ref); +int add_binary_property_with_ref(struct collection_item *ci,char *subcollection, char *property,void *binary_data,int length, + struct collection_item **ret_ref); +int add_int_property_with_ref(struct collection_item *ci,char *subcollection, char *property,int number, + struct collection_item **ret_ref); +int add_unsigned_property_with_ref(struct collection_item *ci,char *subcollection, char *property,unsigned int number, + struct collection_item **ret_ref); +int add_long_property_with_ref(struct collection_item *ci,char *subcollection, char *property,long number, + struct collection_item **ret_ref); +int add_ulong_property_with_ref(struct collection_item *ci,char *subcollection, char *property,unsigned long number, + struct collection_item **ret_ref); +int add_double_property_with_ref(struct collection_item *ci,char *subcollection, char *property,double number, + struct collection_item **ret_ref); +int add_any_property_with_ref(struct collection_item *ci,char *subcollection,char *property,int type,void *data,int length, + struct collection_item **ret_ref); + +/* Function to create a timestamp */ +/* Automatically adds/updates time and timestamp properties in the collection returning references */ +int set_timestamp(struct collection_item *ci, + struct collection_item **timestr_ref, + struct collection_item **timeint_ref); /* Update functions */ @@ -192,7 +219,7 @@ int get_item_and_do(struct collection_item *ci, /* Collection to find thin /* Convenience function to get individual item */ /* Caller should be aware that this is not a copy of the item * but the pointer to actual item stored in the collection. - * The retuned pointer should never be altered or freed by caller of the function. + * The returned pointer should never be altered or freed by caller of the function. * The caller should be sure that the collection does not go out of scope * while the pointer to its data is in use. */ int get_item(struct collection_item *ci, /* Collection to find things in */ |