diff -ruN latest/doc/fileformats.txt work/doc/fileformats.txt --- latest/doc/fileformats.txt Wed Dec 31 19:00:00 1969 +++ work/doc/fileformats.txt Sat Feb 8 21:28:16 2003 @@ -0,0 +1,152 @@ ++========================================================================+ +| File formats for Walter de Jong's BBS100 | +| Written by georbit | +| 2003/02/08 | ++========================================================================+ + +============= + Definitions +============= + +Line: +----- +All message lines are terminated with the 0x0a character... there are no +0x0d characters in the format, at least not that the bbs software itself +generates. The code does check for both characters though and internally +chops them off for its own use. + +Multi-line Fields: +------------------ +Sometimes multiple lines are necessary to store data for one field, such +as message bodies themselves, or lists of usernames, or the room info field. +The important thing to note is that there are NO BLANK LINES within a field. + +Blank lines, in the strict sense (""), are field terminators. + +-------------------------- Example message body ----------------------- +Hi how are you?$ + $ +Please call me back$ +$ +Next field continues here: +----------------------------------------------------------------------- + +Note in the above example, the end of each line is marked by a dollar sign '$' +to make the spaces clear. + +The first "blank line" actually has a space. This is part of the message. +The second blank line has no space, and is therefore the end of the message +body. Following fields are free to exist following this. + + + +===================== + Message file format +===================== + +Line meanings: +-------------- +Line 1: mtime... time of post. This is a time_t variable defined in the +message struct in include/Message.h It is UTC. + +Line 2: a deleted flag, which is also a time_t variable: 0 = not deleted, +otherwise it holds the UTC timestamp that the message was deleted. + +Line 3: message flags. Valid bits are 0x7f and the value read from disk is +anded with this to make sure no improper bits are set. Valid bits are +defined in include/Message.h and are listed below: + + 0x01 - From Sysop + 0x02 - From Room aide + 0x04 - Reply + 0x08 - Forwarded + 0x10 - Deleted by Sysop + 0x20 - Deleted by Room aide + 0x40 - Deleted by Anonymouse user + +Line 4: From line. Lists the user this message is from. MAX_NAME size is +18 which means usernames cannot be longer than 17 characters. + +Line 5: Anon line. This is a username as well, and can be blank. I'm not +sure what the Anon user is... all examples I've seen have this field blank. + +Line 6: Deleted By. This is a username of the person who deleted the +message. Can be blank. + +Line 7: Subject line. May be empty. MAX_LINE is 80, therefore subject +cannot be longer than 79 characters. + +Line 8 to N: To lines. A list of usernames that this message is To. The +list is terminated by a blank line (""). + +Line N+1 to X: Message lines. A list of message lines that contain the body +of the message. The list is terminated by a blank line (""). + +Line X+1: Reply number. This is the message number that this message +replies to. I.e. You can find the reply by looking in the room directory and +loading the message number file. 0 means this is not a reply. + + +Thoughts on the message file format: +------------------------------------ +The usernames in the message file format are just plain names... there is no +database link, like user numbers, etc, in the BBS100 format. Maybe it does +some internal cross referencing based on the text name, but I would kinda +doubt that. + + + +====================== + RoomData File Format +====================== + +File names: +----------- +Each room directory contains a RoomData file, described below. The same +file format is used for the HomeData and MailData files as well. These +files are located inside each user's directory. + + +Line meanings: +-------------- +Line 1: Room name. String with a MAX_LINE length (80 bytes, 79 characters +and 1 NULL) + +Line 2: Room creation date. This is treated like a time_t variable +(actually an unsigned long is it's storage, not sure why) and the time is in +UTC. + +Line 3: Flags. Valid flags include the bits 0xFF. The following are +defined in include/Room.h: + + 0x01 - read only + 0x02 - room uses subject lines + 0x04 - room is invite only + 0x08 - allow anonymous posts + 0x10 - room is hidden + 0x20 - room cannot be zapped + 0x40 - room is a chatroom + 0x80 - home room + +Line 4: Room info has changed. This is an integer that gets incremented +each time the room's info has been modified. This allows a the bbs software +to determine whether a user has read it yet or not. +This field starts at 0 and is an unsigned value, so can wrap safely. + +Line 5 to N: Room info lines. This is just like a message body: a group of +lines terminated by a blank line (""). Any "blank" lines in the room info +must have at least one space in them (like " "). + +Line N+1 to X: List of room aides. This is a list of usernames, terminated +with a blank line (""). Room aides are not required. + +Line X+1 to Y: List of invited users. This is a list of usernames and is +terminated with a blank line as well (""). Again, this list can be empty +just like any other list-type field (a single "" makes it empty). + +Line Y+1 to Z: List of kicked users. Same list of username semantics. + +Line Z+1: (conditional field) Chat history. If this room has the CHATROOM +flag set, the remaining lines in the RoomData file contain the last few lines +of the chatroom's conversation. This field follows the same list semantics. +