\hypertarget{group__keymeta}{\section{Meta Info Manipulation Methods}
\label{group__keymeta}\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
}


Methods to do various operations on Key metainfo.  


Collaboration diagram for Meta Info Manipulation Methods\-:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=264pt]{group__keymeta}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}{key\-Rewind\-Meta} (Key $\ast$key)
\item 
const Key $\ast$ \hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta} (Key $\ast$key)
\item 
const Key $\ast$ \hyperlink{group__keymeta_ga74a273f529030f4947df52e14fdd2869}{key\-Current\-Meta} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{key\-Copy\-Meta} (Key $\ast$dest, const Key $\ast$source, const char $\ast$meta\-Name)
\item 
int \hyperlink{group__keymeta_ga8e63720a65610a29597494d0671f9401}{key\-Copy\-All\-Meta} (Key $\ast$dest, const Key $\ast$source)
\item 
const Key $\ast$ \hyperlink{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{key\-Get\-Meta} (const Key $\ast$key, const char $\ast$meta\-Name)
\item 
ssize\-\_\-t \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta} (Key $\ast$key, const char $\ast$meta\-Name, const char $\ast$new\-Meta\-String)
\item 
uid\-\_\-t \hyperlink{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}{key\-Get\-U\-I\-D} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}{key\-Set\-U\-I\-D} (Key $\ast$key, uid\-\_\-t uid)
\item 
gid\-\_\-t \hyperlink{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}{key\-Get\-G\-I\-D} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}{key\-Set\-G\-I\-D} (Key $\ast$key, gid\-\_\-t gid)
\item 
int \hyperlink{group__keymeta_gaae575bd86a628a15ee45baa860522e75}{key\-Set\-Dir} (Key $\ast$key)
\item 
mode\-\_\-t \hyperlink{group__keymeta_gabc0cec592ce3b77e9bc33dbc8e8f6bdc}{key\-Get\-Mode} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}{key\-Set\-Mode} (Key $\ast$key, mode\-\_\-t mode)
\item 
time\-\_\-t \hyperlink{group__keymeta_ga6b05da399c3c78904969ef39f191b0eb}{key\-Get\-A\-Time} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga995d8b84731673c88c7c01f3fed538b9}{key\-Set\-A\-Time} (Key $\ast$key, time\-\_\-t atime)
\item 
time\-\_\-t \hyperlink{group__keymeta_ga57689eb5691679071463b777ae786ae9}{key\-Get\-M\-Time} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga481d8997187992fe4bbf288bc8ef4db7}{key\-Set\-M\-Time} (Key $\ast$key, time\-\_\-t mtime)
\item 
time\-\_\-t \hyperlink{group__keymeta_ga2c213c120cbe02201278ef7fb8cd94be}{key\-Get\-C\-Time} (const Key $\ast$key)
\item 
int \hyperlink{group__keymeta_ga9f502ecab8ab43f0b17220fcc95f3fa5}{key\-Set\-C\-Time} (Key $\ast$key, time\-\_\-t ctime)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Methods to do various operations on Key metainfo. To use them\-: 
\begin{DoxyCode}
\textcolor{preprocessor}{#include <kdb.h>}
\end{DoxyCode}


Next to \hyperlink{group__keyname}{Name (key and owner) } and \hyperlink{group__keyvalue}{Value (data and comment) } there is the so called meta information inside every key.

Key meta information are an unlimited number of key/value pairs strongly related to a key. It main purpose is to give keys special semantics, so that plugins can treat them differently.

Metakey, as opposed to Key, deliberately has following limitations\-:
\begin{DoxyItemize}
\item no null values
\item no binary data
\item no modification of references (C\-O\-W)
\item no guarantee of ordering
\end{DoxyItemize}

\subsubsection*{Examples for metadata}

File system information (see stat(2) for more information)\-:
\begin{DoxyItemize}
\item uid\-: the user id (positive number)
\item gid\-: the group id (positive number)
\item mode\-: filesystem-\/like mode permissions (positive octal number)
\item atime\-: When was the key accessed the last time.
\item mtime\-: When was the key modified the last time.
\item ctime\-: When the uid, gid or mode of a key changes. (times are represented through a positive number as unix timestamp)
\end{DoxyItemize}

The comment can contain userdata which directly belong to that key. The name of the meta information is \char`\"{}comment\char`\"{} for a general purpose comment about the key. Multi-\/\-Language comments are also supported by appending \mbox{[}L\-A\-N\-G\mbox{]} to the name.

Validators are regular expressions which are tested against the key value. The metakey \char`\"{}validator\char`\"{} can hold a regular expression which will be matched against.

Types can be expressed with the meta information \char`\"{}type\char`\"{}.

The relevance of the key can be tagged with a value from -\/20 to 20. Negative numbers are the more important and must be present in order to start the program.

A version of a key may be stored with \char`\"{}version\char`\"{}. Its format is full.\-major.\-minor where all of these are integers.

The order inside a persistent storage can be described with the tag \char`\"{}order\char`\"{} which contains a positive number.

The meta key \char`\"{}app\char`\"{} describes to which application a key belongs. It can be used to remove keys from an application no longer installed.

The meta key \char`\"{}path\char`\"{} describes where the key is physically stored.

The \char`\"{}owner\char`\"{} is the user that owns the key. It only works for the user/ hierarchy. It rather says where the key is stored and says nothing about the filesystem properties. 

\subsection{Function Documentation}
\hypertarget{group__keymeta_ga8e63720a65610a29597494d0671f9401}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Copy\-All\-Meta@{key\-Copy\-All\-Meta}}
\index{key\-Copy\-All\-Meta@{key\-Copy\-All\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Copy\-All\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Copy\-All\-Meta (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{dest, }
\item[{const Key $\ast$}]{source}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga8e63720a65610a29597494d0671f9401}
Do a shallow copy of all meta data from source to dest.

The key dest will additionally have all meta data the source had. Meta data not present in source will not be changed. Meta data which was present in source and dest will be overwritten.

For example the meta data type is copied into the Key k\-:


\begin{DoxyCodeInclude}
\textcolor{keywordtype}{void} l(Key *k)
\{
        \textcolor{comment}{// receive c}
        \hyperlink{group__keymeta_ga8e63720a65610a29597494d0671f9401}{keyCopyAllMeta}(k, c);
        \textcolor{comment}{// the caller will see the changed key k}
        \textcolor{comment}{// with all the metadata from c}
\}
\end{DoxyCodeInclude}
 The main purpose of this function is for plugins or applications which want to add the same meta data to n keys. When you do that with \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} it will take n times the memory for the key. This can be considerable amount of memory for many keys with some meta data for each.

To avoid that problem you can use \hyperlink{group__keymeta_ga8e63720a65610a29597494d0671f9401}{key\-Copy\-All\-Meta()} or \hyperlink{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{key\-Copy\-Meta()}\-:


\begin{DoxyCodeInclude}
\textcolor{keywordtype}{void} o(KeySet *ks)
\{
        Key *current;
        Key *shared = \hyperlink{group__key_gad23c65b44bf48d773759e1f9a4d43b89}{keyNew} (0);
        \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{keySetMeta}(shared, \textcolor{stringliteral}{"shared1"}, \textcolor{stringliteral}{"this meta data should be
       shared among many keys"});
        \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{keySetMeta}(shared, \textcolor{stringliteral}{"shared2"}, \textcolor{stringliteral}{"this meta data should be
       shared among many keys also"});
        \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{keySetMeta}(shared, \textcolor{stringliteral}{"shared3"}, \textcolor{stringliteral}{"this meta data should be
       shared among many keys too"});

        \hyperlink{group__keyset_gabe793ff51f1728e3429c84a8a9086b70}{ksRewind}(ks);
        \textcolor{keywordflow}{while} ((current = \hyperlink{group__keyset_ga317321c9065b5a4b3e33fe1c399bcec9}{ksNext}(ks)) != 0)
        \{
                \textcolor{keywordflow}{if} (needsSharedData(current)) \hyperlink{group__keymeta_ga8e63720a65610a29597494d0671f9401}{keyCopyAllMeta}(
      current, shared);
        \}

        \hyperlink{group__key_ga3df95bbc2494e3e6703ece5639be5bb1}{keyDel}(shared);
\}
\end{DoxyCodeInclude}
 \begin{DoxyPostcond}{Postcondition}
for every meta\-Name present in source\-: key\-Get\-Meta(source, meta\-Name) == key\-Get\-Meta(dest, meta\-Name)
\end{DoxyPostcond}
\begin{DoxyReturn}{Returns}
1 if was successfully copied 

0 if source did not have any meta data 

-\/1 on null pointer of dest or source 

-\/1 on memory problems 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em dest} & the destination where the meta data should be copied too \\
\hline
{\em source} & the key where the meta data should be copied from \\
\hline
\end{DoxyParams}
\hypertarget{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Copy\-Meta@{key\-Copy\-Meta}}
\index{key\-Copy\-Meta@{key\-Copy\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Copy\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Copy\-Meta (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{dest, }
\item[{const Key $\ast$}]{source, }
\item[{const char $\ast$}]{meta\-Name}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}
Do a shallow copy of meta data from source to dest.

The key dest will have the same meta data referred with meta\-Name afterwards then source.

For example the meta data type is copied into the Key k.


\begin{DoxyCode}
\textcolor{keywordtype}{void} l(Key *k)
\{
        \textcolor{comment}{// receive c}
        \hyperlink{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{keyCopyMeta}(k, c, \textcolor{stringliteral}{"type"});
        \textcolor{comment}{// the caller will see the changed key k}
        \textcolor{comment}{// with the metadata "type" from c}
\}
\end{DoxyCode}


The main purpose of this function is for plugins or applications which want to add the same meta data to n keys. When you do that with \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} it will take n times the memory for the key. This can be considerable amount of memory for many keys with some meta data for each.

To avoid that problem you can use \hyperlink{group__keymeta_ga8e63720a65610a29597494d0671f9401}{key\-Copy\-All\-Meta()} or \hyperlink{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{key\-Copy\-Meta()}.


\begin{DoxyCode}
\textcolor{keywordtype}{void} o(KeySet *ks)
\{
        Key *current;
        Key *shared = \hyperlink{group__key_gad23c65b44bf48d773759e1f9a4d43b89}{keyNew} (0);
        \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{keySetMeta}(shared, \textcolor{stringliteral}{"shared"}, \textcolor{stringliteral}{"this meta data should be shared
       among many keys"});

        \hyperlink{group__keyset_gabe793ff51f1728e3429c84a8a9086b70}{ksRewind}(ks);
        \textcolor{keywordflow}{while} ((current = \hyperlink{group__keyset_ga317321c9065b5a4b3e33fe1c399bcec9}{ksNext}(ks)) != 0)
        \{
                \textcolor{keywordflow}{if} (needs\_shared\_data(current)) \hyperlink{group__keymeta_ga9a22b992478e613c8788bd460b4a1f0c}{keyCopyMeta}(current,
       shared, \textcolor{stringliteral}{"shared"});
        \}
\}
\end{DoxyCode}


\begin{DoxyPostcond}{Postcondition}
key\-Get\-Meta(source, meta\-Name) == key\-Get\-Meta(dest, meta\-Name)
\end{DoxyPostcond}
\begin{DoxyReturn}{Returns}
1 if was successfully copied 

0 if the meta data in dest was removed too 

-\/1 on null pointers (source or dest) 

-\/1 on memory problems 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em dest} & the destination where the meta data should be copied too \\
\hline
{\em source} & the key where the meta data should be copied from \\
\hline
{\em meta\-Name} & the name of the meta data which should be copied \\
\hline
\end{DoxyParams}
\hypertarget{group__keymeta_ga74a273f529030f4947df52e14fdd2869}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Current\-Meta@{key\-Current\-Meta}}
\index{key\-Current\-Meta@{key\-Current\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Current\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}const Key$\ast$ key\-Current\-Meta (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga74a273f529030f4947df52e14fdd2869}
Returns the Value of a Meta-\/\-Information which is current.

The pointer is N\-U\-L\-L if you reached the end or after \hyperlink{group__keyset_gabe793ff51f1728e3429c84a8a9086b70}{ks\-Rewind()}.

\begin{DoxyNote}{Note}
You must not delete or change the returned key, use \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} if you want to delete or change it.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a buffer to the value pointed by {\ttfamily key's} cursor 

0 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()}, \hyperlink{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}{key\-Rewind\-Meta()}

\hyperlink{group__keyset_ga4287b9416912c5f2ab9c195cb74fb094}{ks\-Current()} for pedant in iterator interface of Key\-Set 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga6b05da399c3c78904969ef39f191b0eb}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-A\-Time@{key\-Get\-A\-Time}}
\index{key\-Get\-A\-Time@{key\-Get\-A\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-A\-Time}]{\setlength{\rightskip}{0pt plus 5cm}time\-\_\-t key\-Get\-A\-Time (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga6b05da399c3c78904969ef39f191b0eb}
Get last time the key data was read from disk.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000010}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


Every \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} might update the access time of a key. You get information when the key was read the last time from the database.

You will get 0 when the key was not read already.

Beware that multiple copies of keys with \hyperlink{group__key_gae6ec6a60cc4b8c1463fa08623d056ce3}{key\-Dup()} might have different atimes because you \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} one, but not the other. You can use this information to decide which key is the latest.


\begin{DoxyParams}{Parameters}
{\em key} & Key to get information from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the time you got the key with \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} 

0 on key that was never \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} 

(time\-\_\-t)-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga995d8b84731673c88c7c01f3fed538b9}{key\-Set\-A\-Time()} 

\hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga2c213c120cbe02201278ef7fb8cd94be}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-C\-Time@{key\-Get\-C\-Time}}
\index{key\-Get\-C\-Time@{key\-Get\-C\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-C\-Time}]{\setlength{\rightskip}{0pt plus 5cm}time\-\_\-t key\-Get\-C\-Time (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga2c213c120cbe02201278ef7fb8cd94be}
Get last time the key metadata was changed from disk.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000014}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


You will get 0 when the key was not read already.

Any changed field in metadata will influence the ctime of a key.

This time is not updated if only value or comment are changed.

Not changed keys will not update this time, even after \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()}.

It is possible that other keys written to disc influence this time if the backend is not grained enough.


\begin{DoxyParams}{Parameters}
{\em key} & Key to get information from. \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga9f502ecab8ab43f0b17220fcc95f3fa5}{key\-Set\-C\-Time()} 
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
(time\-\_\-t)-\/1 on N\-U\-L\-L pointer 

the metadata change time 
\end{DoxyReturn}
\hypertarget{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-G\-I\-D@{key\-Get\-G\-I\-D}}
\index{key\-Get\-G\-I\-D@{key\-Get\-G\-I\-D}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-G\-I\-D}]{\setlength{\rightskip}{0pt plus 5cm}gid\-\_\-t key\-Get\-G\-I\-D (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}
Get the group I\-D of a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000005}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}
\hypertarget{group__keymeta_GID}{}\subsection{G\-I\-D}\label{group__keymeta_GID}
The group I\-D is a unique identification for every group present on a system. Keys will belong to root (0) as long as you did not get their real G\-I\-D with \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()}.

Unlike U\-I\-D users might change their group. This makes it possible to share configuration between some users.

A fresh key will have (gid\-\_\-t)-\/1 also known as the group nogroup. It means that the key is not related to a group I\-D at the moment.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the system's G\-I\-D of the key 

(gid\-\_\-t)-\/1 on N\-U\-L\-L key or currently unknown I\-D 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}{key\-Set\-G\-I\-D()}, \hyperlink{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}{key\-Get\-U\-I\-D()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-Meta@{key\-Get\-Meta}}
\index{key\-Get\-Meta@{key\-Get\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}const Key$\ast$ key\-Get\-Meta (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key, }
\item[{const char $\ast$}]{meta\-Name}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}
Returns the Value of a Meta-\/\-Information given by name.

This is a much more efficient version of \hyperlink{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{key\-Get\-Meta()}. But unlike with key\-Get\-Meta you are not allowed to modify the resulting string.


\begin{DoxyCode}
\textcolor{keywordtype}{int} f(Key *k)
\{
        \textcolor{keywordflow}{if} (!strcmp(\hyperlink{group__keyvalue_ga6f29609c5da53c6dc26a98678d5752af}{keyValue}(\hyperlink{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{keyGetMeta}(k, \textcolor{stringliteral}{"type"})), \textcolor{stringliteral}{"boolean
      "}))
        \{
                \textcolor{comment}{// the type of the key is boolean}
        \}
\}
\end{DoxyCode}


\begin{DoxyNote}{Note}
You must not delete or change the returned key, use \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} if you want to delete or change it.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
{\em meta\-Name} & the name of the meta information you want the value from \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if the key or meta\-Name is 0 

0 if no such meta\-Name is found 

value of Meta-\/\-Information if Meta-\/\-Information is found 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{key\-Get\-Meta()}, \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_gabc0cec592ce3b77e9bc33dbc8e8f6bdc}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-Mode@{key\-Get\-Mode}}
\index{key\-Get\-Mode@{key\-Get\-Mode}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-Mode}]{\setlength{\rightskip}{0pt plus 5cm}mode\-\_\-t key\-Get\-Mode (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_gabc0cec592ce3b77e9bc33dbc8e8f6bdc}
Return the key mode permissions.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000008}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


Default is 0664 (octal) for keys and 0775 for directory keys which used \hyperlink{group__keymeta_gaae575bd86a628a15ee45baa860522e75}{key\-Set\-Dir()}.

The defaults are defined with the macros K\-D\-B\-\_\-\-F\-I\-L\-E\-\_\-\-M\-O\-D\-E and K\-D\-B\-\_\-\-D\-I\-R\-\_\-\-M\-O\-D\-E.

For more information about the mode permissions see \hyperlink{group__keymeta_mode}{Modes}.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
mode permissions of the key 

K\-D\-B\-\_\-\-F\-I\-L\-E\-\_\-\-M\-O\-D\-E as defaults 

(mode\-\_\-t)-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}{key\-Set\-Mode()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga57689eb5691679071463b777ae786ae9}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-M\-Time@{key\-Get\-M\-Time}}
\index{key\-Get\-M\-Time@{key\-Get\-M\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-M\-Time}]{\setlength{\rightskip}{0pt plus 5cm}time\-\_\-t key\-Get\-M\-Time (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga57689eb5691679071463b777ae786ae9}
Get last modification time of the key on disk.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000012}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


You will get 0 when the key was not read already.

Everytime you change value or comment and \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()} the key the mtime will be updated. When you \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} the key, the atime is set appropriate.

