title: call function in c++ to C
body: <p>how can i call this function in C ???</p>
  
  <p>decodeEvent(signal ? EVENT_SHORTPULSE : EVENT_SHORTSPACE);</p>
  
  <p>i think that is call with conditions ??</p>
  
  <p>i find it in this code :</p>
  
  <pre><code>void RC5::decodePulse(unsigned char signal, unsigned long period)
  {
      if (period &gt;= MIN_SHORT &amp;&amp; period &lt;= MAX_SHORT) {
          this-&gt;decodeEvent(signal ? EVENT_SHORTPULSE : EVENT_SHORTSPACE);
      } else if (period &gt;= MIN_LONG &amp;&amp; period &lt;= MAX_LONG) {
          this-&gt;decodeEvent(signal ? EVENT_LONGPULSE : EVENT_LONGSPACE);
      } else {
          // time period out of range, reset
          this-&gt;reset();
      }
  }
  
  void RC5::decodeEvent(unsigned char event)
  {
      // find next state, 2 bits
      unsigned char newState = (trans[this-&gt;state]&gt;&gt;event) &amp; 0x3;
      if (newState==this-&gt;state) {
          // no state change indicates error, reset
          this-&gt;reset();
      } else {
          this-&gt;state = newState;
          if (newState == STATE_MID0) {
              // always emit 0 when entering mid0 state
              this-&gt;command = (this-&gt;command&lt;&lt;1)+0;
              this-&gt;bits++;
          } else if (newState == STATE_MID1) {
              // always emit 1 when entering mid1 state
              this-&gt;command = (this-&gt;command&lt;&lt;1)+1;
              this-&gt;bits++;
          }
      }
  }
  </code></pre>