<?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="CommBase_8h" kind="file" language="C++">
    <compoundname>CommBase.h</compoundname>
    <includes refid="tools_8h" local="no">../tools.h</includes>
    <includedby refid="AsciiFileComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/AsciiFileComm.h</includedby>
    <includedby refid="AsciiTableComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/AsciiTableComm.h</includedby>
    <includedby refid="ClientComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h</includedby>
    <includedby refid="communication_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/communication.h</includedby>
    <includedby refid="DefaultComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/DefaultComm.h</includedby>
    <includedby refid="IPCComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h</includedby>
    <includedby refid="RPCComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/RPCComm.h</includedby>
    <includedby refid="ServerComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/ServerComm.h</includedby>
    <includedby refid="ZMQComm_8h" local="no">/root/cis_interface/cis_interface/cis_interface/communication/ZMQComm.h</includedby>
    <incdepgraph>
      <node id="109">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="110" relation="include">
        </childnode>
        <childnode refid="111" relation="include">
        </childnode>
      </node>
      <node id="104">
        <label>stdarg.h</label>
      </node>
      <node id="103">
        <label>stdlib.h</label>
      </node>
      <node id="105">
        <label>errno.h</label>
      </node>
      <node id="111">
        <label>stddef.h</label>
      </node>
      <node id="100">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="101" relation="include">
        </childnode>
        <childnode refid="102" relation="include">
        </childnode>
        <childnode refid="103" relation="include">
        </childnode>
        <childnode refid="104" relation="include">
        </childnode>
        <childnode refid="105" relation="include">
        </childnode>
        <childnode refid="106" relation="include">
        </childnode>
        <childnode refid="107" relation="include">
        </childnode>
        <childnode refid="109" relation="include">
        </childnode>
        <childnode refid="112" relation="include">
        </childnode>
      </node>
      <node id="110">
        <label>wchar.h</label>
      </node>
      <node id="101">
        <label>string.h</label>
      </node>
      <node id="99">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h</label>
        <link refid="CommBase_8h"/>
        <childnode refid="100" relation="include">
        </childnode>
      </node>
      <node id="112">
        <label>unistd.h</label>
      </node>
      <node id="107">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="108" relation="include">
        </childnode>
        <childnode refid="109" relation="include">
        </childnode>
      </node>
      <node id="106">
        <label>time.h</label>
      </node>
      <node id="108">
        <label>regex.h</label>
      </node>
      <node id="102">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="120">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/AsciiTableComm.h</label>
        <link refid="AsciiTableComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="114">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/AsciiFileComm.h</label>
        <link refid="AsciiFileComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="118">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.hpp</label>
        <link refid="PsiInterface_8hpp_source"/>
      </node>
      <node id="125">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/IPCComm.h</label>
        <link refid="IPCComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="124">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ServerComm.h</label>
        <link refid="ServerComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="116">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="117" relation="include">
        </childnode>
        <childnode refid="119" relation="include">
        </childnode>
      </node>
      <node id="113">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h</label>
        <link refid="CommBase_8h"/>
        <childnode refid="114" relation="include">
        </childnode>
        <childnode refid="120" relation="include">
        </childnode>
        <childnode refid="121" relation="include">
        </childnode>
        <childnode refid="115" relation="include">
        </childnode>
        <childnode refid="122" relation="include">
        </childnode>
        <childnode refid="125" relation="include">
        </childnode>
        <childnode refid="123" relation="include">
        </childnode>
        <childnode refid="124" relation="include">
        </childnode>
        <childnode refid="126" relation="include">
        </childnode>
      </node>
      <node id="123">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/RPCComm.h</label>
        <link refid="RPCComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="119">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.h</label>
        <link refid="PsiInterface_8h_source"/>
      </node>
      <node id="126">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ZMQComm.h</label>
        <link refid="ZMQComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
        <childnode refid="122" relation="include">
        </childnode>
      </node>
      <node id="117">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.hpp</label>
        <link refid="CisInterface_8hpp_source"/>
        <childnode refid="118" relation="include">
        </childnode>
      </node>
      <node id="122">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/DefaultComm.h</label>
        <link refid="DefaultComm_8h_source"/>
        <childnode refid="121" relation="include">
        </childnode>
        <childnode refid="115" relation="include">
        </childnode>
        <childnode refid="123" relation="include">
        </childnode>
        <childnode refid="124" relation="include">
        </childnode>
      </node>
      <node id="121">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h</label>
        <link refid="ClientComm_8h_source"/>
        <childnode refid="115" relation="include">
        </childnode>
      </node>
      <node id="115">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="116" relation="include">
        </childnode>
        <childnode refid="119" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
    <innerclass refid="structcomm__t" prot="public">comm_t</innerclass>
      <sectiondef kind="define">
      <memberdef kind="define" id="CommBase_8h_1a56dcddd72d8c19188c3181c0a1f76809" prot="public" static="no">
        <name>COMM_NAME_SIZE</name>
        <initializer>100</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="16" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="16" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="CommBase_8h_1a2bef05e80467521164dff27cba239170" prot="public" static="no">
        <name>COMM_ADDRESS_SIZE</name>
        <initializer>500</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="17" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="17" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="CommBase_8h_1a8e9ccea0ad202afb94169e6f3359f679" prot="public" static="no">
        <name>COMM_DIR_SIZE</name>
        <initializer>100</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="18" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="18" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="enum">
      <memberdef kind="enum" id="CommBase_8h_1af683aded10b2a16782c4966c25a33450" prot="public" static="no" strong="no">
        <type></type>
        <name>comm_enum</name>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450aed3a8ffa4dccfffdb043090f15086c09" prot="public">
          <name>NULL_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a54e6ebe326083abe033bd54cb779a9d3" prot="public">
          <name>IPC_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a2d53dd06b1ba4bca4f20a92bb68a15cc" prot="public">
          <name>ZMQ_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a36af2b097e67b23bf8f5273c6ae1641f" prot="public">
          <name>RPC_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a829be00fafc8e31c8e62dc19ce09fd1e" prot="public">
          <name>SERVER_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a15fa0b2c48d87f03647a2fde027fcd70" prot="public">
          <name>CLIENT_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a21abb9467ee3c2a070249baa4b55c8b7" prot="public">
          <name>ASCII_FILE_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450ad76ee5e4218de51992675b38dc1314f2" prot="public">
          <name>ASCII_TABLE_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <enumvalue id="CommBase_8h_1af683aded10b2a16782c4966c25a33450a6df51d348db03e3a5c19c166f47e98d7" prot="public">
          <name>ASCII_TABLE_ARRAY_COMM</name>
          <briefdescription>
          </briefdescription>
          <detaileddescription>
          </detaileddescription>
        </enumvalue>
        <briefdescription>
