Making ListPlus switchable in WWIV part 3

In a previous post, I modified the Main Defaults screen to display the ListPlus Enabled switch status. This status simply reads the variable lp_options and shows whether the cfl_enable bit is on or off, which we had defined in an earlier post. I’ll write about what I did to give the WWIV BBS user the ability to toggle that bit.

Since I want ListPlus to be available to users who have ANSI enabled, it makes sense to make the toggle as well as the switch visible to users who have okansi() = True. In defaults(), a section of code adds keys that the BBS tests for input. I simply add L to our allowable keys.

    737     bout.outstr("|#9Defaults: ");
    738     std::string allowable = "Q?1234567BCDIKMNTUW";
    739     if (okansi()) {
    740       allowable.append("89AS");
    741       if (a()->fullscreen_read_prompt()) {
    742         allowable.push_back('G');
    743       }
    744     }
    745     switch (const auto ch = onek(allowable, true); ch) {

I modify line 740 to:

    740       allowable.append("89ALS");

This makes the onek() function call in line 745, to accept L as input, aside from the other keys in the string allowable.

Now that onek() will accept L, I need to define a switch case, to handle what to do if the BBS receives an L. To make it easier to find the code, I insert the case definition for ‘L’ right after that for ‘K’.

    802     case 'K':
    803       wwiv::bbs::menus::ConfigUserMenuSet("");
    804       need_menu_reload = true;
    805       break;
       +    case 'L':
       +      a()->user()->data.lp_options ^= cfl_enable;
       +      break;
    806     case 'M':
    807       a()->user()->toggle_flag(User::noMsgs);
    808       break;

I used XOR assignment to toggle the cfl_enable bit of lp_options of the user. If it is currently on, XOR will set it off. If it is currently off, XOR will set it on.

That’s it. I’ve made the user’s cfl_enable bit (ListPlus) toggleable from the Main Defaults menu of WWIV.

Next time, I’ll describe the rest of the code modifications needed to make the switch actually turn ListPlus on or off in WWIV.

Making ListPlus switchable in WWIV part 2

Having decided on a variable to hold the ListPlus toggle ( cfl_enable bit in lp_options of the user record in sdk/user.h ), I figured out where in the BBS this can be switched on or off. I decided on adding the switch to the Main D)efaults menu, and in the T)ransfer section defaults menu.

In the Main D)efaults menu, we take a look at the current menu layout.

I can add a ListPlus Enable status line and switch right beside the K) Configure Menus item. It’ll be switchable on or off with the L key! Isn’t that just right?

This screen is controlled in the bbs/defaults.cpp file, and I can modify the output in line 167.

    167   bout.pl("|#1K|#9) Configure Menus");

ListPlus itself relies on the user having ANSI enabled, so I’ll make it switchable only if the user has ANSI enabled. I’ll also make the current value of the switch visible as Yes or No. This is the code after we’ve modified it.

    167   bout.print("|#1K|#9) Configure Menus                      ");
    168   if (okansi()) {
    169     bout.print("|#1L|#9) ListPlus Enabled   : |#2{}",
            YesNoString(a()->user()->data.lp_options & cfl_enable));
    170   }
    171   bout.nl();

The resulting screen looks like this.

So far, I’ve added a bit in the user record where I can select to enable or disable ListPlus, and prepared the defaults screen to display the status of the ListPlus switch.

(to be continued)

Making ListPlus switchable in WWIV

While hunting down the cause of a bug in uploading files in WWIV, I ran across the ListPlus thing in the file section. On my BBS, I disabled it in code, specifically in bbs/xfer.cpp, in the void listfiles() function.

void listfiles() {
   if (a()->current_user_dir().subnum < 0 || a()->udir.empty()) {
     // We don't have any current directory, can not list files.
     bout.pl("|#6No directories available.");
     return;
   }
 
   if (okansi()) {
     listfiles_plus(LP_LIST_DIR);
     return;
   }

I simply commented out the lines that called listfiles_plus() to prevent listplus from kicking in. That wasn’t comprehensive though. Since file uploading/downloading wasn’t really working properly either, it was enough to just close the XFER section in WWIV.INI by setting CLOSE_XFER = Y. The code that called listfiles_plus() was still there.

I will be working on the WWIV file section code this year (2026) and I had started a little bit on this in late December of 2025. My initial activities had been around testing file uploading and downloading. In the process, I saw the ListPlus hack I made and thought that it needed a bit more work to actually make all calls to ListPlus switchable on or off by the user.

To make ListPlus toggleable, we need a variable on our user record to store the value in. We need just one bit. Since ListPlus itself stores some configurable stuff as bits in the user record in lp_options, we could use a bit there.

I ended up adding a bit which I called cfl_enable, in sdk/user.h.

//
// ListPlus options from lp_options.
//
static constexpr uint32_t cfl_fname = 0x00000001;
static constexpr uint32_t cfl_extension = 0x00000002;
static constexpr uint32_t cfl_dloads = 0x00000004;
static constexpr uint32_t cfl_kbytes = 0x00000008;
static constexpr uint32_t cfl_date_uploaded = 0x00000010;
static constexpr uint32_t cfl_file_points = 0x00000020;
static constexpr uint32_t cfl_days_old = 0x00000040;
static constexpr uint32_t cfl_upby = 0x00000080;
static constexpr uint32_t unused_cfl_times_a_day_dloaded = 0x00000100;
static constexpr uint32_t unused_cfl_days_between_dloads = 0x00000200;
static constexpr uint32_t cfl_description = 0x00000400;
static constexpr uint32_t cfl_header = 0x80000000;

// I added this line for cfl_enable
static constexpr uint32_t cfl_enable = 0x10000000;

At first, I was going to make this switchable in the K) ListPlus Configuration menu. That didn’t make sense though. So I decided to add the switch in the main D)efaults menu, and also in the T)ransfer section defaults menu.