Not changed keys may not even passed to kdb\-Set\-\_\-backend() so it will not update this time, even after \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()}.

It is possible that other keys written to disc influence this time if the backend is not grained enough.

If you add or remove a key the key thereunder in the hierarchy will update the mtime if written with \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()} to disc.


\begin{DoxyParams}{Parameters}
{\em key} & Key to get information from. \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga481d8997187992fe4bbf288bc8ef4db7}{key\-Set\-M\-Time()} 
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
the last modification time 

(time\-\_\-t)-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\hypertarget{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Get\-U\-I\-D@{key\-Get\-U\-I\-D}}
\index{key\-Get\-U\-I\-D@{key\-Get\-U\-I\-D}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Get\-U\-I\-D}]{\setlength{\rightskip}{0pt plus 5cm}uid\-\_\-t key\-Get\-U\-I\-D (
\begin{DoxyParamCaption}
\item[{const Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}
Get the user I\-D of a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000003}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}
\hypertarget{group__keymeta_UID}{}\subsection{U\-I\-D}\label{group__keymeta_UID}
The user I\-D is a unique identification for every user present on a system. Keys will belong to root (0) as long as you did not get their real U\-I\-D with \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()}.

Although usually the same, the U\-I\-D of a key is not related to its owner.

A fresh key will have no U\-I\-D.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the system's U\-I\-D of the key 

