• Rob Swindell's avatar
    Add smb_msg_type() and smb_msg_count() for index-based msg counting. · a3e430e0
    Rob Swindell authored
    In support of message bases with vote-messages and poll-closures:
    
    smb_msg_type() returns an enum smb_msg_type inferred from the combination
    of attribute flags specified (should match msghdr_t.type).
    
    smb_msg_count() calculates the number of message index records of the
    specified type(s) (a bit-field) by reading the message base index file. This
    value should only used for info/display purposes, so no locking is performed
    to return the result as fast as possible.
    
    This allows an accurate number of "posts" (posted *messages*) to be queried
    and displayed to a user when appropriate (e.g. instead of
    smb.status.total_msgs or just the size of the index file divided by the size
    of an index record). In that case, since vote messages and poll closures
    aren't displayed as messages to users, exclude those from the count to reduce
    confusion. For message bases that don't support voting, this scheme is not
    necessary.
    a3e430e0