I'm attaching a table that summarises a few things about most of the options we are likely to encounter (there are lots of them, most of which I do not know the purpose of). As you said, the conditional nature of some options does not let us know all of them, so it probably isn't a complete list. Two important options that were missed: metaserver (oops, didnt do -m) and useRSA (cos I don't have it). I think it would probably make it easier for us to declare and define all the client options (as variables) in one place: defaults.[ch] or data.[ch]? I think most of the int and boolean defaults are in data.[ch] already. Although I think getdefault and it's ilk would have to be modified to work with this, one way is to modify it's behaviour to almost never return NULL but to lookup in some sort of list whether that option it is being asked to look up is known to it, and to return that instead. No functional difference, and I predict nothing will break but it is something of an improvement to have all the options consolidated in one place. It would even be possible to dump a netrekrc based on what's in those header files. Theoretically, it should also be easier for us to write the config program. However, there are many options still not easily found, other than by searching through the code (if it's there at all), or in the stock netrekrc distributed with the client. There's a perl script that prints the table, and some modifications to the client to track calls to getdefault and its variants (not commited to the repository). gerard N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * G arrowCursorDef NULL * * * I autoquit 60 quittime 60 * G b1keymap NULL * G b2keymap NULL * G b3keymap NULL * * B backgroundPix 1 1 * * I baseLocalPort 0 baseLocalPort 0 * * G bigfont NULL * G boldfont NULL * * G buttonmap NULL G buttonmap-as NULL G buttonmap-att NULL G buttonmap-bb NULL G buttonmap-ca NULL G buttonmap-dd NULL G buttonmap-default NULL G buttonmap-ga NULL G buttonmap-sb NULL G buttonmap-sc NULL * * B censorMessages 0 censorMessages 0 * * G ckeymap NULL * G ckeymap-as NULL G ckeymap-att NULL * G ckeymap-bb NULL * G ckeymap-ca NULL * G ckeymap-dd NULL G ckeymap-default NULL G ckeymap-ga NULL * G ckeymap-sb NULL * G ckeymap-sc NULL * G cloakChars NULL * * B cloakPix 1 1 * G color.black NULL N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * G color.cyan NULL * G color.Fed NULL * G color.green NULL * G color.Ind NULL * G color.Kli NULL * G color.light grey NULL * G color.Ori NULL * G color.red NULL * G color.Rom NULL * G color.white NULL * G color.yellow NULL * * B colorgalactic 1 1 * * B continuetractor 1 continuetractor 1 * * * B continuousMouse 0 motion_mouse 0 * * * B DefLite 0 DefLite 0 * G documentation NULL G DocWin.geometry NULL G DocWin.parent NULL * * I enemyPhasers 1 enemyPhasers 1 * * B explosionPix 1 1 * * * B extraAlertBorder 1 extraBorder 1 G FED.geometry NULL B FED.mapped 0 G FED.parent NULL * * B fedPix 1 1 * G font NULL * * * B forcemono 0 forceMono * G help.geometry NULL B help.mapped 0 * G help.parent NULL * * B highlightFriendlyPhasers 0 highlightFriendlyPhasers 0 * * * B ignoreCaps 1 ignoreCaps 1 * * * B ignoreSignals 0 ignore_signals 0 N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * * B indPix 1 1 G info.geometry NULL B info.mapped 0 G info.parent NULL * G infoCursorDef NULL * G italicfont NULL * * * I keepInfo 15 keepInfo 15 * * * B keeppeace 0 keeppeace 0 * * G keymap NULL G keymap-as NULL G keymap-att NULL G keymap-bb NULL G keymap-ca NULL G keymap-dd NULL G keymap-default NULL G keymap-ga NULL G keymap-sb NULL G keymap-sc NULL G KLI.geometry NULL B KLI.mapped 0 G KLI.parent NULL * * B kliPix 1 1 G lagMeter.geometry NULL B lagMeter.mapped 0 G lagMeter.parent NULL G local.geometry NULL B local.mapped 0 G local.parent NULL * G localCursorDef NULL * * G logfile NULL * * * B logging 0 logmess 0 * G macroKey NULL G macrow.geometry NULL N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- G macrow.parent NULL G map.geometry NULL B map.mapped 0 G map.parent NULL * G mapCursorDef NULL * * B mapPix 1 1 * G message.geometry NULL * * * B message.mapped 1 1 * G message.parent NULL * * I messageHoldThresh 0 messHoldThresh 0 * * I messageHUD 0 messageHUD 0 G MetaServer List.geometry NULL B MetaServer List.mapped 0 G MetaServer List.parent NULL * * I motionThresh 16 user_motion_thresh 16 * * B mouseAsShift 0 mouse_as_shift 0 * * G name NULL * G netrek.geometry NULL G netrek.parent NULL G netrek_icon.geometry NULL G netrek_icon.parent NULL G netstat.geometry NULL B netstat.mapped 0 G netstat.parent NULL * * I netstatfreq 5 netstatfreq 5 * * * B netstats 0 netstat 0 G network.geometry NULL B network.mapped 0 G network.parent NULL * * * I newDashboard 0 newDashboard 0 * * * B newDistress 0 UseNewDistress 0 * * B newPlist 0 FALSE G option.geometry NULL N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- B option.mapped 0 G option.parent NULL G ORI.geometry NULL B ORI.mapped 0 G ORI.parent NULL * * B oriPix 1 1 * * B ownerhalo 0 0 * * * B partitionPlist 0 partitionPlist * G password NULL * * I PhaserMsg 2 showPhaser 2 * * I phaserShrink 0 phaserShrink 0 * * B PhaserStats 0 phaserShowStats 0 * * B phaserWindow 0 phaserWindow 0 G pingStats.geometry NULL B pingStats.mapped 0 G pingStats.parent NULL * * I pixFlags 4096 pixFlags 0 * * G pixmapDir NULL * G planet.geometry NULL B planet.mapped 0 * G planet.parent NULL * * I planetCycleTime 10 beep_lite_cycle_time_planet 10 * G player.geometry NULL * B player.mapped 1 * G player.parent NULL * * I playerCycleTime 10 beep_lite_cycle_time_player 10 * * G playerlist NULL * I playerListStyle -1 * * * I port 2592 DEFAULT_PORT I port.localhost -1 * * B portSwap 0 portSwap 0 * G quit.geometry NULL B quit.mapped 0 N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * G quit.parent NULL G rank.geometry NULL B rank.mapped 0 G rank.parent NULL G rcfile-as NULL G rcfile-att NULL G rcfile-bb NULL G rcfile-ca NULL G rcfile-dd NULL G rcfile-default NULL G rcfile-ga NULL G rcfile-sb NULL G rcfile-sc NULL * * I redrawDelay 0 redrawDelay 0 * * B rejectMacro 0 rejectMacro 0 * * B reportKills 1 reportKills 1 * G review.geometry NULL * B review.mapped 1 * G review.parent NULL * G review_all.geometry NULL * B review_all.mapped 0 * G review_all.parent NULL * G review_kill.geometry NULL * B review_kill.mapped 0 * G review_kill.parent NULL G review_phaser.geometry NULL B review_phaser.mapped 0 G review_phaser.parent NULL * G review_team.geometry NULL * B review_team.mapped 0 * G review_team.parent NULL * G review_your.geometry NULL * B review_your.mapped 0 N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * G review_your.parent NULL G ROM.geometry NULL B ROM.mapped 0 G ROM.parent NULL * * B romPix 1 1 * * * B ROMVLVS 0 ROMVLVS 0 G scanner.geometry NULL B scanner.mapped 0 G scanner.parent NULL * * B ScrollBar 1 scrollbar * * I ScrollBarWidth 5 scroll_thumb_width * * I ScrollSaveLines 100 scroll_lines G server.localhost NULL * * B shellTools 1 shelltools 1 * * * B shiftedMouse 0 extended_mouse 0 * * B shipPix 1 1 * * * I showgalactic 2 showgalactic 2 * * * B showIND 0 showIND 0 * * * I showlocal 2 showlocal 2 * * * I showLock 3 showLock 3 * * * B showMotd 1 1 * * B showplanetnames 1 1 * * * B showPlanetOwner 0 showPlanetOwner 0 * * B showstars 1 1 * * * B showstats 0 showStats 0 * * * B showTractorPressor 1 showTractorPressor 1 * * B shrinkPhaserOnMiss 0 shrinkPhaserOnMiss 0 * * * B sortMyTeamFirst 0 sortMyTeamFirst * * * B sortPlayers 0 sortPlayers * * * B sound 0 sound_init 0 G sound.geometry NULL G sound.parent NULL * G stats.geometry NULL N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * G stats.parent NULL * G textCursorDef NULL * * I theirPhaserShrink 0 theirPhaserShrink 0 G tools.geometry NULL G tools.parent NULL * * * B tryShort 1 tryShort 1 * * * B tryUdp 1 tryUdp 1 G tstat.geometry NULL B tstat.mapped 0 G tstat.parent NULL * G tts_color NULL * * G tts_font NULL * * I tts_max_len 40 tts_max_len 40 * * I tts_pos 234 tts_pos TWINSIDE / 2 - 16 * * I tts_time 25 tts_time 25 G UDP.geometry NULL B UDP.mapped 0 G UDP.parent NULL * * * I udpClientReceive 1 udpClientRecv 1 * * * I udpClientSend 1 udpClientSend 1 * * * I udpDebug 0 udpDebug 0 * * * B udpSequenceCheck 1 udpSequenceChk 1 * * I updatespersec 5 updatespeed 5 * * * B UseLite 0 UseLite 0 * * * B useTNGBitmaps 0 use_tng_fed_bitmaps 0 * * * B varyShields 1 VShieldBitmaps 1 * G war.geometry NULL B war.mapped 0 G war.parent NULL * G warn.geometry NULL * B warn.mapped 0 * G warn.parent NULL * * * B warnHull 0 vary_hull 0 N: Appears in the stock netrekrc distributed with the client G: Appears in egrep 'intDefault|booleanDefault|getdefault' D: Variable default is defined in data.c T: I = int, B = boolean, G = string -------------------------------------------------------------------------------------------------------------------------------------------- | N | G | D | T | Key | Value (preferred for bool or int) | Variable | data.c variable value -------------------------------------------------------------------------------------------------------------------------------------------- * * * B warnShields 0 warnShields 0 * * B weaponPix 1 1 G xtrekrc_help.geometry NULL G xtrekrc_help.parent NULL G xtrekrcWin.geometry NULL G xtrekrcWin.parent NULL Options in netrekrc.example not caught by calls to getdefault: server useRSA server.bronco port.bronco useRSA.bronco.ece.cmu.edu server.hockey port.hockey server.picklet server.picklet-home port.picklet-home server.picklet-away port.picklet-away metaCache metaserver continuetractors babes WMXYHintMode sounddir wwwlink WaitMotd.mapped netrek.mapped reportkills udp.geometry udp.mapped fed.parent fed.geometry rom.parent rom.geometry kli.parent kli.geometry ori.parent ori.geometry dist.^A.pop dist.bomb dist.^B.save_planet dist.space_control dist.^C.pickup dist.^D.bombing dist.^E.escorting dist.^F.ogging mac.^G.%u mac.^H.%u dist.^I.ogg dist.^J.help dist.^K.taking dist.^L.carrying macro.b.T macro.s.T macro.g.T mac.F.T mac.f mac.C.A mac.C.A mac.C.A mac.D.A mac.D.A mac.D.A mac.D.A mac.D.A mac.7.A mac.7.A mac.7.A mac.7.A mac.R.A mac.e.T mac.d.T mac.a.T mac.C.%i mac.N.%i mac.S.%i mac.T.%i mac.W.%t mac.I.%u mac.O.%u key.C key.B.0 mac.A.C singleMacro mac.^p mac.^h mac.^l.! lite.pickup lite.base_ogg lite.taking lite.help msg.kill msg.planet msg.bomb msg.destroy msg.take msg.ghostbust >From: James Cameron <quozl at us.netrek.org> >Reply-To: vanilla-list at us.netrek.org >To: vanilla-list at us.netrek.org >Subject: Re: [Vanilla List] any growth on this? >Date: Tue, 27 Nov 2001 23:24:04 +1100 > >Yes, that's right. This should change. Suggest how to change it? > >Idea: special compilation mode for COW that causes getdefault() and the >datatype variants to track what is given to them to fetch. Use the >compiled result to generate a list of parameter names and types that are >placed in a header that is used by defaults.c. Change getdefault() to >issue a warning when a new parameter is seen that is not in the list. > >Audit the code periodically using regular expression searching to >verify that all the defaults are known. > >Since the client is in maintenance mode, and no new major features are >being written, the cost of keeping the known parameters in the list >should be low. > >My quick guess at the size of the task: >1) files that contain getdefault or variants, > >% egrep -l "intDefault|booleanDefault|getdefault" *.c|fmt >audio.c cowmain.c defaults.c defwin.c docwin.c findslot.c gnu_win32.c >input.c main.c newwin.c parsemeta.c playback.c playerlist.c sound.c >winsprite.c x11sprite.c x11window.c > >2) total number of files, > >% egrep -l "intDefault|booleanDefault|getdefault" *.c|wc --lines > 17 > >3) number of calls or parameters to investigate, > >% egrep "intDefault|booleanDefault|getdefault" *.c|wc --lines > 182 >% cat *.c|egrep "intDefault|booleanDefault|getdefault"|sort|uniq|wc --lines > 165 >% cat *.c|egrep "intDefault|booleanDefault|getdefault"|cut -f2 -d\"|sort|uniq|more|wc --lines > 154 > > >What might not be caught by an semi-automatic analysis is calls to >getdefault() that are conditional. One could argue that such calls >are not for important parameters!