diff options
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/pattern.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libdimension/dimension/pattern.h b/libdimension/dimension/pattern.h index c21ca8d..6e8c42f 100644 --- a/libdimension/dimension/pattern.h +++ b/libdimension/dimension/pattern.h @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (C) 2009-2011 Tavian Barnes <tavianator@tavianator.com> * + * Copyright (C) 2009-2014 Tavian Barnes <tavianator@tavianator.com> * * * * This file is part of The Dimension Library. * * * @@ -35,12 +35,16 @@ typedef struct dmnsn_pattern dmnsn_pattern; */ typedef double dmnsn_pattern_fn(const dmnsn_pattern *pattern, dmnsn_vector v); +/** + * Pattern destruction callback. + * @param[in,out] pattern The pattern to destroy. + */ +typedef void dmnsn_pattern_free_fn(dmnsn_pattern *pattern); + /** A pattern. */ struct dmnsn_pattern { dmnsn_pattern_fn *pattern_fn; /**< The pattern callback. */ - dmnsn_free_fn *free_fn; /**< The destructor callback. */ - - void *ptr; /**< Generic pointer. */ + dmnsn_pattern_free_fn *free_fn; /**< The destructor callback. */ DMNSN_REFCOUNT; /**< Reference count. */ }; @@ -52,6 +56,12 @@ struct dmnsn_pattern { dmnsn_pattern *dmnsn_new_pattern(void); /** + * Initialize a dmnsn_pattern field. + * @param[out] pattern The pattern to initialize. + */ +void dmnsn_init_pattern(dmnsn_pattern *pattern); + +/** * Delete a pattern. * @param[in,out] pattern The pattern to destroy. */ |