<para>Flag for checking if this header has already been included. </para>        </briefdescription>
        <detaileddescription>
<para>Communicator types. </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="12" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="12" bodyend="14"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="typedef">
      <memberdef kind="typedef" id="CommBase_8h_1a3c5d8f12992a9000098e53ead535dc95" prot="public" static="no">
        <type>enum comm_enum</type>
        <definition>typedef enum comm_enum comm_type</definition>
        <argsstring></argsstring>
        <name>comm_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="35" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="15" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="CommBase_8h_1a9e9776c33278e6f0c3ea8e6baec0cee0" prot="public" static="no">
        <type>struct <ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
        <definition>typedef struct comm_t  comm_t</definition>
        <argsstring></argsstring>
        <name>comm_t</name>
        <briefdescription>
<para>Communication structure. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="42" column="1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="CommBase_8h_1ad60dcb2f80b1a025ef1237e17d5cbca2" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__t" kindref="compound">comm_t</ref></type>
        <definition>static comm_t empty_comm_base</definition>
        <argsstring>()</argsstring>
        <name>empty_comm_base</name>
        <briefdescription>
<para>Initialize an empty comm base without malloc. </para>        </briefdescription>
        <detaileddescription>
<para><simplesect kind="return"><para><ref refid="structcomm__t" kindref="compound">comm_t</ref> NULL comm object. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="50" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="50" bodyend="71"/>
      </memberdef>
      <memberdef kind="function" id="CommBase_8h_1a6c5040e4ce871e65a128f9d1f71a0611" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
        <definition>static comm_t* new_comm_base</definition>
        <argsstring>(char *address, const char *direction, const comm_type t, const void *seri_info)</argsstring>
        <name>new_comm_base</name>
        <param>
          <type>char *</type>
          <declname>address</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>direction</declname>
        </param>
        <param>
          <type>const comm_type</type>
          <declname>t</declname>
        </param>
        <param>
          <type>const void *</type>
          <declname>seri_info</declname>
        </param>
        <briefdescription>
