summaryrefslogtreecommitdiffstats
path: root/collection/elapi_collection.c
diff options
context:
space:
mode:
Diffstat (limited to 'collection/elapi_collection.c')
-rw-r--r--collection/elapi_collection.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/collection/elapi_collection.c b/collection/elapi_collection.c
index 2654edd..f2614a6 100644
--- a/collection/elapi_collection.c
+++ b/collection/elapi_collection.c
@@ -12,6 +12,7 @@
#define ELAPI_ACTION_FIND 1
#define ELAPI_ACTION_DEL 2
#define ELAPI_ACTION_UPDATE 3
+#define ELAPI_ACTION_GET 4
/* Special internal error code to indicate that collection search was interrupted */
@@ -862,6 +863,10 @@ static int act_traverse_handler(struct collection_item *head,
}
break;
+ case ELAPI_ACTION_GET:
+ DEBUG_STRING("It is a get action.","");
+ if(custom_data != NULL) *((struct collection_item **)(custom_data)) = current;
+ break;
case ELAPI_ACTION_DEL:
DEBUG_STRING("It is a delete action.","");
/* Make sure we tell the caller we found a match */
@@ -1237,7 +1242,6 @@ int get_collection_reference(struct collection_item *ci, /* High level
}
-
/* ADDITION */
/* Add collection to collection */
@@ -1430,6 +1434,25 @@ int get_item_and_do(struct collection_item *ci, /* Collection to find thin
return error;
}
+
+/* Get raw item */
+int get_item(struct collection_item *ci, /* Collection to find things in */
+ char *property_to_find, /* Name to match */
+ int type, /* Type filter */
+ int mode_flags, /* How to traverse the collection */
+ struct collection_item **item) /* Found item */
+{
+
+ int error = EOK;
+
+ DEBUG_STRING("get_item","Entry.");
+
+ error = find_item_and_do(ci,property_to_find,type,mode_flags,NULL,(void *)(item),ELAPI_ACTION_GET);
+
+ DEBUG_NUMBER("get_item returning",error);
+ return error;
+}
+
/* DELETE */
/* Delete property from the collection */
int delete_property(struct collection_item *ci, /* Collection to find things in */