\hypertarget{argv_8h}{\section{opal/util/argv.h File Reference}
\label{argv_8h}\index{opal/util/argv.\+h@{opal/util/argv.\+h}}
}


Generic routines for \char`\"{}argv\char`\"{}-\/like handling.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_af319ce60fb2568e0b63e08655396c0f6}{opal\+\_\+argv\+\_\+append} (int $\ast$argc, char $\ast$$\ast$$\ast$argv, const char $\ast$arg) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+nonnull\+\_\+\+\_\+(1) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+nonnull\+\_\+\+\_\+(3)
\begin{DoxyCompactList}\small\item\em Append a string (by value) to an new or existing N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_a33cd8261cbc91904939b455df0bf4cd9}{opal\+\_\+argv\+\_\+append\+\_\+nosize} (char $\ast$$\ast$$\ast$argv, const char $\ast$arg)
\begin{DoxyCompactList}\small\item\em Append to an argv-\/style array, but ignore the size of the array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_ab52487f325c839a3a2db0c77d74fd6ec}{opal\+\_\+argv\+\_\+prepend\+\_\+nosize} (char $\ast$$\ast$$\ast$argv, const char $\ast$arg)
\begin{DoxyCompactList}\small\item\em Insert the provided arg at the beginning of the array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_a51b556cb89728b095c2d4934c4c51880}{opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize} (char $\ast$$\ast$$\ast$argv, const char $\ast$arg, bool overwrite)
\begin{DoxyCompactList}\small\item\em Append to an argv-\/style array, but only if the provided argument doesn't already exist somewhere in the array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{argv_8h_a812edb42a56e62651124d6fac215aeeb}{opal\+\_\+argv\+\_\+free} (char $\ast$$\ast$argv)
\begin{DoxyCompactList}\small\item\em Free a N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$$\ast$ \hyperlink{argv_8h_a39e5bba1c003efa8c91bdba8b2615255}{opal\+\_\+argv\+\_\+split} (const char $\ast$src\+\_\+string, int delimiter) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Split a string into a N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$$\ast$ \hyperlink{argv_8h_a62ecb683ffc7f4c9d33becf8cd076e11}{opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty} (const char $\ast$src\+\_\+string, int delimiter) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Split a string into a N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_a139f6a5291f1aa512cb90a36572e6d20}{opal\+\_\+argv\+\_\+count} (char $\ast$$\ast$argv)
\begin{DoxyCompactList}\small\item\em Return the length of a N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$ \hyperlink{argv_8h_a7786ee23f52f122ca34499a7ff3a5e14}{opal\+\_\+argv\+\_\+join} (char $\ast$$\ast$argv, int delimiter) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Join all the elements of an argv array into a single newly-\/allocated string. \end{DoxyCompactList}\item 
\hypertarget{argv_8h_af57a81a4fba497ad359a454995a908de}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$ {\bfseries opal\+\_\+argv\+\_\+join\+\_\+range} (char $\ast$$\ast$argv, size\+\_\+t start, size\+\_\+t end, int delimiter) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+}\label{argv_8h_af57a81a4fba497ad359a454995a908de}

\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C size\+\_\+t \hyperlink{argv_8h_ad722149d2ea8b4afd5e9369b334b0f7b}{opal\+\_\+argv\+\_\+len} (char $\ast$$\ast$argv)
\begin{DoxyCompactList}\small\item\em Return the number of bytes consumed by an argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char $\ast$$\ast$ \hyperlink{argv_8h_ad042a70c80f8e1f2025d0f5a24ed1c58}{opal\+\_\+argv\+\_\+copy} (char $\ast$$\ast$argv) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Copy a N\+U\+L\+L-\/terminated argv array. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_a7e5f94d2b7f5658fa7430ba823dfa346}{opal\+\_\+argv\+\_\+delete} (int $\ast$argc, char $\ast$$\ast$$\ast$argv, int start, int num\+\_\+to\+\_\+delete)
\begin{DoxyCompactList}\small\item\em Delete one or more tokens from the middle of an argv. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_a59aa89e674e2909bb82654e20e3c3e7a}{opal\+\_\+argv\+\_\+insert} (char $\ast$$\ast$$\ast$target, int start, char $\ast$$\ast$source)
\begin{DoxyCompactList}\small\item\em Insert one argv array into the middle of another. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{argv_8h_af7fe737f519100a3de2110221713eef8}{opal\+\_\+argv\+\_\+insert\+\_\+element} (char $\ast$$\ast$$\ast$target, int location, char $\ast$source)
\begin{DoxyCompactList}\small\item\em Insert one argv element in front of a specific position in an array. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Generic routines for \char`\"{}argv\char`\"{}-\/like handling. 

