This file also has OOVEN, which seems to be an unused stub or prototype, but if we comment it out we get build errors, so it is referenced by something somewhere that is not obvious. Whatever the case, what we want is HOVEN.
The function init_menus() is in init.c and calls menus(), which is in menusm/menus.c. The function do_menus() is in domenus.c.
The menu system is a complex entity specified by a multitude of tables in a number of directories. Understanding the way the code is built is one thing. Understanding how to use the system is the other.
The key thing to remember in using it is that you use the arrow keys to navigate. Up and down make perfect sense, but the left and right keys do the opposite of what most people seem to expect:
It is not a source of confusion when using the system, but the top thing on the screen is not something you can select, it is the title for the submenu being shown to you (I would set it off some way like I do here):
-- Oven Main Menu Exit Configuration and Status Error Log DatabaseThis top level menu have 4 choices it offers you. Use the up/down arrow keys to select one, then the left arrow to execute it.
Notice that a selection being offered you may be either an action (like "Exit" is here) or another menu with more selections. It is too bad that is not made clear in some way, but it all becomes clear enough with experience and context.
Oven Main Menu Exit %ex $ Configuration and Status %cs $ Error Log %er $ Database %db $This is some kind of metalanguage. The notation %cs takes us to a file menus/cs that has the configuration and status menu. The notation %ex has no corresponding file in the menus directory, so it must be an action that is defined somewhere.
There are 5 directories with "menu stuff" in them.
drwxr-xr-x 2 irafdude irafdude 4096 Jun 26 2012 menus drwxr-xr-x 2 irafdude irafdude 4096 Jan 19 2018 menusc drwxr-xr-x 2 irafdude irafdude 4096 Jun 26 2012 menusk drwxr-xr-x 2 irafdude irafdude 4096 Jan 19 2018 menusm drwxr-xr-x 2 irafdude irafdude 4096 Jan 19 2018 menustThe directory "menusk" contains the makemenus.c program, and it is only 152 lines, so we stand a good chance of figuring it out. It is passed the list of names in menus/* as an argument list and generates:
If we could understand what routines get called for the various entries in the database submenu, it would be instructive. The "db" file looks like this.
Database Read parameters from disk %rf $ Write parameters to disk %wf $ Read parameters from oven %ro $ Write parameters to oven %wo $ Read data from oven %rd $ Read errors from oven %re $ Write parameters to text %wt $ Read parameters from text %rt $If we look at menusc/db.c, we see a list of routines, the first of which looks like:
dbrfg () { int t = 0; if (globalp->readonly) return (GOER_NOEDITP); db_bpread_disk (); t = GOER_EXECUTED; return (t); }There may be a pattern to this name "dbrfg" -- "db" is the menu name and "rf" is the code in the menu definition file. The letter "g" ends every function in this file, and seems to simply indicate a function that is the handler for some entry in a menu definition file.
This is certainly helpful and is enough to help us track down what functions get called when a given menu entry gets invoked.
Tom's home page / [email protected]