<para>Initialize a basic communicator with address info. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">address</parametername>
</parameternamelist>
<parameterdescription>
<para>char * Address for new comm. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">direction</parametername>
</parameternamelist>
<parameterdescription>
<para>Direction that messages will go through the comm. Values include &quot;recv&quot; and &quot;send&quot;. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">t</parametername>
</parameternamelist>
<parameterdescription>
<para>comm_type Type of comm that should be created. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">seri_info</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to info for the serializer (e.g. format string). </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>comm_t* Address of comm structure. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="83" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="83" bodyend="111"/>
      </memberdef>
      <memberdef kind="function" id="CommBase_8h_1a7ced21a0d26b84f7c74c57c2379a00f5" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__t" kindref="compound">comm_t</ref> *</type>
        <definition>static comm_t* init_comm_base</definition>
        <argsstring>(const char *name, const char *direction, const comm_type t, const void *seri_info)</argsstring>
        <name>init_comm_base</name>
        <param>
          <type>const char *</type>
          <declname>name</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>direction</declname>
        </param>
        <param>
          <type>const comm_type</type>
          <declname>t</declname>
        </param>
        <param>
          <type>const void *</type>
          <declname>seri_info</declname>
        </param>
        <briefdescription>
<para>Initialize a basic communicator. The name is used to locate the comm address stored in the associated environment variable. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">name</parametername>
</parameternamelist>
<parameterdescription>
<para>Name of environment variable that the queue address is stored in. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">direction</parametername>
</parameternamelist>
<parameterdescription>
<para>Direction that messages will go through the comm. Values include &quot;recv&quot; and &quot;send&quot;. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">t</parametername>
</parameternamelist>
<parameterdescription>
<para>comm_type Type of comm that should be created. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">seri_info</parametername>
</parameternamelist>
<parameterdescription>
<para>Format for formatting/parsing messages. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>comm_t* Address of comm structure. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="126" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="126" bodyend="158"/>
      </memberdef>
      <memberdef kind="function" id="CommBase_8h_1ae357dfd93668036ad964da446a1aa1ce" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int free_comm_base</definition>
        <argsstring>(comm_t *x)</argsstring>
        <name>free_comm_base</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><ref refid="structcomm__t" kindref="compound">comm_t</ref> * Pointer to communicator to deallocate. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>int 1 if there is and error, 0 otherwise. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" line="166" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="166" bodyend="192"/>
      </memberdef>
      <memberdef kind="function" id="CommBase_8h_1aa72d2216a47801109c9695da0d1791a6" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int comm_base_send</definition>
        <argsstring>(const comm_t x, const char *data, const size_t len)</argsstring>
        <name>comm_base_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/CommBase.h" line="204" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h" bodystart="204" bodyend="218"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="2"><highlight class="preprocessor">#ifndef<sp/>CISCOMMBASE_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CISCOMMBASE_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">#include<sp/>&lt;../tools.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><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="8"><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="9"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="keyword">enum</highlight><highlight class="normal"><sp/>comm_enum<sp/>{<sp/>NULL_COMM,<sp/>IPC_COMM,<sp/>ZMQ_COMM,</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RPC_COMM,<sp/>SERVER_COMM,<sp/>CLIENT_COMM,</highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ASCII_FILE_COMM,<sp/>ASCII_TABLE_COMM,<sp/>ASCII_TABLE_ARRAY_COMM<sp/>};</highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/>comm_enum<sp/>comm_type;</highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>COMM_NAME_SIZE<sp/>100</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>COMM_ADDRESS_SIZE<sp/>500</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>COMM_DIR_SIZE<sp/>100</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight></codeline>