Helpful for creating arrays of strings, especially when creating command lines. 

\subsection{Function Documentation}
\hypertarget{argv_8h_af319ce60fb2568e0b63e08655396c0f6}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+append@{opal\+\_\+argv\+\_\+append}}
\index{opal\+\_\+argv\+\_\+append@{opal\+\_\+argv\+\_\+append}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+append}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+append (
\begin{DoxyParamCaption}
\item[{int $\ast$}]{argc, }
\item[{char $\ast$$\ast$$\ast$}]{argv, }
\item[{const char $\ast$}]{arg}
\end{DoxyParamCaption}
)}}\label{argv_8h_af319ce60fb2568e0b63e08655396c0f6}


Append a string (by value) to an new or existing N\+U\+L\+L-\/terminated argv array. 


\begin{DoxyParams}{Parameters}
{\em argc} & Pointer to the length of the argv array. Must not be N\+U\+L\+L. \\
\hline
{\em argv} & Pointer to an argv array. \\
\hline
{\em str} & Pointer to the string to append.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & On success \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+O\+R} & On failure\\
\hline
\end{DoxyRetVals}
This function adds a string to an argv array of strings by value; it is permissable to pass a string on the stack as the str argument to this function.

To add the first entry to an argv array, call this function with ($\ast$argv == N\+U\+L\+L). This function will allocate an array of length 2; the first entry will point to a copy of the string passed in arg, the second entry will be set to N\+U\+L\+L.

If ({\itshape argv != N\+U\+L\+L), it will be realloc'ed to be 1 (char}) larger, and the next-\/to-\/last entry will point to a copy of the string passed in arg. The last entry will be set to N\+U\+L\+L.

Just to reinforce what was stated above\+: the string is copied by value into the argv array; there is no need to keep the original string (i.\+e., the arg parameter) after invoking this function. 

References opal\+\_\+argv\+\_\+append\+\_\+nosize(), and opal\+\_\+argv\+\_\+count().



Referenced by mca\+\_\+base\+\_\+param\+\_\+build\+\_\+env(), opal\+\_\+argv\+\_\+copy(), opal\+\_\+argv\+\_\+insert(), opal\+\_\+argv\+\_\+insert\+\_\+element(), opal\+\_\+cmd\+\_\+line\+\_\+get\+\_\+usage\+\_\+msg(), opal\+\_\+cmd\+\_\+line\+\_\+parse(), opal\+\_\+setenv(), orte\+\_\+plm\+\_\+base\+\_\+orted\+\_\+append\+\_\+basic\+\_\+args(), and orte\+\_\+plm\+\_\+submit\+\_\+launch().

\hypertarget{argv_8h_a33cd8261cbc91904939b455df0bf4cd9}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+append\+\_\+nosize@{opal\+\_\+argv\+\_\+append\+\_\+nosize}}
\index{opal\+\_\+argv\+\_\+append\+\_\+nosize@{opal\+\_\+argv\+\_\+append\+\_\+nosize}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+append\+\_\+nosize}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+append\+\_\+nosize (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$$\ast$}]{argv, }
\item[{const char $\ast$}]{arg}
\end{DoxyParamCaption}
)}}\label{argv_8h_a33cd8261cbc91904939b455df0bf4cd9}


Append to an argv-\/style array, but ignore the size of the array. 


\begin{DoxyParams}{Parameters}
{\em argv} & Pointer to an argv array. \\
\hline
{\em str} & Pointer to the string to append.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & On success \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+O\+R} & On failure\\
\hline
\end{DoxyRetVals}
This function is identical to the \hyperlink{argv_8h_af319ce60fb2568e0b63e08655396c0f6}{opal\+\_\+argv\+\_\+append()} function except that it does not take a pointer to an argc (integer representing the size of the array). This is handy for argv-\/style arrays that do not have integers that are actively maintaing their sizes. 

References opal\+\_\+argv\+\_\+count().



Referenced by opal\+\_\+argv\+\_\+append(), opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize(), opal\+\_\+show\+\_\+help\+\_\+add\+\_\+dir(), and orte\+\_\+odls\+\_\+base\+\_\+open().