(uid\-\_\-t)-\/1 on N\-U\-L\-L key 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}{key\-Get\-G\-I\-D()}, \hyperlink{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}{key\-Set\-U\-I\-D()}, \hyperlink{group__keyname_ga35922a017bee8b4bcb493bbdfad9d6f5}{key\-Get\-Owner()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga4c88342f580a4291455a801af71ce048}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Next\-Meta@{key\-Next\-Meta}}
\index{key\-Next\-Meta@{key\-Next\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Next\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}const Key$\ast$ key\-Next\-Meta (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga4c88342f580a4291455a801af71ce048}
Iterate to the next meta information.

Keys have an internal cursor that can be reset with \hyperlink{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}{key\-Rewind\-Meta()}. Every time \hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()} is called the cursor is incremented and the new current Name of Meta Information is returned.

You'll get a N\-U\-L\-L pointer if the meta information after the end of the Key was reached. On subsequent calls of \hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()} it will still return the N\-U\-L\-L pointer.

The {\ttfamily key} internal cursor will be changed, so it is not const.

\begin{DoxyNote}{Note}
That the resulting key is guaranteed to have a value, because meta information has no binary or null pointer semantics.

You must not delete or change the returned key, use \hyperlink{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{key\-Set\-Meta()} if you want to delete or change it.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a key representing meta information 

0 when the end is reached 

0 on N\-U\-L\-L pointer
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keyset_ga317321c9065b5a4b3e33fe1c399bcec9}{ks\-Next()} for pedant in iterator interface of Key\-Set 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Rewind\-Meta@{key\-Rewind\-Meta}}
\index{key\-Rewind\-Meta@{key\-Rewind\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Rewind\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Rewind\-Meta (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}
Rewind the internal iterator to first meta data.

Use it to set the cursor to the beginning of the Key Meta Infos. \hyperlink{group__keymeta_ga74a273f529030f4947df52e14fdd2869}{key\-Current\-Meta()} will then always return N\-U\-L\-L afterwards. So you want to \hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()} first.


\begin{DoxyCode}
Key *key;
\textcolor{keyword}{const} Key *meta;

\hyperlink{group__keymeta_ga5dbb669802eea27e106ee3a5e39717a9}{keyRewindMeta} (key);
\textcolor{keywordflow}{while} ((meta = \hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{keyNextMeta} (key))!=0)
\{
        printf (\textcolor{stringliteral}{"name: %s, value: %s"}, \hyperlink{group__keyname_ga8e805c726a60da921d3736cda7813513}{keyName}(meta), (\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)
      \hyperlink{group__keyvalue_ga6f29609c5da53c6dc26a98678d5752af}{keyValue}(meta));
\}
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

0 if there is no meta information for that key (\hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()} will always return 0 in that case) 