<codeline lineno="23" refid="structcomm__t" refkind="compound"><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>{</highlight></codeline>
<codeline lineno="24" refid="structcomm__t_1a9bd691f3ae56e098b9edff7ad1628b3b" refkind="member"><highlight class="normal"><sp/><sp/>comm_type<sp/><ref refid="structcomm__t_1a9bd691f3ae56e098b9edff7ad1628b3b" kindref="member">type</ref>;<sp/></highlight></codeline>
<codeline lineno="25" refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>[COMM_NAME_SIZE];<sp/></highlight></codeline>
<codeline lineno="26" refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1aca2bf1fc2b62c779c50848501f31fbf0" kindref="member">address</ref>[COMM_ADDRESS_SIZE];<sp/></highlight></codeline>
<codeline lineno="27" refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a1940bbad161f8cf5f868ff4cf4e95cda" kindref="member">direction</ref>[COMM_DIR_SIZE];<sp/></highlight></codeline>
<codeline lineno="28" refid="structcomm__t_1afe8a58007e764fb3f2e906025f89fe72" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1afe8a58007e764fb3f2e906025f89fe72" kindref="member">valid</ref>;<sp/></highlight></codeline>
<codeline lineno="29" refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1ab7b58a54178acddc3f641e3a285aab7f" kindref="member">handle</ref>;<sp/></highlight></codeline>
<codeline lineno="30" refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1ac805f6f060d8a6d7be78e9e782d15fdd" kindref="member">info</ref>;<sp/></highlight></codeline>
<codeline lineno="31" refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="structseri__t" kindref="compound">seri_t</ref><sp/>*<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref>;<sp/></highlight></codeline>
<codeline lineno="32" refid="structcomm__t_1a9aecec459dff6ce20398f1c110f8f3f4" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a9aecec459dff6ce20398f1c110f8f3f4" kindref="member">maxMsgSize</ref>;<sp/></highlight></codeline>
<codeline lineno="33" refid="structcomm__t_1a9810578a787d8503b00bcb78a592073d" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a9810578a787d8503b00bcb78a592073d" kindref="member">always_send_header</ref>;<sp/></highlight></codeline>
<codeline lineno="34" refid="structcomm__t_1a87f3a39926576e049b9ddc0cbabc9c95" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a87f3a39926576e049b9ddc0cbabc9c95" kindref="member">index_in_register</ref>;<sp/></highlight></codeline>
<codeline lineno="35" refid="structcomm__t_1adc0fcb148259e9801f63e70f7945e31b" refkind="member"><highlight class="normal"><sp/><sp/>time_t<sp/>*<ref refid="structcomm__t_1adc0fcb148259e9801f63e70f7945e31b" kindref="member">last_send</ref>;<sp/></highlight></codeline>
<codeline lineno="36" refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref>;<sp/></highlight></codeline>
<codeline lineno="37" refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" kindref="member">recv_eof</ref>;<sp/></highlight></codeline>
<codeline lineno="38" refid="structcomm__t_1a7a90d80ee6c1826d0fc152dc3a3f61a1" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1a7a90d80ee6c1826d0fc152dc3a3f61a1" kindref="member">used</ref>;<sp/></highlight></codeline>
<codeline lineno="39" refid="structcomm__t_1a05095fa4451ed9085e2d23bb5304df10" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structcomm__t_1a05095fa4451ed9085e2d23bb5304df10" kindref="member">reply</ref>;<sp/></highlight></codeline>
<codeline lineno="40" refid="structcomm__t_1a2d004dd7203d970ac2f398a25276ad2f" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a2d004dd7203d970ac2f398a25276ad2f" kindref="member">is_file</ref>;<sp/></highlight></codeline>
<codeline lineno="41" refid="structcomm__t_1a9b44169ff04756e8802bb2510892cf56" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__t_1a9b44169ff04756e8802bb2510892cf56" kindref="member">is_work_comm</ref>;<sp/></highlight></codeline>
<codeline lineno="42"><highlight class="normal">}<sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref>;</highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>empty_comm_base()<sp/>{</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>ret;</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/>ret.type<sp/>=<sp/>NULL_COMM;</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/>ret.name[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/>ret.address[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/>ret.direction[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/>ret.valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/>ret.handle<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/>ret.info<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/>ret.serializer<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/>ret.maxMsgSize<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/>ret.always_send_header<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/>ret.index_in_register<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/>ret.last_send<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/>ret.sent_eof<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/>ret.recv_eof<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/>ret.used<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/>ret.reply<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/>ret.is_file<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/>ret.is_work_comm<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="71"><highlight class="normal">};</highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><ref refid="structcomm__t" kindref="compound">comm_t</ref>*<sp/>new_comm_base(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*address,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*direction,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>comm_type<sp/>t,</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*seri_info)<sp/>{</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref>*<sp/>ret<sp/>=<sp/>(<ref refid="structcomm__t" kindref="compound">comm_t</ref>*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structcomm__t" kindref="compound">comm_t</ref>));</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;new_comm_base:<sp/>Failed<sp/>to<sp/>malloc<sp/>comm.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/>ret[0]<sp/>=<sp/>empty_comm_base();</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/>ret-&gt;type<sp/>=<sp/>t;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/>ret-&gt;valid<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(address<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(ret-&gt;address,<sp/>address);</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(direction<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/>ret-&gt;valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(ret-&gt;direction,<sp/>direction);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/>ret-&gt;serializer<sp/>=<sp/>init_serializer(-1,<sp/>seri_info);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/>ret-&gt;maxMsgSize<sp/>=<sp/>CIS_MSG_MAX;</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/>ret-&gt;last_send<sp/>=<sp/>(time_t*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(time_t));</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/>ret-&gt;last_send[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/>ret-&gt;sent_eof<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="105"><highlight class="normal"><sp/><sp/>ret-&gt;recv_eof<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="106"><highlight class="normal"><sp/><sp/>ret-&gt;used<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="107"><highlight class="normal"><sp/><sp/>ret-&gt;sent_eof[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/>ret-&gt;recv_eof[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/>ret-&gt;used[0]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="111"><highlight class="normal">};</highlight></codeline>
<codeline lineno="112"><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="126"><highlight class="normal"><ref refid="structcomm__t" kindref="compound">comm_t</ref>*<sp/>init_comm_base(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*name,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*direction,</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>comm_type<sp/>t,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*seri_info)<sp/>{</highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>full_name[COMM_NAME_SIZE];</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*address<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(name<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(full_name,<sp/>name);</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(t<sp/>!=<sp/>RPC_COMM)<sp/>{</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((direction<sp/>!=<sp/>NULL)<sp/>&amp;&amp;<sp/>(strlen(direction)<sp/>&gt;<sp/>0))<sp/>{</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(is_send(direction))</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcat(full_name,<sp/></highlight><highlight class="stringliteral">&quot;_OUT&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(is_recv(direction))</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcat(full_name,<sp/></highlight><highlight class="stringliteral">&quot;_IN&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/>address<sp/>=<sp/>getenv(full_name);</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*ret<sp/>=<sp/>new_comm_base(address,<sp/>direction,<sp/>t,<sp/>seri_info);</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_comm_base:<sp/>Error<sp/>in<sp/>new_comm_base&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(name<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/>ret-&gt;valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(ret-&gt;name,<sp/>full_name);</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((strlen(ret-&gt;address)<sp/>==<sp/>0)<sp/>&amp;&amp;<sp/>(t<sp/>!=<sp/>SERVER_COMM)<sp/>&amp;&amp;<sp/>(t<sp/>!=<sp/>CLIENT_COMM))<sp/>{</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;init_comm_base:<sp/>%s<sp/>not<sp/>registered<sp/>as<sp/>environment<sp/>variable.\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>full_name);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/>ret-&gt;valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;init_comm_base(%s):<sp/>Done&quot;</highlight><highlight class="normal">,<sp/>ret-&gt;name);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="158"><highlight class="normal">};</highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight></codeline>
<codeline lineno="165"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>free_comm_base(<ref refid="structcomm__t" kindref="compound">comm_t</ref><sp/>*x)<sp/>{</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1adc0fcb148259e9801f63e70f7945e31b" kindref="member">last_send</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1adc0fcb148259e9801f63e70f7945e31b" kindref="member">last_send</ref>);</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1adc0fcb148259e9801f63e70f7945e31b" kindref="member">last_send</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref>);</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1a9c883133ed0ee04e11983dc7efbc8bfb" kindref="member">sent_eof</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" kindref="member">recv_eof</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" kindref="member">recv_eof</ref>);</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1a1d7418e5f54be56939a7f26b68a55f3d" kindref="member">recv_eof</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1a7a90d80ee6c1826d0fc152dc3a3f61a1" kindref="member">used</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1a7a90d80ee6c1826d0fc152dc3a3f61a1" kindref="member">used</ref>);</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1a7a90d80ee6c1826d0fc152dc3a3f61a1" kindref="member">used</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x-&gt;<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref><sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/>free_serializer(x-&gt;<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref>);</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/>free(x-&gt;<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref>);</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/>x-&gt;<ref refid="structcomm__t_1a2c1ca12d0df5193d4a023301aa156e8f" kindref="member">serializer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/>x-&gt;<ref refid="structcomm__t_1afe8a58007e764fb3f2e906025f89fe72" kindref="member">valid</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="192"><highlight class="normal">};</highlight></codeline>
<codeline lineno="193"><highlight class="normal"></highlight></codeline>
<codeline lineno="203"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="204"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>comm_base_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="205"><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="206"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/>x;</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/>data;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/>len;</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Make<sp/>sure<sp/>you<sp/>arn&apos;t<sp/>sending<sp/>a<sp/>message<sp/>that<sp/>is<sp/>too<sp/>big</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>CIS_MSG_MAX)<sp/>{</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;comm_base_send(%s):<sp/>message<sp/>too<sp/>large<sp/>for<sp/>single<sp/>packet<sp/>(CIS_MSG_MAX=%d,<sp/>len=%d)&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x.<ref refid="structcomm__t_1a0c8b237f48a50a181eab8447a87ec172" kindref="member">name</ref>,<sp/>CIS_MSG_MAX,<sp/>len);</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="218"><highlight class="normal">};</highlight></codeline>
<codeline lineno="219"><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><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="222"><highlight class="normal">}</highlight></codeline>
<codeline lineno="223"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="225"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*CISCOMMBASE_H_*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/communication/CommBase.h"/>
  </compounddef>
</doxygen>
