\doxysection{ckd\+\_\+alloc.\+c}
\label{ckd__alloc_8c_source}\index{src/libsphinxbase/util/ckd\_alloc.c@{src/libsphinxbase/util/ckd\_alloc.c}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999-\/2004\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ \textcolor{comment}{/*}}
\DoxyCodeLine{00038\ \textcolor{comment}{\ *\ ckd\_alloc.c\ -\/-\/\ Memory\ allocation\ package.}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ *\ **********************************************}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ *\ CMU\ ARPA\ Speech\ Project}}
\DoxyCodeLine{00042\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00043\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999\ Carnegie\ Mellon\ University.}}
\DoxyCodeLine{00044\ \textcolor{comment}{\ *\ ALL\ RIGHTS\ RESERVED.}}
\DoxyCodeLine{00045\ \textcolor{comment}{\ *\ **********************************************}}
\DoxyCodeLine{00046\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00047\ \textcolor{comment}{\ *\ HISTORY}}
\DoxyCodeLine{00048\ \textcolor{comment}{\ *\ \$Log:\ ckd\_alloc.c,v\ \$}}
\DoxyCodeLine{00049\ \textcolor{comment}{\ *\ Revision\ 1.6\ \ 2005/06/22\ 02:59:25\ \ arthchan2003}}
\DoxyCodeLine{00050\ \textcolor{comment}{\ *\ Added\ \ keyword}}
\DoxyCodeLine{00051\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00052\ \textcolor{comment}{\ *\ Revision\ 1.3\ \ 2005/03/30\ 01:22:48\ \ archan}}
\DoxyCodeLine{00053\ \textcolor{comment}{\ *\ Fixed\ mistakes\ in\ last\ updates.\ Add}}
\DoxyCodeLine{00054\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00055\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00056\ \textcolor{comment}{\ *\ 19-\/Jun-\/97\ \ \ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00057\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Removed\ file,line\ arguments\ from\ free\ functions.}}
\DoxyCodeLine{00058\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Removed\ debugging\ stuff.}}
\DoxyCodeLine{00059\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00060\ \textcolor{comment}{\ *\ 01-\/Jan-\/96\ \ \ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00061\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Created.}}
\DoxyCodeLine{00062\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \textcolor{comment}{/*********************************************************************}}
\DoxyCodeLine{00066\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00067\ \textcolor{comment}{\ *\ \$Header:\ /cvsroot/cmusphinx/sphinx3/src/libutil/ckd\_alloc.c,v\ 1.6\ 2005/06/22\ 02:59:25\ arthchan2003\ Exp\ \$}}
\DoxyCodeLine{00068\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00069\ \textcolor{comment}{\ *\ Carnegie\ Mellon\ ARPA\ Speech\ Group}}
\DoxyCodeLine{00070\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00071\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1994\ Carnegie\ Mellon\ University.}}
\DoxyCodeLine{00072\ \textcolor{comment}{\ *\ All\ rights\ reserved.}}
\DoxyCodeLine{00073\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00074\ \textcolor{comment}{\ *********************************************************************}}
\DoxyCodeLine{00075\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00076\ \textcolor{comment}{\ *\ file:\ ckd\_alloc.c}}
\DoxyCodeLine{00077\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00078\ \textcolor{comment}{\ *\ traceability:\ }}
\DoxyCodeLine{00079\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00080\ \textcolor{comment}{\ *\ description:\ }}
\DoxyCodeLine{00081\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00082\ \textcolor{comment}{\ *\ author:\ }}
\DoxyCodeLine{00083\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00084\ \textcolor{comment}{\ *********************************************************************/}}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00088\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00089\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#include\ <assert.h>}}
\DoxyCodeLine{00091\ \textcolor{preprocessor}{\#include\ <stdarg.h>}}
\DoxyCodeLine{00092\ }
\DoxyCodeLine{00093\ \textcolor{preprocessor}{\#ifdef\ \_MSC\_VER}}
\DoxyCodeLine{00094\ \textcolor{preprocessor}{\#pragma\ warning\ (disable:\ 4996)}}
\DoxyCodeLine{00095\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/ckd\_alloc.h"{}}}
\DoxyCodeLine{00098\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/err.h"{}}}
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00105\ \textcolor{keyword}{static}\ jmp\_buf\ *ckd\_target;}
\DoxyCodeLine{00106\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ jmp\_abort;}
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00108\ jmp\_buf\ *}
\DoxyCodeLine{00109\ ckd\_set\_jump(jmp\_buf\ *env,\ \textcolor{keywordtype}{int}\ abort)}
\DoxyCodeLine{00110\ \{}
\DoxyCodeLine{00111\ \ \ \ \ jmp\_buf\ *old;}
\DoxyCodeLine{00112\ }
\DoxyCodeLine{00113\ \ \ \ \ \textcolor{keywordflow}{if}\ (abort)}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ jmp\_abort\ =\ 1;}
\DoxyCodeLine{00115\ }
\DoxyCodeLine{00116\ \ \ \ \ old\ =\ ckd\_target;}
\DoxyCodeLine{00117\ \ \ \ \ ckd\_target\ =\ env;}
\DoxyCodeLine{00118\ \ \ \ \ \textcolor{keywordflow}{return}\ old;}
\DoxyCodeLine{00119\ \}}
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00122\ ckd\_fail(\textcolor{keywordtype}{char}\ *format,\ ...)}
\DoxyCodeLine{00123\ \{}
\DoxyCodeLine{00124\ \ \ \ \ va\_list\ args;}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ \ \ \ \ va\_start(args,\ format);}
\DoxyCodeLine{00127\ \ \ \ \ vfprintf(stderr,\ format,\ args);}
\DoxyCodeLine{00128\ \ \ \ \ va\_end(args);}
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00130\ \ \ \ \ \textcolor{keywordflow}{if}\ (jmp\_abort)}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Silvio\ Moioli:\ abort()\ doesn't\ exist\ in\ Windows\ CE\ */}}
\DoxyCodeLine{00132\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#if\ defined(\_WIN32\_WCE)}}
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ exit(-\/1);}
\DoxyCodeLine{00134\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#else}}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ abort();}
\DoxyCodeLine{00136\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#endif}}
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (ckd\_target)}
\DoxyCodeLine{00138\ \ \ \ \ \ \ \ \ longjmp(*ckd\_target,\ 1);}
\DoxyCodeLine{00139\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ exit(-\/1);}
\DoxyCodeLine{00141\ \}}
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00143\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00144\ \_\_ckd\_calloc\_\_(\textcolor{keywordtype}{size\_t}\ n\_elem,\ \textcolor{keywordtype}{size\_t}\ elem\_size,}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,\ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00146\ \{}
\DoxyCodeLine{00147\ \ \ \ \ \textcolor{keywordtype}{void}\ *mem;}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00149\ \textcolor{preprocessor}{\#if\ defined(\_\_ADSPBLACKFIN\_\_)\ \&\&\ !defined(\_\_linux\_\_)}}
\DoxyCodeLine{00150\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ heap\_calloc(heap\_lookup(1),n\_elem,\ elem\_size))\ ==\ NULL)}
\DoxyCodeLine{00151\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ heap\_calloc(heap\_lookup(0),n\_elem,\ elem\_size))\ ==\ NULL)\ }
\DoxyCodeLine{00152\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{00153\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ckd\_fail(\textcolor{stringliteral}{"{}calloc(\%d,\%d)\ failed\ from\ \%s(\%d),\ free\ space:\ \%d\(\backslash\)n"{}},\ n\_elem,}
\DoxyCodeLine{00154\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ elem\_size,\ caller\_file,\ caller\_line,space\_unused());}
\DoxyCodeLine{00155\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00156\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00157\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ calloc(n\_elem,\ elem\_size))\ ==\ NULL)\ \{}
\DoxyCodeLine{00158\ \ \ \ \ \ \ \ \ ckd\_fail(\textcolor{stringliteral}{"{}calloc(\%d,\%d)\ failed\ from\ \%s(\%d)\(\backslash\)n"{}},\ n\_elem,}
\DoxyCodeLine{00159\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ elem\_size,\ caller\_file,\ caller\_line);}
\DoxyCodeLine{00160\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00161\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00163\ }
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keywordflow}{return}\ mem;}
\DoxyCodeLine{00165\ \}}
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00168\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00169\ \_\_ckd\_malloc\_\_(\textcolor{keywordtype}{size\_t}\ size,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,\ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00170\ \{}
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keywordtype}{void}\ *mem;}
\DoxyCodeLine{00172\ }
\DoxyCodeLine{00173\ \textcolor{preprocessor}{\#if\ defined(\_\_ADSPBLACKFIN\_\_)\ \&\&\ !defined(\_\_linux\_\_)}}
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ heap\_malloc(heap\_lookup(0),size))\ ==\ NULL)}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ heap\_malloc(heap\_lookup(1),size))\ ==\ NULL)\ }
\DoxyCodeLine{00176\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00177\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ malloc(size))\ ==\ NULL)}
\DoxyCodeLine{00178\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ckd\_fail(\textcolor{stringliteral}{"{}malloc(\%d)\ failed\ from\ \%s(\%d)\(\backslash\)n"{}},\ size,}
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_file,\ caller\_line);}
\DoxyCodeLine{00181\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00182\ \ \ \ \ \textcolor{keywordflow}{return}\ mem;}
\DoxyCodeLine{00183\ \}}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ }
\DoxyCodeLine{00186\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00187\ \_\_ckd\_realloc\_\_(\textcolor{keywordtype}{void}\ *ptr,\ \textcolor{keywordtype}{size\_t}\ new\_size,}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,\ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00189\ \{}
\DoxyCodeLine{00190\ \ \ \ \ \textcolor{keywordtype}{void}\ *mem;}
\DoxyCodeLine{00191\ \textcolor{preprocessor}{\#if\ defined(\_\_ADSPBLACKFIN\_\_)\ \&\&\ !defined(\_\_linux\_\_)}}
\DoxyCodeLine{00192\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ heap\_realloc(heap\_lookup(0),ptr,\ new\_size))\ ==\ NULL)\ \{}
\DoxyCodeLine{00193\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00194\ \ \ \ \ \textcolor{keywordflow}{if}\ ((mem\ =\ realloc(ptr,\ new\_size))\ ==\ NULL)\ \{}
\DoxyCodeLine{00195\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ ckd\_fail(\textcolor{stringliteral}{"{}malloc(\%d)\ failed\ from\ \%s(\%d)\(\backslash\)n"{}},\ new\_size,}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_file,\ caller\_line);}
\DoxyCodeLine{00198\ \ \ \ \ \}}
\DoxyCodeLine{00199\ }
\DoxyCodeLine{00200\ \ \ \ \ \textcolor{keywordflow}{return}\ mem;}
\DoxyCodeLine{00201\ \}}
\DoxyCodeLine{00202\ }
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00204\ \textcolor{keywordtype}{char}\ *}
\DoxyCodeLine{00205\ \_\_ckd\_salloc\_\_(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *orig,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,}
\DoxyCodeLine{00206\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00207\ \{}
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ len;}
\DoxyCodeLine{00209\ \ \ \ \ \textcolor{keywordtype}{char}\ *buf;}
\DoxyCodeLine{00210\ }
\DoxyCodeLine{00211\ \ \ \ \ len\ =\ strlen(orig)\ +\ 1;}
\DoxyCodeLine{00212\ \ \ \ \ buf\ =\ (\textcolor{keywordtype}{char}\ *)\ \_\_ckd\_malloc\_\_(len,\ caller\_file,\ caller\_line);}
\DoxyCodeLine{00213\ }
\DoxyCodeLine{00214\ \ \ \ \ strcpy(buf,\ orig);}
\DoxyCodeLine{00215\ \ \ \ \ \textcolor{keywordflow}{return}\ (buf);}
\DoxyCodeLine{00216\ \}}
\DoxyCodeLine{00217\ }
\DoxyCodeLine{00218\ }
\DoxyCodeLine{00219\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00220\ \_\_ckd\_calloc\_2d\_\_(\textcolor{keywordtype}{size\_t}\ d1,\ \textcolor{keywordtype}{size\_t}\ d2,\ \textcolor{keywordtype}{size\_t}\ elemsize,}
\DoxyCodeLine{00221\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,\ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00222\ \{}
\DoxyCodeLine{00223\ \ \ \ \ \textcolor{keywordtype}{char}\ **ref,\ *mem;}
\DoxyCodeLine{00224\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ i,\ offset;}
\DoxyCodeLine{00225\ }
\DoxyCodeLine{00226\ \ \ \ \ mem\ =}
\DoxyCodeLine{00227\ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ *)\ \_\_ckd\_calloc\_\_(d1\ *\ d2,\ elemsize,\ caller\_file,}
\DoxyCodeLine{00228\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_line);}
\DoxyCodeLine{00229\ \ \ \ \ ref\ =}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ **)\ \_\_ckd\_malloc\_\_(d1\ *\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ *),\ caller\_file,}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_line);}
\DoxyCodeLine{00232\ }
\DoxyCodeLine{00233\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ offset\ =\ 0;\ i\ <\ d1;\ i++,\ offset\ +=\ d2\ *\ elemsize)}
\DoxyCodeLine{00234\ \ \ \ \ \ \ \ \ ref[i]\ =\ mem\ +\ offset;}
\DoxyCodeLine{00235\ }
\DoxyCodeLine{00236\ \ \ \ \ \textcolor{keywordflow}{return}\ ref;}
\DoxyCodeLine{00237\ \}}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00239\ }
\DoxyCodeLine{00240\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00241\ ckd\_free(\textcolor{keywordtype}{void}\ *ptr)}
\DoxyCodeLine{00242\ \{}
\DoxyCodeLine{00243\ \ \ \ \ \textcolor{keywordflow}{if}\ (ptr)}
\DoxyCodeLine{00244\ \textcolor{preprocessor}{\#if\ defined(\_\_ADSPBLACKFIN\_\_)\ \&\&\ !defined(\_\_linux\_\_)}}
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ heap\_free(0,ptr);}
\DoxyCodeLine{00246\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00247\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ free(ptr);}
\DoxyCodeLine{00248\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00249\ \}}
\DoxyCodeLine{00250\ }
\DoxyCodeLine{00251\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00252\ ckd\_free\_2d(\textcolor{keywordtype}{void}\ *tmpptr)}
\DoxyCodeLine{00253\ \{}
\DoxyCodeLine{00254\ \ \ \ \ \textcolor{keywordtype}{void}\ **ptr\ =\ (\textcolor{keywordtype}{void}\ **)tmpptr;}
\DoxyCodeLine{00255\ \ \ \ \ \textcolor{keywordflow}{if}\ (ptr)}
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ ckd\_free(ptr[0]);}
\DoxyCodeLine{00257\ \ \ \ \ ckd\_free(ptr);}
\DoxyCodeLine{00258\ \}}
\DoxyCodeLine{00259\ }
\DoxyCodeLine{00260\ }
\DoxyCodeLine{00261\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00262\ \_\_ckd\_calloc\_3d\_\_(\textcolor{keywordtype}{size\_t}\ d1,\ \textcolor{keywordtype}{size\_t}\ d2,\ \textcolor{keywordtype}{size\_t}\ d3,\ \textcolor{keywordtype}{size\_t}\ elemsize,}
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *caller\_file,\ \textcolor{keywordtype}{int}\ caller\_line)}
\DoxyCodeLine{00264\ \{}
\DoxyCodeLine{00265\ \ \ \ \ \textcolor{keywordtype}{char}\ ***ref1,\ **ref2,\ *mem;}
\DoxyCodeLine{00266\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ i,\ j,\ offset;}
\DoxyCodeLine{00267\ }
\DoxyCodeLine{00268\ \ \ \ \ mem\ =}
\DoxyCodeLine{00269\ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ *)\ \_\_ckd\_calloc\_\_(d1\ *\ d2\ *\ d3,\ elemsize,\ caller\_file,}
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_line);}
\DoxyCodeLine{00271\ \ \ \ \ ref1\ =}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ ***)\ \_\_ckd\_malloc\_\_(d1\ *\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ **),\ caller\_file,}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_line);}
\DoxyCodeLine{00274\ \ \ \ \ ref2\ =}
\DoxyCodeLine{00275\ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{char}\ **)\ \_\_ckd\_malloc\_\_(d1\ *\ d2\ *\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ *),\ caller\_file,}
\DoxyCodeLine{00276\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caller\_line);}
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ offset\ =\ 0;\ i\ <\ d1;\ i++,\ offset\ +=\ d2)}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \ \ ref1[i]\ =\ ref2\ +\ offset;}
\DoxyCodeLine{00280\ }
\DoxyCodeLine{00281\ \ \ \ \ offset\ =\ 0;}
\DoxyCodeLine{00282\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ d1;\ i++)\ \{}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (j\ =\ 0;\ j\ <\ d2;\ j++)\ \{}
\DoxyCodeLine{00284\ \ \ \ \ \ \ \ \ \ \ \ \ ref1[i][j]\ =\ mem\ +\ offset;}
\DoxyCodeLine{00285\ \ \ \ \ \ \ \ \ \ \ \ \ offset\ +=\ d3\ *\ elemsize;}
\DoxyCodeLine{00286\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00287\ \ \ \ \ \}}
\DoxyCodeLine{00288\ }
\DoxyCodeLine{00289\ \ \ \ \ \textcolor{keywordflow}{return}\ ref1;}
\DoxyCodeLine{00290\ \}}
\DoxyCodeLine{00291\ }
\DoxyCodeLine{00292\ }
\DoxyCodeLine{00293\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00294\ ckd\_free\_3d(\textcolor{keywordtype}{void}\ *inptr)}
\DoxyCodeLine{00295\ \{}
\DoxyCodeLine{00296\ \ \ \ \ \textcolor{keywordtype}{void}\ ***ptr\ =\ (\textcolor{keywordtype}{void}\ ***)inptr;}
\DoxyCodeLine{00297\ }
\DoxyCodeLine{00298\ \ \ \ \ \textcolor{keywordflow}{if}\ (ptr\ \&\&\ ptr[0])}
\DoxyCodeLine{00299\ \ \ \ \ \ \ \ \ ckd\_free(ptr[0][0]);}
\DoxyCodeLine{00300\ \ \ \ \ \textcolor{keywordflow}{if}\ (ptr)}
\DoxyCodeLine{00301\ \ \ \ \ \ \ \ \ ckd\_free(ptr[0]);}
\DoxyCodeLine{00302\ \ \ \ \ ckd\_free(ptr);}
\DoxyCodeLine{00303\ \}}
\DoxyCodeLine{00304\ }
\DoxyCodeLine{00305\ }
\DoxyCodeLine{00306\ \textcolor{keywordtype}{void}\ ****}
\DoxyCodeLine{00307\ \_\_ckd\_calloc\_4d\_\_(\textcolor{keywordtype}{size\_t}\ d1,}
\DoxyCodeLine{00308\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d2,}
\DoxyCodeLine{00309\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d3,}
\DoxyCodeLine{00310\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d4,}
\DoxyCodeLine{00311\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ elem\_size,}
\DoxyCodeLine{00312\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *file,}
\DoxyCodeLine{00313\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ line)}
\DoxyCodeLine{00314\ \{}
\DoxyCodeLine{00315\ \ \ \ \ \textcolor{keywordtype}{void}\ *store;}
\DoxyCodeLine{00316\ \ \ \ \ \textcolor{keywordtype}{void}\ **tmp1;}
\DoxyCodeLine{00317\ \ \ \ \ \textcolor{keywordtype}{void}\ ***tmp2;}
\DoxyCodeLine{00318\ \ \ \ \ \textcolor{keywordtype}{void}\ ****out;}
\DoxyCodeLine{00319\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ i,\ j;}
\DoxyCodeLine{00320\ }
\DoxyCodeLine{00321\ \ \ \ \ store\ =\ calloc(d1\ *\ d2\ *\ d3\ *\ d4,\ elem\_size);}
\DoxyCodeLine{00322\ \ \ \ \ \textcolor{keywordflow}{if}\ (store\ ==\ NULL)\ \{}
\DoxyCodeLine{00323\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}ckd\_calloc\_4d\ failed\ for\ caller\ at\ \%s(\%d)\ at\ \%s(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{00324\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file,\ line,\ \_\_FILE\_\_,\ \_\_LINE\_\_);}
\DoxyCodeLine{00325\ \ \ \ \ \}}
\DoxyCodeLine{00326\ \ \ \ \ }
\DoxyCodeLine{00327\ \ \ \ \ tmp1\ =\ calloc(d1\ *\ d2\ *\ d3,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ *));}
\DoxyCodeLine{00328\ \ \ \ \ \textcolor{keywordflow}{if}\ (tmp1\ ==\ NULL)\ \{}
\DoxyCodeLine{00329\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}ckd\_calloc\_4d\ failed\ for\ caller\ at\ \%s(\%d)\ at\ \%s(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{00330\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file,\ line,\ \_\_FILE\_\_,\ \_\_LINE\_\_);}
\DoxyCodeLine{00331\ \ \ \ \ \}}
\DoxyCodeLine{00332\ }
\DoxyCodeLine{00333\ \ \ \ \ tmp2\ =\ ckd\_calloc(d1\ *\ d2,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ **));}
\DoxyCodeLine{00334\ \ \ \ \ \textcolor{keywordflow}{if}\ (tmp2\ ==\ NULL)\ \{}
\DoxyCodeLine{00335\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}ckd\_calloc\_4d\ failed\ for\ caller\ at\ \%s(\%d)\ at\ \%s(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{00336\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file,\ line,\ \_\_FILE\_\_,\ \_\_LINE\_\_);}
\DoxyCodeLine{00337\ \ \ \ \ \}}
\DoxyCodeLine{00338\ }
\DoxyCodeLine{00339\ \ \ \ \ out\ =\ ckd\_calloc(d1,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ ***));}
\DoxyCodeLine{00340\ \ \ \ \ \textcolor{keywordflow}{if}\ (out\ ==\ NULL)\ \{}
\DoxyCodeLine{00341\ \ \ \ \ \ \ \ \ E\_FATAL(\textcolor{stringliteral}{"{}ckd\_calloc\_4d\ failed\ for\ caller\ at\ \%s(\%d)\ at\ \%s(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{00342\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file,\ line,\ \_\_FILE\_\_,\ \_\_LINE\_\_);}
\DoxyCodeLine{00343\ \ \ \ \ \}}
\DoxyCodeLine{00344\ \ \ \ \ }
\DoxyCodeLine{00345\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1*d2*d3;\ i++,\ j\ +=\ d4)\ \{}
\DoxyCodeLine{00346\ \ \ \ \ \ \ \ \ tmp1[i]\ =\ \&((\textcolor{keywordtype}{char}\ *)store)[j*elem\_size];}
\DoxyCodeLine{00347\ \ \ \ \ \}}
\DoxyCodeLine{00348\ }
\DoxyCodeLine{00349\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1*d2;\ i++,\ j\ +=\ d3)\ \{}
\DoxyCodeLine{00350\ \ \ \ \ \ \ \ \ tmp2[i]\ =\ \&tmp1[j];}
\DoxyCodeLine{00351\ \ \ \ \ \}}
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00353\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1;\ i++,\ j\ +=\ d2)\ \{}
\DoxyCodeLine{00354\ \ \ \ \ \ \ \ \ out[i]\ =\ \&tmp2[j];}
\DoxyCodeLine{00355\ \ \ \ \ \}}
\DoxyCodeLine{00356\ }
\DoxyCodeLine{00357\ \ \ \ \ \textcolor{keywordflow}{return}\ out;}
\DoxyCodeLine{00358\ \}}
\DoxyCodeLine{00359\ }
\DoxyCodeLine{00360\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00361\ ckd\_free\_4d(\textcolor{keywordtype}{void}\ *inptr)}
\DoxyCodeLine{00362\ \{}
\DoxyCodeLine{00363\ \ \ \ \ \textcolor{keywordtype}{void}\ ****ptr\ =\ (\textcolor{keywordtype}{void}\ ****)inptr;}
\DoxyCodeLine{00364\ \ \ \ \ \textcolor{keywordflow}{if}\ (ptr\ ==\ NULL)}
\DoxyCodeLine{00365\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{00366\ \ \ \ \ \textcolor{comment}{/*\ free\ the\ underlying\ store\ */}}
\DoxyCodeLine{00367\ \ \ \ \ ckd\_free(ptr[0][0][0]);}
\DoxyCodeLine{00368\ }
\DoxyCodeLine{00369\ \ \ \ \ \textcolor{comment}{/*\ free\ the\ access\ overhead\ */}}
\DoxyCodeLine{00370\ \ \ \ \ ckd\_free(ptr[0][0]);}
\DoxyCodeLine{00371\ \ \ \ \ ckd\_free(ptr[0]);}
\DoxyCodeLine{00372\ \ \ \ \ ckd\_free(ptr);}
\DoxyCodeLine{00373\ \}}
\DoxyCodeLine{00374\ }
\DoxyCodeLine{00375\ \textcolor{comment}{/*\ Layers\ a\ 3d\ array\ access\ structure\ over\ a\ preallocated\ storage\ area\ */}}
\DoxyCodeLine{00376\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00377\ \_\_ckd\_alloc\_3d\_ptr(\textcolor{keywordtype}{size\_t}\ d1,}
\DoxyCodeLine{00378\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d2,}
\DoxyCodeLine{00379\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d3,}
\DoxyCodeLine{00380\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *store,}
\DoxyCodeLine{00381\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ elem\_size,}
\DoxyCodeLine{00382\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *file,}
\DoxyCodeLine{00383\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ line)}
\DoxyCodeLine{00384\ \{}
\DoxyCodeLine{00385\ \ \ \ \ \textcolor{keywordtype}{void}\ **tmp1;}
\DoxyCodeLine{00386\ \ \ \ \ \textcolor{keywordtype}{void}\ ***out;}
\DoxyCodeLine{00387\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ i,\ j;}
\DoxyCodeLine{00388\ \ \ \ \ }
\DoxyCodeLine{00389\ \ \ \ \ tmp1\ =\ \_\_ckd\_calloc\_\_(d1\ *\ d2,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ *),\ file,\ line);}
\DoxyCodeLine{00390\ }
\DoxyCodeLine{00391\ \ \ \ \ out\ \ =\ \_\_ckd\_calloc\_\_(d1,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ **),\ file,\ line);}
\DoxyCodeLine{00392\ \ \ \ \ }
\DoxyCodeLine{00393\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1*d2;\ i++,\ j\ +=\ d3)\ \{}
\DoxyCodeLine{00394\ \ \ \ \ \ \ \ \ tmp1[i]\ =\ \&((\textcolor{keywordtype}{char}\ *)store)[j*elem\_size];}
\DoxyCodeLine{00395\ \ \ \ \ \}}
\DoxyCodeLine{00396\ \ \ \ \ }
\DoxyCodeLine{00397\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1;\ i++,\ j\ +=\ d2)\ \{}
\DoxyCodeLine{00398\ \ \ \ \ \ \ \ \ out[i]\ =\ \&tmp1[j];}
\DoxyCodeLine{00399\ \ \ \ \ \}}
\DoxyCodeLine{00400\ \ \ \ \ }
\DoxyCodeLine{00401\ \ \ \ \ \textcolor{keywordflow}{return}\ out;}
\DoxyCodeLine{00402\ \}}
\DoxyCodeLine{00403\ }
\DoxyCodeLine{00404\ \textcolor{keywordtype}{void}\ *}
\DoxyCodeLine{00405\ \_\_ckd\_alloc\_2d\_ptr(\textcolor{keywordtype}{size\_t}\ d1,}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ d2,}
\DoxyCodeLine{00407\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *store,}
\DoxyCodeLine{00408\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ elem\_size,}
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ *file,}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ line)}
\DoxyCodeLine{00411\ \{}
\DoxyCodeLine{00412\ \ \ \ \ \textcolor{keywordtype}{void}\ **out;}
\DoxyCodeLine{00413\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ i,\ j;}
\DoxyCodeLine{00414\ \ \ \ \ }
\DoxyCodeLine{00415\ \ \ \ \ out\ =\ \_\_ckd\_calloc\_\_(d1,\ \textcolor{keyword}{sizeof}(\textcolor{keywordtype}{void}\ *),\ file,\ line);}
\DoxyCodeLine{00416\ \ \ \ \ }
\DoxyCodeLine{00417\ \ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0,\ j\ =\ 0;\ i\ <\ d1;\ i++,\ j\ +=\ d2)\ \{}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ out[i]\ =\ \&((\textcolor{keywordtype}{char}\ *)store)[j*elem\_size];}
\DoxyCodeLine{00419\ \ \ \ \ \}}
\DoxyCodeLine{00420\ }
\DoxyCodeLine{00421\ \ \ \ \ \textcolor{keywordflow}{return}\ out;}
\DoxyCodeLine{00422\ \}}

\end{DoxyCode}
