/* * Append the end-of-file message. */ static void ap_eof() { strcpy(mp, " (END)"); setmp(); if (curr_ac + 1 < ac) { sprintf(mp, " - Next: %s", av[curr_ac+1]); setmp(); } }
/* * Append the "file N of M" message. */ static void ap_of() { if (ac <= 1) return; sprintf(mp, " (file %d of %d)", curr_ac+1, ac); setmp(); }
/* * Append the name of the current file (to the message buffer). */ static void ap_filename() { if (ispipe) return; strtcpy(mp, current_file, &message[sizeof(message)] - mp); setmp(); }
/* * Append the byte offset into the current file. */ static void ap_byte() { POSITION pos, len; pos = position(BOTTOM_PLUS_ONE); if (pos == NULL_POSITION) pos = ch_length(); if (pos != NULL_POSITION) { sprintf(mp, " byte %ld", (long)pos); setmp(); len = ch_length(); if (len > 0) { sprintf(mp, "/%ld", (long)len); setmp(); } } }
void MQFunctions::setmp(MQHCONN conn, MQHMSG hmsg, MQSMPO* options, MQCHARV* name, MQPD* propDesc, MQLONG type, MQLONG valueLength, MQBYTE* value) { MQLONG cc = MQCC_OK; MQLONG rc = MQRC_NONE; setmp(conn, hmsg, options, name, propDesc, type, valueLength, value, &cc, &rc); if ( cc != MQCC_OK ) { throw MQException("", "MQSETMP", cc, rc); } }
/* * Append the percentage into the current file. * If we cannot find the percentage and must_print is true, * use the byte offset. */ static void ap_percent(int must_print) { POSITION pos,len; pos = position(BOTTOM_PLUS_ONE); len = ch_length(); if (len > 0 && pos != NULL_POSITION) { sprintf(mp, " (%ld%%)", (100 * (long)pos) / len); setmp(); } else if (must_print) ap_byte(); }