<?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="ascii__io_8c" kind="file" language="C++">
    <compoundname>ascii_io.c</compoundname>
    <includes local="no">stdio.h</includes>
    <includes local="no">stdlib.h</includes>
    <includes refid="CisInterface_8h" local="yes">CisInterface.h</includes>
    <incdepgraph>
      <node id="368">
        <label>stdint.h</label>
        <link refid="stdint_8h_source"/>
        <childnode refid="369" relation="include">
        </childnode>
        <childnode refid="370" relation="include">
        </childnode>
      </node>
      <node id="390">
        <label>AsciiTableComm.h</label>
        <link refid="AsciiTableComm_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="363">
        <label>stdarg.h</label>
      </node>
      <node id="357">
        <label>/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c</label>
        <link refid="ascii__io_8c"/>
        <childnode refid="358" relation="include">
        </childnode>
        <childnode refid="359" relation="include">
        </childnode>
        <childnode refid="360" relation="include">
        </childnode>
      </node>
      <node id="376">
        <label>../dataio/AsciiTable.h</label>
        <link refid="AsciiTable_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="377" relation="include">
        </childnode>
      </node>
      <node id="359">
        <label>stdlib.h</label>
      </node>
      <node id="364">
        <label>errno.h</label>
      </node>
      <node id="389">
        <label>AsciiFileComm.h</label>
        <link refid="AsciiFileComm_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="377" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="378">
        <label>AsciiTableSerialize.h</label>
        <link refid="AsciiTableSerialize_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="374" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="380">
        <label>ObjSerialize.h</label>
        <link refid="ObjSerialize_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
      </node>
      <node id="370">
        <label>stddef.h</label>
      </node>
      <node id="361">
        <label>../tools.h</label>
        <link refid="tools_8h_source"/>
        <childnode refid="362" relation="include">
        </childnode>
        <childnode refid="358" relation="include">
        </childnode>
        <childnode refid="359" relation="include">
        </childnode>
        <childnode refid="363" relation="include">
        </childnode>
        <childnode refid="364" relation="include">
        </childnode>
        <childnode refid="365" relation="include">
        </childnode>
        <childnode refid="366" relation="include">
        </childnode>
        <childnode refid="368" relation="include">
        </childnode>
        <childnode refid="371" relation="include">
        </childnode>
      </node>
      <node id="383">
        <label>IPCComm.h</label>
        <link refid="IPCComm_8h_source"/>
        <childnode refid="382" relation="include">
        </childnode>
      </node>
      <node id="375">
        <label>FormatSerialize.h</label>
        <link refid="FormatSerialize_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="374" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="387">
        <label>ServerComm.h</label>
        <link refid="ServerComm_8h_source"/>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="386" relation="include">
        </childnode>
        <childnode refid="381" relation="include">
        </childnode>
      </node>
      <node id="360">
        <label>CisInterface.h</label>
        <link refid="CisInterface_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="372" relation="include">
        </childnode>
        <childnode refid="377" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="373">
        <label>../serialize/serialize.h</label>
        <link refid="serialize_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="374" relation="include">
        </childnode>
        <childnode refid="375" relation="include">
        </childnode>
        <childnode refid="378" relation="include">
        </childnode>
        <childnode refid="379" relation="include">
        </childnode>
        <childnode refid="380" relation="include">
        </childnode>
      </node>
      <node id="377">
        <label>AsciiFile.h</label>
        <link refid="AsciiFile_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
      </node>
      <node id="379">
        <label>PlySerialize.h</label>
        <link refid="PlySerialize_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
      </node>
      <node id="381">
        <label>comm_header.h</label>
        <link refid="comm__header_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="376" relation="include">
        </childnode>
      </node>
      <node id="369">
        <label>wchar.h</label>
      </node>
      <node id="362">
        <label>string.h</label>
      </node>
      <node id="382">
        <label>CommBase.h</label>
        <link refid="CommBase_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
      </node>
      <node id="385">
        <label>RPCComm.h</label>
        <link refid="RPCComm_8h_source"/>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="386" relation="include">
        </childnode>
        <childnode refid="381" relation="include">
        </childnode>
      </node>
      <node id="371">
        <label>unistd.h</label>
      </node>
      <node id="384">
        <label>ZMQComm.h</label>
        <link refid="ZMQComm_8h_source"/>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="381" relation="include">
        </childnode>
      </node>
      <node id="386">
        <label>DefaultComm.h</label>
        <link refid="DefaultComm_8h_source"/>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="384" relation="include">
        </childnode>
      </node>
      <node id="366">
        <label>regex_posix.h</label>
        <link refid="regex__posix_8h_source"/>
        <childnode refid="367" relation="include">
        </childnode>
        <childnode refid="368" relation="include">
        </childnode>
      </node>
      <node id="365">
        <label>time.h</label>
      </node>
      <node id="374">
        <label>SerializeBase.h</label>
        <link refid="SerializeBase_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
      </node>
      <node id="388">
        <label>ClientComm.h</label>
        <link refid="ClientComm_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="386" relation="include">
        </childnode>
        <childnode refid="381" relation="include">
        </childnode>
      </node>
      <node id="372">
        <label>../communication/communication.h</label>
        <link refid="communication_8h_source"/>
        <childnode refid="361" relation="include">
        </childnode>
        <childnode refid="373" relation="include">
        </childnode>
        <childnode refid="381" relation="include">
        </childnode>
        <childnode refid="382" relation="include">
        </childnode>
        <childnode refid="383" relation="include">
        </childnode>
        <childnode refid="384" relation="include">
        </childnode>
        <childnode refid="385" relation="include">
        </childnode>
        <childnode refid="387" relation="include">
        </childnode>
        <childnode refid="388" relation="include">
        </childnode>
        <childnode refid="389" relation="include">
        </childnode>
        <childnode refid="390" relation="include">
        </childnode>
        <childnode refid="386" relation="include">
        </childnode>
      </node>
      <node id="367">
        <label>regex.h</label>
      </node>
      <node id="358">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="ascii__io_8c_1a403cf3149c084cea115b85c90721039a" prot="public" static="no">
        <name>BSIZE</name>
        <initializer>8192</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c" line="6" column="9" bodyfile="/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c" bodystart="6" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="ascii__io_8c_1a0ddf1224851353fc92bfbff6f499fa97" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int main</definition>
        <argsstring>(int argc, char *argv[])</argsstring>
        <name>main</name>
        <param>
          <type>int</type>
          <declname>argc</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>argv</declname>
          <array>[]</array>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c" line="9" column="1" bodyfile="/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c" bodystart="9" bodyend="122"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;stdio.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stdlib.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Include<sp/>interface<sp/>methods</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;CisInterface.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>BSIZE<sp/>8192<sp/>//<sp/>the<sp/>max</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>main(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>argc,</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*argv[]){</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>error_code<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="12"><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Input<sp/>&amp;<sp/>output<sp/>to<sp/>an<sp/>ASCII<sp/>file<sp/>line<sp/>by<sp/>line</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/>cisAsciiFileInput_t<sp/>FileInput<sp/>=<sp/>cisAsciiFileInput(</highlight><highlight class="stringliteral">&quot;inputC_file&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/>cisAsciiFileOutput_t<sp/>FileOutput<sp/>=<sp/>cisAsciiFileOutput(</highlight><highlight class="stringliteral">&quot;outputC_file&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Input<sp/>&amp;<sp/>output<sp/>from<sp/>a<sp/>table<sp/>row<sp/>by<sp/>row</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"><sp/><sp/>cisAsciiTableInput_t<sp/>TableInput<sp/>=<sp/>cisAsciiTableInput(</highlight><highlight class="stringliteral">&quot;inputC_table&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/>cisAsciiTableOutput_t<sp/>TableOutput<sp/>=<sp/>cisAsciiTableOutput(</highlight><highlight class="stringliteral">&quot;outputC_table&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;%5s\t%ld\t%3.1f\t%3.1lf%+3.1lfj\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="20"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Input<sp/>&amp;<sp/>output<sp/>from<sp/>a<sp/>table<sp/>as<sp/>an<sp/>array</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/>cisAsciiArrayInput_t<sp/>ArrayInput<sp/>=<sp/>cisAsciiArrayInput(</highlight><highlight class="stringliteral">&quot;inputC_array&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/>cisAsciiArrayOutput_t<sp/>ArrayOutput<sp/>=<sp/>cisAsciiArrayOutput(</highlight><highlight class="stringliteral">&quot;outputC_array&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;%5s\t%ld\t%3.1f\t%3.1lf%+3.1lfj\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Read<sp/>lines<sp/>from<sp/>ASCII<sp/>text<sp/>file<sp/>until<sp/>end<sp/>of<sp/>file<sp/>is<sp/>reached.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>As<sp/>each<sp/>line<sp/>is<sp/>received,<sp/>it<sp/>is<sp/>then<sp/>sent<sp/>to<sp/>the<sp/>output<sp/>ASCII<sp/>file.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;ascii_io(C):<sp/>Receiving/sending<sp/>ASCII<sp/>file.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*line<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)malloc(LINE_SIZE_MAX);</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Receive<sp/>a<sp/>single<sp/>line</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisRecv(FileInput,<sp/>&amp;line);</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>the<sp/>receive<sp/>was<sp/>succesful,<sp/>send<sp/>the<sp/>line<sp/>to<sp/>output</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;File:<sp/>%s&quot;</highlight><highlight class="normal">,<sp/>line);</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisSend(FileOutput,<sp/>line);</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;ascii_io(C):<sp/>ERROR<sp/>SENDING<sp/>LINE\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/>error_code<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>the<sp/>receive<sp/>was<sp/>not<sp/>succesful,<sp/>send<sp/>the<sp/>end-of-file<sp/>message<sp/>to</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>close<sp/>the<sp/>output<sp/>file.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;End<sp/>of<sp/>file<sp/>input<sp/>(C)\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(line)<sp/>free(line);</highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Read<sp/>rows<sp/>from<sp/>ASCII<sp/>table<sp/>until<sp/>end<sp/>of<sp/>file<sp/>is<sp/>reached.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>As<sp/>each<sp/>row<sp/>is<sp/>received,<sp/>it<sp/>is<sp/>then<sp/>sent<sp/>to<sp/>the<sp/>output<sp/>ASCII<sp/>table</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;ascii_io(C):<sp/>Receiving/sending<sp/>ASCII<sp/>table.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>name[BSIZE];</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>number;</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>value;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>comp_real,<sp/>comp_imag;</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Receive<sp/>a<sp/>single<sp/>row<sp/>with<sp/>values<sp/>stored<sp/>in<sp/>scalars<sp/>declared<sp/>locally</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisRecv(TableInput,<sp/>&amp;name,<sp/>&amp;number,<sp/>&amp;value,<sp/>&amp;comp_real,<sp/>&amp;comp_imag);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>the<sp/>receive<sp/>was<sp/>succesful,<sp/>send<sp/>the<sp/>values<sp/>to<sp/>output.<sp/>Formatting</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>is<sp/>taken<sp/>care<sp/>of<sp/>on<sp/>the<sp/>output<sp/>driver<sp/>side.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;Table:<sp/>%.5s,<sp/>%ld,<sp/>%3.1f,<sp/>%g%+gj\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>name,<sp/>number,<sp/>value,<sp/>comp_real,<sp/>comp_imag);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisSend(TableOutput,<sp/>name,<sp/>number,<sp/>value,<sp/>comp_real,<sp/>comp_imag);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;ascii_io(C):<sp/>ERROR<sp/>SENDING<sp/>ROW\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/>error_code<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>the<sp/>receive<sp/>was<sp/>not<sp/>succesful,<sp/>send<sp/>the<sp/>end-of-file<sp/>message<sp/>to</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>close<sp/>the<sp/>output<sp/>file.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;End<sp/>of<sp/>table<sp/>input<sp/>(C)\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Read<sp/>entire<sp/>array<sp/>from<sp/>ASCII<sp/>table<sp/>into<sp/>columns<sp/>that<sp/>are<sp/>dynamically</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>allocated.<sp/>The<sp/>returned<sp/>values<sp/>tells<sp/>us<sp/>the<sp/>number<sp/>of<sp/>elements<sp/>in<sp/>the</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>columns.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;Receiving/sending<sp/>ASCII<sp/>table<sp/>as<sp/>array.\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*name_arr<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*number_arr<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*value_arr<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*comp_real_arr<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*comp_imag_arr<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/>ret<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisRecv(ArrayInput,<sp/>&amp;name_arr,<sp/>&amp;number_arr,<sp/>&amp;value_arr,</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;comp_real_arr,<sp/>&amp;comp_imag_arr);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&gt;=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;Array:<sp/>(%d<sp/>rows)\n&quot;</highlight><highlight class="normal">,<sp/>ret);</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Print<sp/>each<sp/>line<sp/>in<sp/>the<sp/>array</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>ret;<sp/>i++)</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;%.5s,<sp/>%ld,<sp/>%3.1f,<sp/>%3.1lf%+3.1lfj\n&quot;</highlight><highlight class="normal">,<sp/>&amp;name_arr[5*i],<sp/>number_arr[i],</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value_arr[i],<sp/>comp_real_arr[i],<sp/>comp_imag_arr[i]);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Send<sp/>the<sp/>columns<sp/>in<sp/>the<sp/>array<sp/>to<sp/>output.<sp/>Formatting<sp/>is<sp/>handled<sp/>on<sp/>the</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>output<sp/>driver<sp/>side.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>cisSend(ArrayOutput,<sp/>ret,<sp/>name_arr,<sp/>number_arr,<sp/>value_arr,</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>comp_real_arr,<sp/>comp_imag_arr);</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;ascii_io(C):<sp/>ERROR<sp/>SENDING<sp/>ARRAY\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/>error_code<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;End<sp/>of<sp/>array<sp/>input<sp/>(C)\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>Free<sp/>dynamically<sp/>allocated<sp/>columns</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(name_arr)<sp/>free(name_arr);</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(number_arr)<sp/>free(number_arr);</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(value_arr)<sp/>free(value_arr);</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(comp_real_arr)<sp/>free(comp_real_arr);</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(comp_imag_arr)<sp/>free(comp_imag_arr);</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>error_code;</highlight></codeline>
<codeline lineno="122"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/root/cis_interface/cis_interface/cis_interface/examples/ascii_io/src/ascii_io.c"/>
  </compounddef>
</doxygen>
