\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 $<$VBI/Alias.h$>$}\par
{\tt \#include $<$PBI/Attribute.h$>$}\par
{\tt \#include $<$IPBS/BSWP.h$>$}\par
{\tt \#include $<$IPBS/BSWP.ih$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{BSWP_8c_cbe6c8cfe1150144ab57775ef285eb0b}{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_2c5e2dddf6fc382ba5a0bf66a02d3154}{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_de9cf39e6f8cb78db06351df964b8ab2}{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_012b0b8d25ee9615781d3460cb6347b7}{BSWP\_\-swap16lN} (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_ed2488b0373438713d7b2e4356e30ab8}{BSWP\_\-swap16bN} (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_a4f770dfacbbf03f08d96ee08fa8fc1b}{BSWP\_\-swap32lN} (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_c50562e377a898848916e91420d2100f}{BSWP\_\-swap32bN} (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_4159224c448897a06f15917f3c7e27c4}{BSWP\_\-swap64lN} (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_202aea6791ab3e82a8f442f330e5dfb8}{BSWP\_\-swap64bN} (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_60436671cbd75a7754acd50252509e46}{BSWP\_\-swap16\_\-lclXbigN} (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_930d28f79b4560b11be77e0844923a26}{BSWP\_\-swap16\_\-lclXlittleN} (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_548f66d103eb1abb117f402eb3a22520}{BSWP\_\-swap32\_\-lclXbigN} (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_858e95f9130bbecb1547c79f64720d14}{BSWP\_\-swap32\_\-lclXlittleN} (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.2 2011/03/25 21:14:41 saxton Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{BSWP_8c_60436671cbd75a7754acd50252509e46}{
\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\_\-lclXbigN (unsigned short int $\ast$ {\em dst}, \/  const unsigned short int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_60436671cbd75a7754acd50252509e46}


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_ed2488b0373438713d7b2e4356e30ab8}{BSWP\_\-swap16bN()}. \end{Desc}
\hypertarget{BSWP_8c_930d28f79b4560b11be77e0844923a26}{
\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\_\-lclXlittleN (unsigned short int $\ast$ {\em dst}, \/  const unsigned short int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_930d28f79b4560b11be77e0844923a26}


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_012b0b8d25ee9615781d3460cb6347b7}{BSWP\_\-swap16lN()}. \end{Desc}
\hypertarget{BSWP_8c_ed2488b0373438713d7b2e4356e30ab8}{
\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\_\-swap16bN (unsigned short int $\ast$ {\em dst}, \/  const unsigned short int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_ed2488b0373438713d7b2e4356e30ab8}


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_ed2488b0373438713d7b2e4356e30ab8}{BSWP\_\-swap16bN()}. \end{Desc}
\hypertarget{BSWP_8c_012b0b8d25ee9615781d3460cb6347b7}{
\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\_\-swap16lN (unsigned short int $\ast$ {\em dst}, \/  const unsigned short int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_012b0b8d25ee9615781d3460cb6347b7}


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_cbe6c8cfe1150144ab57775ef285eb0b}{
\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_cbe6c8cfe1150144ab57775ef285eb0b}


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. 

References BSWP\_\-\_\-load16x().\hypertarget{BSWP_8c_548f66d103eb1abb117f402eb3a22520}{
\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\_\-lclXbigN (unsigned int $\ast$ {\em dst}, \/  const unsigned int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_548f66d103eb1abb117f402eb3a22520}


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_c50562e377a898848916e91420d2100f}{BSWP\_\-swap32bN()}. \end{Desc}
\hypertarget{BSWP_8c_858e95f9130bbecb1547c79f64720d14}{
\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\_\-lclXlittleN (unsigned int $\ast$ {\em dst}, \/  const unsigned int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_858e95f9130bbecb1547c79f64720d14}


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_a4f770dfacbbf03f08d96ee08fa8fc1b}{BSWP\_\-swap32lN()}. \end{Desc}
\hypertarget{BSWP_8c_c50562e377a898848916e91420d2100f}{
\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\_\-swap32bN (unsigned int $\ast$ {\em dst}, \/  const unsigned int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_c50562e377a898848916e91420d2100f}


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_c50562e377a898848916e91420d2100f}{BSWP\_\-swap32bN()}. \end{Desc}
\hypertarget{BSWP_8c_a4f770dfacbbf03f08d96ee08fa8fc1b}{
\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\_\-swap32lN (unsigned int $\ast$ {\em dst}, \/  const unsigned int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_a4f770dfacbbf03f08d96ee08fa8fc1b}


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_2c5e2dddf6fc382ba5a0bf66a02d3154}{
\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_2c5e2dddf6fc382ba5a0bf66a02d3154}


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. 

References BSWP\_\-\_\-load32x().\hypertarget{BSWP_8c_202aea6791ab3e82a8f442f330e5dfb8}{
\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\_\-swap64bN (unsigned long long int $\ast$ {\em dst}, \/  const unsigned long long int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_202aea6791ab3e82a8f442f330e5dfb8}


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_4159224c448897a06f15917f3c7e27c4}{
\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\_\-swap64lN (unsigned long long int $\ast$ {\em dst}, \/  const unsigned long long int $\ast$ {\em src}, \/  int {\em cnt})}}
\label{BSWP_8c_4159224c448897a06f15917f3c7e27c4}


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_de9cf39e6f8cb78db06351df964b8ab2}{
\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_de9cf39e6f8cb78db06351df964b8ab2}


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. 

References BSWP\_\-\_\-load64x().