Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add zg_message_to_string to ZenGarden.h

  • Loading branch information...
commit 4196bf7815793801d74c9b7beb6e92a2e1a118ce 1 parent 5b190cd
Martin Roth authored
8 src/PdMessage.cpp
@@ -343,9 +343,7 @@ char *PdMessage::toString() {
343 343 lengths[i] = snprintf(NULL, 0, "%s", getSymbol(i));
344 344 break;
345 345 }
346   - default: {
347   - break;
348   - }
  346 + default: break;
349 347 }
350 348 // total length of our string is each atom plus a space, or \0 on the end
351 349 size += lengths[i] + 1;
@@ -373,9 +371,7 @@ char *PdMessage::toString() {
373 371 snprintf(&finalString[pos], lengths[i] + 1, "%s", getSymbol(i));
374 372 break;
375 373 }
376   - default: {
377   - break;
378   - }
  374 + default: break;
379 375 }
380 376 pos += lengths[i];
381 377 }
4 src/ZenGarden.cpp
@@ -476,3 +476,7 @@ float zg_message_get_float(PdMessage *message, unsigned int index) {
476 476 const char *zg_message_get_symbol(PdMessage *message, unsigned int index) {
477 477 return message->getSymbol(index);
478 478 }
  479 +
  480 +char *zg_message_to_string(ZGMessage *message) {
  481 + return message->toString();
  482 +}
3  src/ZenGarden.h
@@ -319,6 +319,9 @@ typedef enum ZGConnectionType {
319 319
320 320 const char *zg_message_get_symbol(ZGMessage *message, unsigned int index);
321 321
  322 + /** Returns a string representation of the message. The string must be freed by the caller. */
  323 + char *zg_message_to_string(ZGMessage *message);
  324 +
322 325
323 326 #ifdef __cplusplus
324 327 }

0 comments on commit 4196bf7

Please sign in to comment.
Something went wrong with that request. Please try again.