[dovecot-cvs] dovecot/src/lib array.h,1.15,1.16
tss-movial at dovecot.org
tss-movial at dovecot.org
Wed Jun 28 18:36:45 EEST 2006
- Previous message: [dovecot-cvs] dovecot/src/plugins/zlib zlib-plugin.c,1.4,1.5
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-index-dummy-view.c, 1.2,
1.3 mail-index-private.h, 1.71,
1.72 mail-index-transaction-private.h, 1.30,
1.31 mail-index-transaction-view.c, 1.18,
1.19 mail-index-transaction.c, 1.77,
1.78 mail-index-view-private.h, 1.24, 1.25 mail-index-view.c,
1.46, 1.47 mail-index.c, 1.236, 1.237 mail-index.h, 1.159, 1.160
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv25040/lib
Modified Files:
array.h
Log Message:
Added array_idx_clear().
Index: array.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/array.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- array.h 28 Jun 2006 13:10:33 -0000 1.15
+++ array.h 28 Jun 2006 15:36:42 -0000 1.16
@@ -205,6 +205,22 @@
_array_idx_set(&(array)->arr, idx, data); \
} STMT_END
+static inline void
+_array_idx_clear(struct array *array, unsigned int idx)
+{
+ size_t pos;
+
+ pos = idx * array->element_size;
+ if (pos > array->buffer->used) {
+ /* index doesn't exist yet, initialize with zero */
+ buffer_append_zero(array->buffer, pos - array->buffer->used);
+ } else {
+ buffer_write_zero(array->buffer, pos, array->element_size);
+ }
+}
+#define array_idx_clear(array, idx) \
+ _array_idx_clear(&(array)->arr, idx)
+
static inline void *
_array_append_space(struct array *array)
{
- Previous message: [dovecot-cvs] dovecot/src/plugins/zlib zlib-plugin.c,1.4,1.5
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-index-dummy-view.c, 1.2,
1.3 mail-index-private.h, 1.71,
1.72 mail-index-transaction-private.h, 1.30,
1.31 mail-index-transaction-view.c, 1.18,
1.19 mail-index-transaction.c, 1.77,
1.78 mail-index-view-private.h, 1.24, 1.25 mail-index-view.c,
1.46, 1.47 mail-index.c, 1.236, 1.237 mail-index.h, 1.159, 1.160
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list