(to be continued)

How to add a switch/toggle in wwivconfig


How to add a switch/toggle in wwivconfig

====[ xenos@aliens.ph – 26 December 2025]===========

1) Define what you want to have a switch for in sdk/config.h

in lines 54-onwards:

  struct system_toggles_t {
     bool lastnet_at_logon{false};
  bool show_chain_usage{false};

      // ADD YOUR TOGGLE VARIABLE HERE;
  // example: bool variable_name{default};
  // default is true or false, I suggest using false as default
  bool variable_name{false};
  };

2) Add to sdk/config_cereal.h so we can save it

  template <class Archive> void serialize(Archive& ar, system_toggles_t& n) {
    SERIALIZE(n, lastnet_at_logon);
    SERIALIZE(n, show_chain_usage);

    // ADD A SERIALIZE OF NEW VARIABLE HERE;
    // SERIALIZE(n, variable_name);
    SERIALIZE(n, variable_name);

    }

3) Add to wwivconfig/toggles.cpp

Add the following lines:

   ++y;
   items.add(new Label("Thingy we wanna toggle:"),
            new BooleanEditItem(&t.variable_name),
     "Variable name toggle here", 1, y);

4) You can then reference the switch/toggle as:

  if (a()->config()->toggles().variable_name) {
         // do something if variable_name is true
  };

Getting back in the saddle…

After a long drought, I am back to writing stuff for WWIV.

I did a little bit of Python coding here and there, with some updates to my old scripts written in Python 2 so that they will now work nicely in Python 3.

I finished my wwiv5ibbslastcall package, which consists of two Python scripts. The first one, which originally was named wwivibbslastcaller, is now xwibbslastcaller.py. The second, originally just ibbs-extract, is now ibbs-extract3. Both of these are now written in Python 3.

xwibbslastcaller.py is responsible for getting the user’s info from the BBS drop files, then posting to the appropriate SUB or ECHO with the caller’s info in rot47. This script is usually part of the LOGON command and can be added to WWIV.INI in the LOGON_CMD setting like this:

LOGON_CMD = xwibbslastcaller.py %R

The other script, ibbs-extract3, reads in configuration settings from WWIV.INI, then proceeds to read message posts from the SUB or ECHO where IBBSLASTCALLER data is posted. It reads in data from the posts and writes out a laston.txt file for each network that it reads data from.

Here’s sample output of the package.

wwiv5ibbslastcall output showing InterBBS Last Callers for WWIVnet and fsxNet.

You can get the scripts from https://github.com/ericpareja/xenos-wwiv-utils/.

WWIV net38b3 on aliens

I updated WWIV networking software from NET37 to NET38b3. Rushfan is maintaining the official networking stack. I have some ideas for doing a complete rewrite for Linux, but am not sure if I can manage to write a portable rewrite.

The network stack of WWIV consists of several components. I’m planning to rewrite one component at a time, so that we can actually run the entire WWIV BBS + WWIV Network + WWIVToss (FTN<->WWIV) on Linux without resorting to dosemu.

Currently, the WWIV BBS software itself already runs on Linux. See WWIV BBS v5.0 Project.

The NET37/NET38 WWIV networking stuff runs mostly under DOS, so requires Linux WWIV sysops to use dosemu and some creative scripting to get it to work.

There is already a stub NETWORK.EXE replacement in the WWIV BBS project tree, which in turn calls NETWORK0.EXE, NETWORKB (Rushfan’s Binkp WWIV transport replacement) or NETWORKP.

NETWORKP (or the WWIV PPP Project component) has some parts of it that have already been replaced with a bunch of scripts which require Python to handle the transport of network files from the WWIV BBS to the hub via SMTP, and fetchmail to retrieve from the hub to the WWIV BBS via POP3. I’m currently working on replacing NETWORKP completely with a Python script to do the conversion of files from their Sx.NET format to their UUencoded format along with their mail headers. Once this is done,  NETWORKP.exe can be replaced on Linux.

NETWORKB is an option, of course. But I’m all for flexibility and having alternatives. Besides, it’s something I like working on while learning in the process.