brickviking / list

list is a curses-based interactive file listing program that combines the functions of less and hexdump into one handy program. It displays text on the screen in one of two different formats, either in hexadecimal dump format (a la MS-DOS debug.com format), or in text format, similar to what the programs less and more do.
GNU General Public License v2.0
2 stars 0 forks source link

Tidy up Bye() to use ENUMs instead of numbers #2

Open brickviking opened 2 years ago

brickviking commented 2 years ago

This may require several passes through the main code, plus a set of definitions in list.h or relatives. Changing the switch statement should be easy once I get a set of ENUMs organised. The problem will be finding every instance where I use Bye(<n>) and replacing the <n> with the relevant ENUM.

Some examples I could use are below - I'm trying to remove collisions. One other alternative is to use ENUMs that already exist in the standard C library headers. The trick then is, remembering what those are. It's also a reason to avoid reinventing the wheel, as someone famously said. Don't those appear in and relatives?

LIST_OOM   vs ENOMEM
LIST_FILENORW vs EPERM
brickviking commented 1 year ago

I went with BR_NOMEM (and others) as that seems to work (Bye Reason). Still working my way through the rest of the code. I stumbled on another related buglet too, when I tangle the source files, they end up in the primary directory, not in src/* where they're supposed to be! I'll get that one sorted too. Might even put up another issue, now I can post issues.

These issues are not fully synched between github and my instance of gitea.

brickviking commented 1 year ago

At the moment, most of the relevant changes are already present in the src/*.c files as per #4, but haven't made their way into the master list.org document. I'll have to correlate all the relevant files and make any non-ENUM differences go away before I integrate the ENUM stuff back into the master document, this'll make the job of tangling far easier.

brickviking commented 1 year ago

For the moment, here's a dirt simple tasklist. It's not a github-official list, just one I manage as I go.

Tasklist

Once I've got all these ticked off, we should be good to go to merge the changes into master. These changes were all meant to have been on the enums branch, but well... git.