\section{C interface to DCOP}
\label{group__dcopc}\index{C interface to DCOP@{C interface to DCOP}}
\subsection*{Functions}
\begin{CompactItemize}
\item 
Bool {\bf DCOPClient::dcop\_\-attach} (void)
\item 
char $\ast$ {\bf DCOPClient::dcop\_\-register} (const char $\ast$app\_\-name, Bool add\_\-pid)
\item 
Bool {\bf DCOPClient::dcop\_\-detach} (void)
\item 
Bool {\bf DCOPClient::dcop\_\-register\_\-callback} (const char $\ast$object\_\-id, dcop\_\-callback\_\-t callback)
\item 
Bool {\bf DCOPClient::dcop\_\-send\_\-signal} (const char $\ast$receiving\_\-app, const char $\ast$object, const char $\ast$function, char $\ast$data, int data\_\-length)
\item 
Bool {\bf DCOPClient::dcop\_\-call} (const char $\ast$app\_\-name, const char $\ast$remote\_\-app\_\-name, const char $\ast$remote\_\-object\_\-id, const char $\ast$remote\_\-function, const char $\ast$data, int data\_\-length, char $\ast$$\ast$reply\_\-type, char $\ast$$\ast$reply\_\-data, int $\ast$reply\_\-data\_\-length)
\end{CompactItemize}


\subsection{Detailed Description}
dcop\_\-attach, dcop\_\-register, dcop\_\-detach, dcop\_\-register\_\-callback, dcop\_\-send\_\-signal, and dcop\_\-call make up the C interface to DCOP. 

\subsection{Function Documentation}
\index{dcopc@{dcopc}!dcop_attach@{dcop\_\-attach}}
\index{dcop_attach@{dcop\_\-attach}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bool dcop\_\-attach (void)\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga0}


Attach to the DCOP server. 

This registers you as anonymous-pid - you may then register with a 'real' name with {\bf dcop\_\-register()}{\rm (p.\,\pageref{group__dcopc_ga1})}. \index{dcopc@{dcopc}!dcop_register@{dcop\_\-register}}
\index{dcop_register@{dcop\_\-register}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char $\ast$ dcop\_\-register (const char $\ast$ {\em app\_\-name}, Bool {\em add\_\-pid})\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga1}


Register as app 'app\_\-name'. 

If add\_\-pid is true, you will be registered as app\_\-name-pid.

It might not be possible to give you the exact name you requested. In this case, the retval will be different to what you expect, so you should not rely on getting 'app\_\-name'.

If it was not possible to register, retval is 0. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\_\-name}]the name of the application. \item[{\em add\_\-pid}]the process id of the application \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the registered name, or 0 when the registration failed \end{Desc}
\index{dcopc@{dcopc}!dcop_detach@{dcop\_\-detach}}
\index{dcop_detach@{dcop\_\-detach}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bool dcop\_\-detach (void)\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga2}


Detach from the DCOP server. 

\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\index{dcopc@{dcopc}!dcop_register_callback@{dcop\_\-register\_\-callback}}
\index{dcop_register_callback@{dcop\_\-register\_\-callback}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bool dcop\_\-register\_\-callback (const char $\ast$ {\em object\_\-id}, dcop\_\-callback\_\-t {\em callback})\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga3}


Register the callback function for an object id. 

This function should have signature dcop\_\-callback\_\-t. The name of the actual function that should be called is passed in the struct. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em object\_\-id}]the object id to register \item[{\em callback}]the callback for the object id \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\index{dcopc@{dcopc}!dcop_send_signal@{dcop\_\-send\_\-signal}}
\index{dcop_send_signal@{dcop\_\-send\_\-signal}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bool dcop\_\-send\_\-signal (const char $\ast$ {\em receiving\_\-app}, const char $\ast$ {\em object}, const char $\ast$ {\em function}, char $\ast$ {\em data}, int {\em data\_\-length})\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga4}


Send a signal to a DCOP object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em receiving\_\-app}]Name the target application is registered under. Note that you may use wildcards here. For example, you could send to all 'konsole' objects that are registered using the '-pid' extension with \char`\"{}konsole-$\ast$\char`\"{}.\item[{\em object}]Name of the remote object. \item[{\em function}]Name of the function to call. \item[{\em data}]Marshalled arguments to pass to function. \item[{\em data\_\-length}]Number of octets in data. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\index{dcopc@{dcopc}!dcop_call@{dcop\_\-call}}
\index{dcop_call@{dcop\_\-call}!dcopc@{dcopc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Bool dcop\_\-call (const char $\ast$ {\em app\_\-name}, const char $\ast$ {\em remote\_\-app\_\-name}, const char $\ast$ {\em remote\_\-object\_\-id}, const char $\ast$ {\em remote\_\-function}, const char $\ast$ {\em data}, int {\em data\_\-length}, char $\ast$$\ast$ {\em reply\_\-type}, char $\ast$$\ast$ {\em reply\_\-data}, int $\ast$ {\em reply\_\-data\_\-length})\hspace{0.3cm}{\tt  [related, inherited]}}\label{group__dcopc_ga5}


Call a function of a DCOP object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\_\-name}]Name this application is registered under. \item[{\em remote\_\-app\_\-name}]Name the target application is registered under. \item[{\em remote\_\-object\_\-id}]Name of the remote object. \item[{\em remote\_\-function}]Name of the function to call. \item[{\em data}]Marshalled arguments to pass to function. \item[{\em data\_\-length}]Number of octets in data. \item[{\em reply\_\-type}]Will be set to type of retval, represented as a string. \item[{\em reply\_\-data}]Will be set to retval (marshalled). \item[{\em reply\_\-data\_\-length}]Will be set to number of octets in retval. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