-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga4c88342f580a4291455a801af71ce048}{key\-Next\-Meta()}, \hyperlink{group__keymeta_ga74a273f529030f4947df52e14fdd2869}{key\-Current\-Meta()} 

\hyperlink{group__keyset_gabe793ff51f1728e3429c84a8a9086b70}{ks\-Rewind()} for pedant in iterator interface of Key\-Set 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga995d8b84731673c88c7c01f3fed538b9}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-A\-Time@{key\-Set\-A\-Time}}
\index{key\-Set\-A\-Time@{key\-Set\-A\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-A\-Time}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-A\-Time (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{time\-\_\-t}]{atime}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga995d8b84731673c88c7c01f3fed538b9}
Update the atime information for a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000011}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


When you do manual sync of keys you might also update the atime to make them indistinguishable.

It can also be useful if you work with keys not using a keydatabase.


\begin{DoxyParams}{Parameters}
{\em key} & The Key object to work with \\
\hline
{\em atime} & The new access time for the key \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga6b05da399c3c78904969ef39f191b0eb}{key\-Get\-A\-Time()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga9f502ecab8ab43f0b17220fcc95f3fa5}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-C\-Time@{key\-Set\-C\-Time}}
\index{key\-Set\-C\-Time@{key\-Set\-C\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-C\-Time}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-C\-Time (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{time\-\_\-t}]{ctime}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga9f502ecab8ab43f0b17220fcc95f3fa5}
Update the ctime information for a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000015}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em key} & The Key object to work with \\
\hline
{\em ctime} & The new change metadata time for the key \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga2c213c120cbe02201278ef7fb8cd94be}{key\-Get\-C\-Time()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_gaae575bd86a628a15ee45baa860522e75}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-Dir@{key\-Set\-Dir}}
\index{key\-Set\-Dir@{key\-Set\-Dir}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-Dir}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-Dir (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key}
\end{DoxyParamCaption}
)}}\label{group__keymeta_gaae575bd86a628a15ee45baa860522e75}
Set mode so that key will be recognized as directory.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000007}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


