Esempio n. 1
0
int main(int argc, char* argv[])
{
	unsigned int len;

	len = sizeof(buf);
	memset(&vv, 0, sizeof(vv));
	memset(buf, 0xff, sizeof(buf));
	protocol_binary_write(&PROTOCOL_NAME(B), &vv, buf, &len);
	memset(&vv, 0xff, sizeof(vv));
	protocol_binary_read(&PROTOCOL_NAME(B), buf, &len, &vv);
	len = sizeof(buf);
	memset(buf, 0xff, sizeof(buf));
	protocol_text_write(&PROTOCOL_NAME(B), NULL, &vv, buf, &len);
	memset(&vv, 0xff, sizeof(vv));
	len = (unsigned int)strlen(buf);
	protocol_text_read(&PROTOCOL_NAME(B), NULL, buf, &len, &vv);

	protocol_parse(buf, &callback, NULL);
	return 0;
}
Esempio n. 2
0
void
generate_protocol_references (tree plist)
{
  tree lproto;

  /* Forward declare protocols referenced.  */
  for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
    {
      tree proto = TREE_VALUE (lproto);

      if (TREE_CODE (proto) == PROTOCOL_INTERFACE_TYPE
	  && PROTOCOL_NAME (proto))
	{
          if (! PROTOCOL_FORWARD_DECL (proto))
            PROTOCOL_FORWARD_DECL (proto) = (*runtime.protocol_decl) (proto);

          if (PROTOCOL_LIST (proto))
            generate_protocol_references (PROTOCOL_LIST (proto));
        }
    }
}