\doxysubsection{util.\+h}
\label{util_8h_source}\index{util.h@{util.h}}
\mbox{\hyperlink{util_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001 \textcolor{comment}{/*= -\/*-\/ c-\/basic-\/offset: 4; indent-\/tabs-\/mode: nil; -\/*-\/}}
\DoxyCodeLine{00002 \textcolor{comment}{ *}}
\DoxyCodeLine{00003 \textcolor{comment}{ * librsync -\/-\/ library for network deltas}}
\DoxyCodeLine{00004 \textcolor{comment}{ *}}
\DoxyCodeLine{00005 \textcolor{comment}{ * Copyright (C) 1999, 2000, 2001 by Martin Pool <mbp@sourcefrog.net>}}
\DoxyCodeLine{00006 \textcolor{comment}{ * Copyright (C) 1999 by Andrew Tridgell <tridge@samba.org>}}
\DoxyCodeLine{00007 \textcolor{comment}{ *}}
\DoxyCodeLine{00008 \textcolor{comment}{ * This program is free software; you can redistribute it and/or}}
\DoxyCodeLine{00009 \textcolor{comment}{ * modify it under the terms of the GNU Lesser General Public License}}
\DoxyCodeLine{00010 \textcolor{comment}{ * as published by the Free Software Foundation; either version 2.1 of}}
\DoxyCodeLine{00011 \textcolor{comment}{ * the License, or (at your option) any later version.}}
\DoxyCodeLine{00012 \textcolor{comment}{ *}}
\DoxyCodeLine{00013 \textcolor{comment}{ * This program is distributed in the hope that it will be useful, but}}
\DoxyCodeLine{00014 \textcolor{comment}{ * WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{00015 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU}}
\DoxyCodeLine{00016 \textcolor{comment}{ * Lesser General Public License for more details.}}
\DoxyCodeLine{00017 \textcolor{comment}{ *}}
\DoxyCodeLine{00018 \textcolor{comment}{ * You should have received a copy of the GNU Lesser General Public}}
\DoxyCodeLine{00019 \textcolor{comment}{ * License along with this program; if not, write to the Free Software}}
\DoxyCodeLine{00020 \textcolor{comment}{ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.}}
\DoxyCodeLine{00021 \textcolor{comment}{ */}}
\DoxyCodeLine{00022 \textcolor{comment}{}}
\DoxyCodeLine{00023 \textcolor{comment}{/** \(\backslash\)file util.h}}
\DoxyCodeLine{00024 \textcolor{comment}{ * Misc utility functions used by librsync. */}}
\DoxyCodeLine{00025 \textcolor{preprocessor}{\#ifndef UTIL\_H}}
\DoxyCodeLine{00026 \textcolor{preprocessor}{\#  define UTIL\_H}}
\DoxyCodeLine{00027 }
\DoxyCodeLine{00028 \textcolor{preprocessor}{\#  include <stddef.h>}}
\DoxyCodeLine{00029 \textcolor{preprocessor}{\#  include "{}librsync.h"{}}}
\DoxyCodeLine{00030 }
\DoxyCodeLine{00031 \textcolor{keywordtype}{void} *rs\_alloc(\textcolor{keywordtype}{size\_t} size, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *name);}
\DoxyCodeLine{00032 \textcolor{keywordtype}{void} *rs\_realloc(\textcolor{keywordtype}{void} *ptr, \textcolor{keywordtype}{size\_t} size, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *name);}
\DoxyCodeLine{00033 \textcolor{keywordtype}{void} *rs\_alloc\_struct0(\textcolor{keywordtype}{size\_t} size, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *name);}
\DoxyCodeLine{00034 }
\DoxyCodeLine{00035 \textcolor{keywordtype}{void} rs\_bzero(\textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} size);}
\DoxyCodeLine{00036 }
\DoxyCodeLine{00037 \textcolor{keywordtype}{int} rs\_long\_ln2(rs\_long\_t v);}
\DoxyCodeLine{00038 \textcolor{keywordtype}{int} rs\_long\_sqrt(rs\_long\_t v);}
\DoxyCodeLine{00039 \textcolor{comment}{}}
\DoxyCodeLine{00040 \textcolor{comment}{/** Allocate and zero-\/fill an instance of TYPE. */}}
\DoxyCodeLine{00041 \textcolor{preprocessor}{\#  define rs\_alloc\_struct(type)                         \(\backslash\)}}
\DoxyCodeLine{00042 \textcolor{preprocessor}{        ((type *) rs\_alloc\_struct0(sizeof(type), \#type))}}
\DoxyCodeLine{00043 }
\DoxyCodeLine{00044 \textcolor{preprocessor}{\#  ifdef \_\_GNUC\_\_}}
\DoxyCodeLine{00045 \textcolor{preprocessor}{\#    define UNUSED(x) x \_\_attribute\_\_((unused))}}
\DoxyCodeLine{00046 \textcolor{preprocessor}{\#  elif defined(\_\_LCLINT\_\_) || defined(S\_SPLINT\_S)}}
\DoxyCodeLine{00047 \textcolor{preprocessor}{\#    define UNUSED(x) }\textcolor{comment}{/*@unused@*/}\textcolor{preprocessor}{ x}}
\DoxyCodeLine{00048 \textcolor{preprocessor}{\#  else                         }\textcolor{comment}{/* !\_\_GNUC\_\_ \&\& !\_\_LCLINT\_\_ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00049 \textcolor{preprocessor}{\#    define UNUSED(x) x}}
\DoxyCodeLine{00050 \textcolor{preprocessor}{\#  endif                        }\textcolor{comment}{/* !\_\_GNUC\_\_ \&\& !\_\_LCLINT\_\_ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00051 }
\DoxyCodeLine{00052 \textcolor{preprocessor}{\#endif                          }\textcolor{comment}{/* !UTIL\_H */}\textcolor{preprocessor}{}}

\end{DoxyCode}
