<?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="comm__header_8h" kind="file" language="C++">
    <compoundname>comm_header.h</compoundname>
    <includes refid="tools_8h" local="no">../tools.h</includes>
    <includes refid="AsciiTable_8h" local="no">../dataio/AsciiTable.h</includes>
    <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="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="yes">/root/cis_interface/cis_interface/cis_interface/communication/ZMQComm.h</includedby>
    <incdepgraph>
      <node id="82">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="83" relation="include">
        </childnode>
        <childnode refid="84" relation="include">
        </childnode>
      </node>
      <node id="77">
        <label>stdarg.h</label>
      </node>
      <node id="86">
        <label>../dataio/AsciiTable.h</label>
        <link refid="AsciiTable_8h_source"/>
        <childnode refid="73" relation="include">
        </childnode>
        <childnode refid="87" relation="include">
        </childnode>
      </node>
      <node id="76">
        <label>stdlib.h</label>
      </node>
      <node id="78">
        <label>errno.h</label>
      </node>
      <node id="84">
        <label>stddef.h</label>
      </node>
      <node id="73">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="74" relation="include">
        </childnode>
        <childnode refid="75" relation="include">
        </childnode>
        <childnode refid="76" relation="include">
        </childnode>
        <childnode refid="77" relation="include">
        </childnode>
        <childnode refid="78" relation="include">
        </childnode>
        <childnode refid="79" relation="include">
        </childnode>
        <childnode refid="80" relation="include">
        </childnode>
        <childnode refid="82" relation="include">
        </childnode>
        <childnode refid="85" relation="include">
        </childnode>
      </node>
      <node id="87">
        <label>AsciiFile.h</label>
        <link refid="AsciiFile_8h_source"/>
        <childnode refid="73" relation="include">
        </childnode>
      </node>
      <node id="72">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h</label>
        <link refid="comm__header_8h"/>
        <childnode refid="73" relation="include">
        </childnode>
        <childnode refid="86" relation="include">
        </childnode>
      </node>
      <node id="83">
        <label>wchar.h</label>
      </node>
      <node id="74">
        <label>string.h</label>
      </node>
      <node id="85">
        <label>unistd.h</label>
      </node>
      <node id="80">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="81" relation="include">
        </childnode>
        <childnode refid="82" relation="include">
        </childnode>
      </node>
      <node id="79">
        <label>time.h</label>
      </node>
      <node id="81">
        <label>regex.h</label>
      </node>
      <node id="75">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
    <invincdepgraph>
      <node id="93">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.hpp</label>
        <link refid="PsiInterface_8hpp_source"/>
      </node>
      <node id="96">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ServerComm.h</label>
        <link refid="ServerComm_8h_source"/>
        <childnode refid="90" relation="include">
        </childnode>
      </node>
      <node id="91">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="92" relation="include">
        </childnode>
        <childnode refid="94" relation="include">
        </childnode>
      </node>
      <node id="88">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h</label>
        <link refid="comm__header_8h"/>
        <childnode refid="89" relation="include">
        </childnode>
        <childnode refid="90" relation="include">
        </childnode>
        <childnode refid="95" relation="include">
        </childnode>
        <childnode refid="96" relation="include">
        </childnode>
        <childnode refid="97" relation="include">
        </childnode>
      </node>
      <node id="95">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/RPCComm.h</label>
        <link refid="RPCComm_8h_source"/>
        <childnode refid="90" relation="include">
        </childnode>
      </node>
      <node id="94">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/PsiInterface.h</label>
        <link refid="PsiInterface_8h_source"/>
      </node>
      <node id="97">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ZMQComm.h</label>
        <link refid="ZMQComm_8h_source"/>
        <childnode refid="90" relation="include">
        </childnode>
        <childnode refid="98" relation="include">
        </childnode>
      </node>
      <node id="92">
        <label>/root/cis_interface/cis_interface/cis_interface/interface/CisInterface.hpp</label>
        <link refid="CisInterface_8hpp_source"/>
        <childnode refid="93" relation="include">
        </childnode>
      </node>
      <node id="98">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/DefaultComm.h</label>
        <link refid="DefaultComm_8h_source"/>
        <childnode refid="89" relation="include">
        </childnode>
        <childnode refid="90" relation="include">
        </childnode>
        <childnode refid="95" relation="include">
        </childnode>
        <childnode refid="96" relation="include">
        </childnode>
      </node>
      <node id="89">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/ClientComm.h</label>
        <link refid="ClientComm_8h_source"/>
        <childnode refid="90" relation="include">
        </childnode>
      </node>
      <node id="90">
        <label>/root/cis_interface/cis_interface/cis_interface/communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="91" relation="include">
        </childnode>
        <childnode refid="94" relation="include">
        </childnode>
      </node>
    </invincdepgraph>
    <innerclass refid="structcomm__head__t" prot="public">comm_head_t</innerclass>
      <sectiondef kind="define">
      <memberdef kind="define" id="comm__header_8h_1a06cc9f43079ea46df4eba4e897909c5b" prot="public" static="no">
        <name>CIS_MSG_HEAD</name>
        <initializer>&quot;CIS_MSG_HEAD&quot;</initializer>
        <briefdescription>
