invariants?

\label{doc_api_review_core_keyCopy_md_md_doc_api_review_core_keyCopy}%
\Hypertarget{doc_api_review_core_keyCopy_md_md_doc_api_review_core_keyCopy}%

\begin{DoxyItemize}
\item start = 2021-\/02-\/13 12\+:00
\item end = 2021-\/02-\/13 13\+:10
\item moderator = Stefan Hanreich \href{mailto:stefanhani@gmail.com}{\texttt{ stefanhani@gmail.\+com}}
\item reviewer = Markus Raab \href{mailto:markus@libelektra.org}{\texttt{ markus@libelektra.\+org}}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md760}{}\doxysection{Signature}\label{doc_api_review_core_keyCopy_md_autotoc_md760}
{\ttfamily int key\+Copy(\+Key $\ast$dest, const Key $\ast$source);}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md761}{}\doxysection{Checklist}\label{doc_api_review_core_keyCopy_md_autotoc_md761}
\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md762}{}\doxysubsection{Doxygen}\label{doc_api_review_core_keyCopy_md_autotoc_md762}

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} first line explains briefly what the function does ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Clear -\/$>$ clear ~\newline

\item \mbox{[}x\mbox{]} do not instantly reference {\ttfamily key\+Dup}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @see} ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add {\ttfamily @see} for {\ttfamily key\+Dup}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @since} (optional\+: for after 1.\+0.\+0) ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add {\ttfamily @since} 0.\+9.\+5
\end{DoxyItemize}
\item \mbox{[}x\mbox{]} {\ttfamily @ingroup}
\item \mbox{[} \mbox{]} {\ttfamily @retval} ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} use retval instead of return (see snippet below)
\end{DoxyItemize}
\item \mbox{[} \mbox{]} good example or snippet how to use the function ~\newline

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} move example to {\ttfamily key\+Dup}
\end{DoxyItemize}
\item \mbox{[} \mbox{]} simple examples go first ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} move simple example to the top
\end{DoxyItemize}
\item \mbox{[} \mbox{]} Precondition ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add precondition (valid key values) ~\newline

\item \mbox{[}x\mbox{]} \begin{DoxyPrecond}{Precondition}
dest must be a valid Key (created with key\+New) ~\newline

\end{DoxyPrecond}

\item \mbox{[}x\mbox{]} \begin{DoxyPrecond}{Precondition}
source must be a valid Key or NULL
\end{DoxyPrecond}

\end{DoxyItemize}
\item \mbox{[} \mbox{]} Postcondition ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add postcondition ~\newline

\item \mbox{[}x\mbox{]} \begin{DoxyPostcond}{Postcondition}
Value is written to key dest
\end{DoxyPostcond}

\end{DoxyItemize}
\item \mbox{[} \mbox{]} Invariant ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add invariant ~\newline

\item \mbox{[}x\mbox{]} Key name stays valid (document at struct) ~\newline

\item \mbox{[}x\mbox{]} Key name stays valid until delete
\end{DoxyItemize}
\item \mbox{[} \mbox{]} {\ttfamily @param} for every parameter ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} better describe flags ($\vert$)
\end{DoxyItemize}

invariants?
\end{DoxyItemize}


\begin{DoxyCode}{0}
\DoxyCodeLine{@retval dest}
\DoxyCodeLine{@retval NULL in case of error}