\hypertarget{argv_8h_a51b556cb89728b095c2d4934c4c51880}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize@{opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize}}
\index{opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize@{opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+append\+\_\+unique\+\_\+nosize (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$$\ast$}]{argv, }
\item[{const char $\ast$}]{arg, }
\item[{bool}]{overwrite}
\end{DoxyParamCaption}
)}}\label{argv_8h_a51b556cb89728b095c2d4934c4c51880}


Append to an argv-\/style array, but only if the provided argument doesn't already exist somewhere in the array. 

Ignore the size of the array.


\begin{DoxyParams}{Parameters}
{\em argv} & Pointer to an argv array. \\
\hline
{\em str} & Pointer to the string to append. \\
\hline
{\em bool} & Whether or not to overwrite a matching value if found\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & On success \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+O\+R} & On failure\\
\hline
\end{DoxyRetVals}
This function is identical to the \hyperlink{argv_8h_a33cd8261cbc91904939b455df0bf4cd9}{opal\+\_\+argv\+\_\+append\+\_\+nosize()} function except that it only appends the provided argument if it does not already exist in the provided array, or overwrites it if it is. 

References opal\+\_\+argv\+\_\+append\+\_\+nosize().



Referenced by orte\+\_\+ras\+\_\+base\+\_\+node\+\_\+insert().

\hypertarget{argv_8h_ad042a70c80f8e1f2025d0f5a24ed1c58}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+copy@{opal\+\_\+argv\+\_\+copy}}
\index{opal\+\_\+argv\+\_\+copy@{opal\+\_\+argv\+\_\+copy}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+copy}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$$\ast$ opal\+\_\+argv\+\_\+copy (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{argv}
\end{DoxyParamCaption}
)}}\label{argv_8h_ad042a70c80f8e1f2025d0f5a24ed1c58}


Copy a N\+U\+L\+L-\/terminated argv array. 


\begin{DoxyParams}{Parameters}
{\em argv} & The input argv array.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em argv} & Copied argv array on success. \\
\hline
{\em N\+U\+L\+L} & On failure.\\
\hline
\end{DoxyRetVals}
Copy an argv array, including copying all off its strings. Specifically, the output argv will be an array of the same length as the input argv, and strcmp(argv\+\_\+in\mbox{[}i\mbox{]}, argv\+\_\+out\mbox{[}i\mbox{]}) will be 0. 

References opal\+\_\+argv\+\_\+append(), and opal\+\_\+argv\+\_\+free().



Referenced by mca\+\_\+btl\+\_\+ud\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+udapl\+\_\+component\+\_\+init(), opal\+\_\+cmd\+\_\+line\+\_\+get\+\_\+tail(), opal\+\_\+cmd\+\_\+line\+\_\+parse(), opal\+\_\+environ\+\_\+merge(), and orte\+\_\+plm\+\_\+submit\+\_\+launch().

\hypertarget{argv_8h_a139f6a5291f1aa512cb90a36572e6d20}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+count@{opal\+\_\+argv\+\_\+count}}
\index{opal\+\_\+argv\+\_\+count@{opal\+\_\+argv\+\_\+count}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+count}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+count (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{argv}
\end{DoxyParamCaption}
)}}\label{argv_8h_a139f6a5291f1aa512cb90a36572e6d20}


Return the length of a N\+U\+L\+L-\/terminated argv array. 


\begin{DoxyParams}{Parameters}
{\em argv} & The input argv array.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em 0} & If N\+U\+L\+L is passed as argv. \\
\hline
{\em count} & Number of entries in the argv array.\\
\hline
\end{DoxyRetVals}
The argv array must be N\+U\+L\+L-\/terminated. 

Referenced by mca\+\_\+io\+\_\+base\+\_\+delete(), mca\+\_\+io\+\_\+base\+\_\+file\+\_\+select(), mca\+\_\+oob\+\_\+tcp\+\_\+resolve(), opal\+\_\+argv\+\_\+append(), opal\+\_\+argv\+\_\+append\+\_\+nosize(), opal\+\_\+argv\+\_\+delete(), opal\+\_\+argv\+\_\+insert(), opal\+\_\+argv\+\_\+insert\+\_\+element(), opal\+\_\+argv\+\_\+prepend\+\_\+nosize(), opal\+\_\+cmd\+\_\+line\+\_\+parse(), opal\+\_\+os\+\_\+dirpath\+\_\+create(), opal\+\_\+setenv(), orte\+\_\+odls\+\_\+base\+\_\+open(), orte\+\_\+plm\+\_\+base\+\_\+orted\+\_\+append\+\_\+basic\+\_\+args(), orte\+\_\+rmaps\+\_\+base\+\_\+open(), and parse\+\_\+args().