The function will add all executable bits.


\begin{DoxyItemize}
\item Mode 0200 will be translated to 0311
\item Mode 0400 will be translated to 0711
\item Mode 0664 will be translated to 0775
\end{DoxyItemize}

The macro K\-D\-B\-\_\-\-D\-I\-R\-\_\-\-M\-O\-D\-E (defined to 0111) will be used for that.

The executable bits show that child keys are allowed and listable. There is no way to have child keys which are not listable for anyone, but it is possible to restrict listing the keys to the owner only.


\begin{DoxyItemize}
\item Mode 0000 means that it is a key not read or writable to anyone.
\item Mode 0111 means that it is a directory not read or writable to anyone. But it is recognized as directory to anyone.
\end{DoxyItemize}

For more about mode see \hyperlink{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}{key\-Set\-Mode()}.

It is not possible to access keys below a not executable key. If a key is not writeable and executable \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()} will fail to access the keys below. If a key is not readable and executable \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()} will fail to access the keys below.


\begin{DoxyParams}{Parameters}
{\em key} & the key to set permissions to be recognized as directory. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L pointer 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}{key\-Set\-Mode()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-G\-I\-D@{key\-Set\-G\-I\-D}}
\index{key\-Set\-G\-I\-D@{key\-Set\-G\-I\-D}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-G\-I\-D}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-G\-I\-D (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{gid\-\_\-t}]{gid}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}
Set the group I\-D of a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000006}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