<para>Flag for checking if this header has already been included. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="12" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="12" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="comm__header_8h_1a8f0dfff3eb9e9d505a4abaf2070b0662" prot="public" static="no">
        <name>HEAD_VAL_SEP</name>
        <initializer>&quot;:CIS:&quot;</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="13" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="13" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="comm__header_8h_1ac0230d0a3fce4f1ca074025ebace3044" prot="public" static="no">
        <name>HEAD_KEY_SEP</name>
        <initializer>&quot;,CIS,&quot;</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="14" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="14" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="comm__header_8h_1a4eefb568b178b65c8a7decb3aa234be2" prot="public" static="no">
        <name>COMMBUFFSIZ</name>
        <initializer>2000</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="15" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="15" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="typedef">
      <memberdef kind="typedef" id="comm__header_8h_1aaeec7eb21a199cf8867cf87dfcf7b4af" prot="public" static="no">
        <type>struct <ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
        <definition>typedef struct comm_head_t  comm_head_t</definition>
        <argsstring></argsstring>
        <name>comm_head_t</name>
        <briefdescription>
<para>Header information passed by comms for multipart messages. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="36" column="1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="comm__header_8h_1a3a8a49d7d9ae5abf895186bd75fb69c8" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
        <definition>static comm_head_t init_header</definition>
        <argsstring>(const size_t size, const char *address, const char *id)</argsstring>
        <name>init_header</name>
        <param>
          <type>const size_t</type>
          <declname>size</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>address</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>id</declname>
        </param>
        <briefdescription>
<para>Initialize a header struct. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">size</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of message to be sent. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">address</parametername>
</parameternamelist>
<parameterdescription>
<para>char* Address that should be used for remainder of message following this header if it is a multipart message. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">id</parametername>
</parameternamelist>
<parameterdescription>
<para>char* Message ID. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref> Structure with provided information, char arrays correctly initialized to empty strings if NULLs provided. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="48" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="48" bodyend="75"/>
      </memberdef>
      <memberdef kind="function" id="comm__header_8h_1ab24ff015a4e16d6f5955463a4bf77bad" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int format_header_entry</definition>
        <argsstring>(char *head, const char *key, const char *value, const size_t headsiz)</argsstring>
        <name>format_header_entry</name>
        <param>
          <type>char *</type>
          <declname>head</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>key</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>value</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>headsiz</declname>
        </param>
        <briefdescription>
<para>Format single key, value pair into header. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="out">head</parametername>
</parameternamelist>
<parameterdescription>
<para>char * Buffer where key, value pair should be written. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">key</parametername>
</parameternamelist>
<parameterdescription>
<para>const char * Key to be written. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">value</parametername>
</parameternamelist>
<parameterdescription>
<para>const char * Value to be written. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">headsiz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of head buffer. returns: int Number of characters written. </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="86" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="86" bodyend="95"/>
      </memberdef>
      <memberdef kind="function" id="comm__header_8h_1ac4f164d9f1965c85e826f7a7d90bb500" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int parse_header_entry</definition>
        <argsstring>(const char *head, const char *key, char *value, const size_t valsiz)</argsstring>
        <name>parse_header_entry</name>
        <param>
          <type>const char *</type>
          <declname>head</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>key</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>value</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>valsiz</declname>
        </param>
        <briefdescription>
