net-snmp 5.7
container_iterator.h
Go to the documentation of this file.
00001 
00006 #ifndef _CONTAINER_ITERATOR_HANDLER_H_
00007 #define _CONTAINER_ITERATOR_HANDLER_H_
00008 
00009 #include "container.h"
00010 
00011 #ifdef __cplusplus
00012 extern          "C" {
00013 #endif
00014 
00015     typedef int (Netsnmp_Iterator_Loop_Key) (void *iterator_ctx,
00016                                              netsnmp_ref_void* loop_ctx,
00017                                              netsnmp_ref_void* key);
00018     typedef int (Netsnmp_Iterator_Loop_Data)(void *iterator_ctx,
00019                                              netsnmp_ref_void* loop_ctx,
00020                                              netsnmp_ref_void* data);
00021     typedef int (Netsnmp_Iterator_Ctx) (void *iterator_ctx,
00022                                          netsnmp_ref_void* loop_ctx);
00023     typedef int (Netsnmp_Iterator_Ctx_Dup) (void *iterator_ctx,
00024                                             netsnmp_ref_void* loop_ctx,
00025                                             netsnmp_ref_void* dup_ctx,
00026                                             int reuse);
00027     typedef int (Netsnmp_Iterator_Op) (void *iterator_ctx);
00028     typedef int (Netsnmp_Iterator_Data) (void *iterator_ctx,
00029                                             const void *data);    
00030 
00031     void netsnmp_container_iterator_init(void);
00032 
00033     netsnmp_container* netsnmp_container_iterator_get(
00034         void *iterator_user_ctx,
00035         netsnmp_container_compare * compare,
00036         Netsnmp_Iterator_Loop_Key * get_first,
00037         Netsnmp_Iterator_Loop_Key * get_next,
00038         Netsnmp_Iterator_Loop_Data * get_data,
00039         Netsnmp_Iterator_Ctx_Dup * save_pos, /* iff returning static data */
00040         Netsnmp_Iterator_Ctx * init_loop_ctx,
00041         Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
00042         Netsnmp_Iterator_Data * free_user_ctx,
00043         int sorted);
00044     
00045     /*
00046      * set up optional callbacks/
00047      * NOTE: even though the first parameter is a generic netsnmp_container,
00048      *       this function should only be called for a container created
00049      *       by netsnmp_container_iterator_get.
00050      */
00051     void
00052     netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
00053                                            Netsnmp_Iterator_Data * insert_data,
00054                                            Netsnmp_Iterator_Data * remove_data,
00055                                            Netsnmp_Iterator_Op * get_size);
00056 
00057 #ifdef __cplusplus
00058 }
00059 #endif
00060 
00061 #endif                          /* _CONTAINER_ITERATOR_HANDLER_H_ */
00062