static const char *get_message_body(ScmObj msg, u_int *size) { if (SCM_UVECTORP(msg)) { *size = Scm_UVectorSizeInBytes(SCM_UVECTOR(msg)); return (const char*)SCM_UVECTOR_ELEMENTS(msg); } else if (SCM_STRINGP(msg)) { return Scm_GetStringContent(SCM_STRING(msg), size, NULL, NULL); } else { Scm_TypeError("socket message", "uniform vector or string", msg); *size = 0; /* dummy */ return NULL; } }
static const uint8_t* get_message_body(ScmObj msg, u_int *size) { if (SCM_UVECTORP(msg)) { *size = Scm_UVectorSizeInBytes(SCM_UVECTOR(msg)); return (const uint8_t*) SCM_UVECTOR_ELEMENTS(msg); } else if (SCM_STRINGP(msg)) { return (const uint8_t*)Scm_GetStringContent(SCM_STRING(msg), size, 0, 0); } else { Scm_TypeError("TLS message", "uniform vector or string", msg); *size = 0; return 0; } }