<para>Extract header value for a given key. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">head</parametername>
</parameternamelist>
<parameterdescription>
<para>const char * Header string. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">key</parametername>
</parameternamelist>
<parameterdescription>
<para>const char * Key that should be extracted. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">value</parametername>
</parameternamelist>
<parameterdescription>
<para>char * buffer where value should be stored. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">valsiz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of value buffer. returns: int size of value if it could be found, -1 otherwise. </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="106" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="106" bodyend="148"/>
      </memberdef>
      <memberdef kind="function" id="comm__header_8h_1a56e1f09b860a618ad124f75fe331e083" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>int</type>
        <definition>static int format_comm_header</definition>
        <argsstring>(const comm_head_t head, char *buf, const size_t bufsiz)</argsstring>
        <name>format_comm_header</name>
        <param>
          <type>const <ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
          <declname>head</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>bufsiz</declname>
        </param>
        <briefdescription>
<para>Format header to a string. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">head</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref> Header to be formatted. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="out">buf</parametername>
</parameternamelist>
<parameterdescription>
<para>char * Buffer where header should be written. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">bufsiz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of buf. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>: int Size of header written. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="159" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="159" bodyend="299"/>
      </memberdef>
      <memberdef kind="function" id="comm__header_8h_1a15f4ea198e9f1e33c28553f31991536a" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref></type>
        <definition>static comm_head_t parse_comm_header</definition>
        <argsstring>(const char *buf, const size_t bufsiz)</argsstring>
        <name>parse_comm_header</name>
        <param>
          <type>const char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>const size_t</type>
          <declname>bufsiz</declname>
        </param>
        <briefdescription>
<para>Extract header information from a string. </para>        </briefdescription>
        <detaileddescription>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername direction="in">buf</parametername>
