\hypertarget{BSWP_8c}{
\section{BSWP.c File Reference}
\label{BSWP_8c}\index{BSWP.c@{BSWP.c}}
}
Byteswapping, callable implementation. 

{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}VBI/Alias.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/BSWP.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/BSWP.ih\char`\"{}}\par


Include dependency graph for BSWP.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=212pt]{BSWP_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{BSWP_8c_a0}{BSWP\_\-swap16N} (unsigned short int $\ast$dst, const unsigned short int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 16 bit words. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a1}{BSWP\_\-swap32N} (unsigned int $\ast$dst, const unsigned int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 32 bit words. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a2}{BSWP\_\-swap64N} (unsigned long long int $\ast$dst, const unsigned long long int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 64 bit words. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a3}{BSWP\_\-swap16l\-N} (unsigned short int $\ast$dst, const unsigned short int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 16 bit words; local representation $<$=$>$ little. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a4}{BSWP\_\-swap16b\-N} (unsigned short int $\ast$dst, const unsigned short int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 16 bit words; local representation $<$=$>$ big. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a5}{BSWP\_\-swap32l\-N} (unsigned int $\ast$dst, const unsigned int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps an array 32 bit words; local representation $<$=$>$ little. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a6}{BSWP\_\-swap32b\-N} (unsigned int $\ast$dst, const unsigned int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 32 bit words; local representation $<$=$>$ big. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a7}{BSWP\_\-swap64l\-N} (unsigned long long int $\ast$dst, const unsigned long long int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps an array 64 bit words; local representation $<$=$>$ little. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a8}{BSWP\_\-swap64b\-N} (unsigned long long int $\ast$dst, const unsigned long long int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 64 bit words; local representation $<$=$>$ big. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a9}{BSWP\_\-swap16\_\-lcl\-Xbig\-N} (unsigned short int $\ast$dst, const unsigned short int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 16 bit words; local representation $<$=$>$ big. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a10}{BSWP\_\-swap16\_\-lcl\-Xlittle\-N} (unsigned short int $\ast$dst, const unsigned short int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 16 bit words; local representation $<$=$>$ little. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a11}{BSWP\_\-swap32\_\-lcl\-Xbig\-N} (unsigned int $\ast$dst, const unsigned int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps 32 bit words; local representation $<$=$>$ big. \item\end{CompactList}\item 
void \hyperlink{BSWP_8c_a12}{BSWP\_\-swap32\_\-lcl\-Xlittle\-N} (unsigned int $\ast$dst, const unsigned int $\ast$src, int cnt)
\begin{CompactList}\small\item\em Byte swaps an array 32 bit words; local representation $<$=$>$ little. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Byteswapping, callable implementation. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}    CVS $Id: BSWP.c,v 1.1.1.1 2006/02/10 21:45:33 saxton Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{BSWP_8c_a9}{
\index{BSWP.c@{BSWP.c}!BSWP_swap16_lclXbigN@{BSWP\_\-swap16\_\-lclXbigN}}
\index{BSWP_swap16_lclXbigN@{BSWP\_\-swap16\_\-lclXbigN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap16\_\-lclXbigN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap16\_\-lcl\-Xbig\-N (unsigned short int $\ast$ {\em dst}, const unsigned short int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a9}


Byte swaps 16 bit words; local representation $<$=$>$ big. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 16 bit words to swap \item[{\em cnt}]The number of 16 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 16 bit integer to/from local/big endian representation from to/big endian/local representation. If the local representation is big endian, then this operation is a copy. If the local representation is big endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a2}{BSWP\_\-swap16b\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a10}{
\index{BSWP.c@{BSWP.c}!BSWP_swap16_lclXlittleN@{BSWP\_\-swap16\_\-lclXlittleN}}
\index{BSWP_swap16_lclXlittleN@{BSWP\_\-swap16\_\-lclXlittleN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap16\_\-lclXlittleN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap16\_\-lcl\-Xlittle\-N (unsigned short int $\ast$ {\em dst}, const unsigned short int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a10}


Byte swaps 16 bit words; local representation $<$=$>$ little. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The source array of 16 bit words to swap \item[{\em dst}]The destination array to receive the swapped words \item[{\em cnt}]The number of 16 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 16 bit integer to/from local/little endian representation from/to little endian/local representation. If the local representation is little endian, then this operation is a copy. If the local representation is little endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a1}{BSWP\_\-swap16l\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a4}{
\index{BSWP.c@{BSWP.c}!BSWP_swap16bN@{BSWP\_\-swap16bN}}
\index{BSWP_swap16bN@{BSWP\_\-swap16bN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap16bN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap16b\-N (unsigned short int $\ast$ {\em dst}, const unsigned short int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a4}


Byte swaps 16 bit words; local representation $<$=$>$ big. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 16 bit words to swap \item[{\em cnt}]The number of 16 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 16 bit integer to/from local/big endian representation from to/big endian/local representation. If the local representation is big endian, then this operation is a copy. If the local representation is big endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a2}{BSWP\_\-swap16b\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a3}{
\index{BSWP.c@{BSWP.c}!BSWP_swap16lN@{BSWP\_\-swap16lN}}
\index{BSWP_swap16lN@{BSWP\_\-swap16lN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap16lN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap16l\-N (unsigned short int $\ast$ {\em dst}, const unsigned short int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a3}


Byte swaps 16 bit words; local representation $<$=$>$ little. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The source array of 16 bit words to swap \item[{\em dst}]The destination array to receive the swapped words \item[{\em cnt}]The number of 16 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 16 bit integer to/from local/little endian representation from/to little endian/local representation. If the local representation is little endian, then this operation is a copy. If the local representation is little endian and the source and destination addresses are identical, then this operation is a NOOP.\hypertarget{BSWP_8c_a0}{
\index{BSWP.c@{BSWP.c}!BSWP_swap16N@{BSWP\_\-swap16N}}
\index{BSWP_swap16N@{BSWP\_\-swap16N}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap16N]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap16N (unsigned short int $\ast$ {\em dst}, const unsigned short int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a0}


Byte swaps 16 bit words. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 16 bit words to swap \item[{\em cnt}]The number of 16 bit words to swap\end{description}
\end{Desc}
This routine byte swaps the source array of 16 bit integers into the destination array.\hypertarget{BSWP_8c_a11}{
\index{BSWP.c@{BSWP.c}!BSWP_swap32_lclXbigN@{BSWP\_\-swap32\_\-lclXbigN}}
\index{BSWP_swap32_lclXbigN@{BSWP\_\-swap32\_\-lclXbigN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap32\_\-lclXbigN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap32\_\-lcl\-Xbig\-N (unsigned int $\ast$ {\em dst}, const unsigned int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a11}


Byte swaps 32 bit words; local representation $<$=$>$ big. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 32 bit words to swap \item[{\em cnt}]The number of 32 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 32 bit integer to/from local/big endian representation from/to big endian/local representation. If the local representation is big endian, then this operation is a copy. If the local representation is big endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a5}{BSWP\_\-swap32b\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a12}{
\index{BSWP.c@{BSWP.c}!BSWP_swap32_lclXlittleN@{BSWP\_\-swap32\_\-lclXlittleN}}
\index{BSWP_swap32_lclXlittleN@{BSWP\_\-swap32\_\-lclXlittleN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap32\_\-lclXlittleN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap32\_\-lcl\-Xlittle\-N (unsigned int $\ast$ {\em dst}, const unsigned int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a12}


Byte swaps an array 32 bit words; local representation $<$=$>$ little. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 32 bit words to swap \item[{\em cnt}]The number of 32 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 32 bit integer to/from local/little endian representation from to little endian/local representation. If the local representation is little endian, then this operation is a copy. If the local representation is little endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a4}{BSWP\_\-swap32l\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a6}{
\index{BSWP.c@{BSWP.c}!BSWP_swap32bN@{BSWP\_\-swap32bN}}
\index{BSWP_swap32bN@{BSWP\_\-swap32bN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap32bN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap32b\-N (unsigned int $\ast$ {\em dst}, const unsigned int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a6}


Byte swaps 32 bit words; local representation $<$=$>$ big. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 32 bit words to swap \item[{\em cnt}]The number of 32 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 32 bit integer to/from local/big endian representation from/to big endian/local representation. If the local representation is big endian, then this operation is a copy. If the local representation is big endian and the source and destination addresses are identical, then this operation is a NOOP.

\begin{Desc}
\item[Warning:]This function name is being deprecated. The new name is \hyperlink{BSWP_8h_a5}{BSWP\_\-swap32b\-N()}.\end{Desc}
\hypertarget{BSWP_8c_a5}{
\index{BSWP.c@{BSWP.c}!BSWP_swap32lN@{BSWP\_\-swap32lN}}
\index{BSWP_swap32lN@{BSWP\_\-swap32lN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap32lN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap32l\-N (unsigned int $\ast$ {\em dst}, const unsigned int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a5}


Byte swaps an array 32 bit words; local representation $<$=$>$ little. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 32 bit words to swap \item[{\em cnt}]The number of 32 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 32 bit integer to/from local/little endian representation from to little endian/local representation. If the local representation is little endian, then this operation is a copy. If the local representation is little endian and the source and destination addresses are identical, then this operation is a NOOP.\hypertarget{BSWP_8c_a1}{
\index{BSWP.c@{BSWP.c}!BSWP_swap32N@{BSWP\_\-swap32N}}
\index{BSWP_swap32N@{BSWP\_\-swap32N}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap32N]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap32N (unsigned int $\ast$ {\em dst}, const unsigned int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a1}


Byte swaps 32 bit words. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The source array of 32 bit words to swap \item[{\em dst}]The destination array to receive the swapped words \item[{\em cnt}]The number of 32 bit words to swap\end{description}
\end{Desc}
This routine byte swaps the source array of 32 bit integers into the destination array.\hypertarget{BSWP_8c_a8}{
\index{BSWP.c@{BSWP.c}!BSWP_swap64bN@{BSWP\_\-swap64bN}}
\index{BSWP_swap64bN@{BSWP\_\-swap64bN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap64bN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap64b\-N (unsigned long long int $\ast$ {\em dst}, const unsigned long long int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a8}


Byte swaps 64 bit words; local representation $<$=$>$ big. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 64 bit words to swap \item[{\em cnt}]The number of 64 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 64 bit integer to/from local/big endian representation from/to big endian/local representation. If the local representation is big endian, then this operation is a copy. If the local representation is big endian and the source and destination addresses are identical, then this operation is a NOOP.\hypertarget{BSWP_8c_a7}{
\index{BSWP.c@{BSWP.c}!BSWP_swap64lN@{BSWP\_\-swap64lN}}
\index{BSWP_swap64lN@{BSWP\_\-swap64lN}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap64lN]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap64l\-N (unsigned long long int $\ast$ {\em dst}, const unsigned long long int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a7}


Byte swaps an array 64 bit words; local representation $<$=$>$ little. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination array to receive the swapped words \item[{\em src}]The source array of 64 bit words to swap \item[{\em cnt}]The number of 64 bit words to swap\end{description}
\end{Desc}
This routine transforms the source array of 64 bit integer to/from local/little endian representation from to little endian/local representation. If the local representation is little endian, then this operation is a copy. If the local representation is little endian and the source and destination addresses are identical, then this operation is a NOOP.\hypertarget{BSWP_8c_a2}{
\index{BSWP.c@{BSWP.c}!BSWP_swap64N@{BSWP\_\-swap64N}}
\index{BSWP_swap64N@{BSWP\_\-swap64N}!BSWP.c@{BSWP.c}}
\subsubsection[BSWP\_\-swap64N]{\setlength{\rightskip}{0pt plus 5cm}void BSWP\_\-swap64N (unsigned long long int $\ast$ {\em dst}, const unsigned long long int $\ast$ {\em src}, int {\em cnt})}}
\label{BSWP_8c_a2}


Byte swaps 64 bit words. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]The source array of 64 bit words to swap \item[{\em dst}]The destination array to receive the swapped words \item[{\em cnt}]The number of 64 bit words to swap\end{description}
\end{Desc}
This routine byte swaps the source array of 64 bit integers into the destination array.