See \hyperlink{group__keymeta_GID}{G\-I\-D} for more information about group I\-Ds.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
{\em gid} & is the group I\-D \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L key 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}{key\-Get\-G\-I\-D()}, \hyperlink{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}{key\-Set\-U\-I\-D()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-Meta@{key\-Set\-Meta}}
\index{key\-Set\-Meta@{key\-Set\-Meta}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-Meta}]{\setlength{\rightskip}{0pt plus 5cm}ssize\-\_\-t key\-Set\-Meta (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{const char $\ast$}]{meta\-Name, }
\item[{const char $\ast$}]{new\-Meta\-String}
\end{DoxyParamCaption}
)}}\label{group__keymeta_gae1f15546b234ffb6007d8a31178652b9}
Set a new Meta-\/\-Information.

Will set a new Meta-\/\-Information pair consisting of meta\-Name and new\-Meta\-String.

Will add a new Pair for Meta-\/\-Information if meta\-Name was not added up to now.

It will modify a existing Pair of Meta-\/\-Information if the the meta\-Name was inserted already.

It will remove a meta information if new\-Meta\-String is 0.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
{\em meta\-Name} & the name of the meta information where you want to change the value \\
\hline
{\em new\-Meta\-String} & the new value for the meta information \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 on error if key or meta\-Name is 0, out of memory or names are not valid 

