• src/smblib/smbdefs.h smblib.c smblib.h

    From Rob Swindell@1:103/705 to Git commit to sbbs/master on Sat Sep 26 13:38:58 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/a3e430e09c2f2ba36464173c
    Modified Files:
    src/smblib/smbdefs.h smblib.c smblib.h
    Log Message:
    Add smb_msg_type() and smb_msg_count() for index-based msg counting.In support of message bases with vote-messages and poll-closures:smb_msg_type() returns an
    enum smb_msg_type inferred from the combinationof attribute flags specified (should match msghdr_t.type).smb_msg_count() calculates the number of message index records of thespecified type(s) (a bit-field) by reading the message base
    index file. Thisvalue should only used for info/display purposes, so no locking
    is performedto return the result as fast as possible.This allows an accurate number of "posts" (posted *messages*) to be queriedand displayed to a user when
    appropriate (e.g. instead ofsmb.status.total_msgs or just the size of the index
    file divided by the sizeof an index record). In that case, since vote messages and poll closuresaren't displayed as messages to users, exclude those from the count to reduceconfusion. For message bases that don't support voting, this scheme is notnecessary.
    --- SBBSecho 3.11-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)