\hypertarget{argv_8h_a7e5f94d2b7f5658fa7430ba823dfa346}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+delete@{opal\+\_\+argv\+\_\+delete}}
\index{opal\+\_\+argv\+\_\+delete@{opal\+\_\+argv\+\_\+delete}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+delete}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+delete (
\begin{DoxyParamCaption}
\item[{int $\ast$}]{argc, }
\item[{char $\ast$$\ast$$\ast$}]{argv, }
\item[{int}]{start, }
\item[{int}]{num\+\_\+to\+\_\+delete}
\end{DoxyParamCaption}
)}}\label{argv_8h_a7e5f94d2b7f5658fa7430ba823dfa346}


Delete one or more tokens from the middle of an argv. 


\begin{DoxyParams}{Parameters}
{\em argv} & The argv to delete from \\
\hline
{\em start} & The index of the first token to delete \\
\hline
{\em num\+\_\+to\+\_\+delete} & How many tokens to delete\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & Always\\
\hline
\end{DoxyRetVals}
Delete some tokens from within an existing argv. The start parameter specifies the first token to delete, and will delete (num\+\_\+to\+\_\+delete-\/1) tokens following it. argv will be realloc()ed to $\ast$argc -\/ num\+\_\+deleted size.

If start is beyond the end of the argv array, this function is a no-\/op.

If num\+\_\+to\+\_\+delete runs beyond the end of the argv array, this function will delete all tokens starting with start to the end of the array.

All deleted items in the argv array will have their contents free()ed (it is assumed that the argv \char`\"{}owns\char`\"{} the memory that the pointer points to). 

References opal\+\_\+argv\+\_\+count().



Referenced by opal\+\_\+cmd\+\_\+line\+\_\+parse().

\hypertarget{argv_8h_a812edb42a56e62651124d6fac215aeeb}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+free@{opal\+\_\+argv\+\_\+free}}
\index{opal\+\_\+argv\+\_\+free@{opal\+\_\+argv\+\_\+free}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+argv\+\_\+free (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{argv}
\end{DoxyParamCaption}
)}}\label{argv_8h_a812edb42a56e62651124d6fac215aeeb}


Free a N\+U\+L\+L-\/terminated argv array. 


\begin{DoxyParams}{Parameters}
{\em argv} & Argv array to free.\\
\hline
\end{DoxyParams}
This function frees an argv array and all of the strings that it contains. Since the argv parameter is passed by value, it is not set to N\+U\+L\+L in the caller's scope upon return.

It is safe to invoke this function with a N\+U\+L\+L pointer. It is not safe to invoke this function with a non-\/\+N\+U\+L\+L-\/terminated argv array. 

Referenced by mca\+\_\+base\+\_\+param\+\_\+build\+\_\+env(), mca\+\_\+btl\+\_\+ud\+\_\+component\+\_\+init(), mca\+\_\+io\+\_\+base\+\_\+delete(), mca\+\_\+io\+\_\+base\+\_\+file\+\_\+select(), opal\+\_\+argv\+\_\+copy(), opal\+\_\+cmd\+\_\+line\+\_\+get\+\_\+usage\+\_\+msg(), opal\+\_\+cmd\+\_\+line\+\_\+parse(), opal\+\_\+os\+\_\+dirpath\+\_\+create(), opal\+\_\+show\+\_\+help\+\_\+vstring(), orte\+\_\+odls\+\_\+base\+\_\+open(), orte\+\_\+plm\+\_\+submit\+\_\+launch(), and orte\+\_\+rmaps\+\_\+base\+\_\+open().

\hypertarget{argv_8h_a59aa89e674e2909bb82654e20e3c3e7a}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+insert@{opal\+\_\+argv\+\_\+insert}}
\index{opal\+\_\+argv\+\_\+insert@{opal\+\_\+argv\+\_\+insert}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+insert}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+insert (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$$\ast$}]{target, }
\item[{int}]{start, }
\item[{char $\ast$$\ast$}]{source}
\end{DoxyParamCaption}
)}}\label{argv_8h_a59aa89e674e2909bb82654e20e3c3e7a}


