xref: /freebsd/contrib/mandoc/mandoc_aux.h (revision c1c95add8c80843ba15d784f95c361d795b1f593)
1*c1c95addSBrooks Davis /* $Id: mandoc_aux.h,v 1.8 2022/04/14 16:43:44 schwarze Exp $ */
261d06d6bSBaptiste Daroussin /*
3*c1c95addSBrooks Davis  * Copyright (c) 2014, 2017, 2021 Ingo Schwarze <schwarze@openbsd.org>
461d06d6bSBaptiste Daroussin  * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
561d06d6bSBaptiste Daroussin  *
661d06d6bSBaptiste Daroussin  * Permission to use, copy, modify, and distribute this software for any
761d06d6bSBaptiste Daroussin  * purpose with or without fee is hereby granted, provided that the above
861d06d6bSBaptiste Daroussin  * copyright notice and this permission notice appear in all copies.
961d06d6bSBaptiste Daroussin  *
1061d06d6bSBaptiste Daroussin  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1161d06d6bSBaptiste Daroussin  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1261d06d6bSBaptiste Daroussin  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1361d06d6bSBaptiste Daroussin  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1461d06d6bSBaptiste Daroussin  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1561d06d6bSBaptiste Daroussin  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1661d06d6bSBaptiste Daroussin  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1761d06d6bSBaptiste Daroussin  */
1861d06d6bSBaptiste Daroussin 
1961d06d6bSBaptiste Daroussin int		  mandoc_asprintf(char **, const char *, ...)
2061d06d6bSBaptiste Daroussin 			__attribute__((__format__ (__printf__, 2, 3)));
2161d06d6bSBaptiste Daroussin void		 *mandoc_calloc(size_t, size_t);
2261d06d6bSBaptiste Daroussin void		 *mandoc_malloc(size_t);
2361d06d6bSBaptiste Daroussin void		 *mandoc_realloc(void *, size_t);
2461d06d6bSBaptiste Daroussin void		 *mandoc_reallocarray(void *, size_t, size_t);
2561d06d6bSBaptiste Daroussin void		 *mandoc_recallocarray(void *, size_t, size_t, size_t);
2661d06d6bSBaptiste Daroussin char		 *mandoc_strdup(const char *);
2761d06d6bSBaptiste Daroussin char		 *mandoc_strndup(const char *, size_t);
28*c1c95addSBrooks Davis 
29*c1c95addSBrooks Davis #if DEBUG_MEMORY
30*c1c95addSBrooks Davis #include "mandoc_dbg.h"
31*c1c95addSBrooks Davis #endif
32