<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.14">
  <compounddef id="IPCComm_8h" kind="file" language="C++">
    <compoundname>IPCComm.h</compoundname>
    <includes refid="CommBase_8h" local="no">CommBase.h</includes>
    <includedby refid="communication_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/communication.h</includedby>
    <incdepgraph>
      <node id="203">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="204" relation="include">
        </childnode>
        <childnode refid="205" relation="include">
        </childnode>
      </node>
      <node id="198">
        <label>stdarg.h</label>
      </node>
      <node id="197">
        <label>stdlib.h</label>
      </node>
      <node id="199">
        <label>errno.h</label>
      </node>
      <node id="205">
        <label>stddef.h</label>
      </node>
      <node id="194">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="195" relation="include">
        </childnode>
        <childnode refid="196" relation="include">
        </childnode>
        <childnode refid="197" relation="include">
        </childnode>
        <childnode refid="198" relation="include">
        </childnode>
        <childnode refid="199" relation="include">
        </childnode>
        <childnode refid="200" relation="include">
        </childnode>
        <childnode refid="201" relation="include">
        </childnode>
        <childnode refid="203" relation="include">
        </childnode>
        <childnode refid="206" relation="include">
        </childnode>
      </node>
      <node id="192">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h</label>
        <link refid="IPCComm_8h"/>
        <childnode refid="193" relation="include">
        </childnode>
      </node>
      <node id="204">
        <label>wchar.h</label>
      </node>
      <node id="195">
        <label>string.h</label>
      </node>
      <node id="193">
        <label>CommBase.h</label>
        <link refid="CommBase_8h_source"/>
        <childnode refid="194" relation="include">
        </childnode>
      </node>
      <node id="206">
        <label>unistd.h</label>
      </node>
      <node id="201">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="202" relation="include">
        </childnode>
        <childnode refid="203" relation="include">
        </childnode>
      </node>
      <node id="200">
        <label>time.h</label>
      </node>
      <node id="202">
        <label>regex.h</label>
      </node>
      <node id="196">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="211">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.hpp</label>
        <link refid="PsiInterface_8hpp_source"/>
      </node>
      <node id="207">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h</label>
        <link refid="IPCComm_8h"/>
        <childnode refid="208" relation="include">
        </childnode>
      </node>
      <node id="209">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="210" relation="include">
        </childnode>
        <childnode refid="212" relation="include">
        </childnode>
      </node>
      <node id="212">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.h</label>
        <link refid="PsiInterface_8h_source"/>
      </node>
      <node id="210">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.hpp</label>
        <link refid="CisInterface_8hpp_source"/>
        <childnode refid="211" relation="include">
        </childnode>
      </node>
      <node id="208">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="209" relation="include">
        </childnode>
        <childnode refid="212" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="IPCComm_8h_1abbcbe304b5851213cbfba1197b205683" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void ipc_install_error</definition>
        <argsstring>()</argsstring>
        <name>ipc_install_error</name>
        <briefdescription>
<para>Flag for checking if this header has already been included. </para>        </briefdescription>
        <detaileddescription>
<para>Print error message about IPC library not being installed. </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="385" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="385" bodyend="387"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1ac1e7e2d384efc0bd2023b85ff16a6f55" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int free_ipc_comm</definition>
        <argsstring>(comm_t *x)</argsstring>
        <name>free_ipc_comm</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>x</declname>
        </param>
        <briefdescription>
<para>Perform deallocation for basic communicator. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para>comm_t* Pointer to communicator to deallocate. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 1 if there is an error, 0 otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="395" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="395" bodyend="402"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1af95dcab270d93c745e3bbd2376a59c7c" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int new_ipc_address</definition>
        <argsstring>(comm_t *comm)</argsstring>
        <name>new_ipc_address</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>comm</declname>
        </param>
        <briefdescription>
<para>Create a new channel. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">comm</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> * Comm structure initialized with new_comm_base. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if the address could not be created. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="410" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="410" bodyend="417"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1a77f786710a9bdd983acadb90376df311" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int init_ipc_comm</definition>
        <argsstring>(comm_t *comm)</argsstring>
        <name>init_ipc_comm</name>
        <param>
          <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
          <declname>comm</declname>
        </param>
        <briefdescription>