Insert one argv array into the middle of another. 


\begin{DoxyParams}{Parameters}
{\em target} & The argv to insert tokens into \\
\hline
{\em start} & Index where the first token will be placed in target \\
\hline
{\em source} & The argv to copy tokens from\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & upon success \\
\hline
{\em O\+P\+A\+L\+\_\+\+B\+A\+D\+\_\+\+P\+A\+R\+A\+M} & if any parameters are non-\/sensical\\
\hline
\end{DoxyRetVals}
This function takes one arg and inserts it in the middle of another. The first token in source will be insertted at index start in the target argv; all other tokens will follow it. Similar to \hyperlink{argv_8h_af319ce60fb2568e0b63e08655396c0f6}{opal\+\_\+argv\+\_\+append()}, the target may be realloc()'ed to accomodate the new storage requirements.

The source array is left unaffected -- its contents are copied by value over to the target array (i.\+e., the strings that source points to are strdup'ed into the new locations in target). 

References opal\+\_\+argv\+\_\+append(), and opal\+\_\+argv\+\_\+count().



Referenced by opal\+\_\+cmd\+\_\+line\+\_\+parse().

\hypertarget{argv_8h_af7fe737f519100a3de2110221713eef8}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+insert\+\_\+element@{opal\+\_\+argv\+\_\+insert\+\_\+element}}
\index{opal\+\_\+argv\+\_\+insert\+\_\+element@{opal\+\_\+argv\+\_\+insert\+\_\+element}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+insert\+\_\+element}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+insert\+\_\+element (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$$\ast$}]{target, }
\item[{int}]{location, }
\item[{char $\ast$}]{source}
\end{DoxyParamCaption}
)}}\label{argv_8h_af7fe737f519100a3de2110221713eef8}


Insert one argv element in front of a specific position in an array. 


\begin{DoxyParams}{Parameters}
{\em target} & The argv to insert tokens into \\
\hline
{\em location} & Index where the token will be placed in target \\
\hline
{\em source} & The token to be inserted\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & upon success \\
\hline
{\em O\+P\+A\+L\+\_\+\+B\+A\+D\+\_\+\+P\+A\+R\+A\+M} & if any parameters are non-\/sensical\\
\hline
\end{DoxyRetVals}
This function takes one arg and inserts it in the middle of another. The token will be inserted at the specified index in the target argv; all other tokens will be shifted down. Similar to \hyperlink{argv_8h_af319ce60fb2568e0b63e08655396c0f6}{opal\+\_\+argv\+\_\+append()}, the target may be realloc()'ed to accomodate the new storage requirements.

The source token is left unaffected -- its contents are copied by value over to the target array (i.\+e., the string that source points to is strdup'ed into the new location in target). 

References opal\+\_\+argv\+\_\+append(), and opal\+\_\+argv\+\_\+count().

\hypertarget{argv_8h_a7786ee23f52f122ca34499a7ff3a5e14}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+join@{opal\+\_\+argv\+\_\+join}}
\index{opal\+\_\+argv\+\_\+join@{opal\+\_\+argv\+\_\+join}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+join}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$ opal\+\_\+argv\+\_\+join (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{argv, }
\item[{int}]{delimiter}
\end{DoxyParamCaption}
)}}\label{argv_8h_a7786ee23f52f122ca34499a7ff3a5e14}


Join all the elements of an argv array into a single newly-\/allocated string. 


\begin{DoxyParams}{Parameters}
{\em argv} & The input argv array. \\
\hline
{\em delimiter} & Delimiter character placed between each argv string.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em new\+\_\+string} & Output string on success. \\
\hline
{\em N\+U\+L\+L} & On failure.\\
\hline
\end{DoxyRetVals}
Similar to the Perl join function, this function takes an input argv and joins them into into a single string separated by the delimiter character.

It is the callers responsibility to free the returned string. 

Referenced by opal\+\_\+cmd\+\_\+line\+\_\+get\+\_\+usage\+\_\+msg(), orte\+\_\+plm\+\_\+submit\+\_\+launch(), and parse\+\_\+args().

\hypertarget{argv_8h_ad722149d2ea8b4afd5e9369b334b0f7b}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+len@{opal\+\_\+argv\+\_\+len}}
\index{opal\+\_\+argv\+\_\+len@{opal\+\_\+argv\+\_\+len}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+len}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C size\+\_\+t opal\+\_\+argv\+\_\+len (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{argv}
\end{DoxyParamCaption}
)}}\label{argv_8h_ad722149d2ea8b4afd5e9369b334b0f7b}


