view src/lib/array-decl.h @ 9565:7c447e8c24fe HEAD

maildir: If we detect MH as the cause of unexpunging, log it in the error message.
author Timo Sirainen <tss@iki.fi>
date Thu, 29 Apr 2010 20:43:16 +0300
parents e4eb71ae8e96
children
line wrap: on
line source

#ifndef ARRAY_DECL_H
#define ARRAY_DECL_H

#define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; } name
#define ARRAY_INIT { { 0, 0 } }

#define ARRAY_DEFINE_TYPE(name, array_type) \
	union array ## __ ## name { struct array arr; array_type const *const *v; array_type **v_modifiable; }
#define ARRAY_TYPE(name) \
	union array ## __ ## name

struct array {
	buffer_t *buffer;
	size_t element_size;
};

ARRAY_DEFINE_TYPE(string, char *);
ARRAY_DEFINE_TYPE(const_string, const char *);
ARRAY_DEFINE_TYPE(uint32_t, uint32_t);

#endif