MCPcopy Index your code
hub / github.com/GJDuck/e9patch / parseMessage

Function parseMessage

src/e9patch/e9api.cpp:787–822  ·  view source on GitHub ↗

* Parse the given message. */

Source from the content-addressed store, hash-verified

785 * Parse the given message.
786 */
787Binary *parseMessage(Binary *B, Message &msg)
788{
789 if (msg.method != METHOD_BINARY && B == nullptr)
790 error("failed to parse message stream; got \"%s\" message (id=%u) "
791 "before \"binary\" message", getMethodString(msg.method), msg.id);
792
793 switch (msg.method)
794 {
795 case METHOD_BINARY:
796 if (B != nullptr)
797 error("failed to parse message stream; got duplicate "
798 "\"binary\" message (id=%u)", msg.id);
799 return parseBinary(msg);
800 case METHOD_INSTRUCTION:
801 parseInstruction(B, msg);
802 return B;
803 case METHOD_PATCH:
804 parsePatch(B, msg);
805 return B;
806 case METHOD_EMIT:
807 parseEmit(B, msg);
808 return B;
809 case METHOD_RESERVE:
810 parseReserve(B, msg);
811 return B;
812 case METHOD_TRAMPOLINE:
813 parseTrampoline(B, msg);
814 return B;
815 case METHOD_OPTIONS:
816 parseOptions(B, msg);
817 return B;
818 default:
819 error("failed to parse message stream; got unknown message "
820 "method (id=%u)", msg.id);
821 }
822}
823

Callers 1

realMainFunction · 0.85

Calls 9

errorFunction · 0.85
getMethodStringFunction · 0.85
parseBinaryFunction · 0.85
parseInstructionFunction · 0.85
parseEmitFunction · 0.85
parseReserveFunction · 0.85
parsePatchFunction · 0.70
parseTrampolineFunction · 0.70
parseOptionsFunction · 0.70

Tested by

no test coverage detected