/* These routines allow writing an arbitrary marker with parameters. The only intended use is to emit COM or APPn markers after calling write_file_header and before calling write_frame_header. Other uses are not guaranteed to produce desirable results. Counting the parameter bytes properly is the caller's responsibility.  */
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
/* These routines allow writing an arbitrary marker with parameters. The only intended use is to emit COM or APPn markers after calling write_file_header and before calling write_frame_header. Other uses are not guaranteed to produce desirable results. Counting the parameter bytes properly is the caller's responsibility.  */
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
{
    if (datalen > (unsigned int)65533)
        ERREXIT(cinfo, JERR_BAD_LENGTH);
    emit_marker(cinfo, (JPEG_MARKER)marker);
    emit_2bytes(cinfo, (int)(datalen + 2));
}