Revision f3480090

View differences:

include/chunkidset.h
46 46
  * @parameter h a pointer to the set
47 47
  * @return the number of chunk IDs in the set, or < 0 on error
48 48
  */
49
int chunkID_size(const struct chunkID_set *h);
49
int chunkID_set_size(const struct chunkID_set *h);
50 50

  
51 51
 /**
52 52
  * Get a chunk ID from a set
......
94 94
  * @parameter size the expected number of chunk IDs that will be stored
95 95
  *                 in the set; 0 if such a number is not known.
96 96
  */
97
void chunkID_clear(struct chunkID_set *h, int size);
97
void chunkID_set_clear(struct chunkID_set *h, int size);
98 98

  
99 99
#endif	/* CHUNKIDSET_H */
include/peer.h
13 13
struct peer {
14 14
    const struct nodeID *id;
15 15
    struct chunkID_set *bmap;
16
    struct timeval bmap_timestamp;
17 16
};
18 17

  
19 18

  
som/ChunkIDSet/chunkids_ops.c
46 46
  return h->n_elements;
47 47
}
48 48

  
49
int chunkID_size(const struct chunkID_set *h)
49
int chunkID_set_size(const struct chunkID_set *h)
50 50
{
51 51
  return h->n_elements;
52 52
}
......
84 84
  return h->n_elements;
85 85
}
86 86

  
87
void chunkID_clear(struct chunkID_set *h, int size)
87
void chunkID_set_clear(struct chunkID_set *h, int size)
88 88
{
89 89
  h->n_elements = 0;
90 90
  h->size = size;
som/Tests/chunkidset_test.c
25 25
  int res;
26 26

  
27 27
  res = chunkID_set_add_chunk(c, n);
28
  printf("Add %d ---> Result=%d\tSize=%d\n", n, res, chunkID_size(c));
28
  printf("Add %d ---> Result=%d\tSize=%d\n", n, res, chunkID_set_size(c));
29 29
}
30 30

  
31 31
static void print_set(struct chunkID_set *c)
32 32
{
33
  int i, size = chunkID_size(c);
33
  int i, size = chunkID_set_size(c);
34 34

  
35 35
  printf("Chunk ID Set size: %d\n", size);
36 36
  printf("Chunks (in priority order): ");
......
56 56
  struct chunkID_set *cset;
57 57

  
58 58
  cset = chunkID_set_init(0);
59
  printf("Chunk ID Set initialised: size is %d\n", chunkID_size(cset));
59
  printf("Chunk ID Set initialised: size is %d\n", chunkID_set_size(cset));
60 60
  populate(cset);
61 61
  print_set(cset);
62 62

  
......
65 65
  check_chunk(cset, 3);
66 66
  check_chunk(cset, 9);
67 67

  
68
  chunkID_clear(cset, 0);
68
  chunkID_set_clear(cset, 0);
69 69
  free(cset);
70 70
}
71 71

  
......
80 80
  populate(cset);
81 81
  res = encodeChunkSignaling(cset, NULL, 0, buff, sizeof(buff));
82 82
  printf("Encoding Result: %d\n", res);
83
  chunkID_clear(cset, 0);
83
  chunkID_set_clear(cset, 0);
84 84
  free(cset);
85 85
  
86 86
  cset1 = decodeChunkSignaling(&meta, &meta_len, buff, res);
87 87
  print_set(cset1);
88
  chunkID_clear(cset1, 0);
88
  chunkID_set_clear(cset1, 0);
89 89
  free(cset1);
90 90
}
91 91

  

Also available in: Unified diff