From d5f3c29cf8d59fad4f3c657fc0a26510043bec65 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 14:50:35 -0500 Subject: qapi: add QAPI dealloc visitor Type of Visitor class that can be passed into a qapi-generated C type's visitor function to free() any heap-allocated data types. Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- qapi/qapi-dealloc-visitor.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 qapi/qapi-dealloc-visitor.h (limited to 'qapi/qapi-dealloc-visitor.h') diff --git a/qapi/qapi-dealloc-visitor.h b/qapi/qapi-dealloc-visitor.h new file mode 100644 index 0000000..5842bc7 --- /dev/null +++ b/qapi/qapi-dealloc-visitor.h @@ -0,0 +1,26 @@ +/* + * Dealloc Visitor + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Michael Roth + * + * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. + * See the COPYING.LIB file in the top-level directory. + * + */ + +#ifndef QAPI_DEALLOC_VISITOR_H +#define QAPI_DEALLOC_VISITOR_H + +#include "qapi-visit-core.h" + +typedef struct QapiDeallocVisitor QapiDeallocVisitor; + +QapiDeallocVisitor *qapi_dealloc_visitor_new(void); +void qapi_dealloc_visitor_cleanup(QapiDeallocVisitor *d); + +Visitor *qapi_dealloc_get_visitor(QapiDeallocVisitor *v); + +#endif -- cgit v1.1