/usr/lib/emboss/include/ajmem.h is in emboss-lib 6.6.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | /* @include ajmem *************************************************************
**
** AJAX memory functions
**
** @author Copyright (C) 1999 Peter Rice
** @version $Revision: 1.15 $
** @modified Peter Rice pmr@ebi.ac.uk
** @modified $Date: 2011/10/18 14:23:40 $ by $Author: rice $
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
**
******************************************************************************/
#ifndef AJMEM_H
#define AJMEM_H
/* ========================================================================= */
/* ============================= include files ============================= */
/* ========================================================================= */
#include "ajdefine.h"
AJ_BEGIN_DECLS
/* ========================================================================= */
/* =============================== constants =============================== */
/* ========================================================================= */
/* ========================================================================= */
/* ============================== public data ============================== */
/* ========================================================================= */
/* ========================================================================= */
/* =========================== public functions ============================ */
/* ========================================================================= */
#ifdef HAVE_MEMMOVE
#define ajMemMove(d,s,l) memmove(d,s,l)
#else /* !HAVE_MEMMOVE */
#define ajMemMove(d,s,l) bcopy(s,d,l)
#endif /* !HAVE_MEMMOVE */
/*
** Prototype definitions
*/
void *ajMemAlloc(size_t nbytes,
const char *file, ajint line, AjBool nofail);
void *ajMemCalloc(size_t count, size_t nbytes,
const char *file, ajint line, AjBool nofail);
void *ajMemCallocZero(size_t count, size_t nbytes,
const char *file, ajint line, AjBool nofail);
void ajMemFree(void **ptr);
void *ajMemResize(void *ptr, size_t nbytes,
const char *file, ajint line, AjBool nofail);
void *ajMemResizeZero(void *ptr, size_t oldbytes, size_t nbytes,
const char *file, ajint line, AjBool nofail);
void ajMemSetZero(void* ptr, size_t count, size_t nbytes);
ajint *ajMemArrB(size_t size);
ajint *ajMemArrI(size_t size);
float *ajMemArrF(size_t size);
void ajMemStat(const char* title);
void ajMemExit(void);
void ajMemCheck(int istat);
void ajMemCheckSetLimit(ajint maxfail);
void ajMemProbe(void* ptr, const char* file, ajint line);
/*
** End of prototype definitions
*/
#define AJALLOC(nbytes) \
ajMemAlloc((nbytes), __FILE__, __LINE__, AJFALSE)
#define AJALLOC0(nbytes) \
ajMemCallocZero(1, (nbytes), __FILE__, __LINE__, AJFALSE)
#define AJCALLOC(count, nbytes) \
ajMemCalloc((count), (nbytes), __FILE__, __LINE__, AJFALSE)
#define AJCALLOC0(count, nbytes) \
ajMemCallocZero((count), (nbytes), __FILE__, __LINE__, AJFALSE)
#define AJNEW(p) ((p) = AJALLOC(sizeof *(p)))
#define AJCNEW(p,c) ((p) = AJCALLOC((size_t)c, sizeof *(p)))
#define AJNEW0(p) ((p) = AJCALLOC0((size_t)1, sizeof *(p)))
#define AJCNEW0(p,c) ((p) = AJCALLOC0((size_t)c, sizeof *(p)))
#define AJSET0(p) (ajMemSetZero((p), (size_t)1, sizeof *(p)))
#define AJCSET0(p,c) (ajMemSetZero((p), (size_t)c, sizeof *(p)))
#define AJFREE(ptr) ((void)(ajMemFree((void**)&ptr)))
#define AJRESIZE(ptr, nbytes) \
((ptr) = ajMemResize((ptr), (nbytes), __FILE__, __LINE__, AJFALSE))
#define AJRESIZE0(ptr, oldbytes, nbytes) \
((ptr) = ajMemResizeZero((ptr), (oldbytes), (nbytes), \
__FILE__, __LINE__, AJFALSE))
#define AJCRESIZE(ptr, nbytes) \
((ptr) = ajMemResize((ptr), (nbytes)*sizeof *(ptr), \
__FILE__, __LINE__, AJFALSE))
#define AJCRESIZE0(ptr, oldbytes, nbytes) \
((ptr) = ajMemResizeZero((ptr), (oldbytes)*sizeof *(ptr), \
(nbytes)*sizeof *(ptr), \
__FILE__, __LINE__, AJFALSE))
#define AJCRESIZETRY(ptr, nbytes) \
((ptr) = ajMemResize((ptr), (nbytes)*sizeof *(ptr), \
__FILE__, __LINE__, AJTRUE))
#define AJCRESIZETRY0(ptr, oldbytes, nbytes) \
((ptr) = ajMemResizeZero((ptr), (oldbytes)*sizeof *(ptr), \
(nbytes)*sizeof *(ptr), \
__FILE__, __LINE__, AJTRUE))
#define AJMPROBE(ptr) \
ajMemProbe(ptr, __FILE__, __LINE__)
#ifdef AJ_COMPILE_DEPRECATED_BOOK
#endif /* AJ_COMPILE_DEPRECATED_BOOK */
#ifdef AJ_COMPILE_DEPRECATED
__deprecated void *ajMemCalloc0(size_t count, size_t nbytes,
const char *file, ajint line, AjBool nofail);
#endif /* AJ_COMPILE_DEPRECATED */
AJ_END_DECLS
#endif /* !AJMEM_H */
|