Return the number of bytes consumed by an argv array. 


\begin{DoxyParams}{Parameters}
{\em argv} & The input argv array.\\
\hline
\end{DoxyParams}
Count the number of bytes consumed by a N\+U\+L\+L-\/terminated argv array. This includes the number of bytes used by each of the strings as well as the pointers used in the argv array. \hypertarget{argv_8h_ab52487f325c839a3a2db0c77d74fd6ec}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+prepend\+\_\+nosize@{opal\+\_\+argv\+\_\+prepend\+\_\+nosize}}
\index{opal\+\_\+argv\+\_\+prepend\+\_\+nosize@{opal\+\_\+argv\+\_\+prepend\+\_\+nosize}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+prepend\+\_\+nosize}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+argv\+\_\+prepend\+\_\+nosize (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$$\ast$}]{argv, }
\item[{const char $\ast$}]{arg}
\end{DoxyParamCaption}
)}}\label{argv_8h_ab52487f325c839a3a2db0c77d74fd6ec}


Insert the provided arg at the beginning of the array. 


\begin{DoxyParams}{Parameters}
{\em argv} & Pointer to an argv array \\
\hline
{\em str} & Pointer to the string to prepend\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & On success \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+O\+R} & On failure \\
\hline
\end{DoxyRetVals}


References opal\+\_\+argv\+\_\+count().

\hypertarget{argv_8h_a39e5bba1c003efa8c91bdba8b2615255}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+split@{opal\+\_\+argv\+\_\+split}}
\index{opal\+\_\+argv\+\_\+split@{opal\+\_\+argv\+\_\+split}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+split}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$$\ast$ opal\+\_\+argv\+\_\+split (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{src\+\_\+string, }
\item[{int}]{delimiter}
\end{DoxyParamCaption}
)}}\label{argv_8h_a39e5bba1c003efa8c91bdba8b2615255}


Split a string into a N\+U\+L\+L-\/terminated argv array. 

Do not include empty strings in result array.


\begin{DoxyParams}{Parameters}
{\em src\+\_\+string} & Input string. \\
\hline
{\em delimiter} & Delimiter character.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em argv} & pointer to new argv array on success \\
\hline
{\em N\+U\+L\+L} & on error\\
\hline
\end{DoxyRetVals}
All strings are insertted into the argv array by value; the newly-\/allocated array makes no references to the src\+\_\+string argument (i.\+e., it can be freed after calling this function without invalidating the output argv). 

Referenced by mca\+\_\+btl\+\_\+base\+\_\+select(), mca\+\_\+btl\+\_\+ud\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+udapl\+\_\+component\+\_\+init(), mca\+\_\+io\+\_\+base\+\_\+delete(), mca\+\_\+io\+\_\+base\+\_\+file\+\_\+select(), ompi\+\_\+wait\+\_\+for\+\_\+debugger(), opal\+\_\+os\+\_\+dirpath\+\_\+create(), orte\+\_\+register\+\_\+params(), orte\+\_\+rmaps\+\_\+base\+\_\+open(), and orte\+\_\+rml\+\_\+base\+\_\+parse\+\_\+uris().

\hypertarget{argv_8h_a62ecb683ffc7f4c9d33becf8cd076e11}{\index{argv.\+h@{argv.\+h}!opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty@{opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty}}
\index{opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty@{opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty}!argv.\+h@{argv.\+h}}
\subsubsection[{opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C char$\ast$$\ast$ opal\+\_\+argv\+\_\+split\+\_\+with\+\_\+empty (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{src\+\_\+string, }
\item[{int}]{delimiter}
\end{DoxyParamCaption}
)}}\label{argv_8h_a62ecb683ffc7f4c9d33becf8cd076e11}


Split a string into a N\+U\+L\+L-\/terminated argv array. 

Include empty strings in result array.


\begin{DoxyParams}{Parameters}
{\em src\+\_\+string} & Input string. \\
\hline
{\em delimiter} & Delimiter character.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em argv} & pointer to new argv array on success \\
\hline
{\em N\+U\+L\+L} & on error\\
\hline
\end{DoxyRetVals}
All strings are insertted into the argv array by value; the newly-\/allocated array makes no references to the src\+\_\+string argument (i.\+e., it can be freed after calling this function without invalidating the output argv). 