<para>Initialize a sysv_ipc communicator. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">comm</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> * Comm structure initialized with init_comm_base. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if the comm could not be initialized. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="425" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="425" bodyend="432"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1a70a1eab261f9446424933e469aff6475" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int ipc_comm_nmsg</definition>
        <argsstring>(const comm_t x)</argsstring>
        <name>ipc_comm_nmsg</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <briefdescription>
<para>Get number of messages in the comm. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> Communicator to check. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int Number of messages. -1 indicates an error. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="440" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="440" bodyend="447"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1ad6879ed4ed886f6e66b062e220741e29" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int ipc_comm_send</definition>
        <argsstring>(const comm_t x, const char *data, const size_t len)</argsstring>
        <name>ipc_comm_send</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>data</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>len</declname>
        </param>
        <briefdescription>
<para>Send a message to the comm. Send a message smaller than CIS_MSG_MAX bytes to an output comm. If the message is larger, it will not be sent. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> structure that comm should be sent to. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">data</parametername>
</parameternamelist>
<parameterdescription>
<para>character pointer to message that should be sent. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">len</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t length of message to be sent. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 0 if send succesfull, -1 if send unsuccessful. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="459" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="459" bodyend="468"/>
      </memberdef>
      <memberdef kind="function" id="IPCComm_8h_1ab0e1356e788610457b734a67e65e69ff" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int ipc_comm_recv</definition>
        <argsstring>(const comm_t x, char **data, const size_t len, const int allow_realloc)</argsstring>
        <name>ipc_comm_recv</name>
        <param>
          <type>const <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
          <declname>x</declname>
        </param>
        <param>
          <type>char **</type>
          <declname>data</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>len</declname>
        </param>
        <param>
          <type>const int</type>
          <declname>allow_realloc</declname>
        </param>
        <briefdescription>
