~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to include/net-snmp/library/container_iterator.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file container_iterator.h
 
3
 * @addtogroup container_iterator
 
4
 * @{
 
5
 */
 
6
#ifndef _CONTAINER_ITERATOR_HANDLER_H_
 
7
#define _CONTAINER_ITERATOR_HANDLER_H_
 
8
 
 
9
#include "container.h"
 
10
 
 
11
#ifdef __cplusplus
 
12
extern          "C" {
 
13
#endif
 
14
 
 
15
    typedef int (Netsnmp_Iterator_Loop_Key) (void *iterator_ctx,
 
16
                                             netsnmp_ref_void* loop_ctx,
 
17
                                             netsnmp_ref_void* key);
 
18
    typedef int (Netsnmp_Iterator_Loop_Data)(void *iterator_ctx,
 
19
                                             netsnmp_ref_void* loop_ctx,
 
20
                                             netsnmp_ref_void* data);
 
21
    typedef int (Netsnmp_Iterator_Ctx) (void *iterator_ctx,
 
22
                                         netsnmp_ref_void* loop_ctx);
 
23
    typedef int (Netsnmp_Iterator_Ctx_Dup) (void *iterator_ctx,
 
24
                                            netsnmp_ref_void* loop_ctx,
 
25
                                            netsnmp_ref_void* dup_ctx,
 
26
                                            int reuse);
 
27
    typedef int (Netsnmp_Iterator_Op) (void *iterator_ctx);
 
28
    typedef int (Netsnmp_Iterator_Data) (void *iterator_ctx,
 
29
                                            const void *data);    
 
30
 
 
31
    void netsnmp_container_iterator_init(void);
 
32
 
 
33
    netsnmp_container* netsnmp_container_iterator_get(
 
34
        void *iterator_user_ctx,
 
35
        netsnmp_container_compare * compare,
 
36
        Netsnmp_Iterator_Loop_Key * get_first,
 
37
        Netsnmp_Iterator_Loop_Key * get_next,
 
38
        Netsnmp_Iterator_Loop_Data * get_data,
 
39
        Netsnmp_Iterator_Ctx_Dup * save_pos, /* iff returning static data */
 
40
        Netsnmp_Iterator_Ctx * init_loop_ctx,
 
41
        Netsnmp_Iterator_Ctx * cleanup_loop_ctx,
 
42
        Netsnmp_Iterator_Data * free_user_ctx,
 
43
        int sorted);
 
44
    
 
45
    /*
 
46
     * set up optional callbacks/
 
47
     * NOTE: even though the first parameter is a generic netsnmp_container,
 
48
     *       this function should only be called for a container created
 
49
     *       by netsnmp_container_iterator_get.
 
50
     */
 
51
    void
 
52
    netsnmp_container_iterator_set_data_cb(netsnmp_container *c,
 
53
                                           Netsnmp_Iterator_Data * insert_data,
 
54
                                           Netsnmp_Iterator_Data * remove_data,
 
55
                                           Netsnmp_Iterator_Op * get_size);
 
56
 
 
57
#ifdef __cplusplus
 
58
};
 
59
#endif
 
60
 
 
61
#endif                          /* _CONTAINER_ITERATOR_HANDLER_H_ */
 
62
/** @} */