0 if the Meta-\/\-Information for meta\-Name was removed 

size ($>$0) of new\-Meta\-String if Meta-\/\-Information was successfully added 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga9ed3875495ddb3d8a8d29158a60a147c}{key\-Get\-Meta()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-Mode@{key\-Set\-Mode}}
\index{key\-Set\-Mode@{key\-Set\-Mode}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-Mode}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-Mode (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{mode\-\_\-t}]{mode}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga8803037e35b9da1ce492323a88ff6bc3}
Set the key mode permissions.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000009}{Deprecated}]This A\-P\-I is obsolete. It is only a mapping to key\-Set\-Meta(key, \char`\"{}mode\char`\"{}, str) which should be prefered.\end{DoxyRefDesc}


The mode consists of 9 individual bits for mode permissions. In the following explanation the octal notation with leading zero will be used.

Default is 0664 (octal) for keys and 0775 for directory keys which used \hyperlink{group__keymeta_gaae575bd86a628a15ee45baa860522e75}{key\-Set\-Dir()}.

The defaults are defined with the macros K\-D\-B\-\_\-\-F\-I\-L\-E\-\_\-\-M\-O\-D\-E and K\-D\-B\-\_\-\-D\-I\-R\-\_\-\-M\-O\-D\-E.

\begin{DoxyNote}{Note}
libelektra 0.\-7.\-0 only allows 0775 (directory keys) and 0664 (other keys). More will be added later in a sense of the description below.
\end{DoxyNote}
\hypertarget{group__keymeta_mode}{}\subsection{Modes}\label{group__keymeta_mode}
0000 is the most restrictive mode. No user might read, write or execute the key.

Reading the key means to get the value by \hyperlink{group__kdb_ga28e385fd9cb7ccfe0b2f1ed2f62453a1}{kdb\-Get()}.

Writing the key means to set the value by \hyperlink{group__kdb_ga11436b058408f83d303ca5e996832bcf}{kdb\-Set()}.

Execute the key means to make a step deeper in the hierarchy. But you must be able to read the key to be able to list the keys below. See also \hyperlink{group__keymeta_gaae575bd86a628a15ee45baa860522e75}{key\-Set\-Dir()} in that context. But you must be able to write the key to be able to add or remove keys below.

0777 is the most relaxing mode. Every user is allowed to read, write and execute the key, if he is allowed to execute and read all keys below.

0700 allows every action for the current user, identified by the uid. See \hyperlink{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}{key\-Get\-U\-I\-D()} and \hyperlink{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}{key\-Set\-U\-I\-D()}.

To be more specific for the user the single bits can elect the mode for read, write and execute. 0100 only allows executing which gives the information that it is a directory for that user, but not accessable. 0200 only allows reading. This information may be combined to 0300, which allows execute and reading of the directory. Last 0400 decides about the writing permissions.

The same as above is also valid for the 2 other octal digits. 0070 decides about the group permissions, in that case full access. Groups are identified by the gid. See \hyperlink{group__keymeta_ga46a95e81d7d7f4e3eb59e60e5f3738c0}{key\-Get\-G\-I\-D()} and \hyperlink{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}{key\-Set\-G\-I\-D()}. In that example everyone with a different uid, but the gid of the the key, has full access.

0007 decides about the world permissions. This is taken into account when neighter the uid nor the gid matches. So that example would allow everyone with a different uid and gid of that key gains full access.


\begin{DoxyParams}{Parameters}
{\em key} & the key to set mode permissions \\
\hline
{\em mode} & the mode permissions \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L key 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_gabc0cec592ce3b77e9bc33dbc8e8f6bdc}{key\-Get\-Mode()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_ga481d8997187992fe4bbf288bc8ef4db7}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-M\-Time@{key\-Set\-M\-Time}}
\index{key\-Set\-M\-Time@{key\-Set\-M\-Time}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-M\-Time}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-M\-Time (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{time\-\_\-t}]{mtime}
\end{DoxyParamCaption}
)}}\label{group__keymeta_ga481d8997187992fe4bbf288bc8ef4db7}
Update the mtime information for a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000013}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em key} & The Key object to work with \\
\hline
{\em mtime} & The new modification time for the key \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga57689eb5691679071463b777ae786ae9}{key\-Get\-M\-Time()} 
\end{DoxySeeAlso}
\hypertarget{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}{\index{Meta Info Manipulation Methods@{Meta Info Manipulation Methods}!key\-Set\-U\-I\-D@{key\-Set\-U\-I\-D}}
\index{key\-Set\-U\-I\-D@{key\-Set\-U\-I\-D}!Meta Info Manipulation Methods@{Meta Info Manipulation Methods}}
\subsubsection[{key\-Set\-U\-I\-D}]{\setlength{\rightskip}{0pt plus 5cm}int key\-Set\-U\-I\-D (
\begin{DoxyParamCaption}
\item[{Key $\ast$}]{key, }
\item[{uid\-\_\-t}]{uid}
\end{DoxyParamCaption}
)}}\label{group__keymeta_gab5f284f5ecd261e0a290095f50ba1af7}
Set the user I\-D of a key.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000004}{Deprecated}]This A\-P\-I is obsolete.\end{DoxyRefDesc}


See \hyperlink{group__keymeta_UID}{U\-I\-D} for more information about user I\-Ds.


\begin{DoxyParams}{Parameters}
{\em key} & the key object to work with \\
\hline
{\em uid} & the user I\-D to set \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success 

-\/1 on N\-U\-L\-L key or conversion error 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See Also}
\hyperlink{group__keymeta_ga9e3d0fb3f7ba906e067727b9155d22e3}{key\-Set\-G\-I\-D()}, \hyperlink{group__keymeta_gacaa5060e67b03f50ae49a3620c54bc46}{key\-Get\-U\-I\-D()}, \hyperlink{group__keyname_ga35922a017bee8b4bcb493bbdfad9d6f5}{key\-Get\-Owner()} 
\end{DoxySeeAlso}