<para>Receive a message from an input comm. Receive a message smaller than CIS_MSG_MAX bytes from an input comm. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">x</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__t" kindref="compound">comm_t</ref> structure that message should be sent to. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">data</parametername>
</parameternamelist>
<parameterdescription>
<para>char ** pointer to allocated buffer where the message should be saved. This should be a malloc&apos;d buffer if allow_realloc is 1. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">len</parametername>
</parameternamelist>
<parameterdescription>
<para>const size_t length of the allocated message buffer in bytes. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">allow_realloc</parametername>
</parameternamelist>
<parameterdescription>
<para>const int If 1, the buffer will be realloced if it is not large enought. Otherwise an error will be returned. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int -1 if message could not be received. Length of the received message if message was received. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" line="483" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h" bodystart="483" bodyend="494"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="2"><highlight class="preprocessor">#ifndef<sp/>CISIPCCOMM_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CISIPCCOMM_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>IPCINSTALLED</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;fcntl.h&gt;</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>For<sp/>O_*<sp/>constants<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/stat.h&gt;</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>For<sp/>mode<sp/>constants<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/msg.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/types.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/sem.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;sys/shm.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*IPCINSTALLED*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;CommBase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>use<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="keyword">extern</highlight><highlight class="normal"><sp/></highlight><highlight class="stringliteral">&quot;C&quot;</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>IPCINSTALLED</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>_cisChannelsCreated<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="24"><highlight class="preprocessor">#define<sp/>_cisTrackChannels<sp/>256</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>_cisChannelNames[_cisTrackChannels];<sp/></highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight><highlight class="comment">//static<sp/>char<sp/>*<sp/>_cisChannelNames[_cisTrackChannels];</highlight></codeline>
<codeline lineno="29"><highlight class="comment"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>_cisChannelsUsed<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>_ipc_rand_seeded<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">msgbuf_t<sp/>{</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>mtype;<sp/></highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>data[CIS_MSG_MAX];<sp/></highlight></codeline>
<codeline lineno="38"><highlight class="normal">}<sp/>msgbuf_t;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>check_channels(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>comm)<sp/>{</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Fail<sp/>if<sp/>name<sp/>is<sp/>empty</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(comm.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Cannot<sp/>create<sp/>channel<sp/>with<sp/>empty<sp/>name.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Fail<sp/>if<sp/>trying<sp/>to<sp/>re-use<sp/>the<sp/>same<sp/>channel<sp/>twice</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*key<sp/>=<sp/>comm.<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>_cisChannelsUsed;<sp/>i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(_cisChannelNames[i]<sp/>==<sp/>atoi(comm.<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>))<sp/>{</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>if<sp/>(0<sp/>==<sp/>strcmp(_cisChannelNames[i],<sp/>key))<sp/>{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Attempt<sp/>to<sp/>re-use<sp/>channel:<sp/>name=%s,<sp/>key=%s,<sp/>i=%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>comm.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>key,<sp/>i);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Fail<sp/>if<sp/>&gt;<sp/>_cisTrackChannels<sp/>channels<sp/>used</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(_cisChannelsUsed<sp/>&gt;=<sp/>_cisTrackChannels)<sp/>{</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Too<sp/>many<sp/>channels<sp/>in<sp/>use,<sp/>max:<sp/>%d&quot;</highlight><highlight class="normal">,<sp/>_cisTrackChannels);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="69"><highlight class="normal">};</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>add_channel(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>comm)<sp/>{</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>printf(&quot;add_channel(%s):<sp/>%d,<sp/>%s\n&quot;,<sp/>comm.name,<sp/>_cisChannelsUsed,<sp/>comm.address);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/>_cisChannelNames[_cisChannelsUsed++]<sp/>=<sp/>atoi(comm.<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="79"><highlight class="normal">};</highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>remove_comm(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>comm,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>close_comm)<sp/>{</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(close_comm)<sp/>{</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>msgctl(((</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)comm.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>)[0],<sp/>IPC_RMID,<sp/>NULL);</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>if<sp/>(ret<sp/>&lt;<sp/>0)<sp/>{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>cislog_error(&quot;remove_comm(%s):<sp/>Could<sp/>not<sp/>close<sp/>comm.&quot;,<sp/>comm.name);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>return<sp/>ret;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>}<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ich<sp/>=<sp/>atoi(comm.<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>_cisChannelsUsed;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ich<sp/>==<sp/>_cisChannelNames[i])<sp/>{</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>memmove(_cisChannelNames<sp/>+<sp/>i,<sp/>_cisChannelNames<sp/>+<sp/>i<sp/>+<sp/>1,</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(_cisTrackChannels<sp/>-<sp/>(i<sp/>+<sp/>1))*</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>_cisChannelsUsed--;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;remove_comm(%s):<sp/>Could<sp/>not<sp/>locate<sp/>comm<sp/>in<sp/>register.&quot;</highlight><highlight class="normal">,<sp/>comm.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>if<sp/>((ret<sp/>!=<sp/>-1)<sp/>&amp;&amp;<sp/>(ich<sp/>==<sp/>(int)(_cisChannelsUsed<sp/>-<sp/>1)))<sp/>{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>/\*<sp/>memmove(_cisChannelNames<sp/>+<sp/>ich,<sp/>_cisChannelNames<sp/>+<sp/>ich<sp/>+<sp/>1,<sp/>*\/<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>/\*<sp/><sp/><sp/><sp/><sp/><sp/>(_cisTrackChannels<sp/>-<sp/>(ich<sp/>+<sp/>1))*sizeof(char*));<sp/>*\/<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>_cisChannelsUsed--;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>}<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="120"><highlight class="normal">};</highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
<codeline lineno="127"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>new_ipc_address(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO:<sp/>small<sp/>chance<sp/>of<sp/>reusing<sp/>same<sp/>number</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>key<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!(_ipc_rand_seeded))<sp/>{</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/>srand(ptr2seed(comm));</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/>_ipc_rand_seeded<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(key<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/>key<sp/>=<sp/>rand();</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="comment">//<sp/>_cisChannelsUsed<sp/>+<sp/>1;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/></highlight><highlight class="stringliteral">&quot;tempnewIPC.%d&quot;</highlight><highlight class="normal">,<sp/>key);</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>check_channels(*comm);</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/>sprintf(comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>key);</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*fid<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fid<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;new_ipc_address:<sp/>Could<sp/>not<sp/>malloc<sp/>queue<sp/>fid.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/>fid[0]<sp/>=<sp/>msgget(key,<sp/>(IPC_CREAT<sp/>|<sp/>0777));</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fid[0]<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;new_ipc_address:<sp/>msgget(%d,<sp/>%d<sp/>|<sp/>0777)<sp/>ret(%d),<sp/>errno(%d):<sp/>%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>key,<sp/>IPC_CREAT,<sp/>fid[0],<sp/>errno,<sp/>strerror(errno));</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)fid;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/>add_channel(*comm);</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/>_cisChannelsCreated++;</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="162"><highlight class="normal">};</highlight></codeline>
<codeline lineno="163"><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>init_ipc_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(comm-&gt;<ref refid="structcomm__t_1afe8a58007e764fb3f2e906025f89fe72" kindref="member">valid</ref><sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(comm-&gt;<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/></highlight><highlight class="stringliteral">&quot;tempinitIPC.%s&quot;</highlight><highlight class="normal">,<sp/>comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>check_channels(*comm);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/>add_channel(*comm);</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>qkey<sp/>=<sp/>atoi(comm-&gt;<ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>);</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*fid<sp/>=<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fid<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_ipc_comm:<sp/>Could<sp/>not<sp/>malloc<sp/>queue<sp/>fid.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/>fid[0]<sp/>=<sp/>msgget(qkey,<sp/>0600);</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fid[0]<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_ipc_address:<sp/>msgget(%d,<sp/>0600)<sp/>ret(%d),<sp/>errno(%d):<sp/>%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>qkey,<sp/>fid[0],<sp/>errno,<sp/>strerror(errno));</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/>comm-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)fid;</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="195"><highlight class="normal">};</highlight></codeline>
<codeline lineno="196"><highlight class="normal"></highlight></codeline>
<codeline lineno="202"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="203"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>free_ipc_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*x)<sp/>{</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strcmp(x-&gt;<ref refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" kindref="member">direction</ref>,<sp/></highlight><highlight class="stringliteral">&quot;recv&quot;</highlight><highlight class="normal">)<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>remove_comm(*x,<sp/>1);</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>remove_comm(*x,<sp/>0);</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="214"><highlight class="normal">};</highlight></codeline>
<codeline lineno="215"><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_nmsg(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">msqid_ds<sp/>buf;</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref><sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;ipc_comm_nmsg:<sp/>Queue<sp/>handle<sp/>is<sp/>NULL.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rc<sp/>=<sp/>msgctl(((</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>)[0],<sp/>IPC_STAT,<sp/>&amp;buf);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rc<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>cislog_error(&quot;ipc_comm_nmsg:<sp/>Could<sp/>not<sp/>access<sp/>queue.&quot;);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>buf.msg_qnum;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="235"><highlight class="normal">};</highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="247"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_send(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send(%s):<sp/>%d<sp/>bytes&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>len);</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(comm_base_send(x,<sp/>data,<sp/>len)<sp/>==<sp/>-1)</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/>msgbuf_t<sp/>t;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/>t.mtype<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/>memcpy(t.data,<sp/>data,<sp/>len);</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>handle<sp/>=<sp/>((</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)(x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>))[0];</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(1)<sp/>{</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>msgsnd(handle,<sp/>&amp;t,<sp/>len,<sp/>IPC_NOWAIT);</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send(%s):<sp/>msgsnd<sp/>returned<sp/>%d&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ret);</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>0)<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ret<sp/>==<sp/>-1)<sp/>&amp;&amp;<sp/>(errno<sp/>==<sp/>EAGAIN))<sp/>{</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send(%s):<sp/>msgsnd,<sp/>sleep&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>usleep(CIS_SLEEP_TIME);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;ipc_comm_send:<sp/><sp/>msgsend(%d,<sp/>%p,<sp/>%d,<sp/>IPC_NOWAIT)<sp/>ret(%d),<sp/>errno(%d):<sp/>%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>,<sp/>&amp;t,<sp/>len,<sp/>ret,<sp/>errno,<sp/>strerror(errno));</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send(%s):<sp/>returning<sp/>%d&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ret);</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="272"><highlight class="normal">};</highlight></codeline>
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
<codeline lineno="286"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="287"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_recv(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len,</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>allow_realloc)<sp/>{</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s)&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/>msgbuf_t<sp/>t;</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/>t.mtype<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len_recv<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(1)<sp/>{</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>msgrcv(((</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>)[0],<sp/>&amp;t,<sp/>CIS_MSG_MAX,<sp/>0,<sp/>IPC_NOWAIT);</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>-1<sp/>&amp;&amp;<sp/>errno<sp/>==<sp/>ENOMSG)<sp/>{</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>no<sp/>input,<sp/>sleep&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>usleep(CIS_SLEEP_TIME);</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>received<sp/>input:<sp/>%d<sp/>bytes,<sp/>ret=%d&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>strlen(t.data),<sp/>ret);</highlight></codeline>
<codeline lineno="302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv:<sp/>msgrecv(%d,<sp/>%p,<sp/>%d,<sp/>0,<sp/>IPC_NOWAIT):<sp/>%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*)x.<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>,<sp/>&amp;t,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)CIS_MSG_MAX,<sp/>strerror(errno));</highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/>len_recv<sp/>=<sp/>ret<sp/>+<sp/>1;</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len_recv<sp/>&gt;<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)len)<sp/>{</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(allow_realloc)<sp/>{</highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>reallocating<sp/>buffer<sp/>from<sp/>%d<sp/>to<sp/>%d<sp/>bytes.&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)len,<sp/>len_recv);</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(*data)<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)realloc(*data,<sp/>len_recv);</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*data<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>failed<sp/>to<sp/>realloc<sp/>buffer.&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>buffer<sp/>(%d<sp/>bytes)<sp/>is<sp/>not<sp/>large<sp/>enough<sp/>for<sp/>message<sp/>(%d<sp/>bytes)&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>len,<sp/>len_recv);</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-(len_recv<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/>memcpy(*data,<sp/>t.data,<sp/>len_recv);</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/>(*data)[len_recv<sp/>-<sp/>1]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>len_recv<sp/>-<sp/>1;</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_recv(%s):<sp/>returns<sp/>%d<sp/>bytes&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>ret);</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="331"><highlight class="normal">};</highlight></codeline>
<codeline lineno="332"><highlight class="normal"></highlight></codeline>
<codeline lineno="344"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="345"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_send_nolimit(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len){</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send_nolimit(%s):<sp/>%d<sp/>bytes&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>len);</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>msgsiz<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>msg[CIS_MSG_MAX];</highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/>sprintf(msg,<sp/></highlight><highlight class="stringliteral">&quot;%ld&quot;</highlight><highlight class="normal">,<sp/>(</highlight><highlight class="keywordtype">long</highlight><highlight class="normal">)(len));</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>ipc_comm_send(x,<sp/>msg,<sp/>strlen(msg));</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send_nolimit(%s):<sp/>sending<sp/>size<sp/>of<sp/>payload<sp/>failed.&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>);</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>prev<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(prev<sp/>&lt;<sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((len<sp/>-<sp/>prev)<sp/>&gt;<sp/>CIS_MSG_MAX)</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>msgsiz<sp/>=<sp/>CIS_MSG_MAX;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>msgsiz<sp/>=<sp/>len<sp/>-<sp/>prev;</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>ipc_comm_send(x,<sp/>data<sp/>+<sp/>prev,<sp/>msgsiz);</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send_nolimit(%s):<sp/>send<sp/>interupted<sp/>at<sp/>%d<sp/>of<sp/>%d<sp/>bytes.&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)prev,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)len);</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/>prev<sp/>+=<sp/>msgsiz;</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send_nolimit(%s):<sp/>%d<sp/>of<sp/>%d<sp/>bytes<sp/>sent&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>prev,<sp/>len);</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;ipc_comm_send_nolimit(%s):<sp/>%d<sp/>bytes<sp/>completed&quot;</highlight><highlight class="normal">,<sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>len);</highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="375"><highlight class="normal">};</highlight></codeline>
<codeline lineno="376"><highlight class="normal"></highlight></codeline>
<codeline lineno="377"><highlight class="normal"></highlight></codeline>
<codeline lineno="378"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Definitions<sp/>in<sp/>the<sp/>case<sp/>where<sp/>IPC<sp/>libraries<sp/>not<sp/>installed</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="379"><highlight class="normal"></highlight><highlight class="preprocessor">#else<sp/></highlight><highlight class="comment">/*IPCINSTALLED*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="380"><highlight class="normal"></highlight></codeline>
<codeline lineno="384"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="385"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ipc_install_error()<sp/>{</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Compiler<sp/>flag<sp/>&apos;IPCINSTALLED&apos;<sp/>not<sp/>defined<sp/>so<sp/>IPC<sp/>bindings<sp/>are<sp/>disabled.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="387"><highlight class="normal">};</highlight></codeline>
<codeline lineno="388"><highlight class="normal"></highlight></codeline>
<codeline lineno="394"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="395"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>free_ipc_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*x)<sp/>{</highlight></codeline>
<codeline lineno="396"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="397"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="398"><highlight class="normal"><sp/><sp/>x;</highlight></codeline>
<codeline lineno="399"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1;</highlight></codeline>
<codeline lineno="402"><highlight class="normal">};</highlight></codeline>
<codeline lineno="403"><highlight class="normal"></highlight></codeline>
<codeline lineno="409"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="410"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>new_ipc_address(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="412"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/>comm;</highlight></codeline>
<codeline lineno="414"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="415"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="417"><highlight class="normal">};</highlight></codeline>
<codeline lineno="418"><highlight class="normal"></highlight></codeline>
<codeline lineno="424"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="425"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>init_ipc_comm(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*comm)<sp/>{</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="427"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/>comm;</highlight></codeline>
<codeline lineno="429"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="430"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="432"><highlight class="normal">};</highlight></codeline>
<codeline lineno="433"><highlight class="normal"></highlight></codeline>
<codeline lineno="439"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="440"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_nmsg(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x)<sp/>{</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="442"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/>x;</highlight></codeline>
<codeline lineno="444"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="445"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="447"><highlight class="normal">};</highlight></codeline>
<codeline lineno="448"><highlight class="normal"></highlight></codeline>
<codeline lineno="458"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="459"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_send(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="461"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/>x;</highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/>data;</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/>len;</highlight></codeline>
<codeline lineno="465"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="468"><highlight class="normal">};</highlight></codeline>
<codeline lineno="469"><highlight class="normal"></highlight></codeline>
<codeline lineno="482"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="483"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ipc_comm_recv(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>x,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>**data,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>len,</highlight></codeline>
<codeline lineno="484"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>allow_realloc)<sp/>{</highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Prevent<sp/>C4100<sp/>warning<sp/>on<sp/>windows<sp/>by<sp/>referencing<sp/>param</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="486"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/>x;</highlight></codeline>
<codeline lineno="488"><highlight class="normal"><sp/><sp/>data;</highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/>len;</highlight></codeline>
<codeline lineno="490"><highlight class="normal"><sp/><sp/>allow_realloc;</highlight></codeline>
<codeline lineno="491"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/>ipc_install_error();</highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="494"><highlight class="normal">};</highlight></codeline>
<codeline lineno="495"><highlight class="normal"></highlight></codeline>
<codeline lineno="496"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*IPCINSTALLED*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="497"><highlight class="normal"></highlight></codeline>
<codeline lineno="498"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__cplusplus<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>this<sp/>is<sp/>a<sp/>C++<sp/>compiler,<sp/>end<sp/>C<sp/>linkage<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="499"><highlight class="normal">}</highlight></codeline>
<codeline lineno="500"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="501"><highlight class="normal"></highlight></codeline>
<codeline lineno="502"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*CISIPCCOMM_H_*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h"/>
  </compounddef>
</doxygen>
