~ubuntu-branches/ubuntu/jaunty/clamav/jaunty-backports

« back to all changes in this revision

Viewing changes to libclamav/hashtab.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-10-02 15:36:00 UTC
  • mfrom: (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20101002153600-2tx3vki1u55cdrjy
Tags: 0.96.3+dfsg-2ubuntu0.10.04.1
Microversion update to 0.96.3 for Lucid (LP: #653738)

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        STRUCT_PROFILE
76
76
};
77
77
 
78
 
 
79
 
 
80
78
int cli_hashtab_generate_c(const struct cli_hashtable *s,const char* name);
81
79
struct cli_element* cli_hashtab_find(const struct cli_hashtable *s, const char* key, const size_t len);
82
80
int cli_hashtab_init(struct cli_hashtable *s,size_t capacity);
87
85
int cli_hashtab_load(FILE* in, struct cli_hashtable *s);
88
86
int cli_hashtab_store(const struct cli_hashtable *s,FILE* out);
89
87
 
 
88
/* a hashtable that stores the values too */
 
89
struct cli_map_value {
 
90
    void *value;
 
91
    int32_t valuesize;
 
92
};
 
93
 
 
94
struct cli_map {
 
95
    struct cli_hashtable htab;
 
96
    union {
 
97
        struct cli_map_value *unsized_values;
 
98
        void *sized_values;
 
99
    } u;
 
100
    uint32_t nvalues;
 
101
    int32_t keysize;
 
102
    int32_t valuesize;
 
103
    int32_t last_insert;
 
104
    int32_t last_find;
 
105
};
 
106
int cli_map_init(struct cli_map *m, int32_t keysize, int32_t valuesize,
 
107
                  int32_t capacity);
 
108
int  cli_map_addkey(struct cli_map *m, const void *key, int32_t keysize);
 
109
int  cli_map_removekey(struct cli_map *m, const void *key, int32_t keysize);
 
110
int  cli_map_setvalue(struct cli_map *m, const void* value, int32_t valuesize);
 
111
int  cli_map_find(struct cli_map *m, const void *key, int32_t keysize);
 
112
int  cli_map_getvalue_size(struct cli_map *m);
 
113
void*  cli_map_getvalue(struct cli_map *m);
 
114
void cli_map_delete(struct cli_map *m);
 
115
 
90
116
/* A set of unique keys. */
91
117
struct cli_hashset {
92
118
        uint32_t* keys;