\end{DoxyCode}
\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md763}{}\doxysubsection{Naming}\label{doc_api_review_core_keyCopy_md_autotoc_md763}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Abbreviations used in function names must be defined in the \mbox{\hyperlink{doc_help_elektra-glossary_md}{Glossary}} src/libs/elektra/symbols.\+map
\item \mbox{[}x\mbox{]} Function names should neither be too long, nor too short
\item \mbox{[}x\mbox{]} Function name should be clear and unambiguous
\item \mbox{[} \mbox{]} Abbreviations used in parameter names must be defined in the \mbox{\hyperlink{doc_help_elektra-glossary_md}{Glossary}} ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} add dest to glossary -\/ maybe rename dest to destination?
\end{DoxyItemize}
\item \mbox{[}x\mbox{]} Parameter names should neither be too long, nor too short
\item \mbox{[}x\mbox{]} Parameter names should be clear and unambiguous
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md764}{}\doxysubsection{Compatibility}\label{doc_api_review_core_keyCopy_md_autotoc_md764}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} ABI/\+API changes are forward-\/compatible (breaking backwards-\/compatibility to add additional symbols is fine)
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md765}{}\doxysubsection{Parameter \& Return Types}\label{doc_api_review_core_keyCopy_md_autotoc_md765}

\begin{DoxyItemize}
\item Functions should return the most specific type possible
\item Functions should require the most general type possible
\item \mbox{[}x\mbox{]} Function parameters should use enum types instead of boolean types wherever sensible
\item \mbox{[}x\mbox{]} Wherever possible, function parameters should be {\ttfamily const}
\item \mbox{[}x\mbox{]} Wherever possible, return types should be {\ttfamily const}
\item \mbox{[}x\mbox{]} Functions should have the least amount of parameters feasible
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md766}{}\doxysubsection{Structural Clarity}\label{doc_api_review_core_keyCopy_md_autotoc_md766}

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} Functions should do exactly one thing ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} remove key\+Set\+Name key\+Set\+Raw ks\+Clear functionality from key\+Copy?
\end{DoxyItemize}
\item \mbox{[}x\mbox{]} Function name has the appropriate prefix
\item \mbox{[}x\mbox{]} Signature in kdb.\+h.\+in has same order as Doxygen docu
\item \mbox{[} \mbox{]} No functions with similar purpose exist ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} key\+Copy\+All\+Meta
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md767}{}\doxysubsection{Memory Management}\label{doc_api_review_core_keyCopy_md_autotoc_md767}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Memory Management should be handled by the function wherever possible
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md768}{}\doxysubsection{Extensibility}\label{doc_api_review_core_keyCopy_md_autotoc_md768}

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} Function is easily extensible, e.\+g., with flags
\item \mbox{[} \mbox{]} Documentation does not impose limits, that would hinder further extensions ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} KEY\+\_\+\+CP\+\_\+\+ALL equivalent to KEY\+\_\+\+CP\+\_\+\+NAME $\vert$ KEY\+\_\+\+CP\+\_\+\+VALUE $\vert$ KEY\+\_\+\+CP\+\_\+\+META
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md769}{}\doxysubsection{Tests}\label{doc_api_review_core_keyCopy_md_autotoc_md769}

\begin{DoxyItemize}
\item \mbox{[} \mbox{]} Added functions are fully covered by tests \href{https://doc.libelektra.org/coverage/master/debian-buster-full/src/libs/elektra/key.c.gcov.html}{\texttt{ https\+://doc.\+libelektra.\+org/coverage/master/debian-\/buster-\/full/src/libs/elektra/key.\+c.\+gcov.\+html}}
\item \mbox{[} \mbox{]} All possible error states are covered by tests and documented
\item \mbox{[} \mbox{]} All possible enum values are covered by tests ~\newline

\begin{DoxyItemize}
\item \mbox{[}x\mbox{]} use flags other than KEY\+\_\+\+CP\+\_\+\+ALL
\end{DoxyItemize}
\item \mbox{[} \mbox{]} No inconsistencies between tests and documentation
\item \mbox{[} \mbox{]} Functions should have no side effects (idempotency)
\end{DoxyItemize}\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md770}{}\doxysection{Summary}\label{doc_api_review_core_keyCopy_md_autotoc_md770}
\hypertarget{doc_api_review_core_keyCopy_md_autotoc_md771}{}\doxysection{Other Issues discovered (unrelated to function)}\label{doc_api_review_core_keyCopy_md_autotoc_md771}
