/* There are three reserved values for the TIF: 0, 99998 and 99999. These are trapped and displayed as an appropriate string. All other values are printed as a duration in hours, minutes and seconds.  */
static void format_tif(gchar *buf, guint32 value)
/* There are three reserved values for the TIF: 0, 99998 and 99999. These are trapped and displayed as an appropriate string. All other values are printed as a duration in hours, minutes and seconds.  */
static void format_tif(gchar *buf, guint32 value)
{
    guint32 hours;
    guint32 mins;
    guint32 secs;
    switch (value) {
    case 0:
        g_snprintf(buf, ITEM_LABEL_LENGTH, "Immediate Or Cancel (%u)", value);
        break;
    case 99998:
        g_snprintf(buf, ITEM_LABEL_LENGTH, "Market Hours (%u)", value);
        break;
    case 99999:
        g_snprintf(buf, ITEM_LABEL_LENGTH, "System Hours (%u)", value);
        break;
    default:
        hours = value / 3600;
        mins = (value % 3600) / 60;
        secs = value % 60;
        g_snprintf(buf, ITEM_LABEL_LENGTH,
                   "%uh %02um %02us (%u seconds)",
                   hours, mins, secs,
                   value);
        break;
    }
}