</parameternamelist>
<parameterdescription>
<para>const char* Message that header should be extracted from. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername direction="in">bufsiz</parametername>
</parameternamelist>
<parameterdescription>
<para>size_t Size of buf. </para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>: <ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref> Header information structure. </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" line="308" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h" bodystart="308" bodyend="389"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="2"><highlight class="preprocessor">#ifndef<sp/>CISCOMMHEADER_H_</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CISCOMMHEADER_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><highlight class="preprocessor">#include<sp/>&lt;../dataio/AsciiTable.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><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="9"><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="10"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>CIS_MSG_HEAD<sp/>&quot;CIS_MSG_HEAD&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>HEAD_VAL_SEP<sp/>&quot;:CIS:&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>HEAD_KEY_SEP<sp/>&quot;,CIS,&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>COMMBUFFSIZ<sp/>2000</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight></codeline>
<codeline lineno="19" refid="structcomm__head__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__head__t" kindref="compound">comm_head_t</ref><sp/>{</highlight></codeline>
<codeline lineno="20" refid="structcomm__head__t_1a61721f46c3f5850a5e65e28d497da0fb" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a61721f46c3f5850a5e65e28d497da0fb" kindref="member">size</ref>;<sp/></highlight></codeline>
<codeline lineno="21" refid="structcomm__head__t_1af762f3a390be988bb2f9dca01a7b5bb5" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1af762f3a390be988bb2f9dca01a7b5bb5" kindref="member">address</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="22" refid="structcomm__head__t_1a6f14ffcda4738e5e4b498b05a802f293" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a6f14ffcda4738e5e4b498b05a802f293" kindref="member">multipart</ref>;<sp/></highlight></codeline>
<codeline lineno="23" refid="structcomm__head__t_1a981bda83ada0637a0153dcd6c46420f0" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a981bda83ada0637a0153dcd6c46420f0" kindref="member">bodysiz</ref>;<sp/></highlight></codeline>
<codeline lineno="24" refid="structcomm__head__t_1a5e01ad7e302f5597bccfcf208cdcbe0a" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a5e01ad7e302f5597bccfcf208cdcbe0a" kindref="member">bodybeg</ref>;<sp/></highlight></codeline>
<codeline lineno="25" refid="structcomm__head__t_1a541f991a66b2422bec7b1cc25b5dd567" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a541f991a66b2422bec7b1cc25b5dd567" kindref="member">valid</ref>;<sp/></highlight></codeline>
<codeline lineno="26" refid="structcomm__head__t_1ade03bb53d07aaffff906db9a8d95da02" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">id</highlight><highlight class="normal">[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="27" refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" kindref="member">response_address</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="28" refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" kindref="member">request_id</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="29" refid="structcomm__head__t_1a4d963ff774cc3537d8944856b2365c6a" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a4d963ff774cc3537d8944856b2365c6a" kindref="member">serializer_type</ref>;<sp/></highlight></codeline>
<codeline lineno="30" refid="structcomm__head__t_1acfddb7dfc30cd546036af32cab2295e2" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1acfddb7dfc30cd546036af32cab2295e2" kindref="member">format_str</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="31" refid="structcomm__head__t_1a15efa818f71d8712b6f3270ca3c45ef1" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a15efa818f71d8712b6f3270ca3c45ef1" kindref="member">field_names</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="32" refid="structcomm__head__t_1ac2d45e0c1ac6a748e1516bfac30f359b" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1ac2d45e0c1ac6a748e1516bfac30f359b" kindref="member">field_units</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="33" refid="structcomm__head__t_1a68f4fd55f648414958edcd564be498b7" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a68f4fd55f648414958edcd564be498b7" kindref="member">as_array</ref>;<sp/></highlight></codeline>
<codeline lineno="34" refid="structcomm__head__t_1a81034ab274964279115f5ce7669f055b" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a81034ab274964279115f5ce7669f055b" kindref="member">zmq_reply</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="35" refid="structcomm__head__t_1a1367a9bb9ef1938d87897ab5685b01ef" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t_1a1367a9bb9ef1938d87897ab5685b01ef" kindref="member">zmq_reply_worker</ref>[COMMBUFFSIZ];<sp/></highlight></codeline>
<codeline lineno="36"><highlight class="normal">}<sp/><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref>;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>init_header(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>size,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></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/>*</highlight><highlight class="keywordtype">id</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>out;</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/>out.size<sp/>=<sp/>size;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/>out.multipart<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/>out.bodysiz<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/>out.bodybeg<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/>out.valid<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(address<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/>out.address[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(out.address,<sp/>address);</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">id</highlight><highlight class="normal"><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/>out.id[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(out.id,<sp/></highlight><highlight class="keywordtype">id</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/>out.response_address[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/>out.request_id[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/>out.serializer_type<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/>out.format_str[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/>out.as_array<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/>out.zmq_reply[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/>out.zmq_reply_worker[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>if<sp/>(response_address<sp/>==<sp/>NULL)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>out.response_address[0]<sp/>=<sp/>&apos;\0&apos;;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>else<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>strcpy(out.response_address,<sp/>response_address);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="75"><highlight class="normal">};</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>format_header_entry(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*head,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*key,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*value,</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><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">size_t</highlight><highlight class="normal"><sp/>headsiz)<sp/>{</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret<sp/>=<sp/>snprintf(head,<sp/>headsiz,<sp/></highlight><highlight class="stringliteral">&quot;%s%s%s%s&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>key,<sp/>HEAD_VAL_SEP,<sp/>value,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)headsiz)<sp/>{</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;format_header_entry:<sp/>Formatted<sp/>header<sp/>is<sp/>larger<sp/>than<sp/>bufer.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="95"><highlight class="normal">};</highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight></codeline>
<codeline lineno="105"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>parse_header_entry(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*head,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*key,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*value,</highlight></codeline>
<codeline lineno="107"><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/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>valsiz)<sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Compile</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="110"><highlight class="comment"><sp/><sp/>if<sp/>(strlen(HEAD_KEY_SEP)<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="111"><highlight class="comment"><sp/><sp/><sp/><sp/>cislog_error(&quot;parse_header_entry:<sp/>HEAD_KEY_SEP<sp/>is<sp/>more<sp/>than<sp/>one<sp/>character.<sp/>Fix<sp/>regex.&quot;);</highlight></codeline>
<codeline lineno="112"><highlight class="comment"><sp/><sp/><sp/><sp/>return<sp/>-1;</highlight></codeline>
<codeline lineno="113"><highlight class="comment"><sp/><sp/><sp/><sp/>}<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>regex_text[200];</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/>regex_text[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/>key);</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/>HEAD_VAL_SEP);</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/></highlight><highlight class="stringliteral">&quot;([^(&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/></highlight><highlight class="stringliteral">&quot;)]*)&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/>strcat(regex_text,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>substring</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*sind<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>*eind<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_sub_matches<sp/>=<sp/>find_matches(regex_text,<sp/>head,<sp/>&amp;sind,<sp/>&amp;eind);</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Loop<sp/>until<sp/>string<sp/>done</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n_sub_matches<sp/>&lt;<sp/>2)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;parse_header_entry:<sp/>Could<sp/>not<sp/>find<sp/>match<sp/>to<sp/>%s<sp/>in<sp/>%s.&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>regex_text,<sp/>head);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sind<sp/>!=<sp/>NULL)<sp/>free(sind);</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eind<sp/>!=<sp/>NULL)<sp/>free(eind);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>substring</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>value_size<sp/>=<sp/>eind[1]<sp/>-<sp/>sind[1];</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(value_size<sp/>&gt;<sp/>valsiz)<sp/>{</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;parse_header_entry:<sp/>Value<sp/>is<sp/>larger<sp/>than<sp/>buffer.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sind<sp/>!=<sp/>NULL)<sp/>free(sind);</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eind<sp/>!=<sp/>NULL)<sp/>free(eind);</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/>memcpy(value,<sp/>head<sp/>+<sp/>sind[1],<sp/>value_size);</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/>value[value_size]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sind<sp/>!=<sp/>NULL)<sp/>free(sind);</highlight></codeline>
<codeline lineno="146"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eind<sp/>!=<sp/>NULL)<sp/>free(eind);</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)value_size;</highlight></codeline>
<codeline lineno="148"><highlight class="normal">};</highlight></codeline>
<codeline lineno="149"><highlight class="normal"></highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight></codeline>
<codeline lineno="158"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="159"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>format_comm_header(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>head,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*buf,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>bufsiz)<sp/>{</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>pos;</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Header<sp/>tag</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/>pos<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/>strcpy(buf,<sp/>CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/>pos<sp/>+=<sp/>strlen(CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(pos<sp/>&gt;<sp/>bufsiz)<sp/>{</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;First<sp/>header<sp/>tag<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Address<sp/>entry</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1af762f3a390be988bb2f9dca01a7b5bb5" kindref="member">address</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;address&quot;</highlight><highlight class="normal">,<sp/>head.<ref refid="structcomm__head__t_1af762f3a390be988bb2f9dca01a7b5bb5" kindref="member">address</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>address<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Size<sp/>entry</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>size_str[100];</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/>sprintf(size_str,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)(head.<ref refid="structcomm__head__t_1a61721f46c3f5850a5e65e28d497da0fb" kindref="member">size</ref>));</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;size&quot;</highlight><highlight class="normal">,<sp/>size_str,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="184"><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="185"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>size<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1ade03bb53d07aaffff906db9a8d95da02" kindref="member">id</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;id&quot;</highlight><highlight class="normal">,<sp/>head.<ref refid="structcomm__head__t_1ade03bb53d07aaffff906db9a8d95da02" kindref="member">id</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>id<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>REQUEST_ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" kindref="member">request_id</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;request_id&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a80b9979899d06f21b7f996c1a119e665" kindref="member">request_id</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>request_id<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</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/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>RESPONSE_ADDRESS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" kindref="member">response_address</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;response_address&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a5a1970e9fb2c1087c001345603ab5c2b" kindref="member">response_address</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>response_address<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Serializer<sp/>type</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(head.<ref refid="structcomm__head__t_1a4d963ff774cc3537d8944856b2365c6a" kindref="member">serializer_type</ref><sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>stype_str[100];</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(stype_str,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>head.<ref refid="structcomm__head__t_1a4d963ff774cc3537d8944856b2365c6a" kindref="member">serializer_type</ref>);</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;stype&quot;</highlight><highlight class="normal">,<sp/>stype_str,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>stype<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Serializer<sp/>format_str</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1acfddb7dfc30cd546036af32cab2295e2" kindref="member">format_str</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;format_str&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1acfddb7dfc30cd546036af32cab2295e2" kindref="member">format_str</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>format_str<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Serializer<sp/>as_array</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(head.<ref refid="structcomm__head__t_1a68f4fd55f648414958edcd564be498b7" kindref="member">as_array</ref><sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>as_array_str[100];</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/>sprintf(as_array_str,<sp/></highlight><highlight class="stringliteral">&quot;%d&quot;</highlight><highlight class="normal">,<sp/>head.<ref refid="structcomm__head__t_1a68f4fd55f648414958edcd564be498b7" kindref="member">as_array</ref>);</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;as_array&quot;</highlight><highlight class="normal">,<sp/>as_array_str,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>as_array<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>ZMQ<sp/>Reply<sp/>address</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1a81034ab274964279115f5ce7669f055b" kindref="member">zmq_reply</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;zmq_reply&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a81034ab274964279115f5ce7669f055b" kindref="member">zmq_reply</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>zmq_reply<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>ZMQ<sp/>Reply<sp/>address<sp/>for<sp/>worker</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strlen(head.<ref refid="structcomm__head__t_1a1367a9bb9ef1938d87897ab5685b01ef" kindref="member">zmq_reply_worker</ref>)<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>format_header_entry(buf<sp/>+<sp/>pos,<sp/></highlight><highlight class="stringliteral">&quot;zmq_reply_worker&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>head.<ref refid="structcomm__head__t_1a1367a9bb9ef1938d87897ab5685b01ef" kindref="member">zmq_reply_worker</ref>,<sp/>bufsiz<sp/>-<sp/>pos);</highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Adding<sp/>zmq_reply_worker<sp/>entry<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/>ret;</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Closing<sp/>header<sp/>tag</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/>pos<sp/>-=<sp/>strlen(HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/>buf[pos]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/>pos<sp/>+=<sp/>strlen(CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(pos<sp/>&gt;<sp/>bufsiz)<sp/>{</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;Closing<sp/>header<sp/>tag<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/>strcat(buf,<sp/>CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>//<sp/>Body<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>if<sp/>(head.body<sp/>!=<sp/>NULL)<sp/>{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>pos<sp/>+=<sp/>head.bodysiz;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>if<sp/>(pos<sp/>&gt;<sp/>bufsiz)<sp/>{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/>cislog_error(&quot;Adding<sp/>body<sp/>would<sp/>exceed<sp/>buffer<sp/>size\n&quot;);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/><sp/>return<sp/>-1;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>}<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>memcpy(buf,<sp/>head.body,<sp/>head.bodysiz);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/>buf[pos]<sp/>=<sp/>&apos;\0&apos;;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>}<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">)pos;</highlight></codeline>
<codeline lineno="299"><highlight class="normal">};</highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="308"><highlight class="normal"><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>parse_comm_header(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*buf,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>bufsiz)<sp/>{</highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><ref refid="structcomm__head__t" kindref="compound">comm_head_t</ref><sp/>out<sp/>=<sp/>init_header(0,<sp/>NULL,<sp/>NULL);</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>sind,<sp/>eind;</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="312"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>_WIN32</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Windows<sp/>regex<sp/>of<sp/>newline<sp/>is<sp/>buggy</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>sind1,<sp/>eind1,<sp/>sind2,<sp/>eind2;</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_head_tag[COMMBUFFSIZ];</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/>sprintf(re_head_tag,<sp/></highlight><highlight class="stringliteral">&quot;(%s)&quot;</highlight><highlight class="normal">,<sp/>CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>find_match(re_head_tag,<sp/>buf,<sp/>&amp;sind1,<sp/>&amp;eind1);</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/>sind<sp/>=<sp/>sind1;</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>find_match(re_head_tag,<sp/>buf<sp/>+<sp/>eind1,<sp/>&amp;sind2,<sp/>&amp;eind2);</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>eind<sp/>=<sp/>eind1<sp/>+<sp/>eind2;</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="324"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>just<sp/>header</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>re_head[COMMBUFFSIZ]<sp/>=<sp/>CIS_MSG_HEAD;</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/>strcat(re_head,<sp/></highlight><highlight class="stringliteral">&quot;(.*)&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/>strcat(re_head,<sp/>CIS_MSG_HEAD);</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>strcat(re_head,<sp/>&quot;.*&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>find_match(re_head,<sp/>buf,<sp/>&amp;sind,<sp/>&amp;eind);</highlight></codeline>
<codeline lineno="331"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="332"><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="333"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;parse_comm_header:<sp/>could<sp/>not<sp/>find<sp/>header<sp/>in<sp/>&apos;%.1000s&apos;&quot;</highlight><highlight class="normal">,<sp/>buf);</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/>out.valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/>cislog_debug(</highlight><highlight class="stringliteral">&quot;parse_comm_header:<sp/>No<sp/>header<sp/>in<sp/>&apos;%.1000s...&apos;&quot;</highlight><highlight class="normal">,<sp/>buf);</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/>out.multipart<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/>out.size<sp/>=<sp/>bufsiz;</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="341"><highlight class="normal"><sp/><sp/><sp/><sp/>out.multipart<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>just<sp/>header</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>headsiz<sp/>=<sp/>(eind-sind);</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/>out.bodysiz<sp/>=<sp/>bufsiz<sp/>-<sp/>headsiz;</highlight></codeline>
<codeline lineno="345"><highlight class="normal"><sp/><sp/><sp/><sp/>out.bodybeg<sp/>=<sp/>eind;</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><sp/><sp/>headsiz<sp/>-=<sp/>(2*strlen(CIS_MSG_HEAD));</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*head<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)malloc(headsiz<sp/>+<sp/>2*strlen(HEAD_KEY_SEP)<sp/>+<sp/>1);</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/>strcpy(head,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/>memcpy(head<sp/>+<sp/>strlen(HEAD_KEY_SEP),<sp/>buf<sp/>+<sp/>sind<sp/>+<sp/>strlen(CIS_MSG_HEAD),<sp/>headsiz);</highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/>head[headsiz<sp/>+<sp/>strlen(HEAD_KEY_SEP)]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/>strcat(head,<sp/>HEAD_KEY_SEP);</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>address</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;address&quot;</highlight><highlight class="normal">,<sp/>out.address,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>size</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>size_str[COMMBUFFSIZ];</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;size&quot;</highlight><highlight class="normal">,<sp/>size_str,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>cislog_error(</highlight><highlight class="stringliteral">&quot;parse_comm_header:<sp/>could<sp/>not<sp/>find<sp/>size<sp/>in<sp/>header&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out.valid<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>free(head);</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/>out.size<sp/>=<sp/>atoi(size_str);</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>id<sp/>&amp;<sp/>response<sp/>address</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;id&quot;</highlight><highlight class="normal">,<sp/>out.id,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;response_address&quot;</highlight><highlight class="normal">,<sp/>out.response_address,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;request_id&quot;</highlight><highlight class="normal">,<sp/>out.request_id,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>serializer<sp/>type</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>stype_str[COMMBUFFSIZ];</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;stype&quot;</highlight><highlight class="normal">,<sp/>stype_str,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out.serializer_type<sp/>=<sp/>atoi(stype_str);</highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>as_array<sp/>serialization<sp/>parameter</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>array_str[COMMBUFFSIZ];</highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;as_array&quot;</highlight><highlight class="normal">,<sp/>array_str,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>out.as_array<sp/>=<sp/>atoi(array_str);</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Extract<sp/>serializer<sp/>information</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;format_str&quot;</highlight><highlight class="normal">,<sp/>out.format_str,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;field_names&quot;</highlight><highlight class="normal">,<sp/>out.field_names,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;field_units&quot;</highlight><highlight class="normal">,<sp/>out.field_units,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>ZMQ<sp/>reply<sp/>addresses</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;zmq_reply&quot;</highlight><highlight class="normal">,<sp/>out.zmq_reply,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>parse_header_entry(head,<sp/></highlight><highlight class="stringliteral">&quot;zmq_reply_worker&quot;</highlight><highlight class="normal">,<sp/>out.zmq_reply_worker,<sp/>COMMBUFFSIZ);</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Free<sp/>header</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/>free(head);</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>out;</highlight></codeline>
<codeline lineno="389"><highlight class="normal">};</highlight></codeline>
<codeline lineno="390"><highlight class="normal"></highlight></codeline>
<codeline lineno="391"><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="392"><highlight class="normal">}</highlight></codeline>
<codeline lineno="393"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="394"><highlight class="normal"></highlight></codeline>
<codeline lineno="395"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*CISCOMMHEADER_H_*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/communication/comm_header.h"/>
  </compounddef>
</doxygen>
