$CASE/gen/ver_12/sjaganat/diffsrc.vs.srcMain.hlp - RJL 040831 This note explains why replay_log(void) is preferable to and evolved from replay_log(arg1,arg2). Newer projects should move in this direction not the reverse. ------------------------------------------ sjaganat has two source directories: src and srcMain. The only file which differs between them is pr_log.c. srcMain/pr_log.c is older - it has Rideout/Murphy/sjaganat as authors; src/pr_log.c is more recent and has only sjaganat as author/reviser. He is a major contributor to making logging and replay code from genv12 usable in bde's XWIndows GUI environment. src is an upgrade to srcMain. They generate two different versions of replay_log, with different signatures. The src/ version generates do_command and encode_token functions which I recognized could be factored out of replay_log in bde and moved to pr_log.c. This reduced replay_log application-dependence so genv12 could auto-generate most of replay_log in pr_log.c. My goal is to make all of replay_log independent of the application. The srcMain version had the equivalent functionality inside replay_log. Very little remains in replay_log from src/gen_pr_log; Team1 in 02s522 used the earlier version of genv12, before Sathya J added bde's mods to replay_log in 2003. AJLopez in 04s522 is trying to modify Team1 to use the newer version of genv12 for the Hominid project. Here are 20 refs in the two gen_pr_log versions (RJL040802) -------------------- pwd /nfs/earth/misc/proj3/case/gen/ver_12/sjaganat saturn.cs.uml.edu(86)> grep 'encode_token|do_command|replay_log' src/gen_pr_log.c srcMain/gen_pr_log.c | wc grep 'encode_token|do_command|replay_log' src/gen_pr_log.c srcMain/gen_pr_log.c | wc 20 113 1649 saturn.cs.uml.edu(87)> grep 'encode_token|do_command|replay_log' src/gen_pr_log.c srcMain/gen_pr_log.c grep 'encode_token|do_command|replay_log' src/gen_pr_log.c srcMain/gen_pr_log.c src/gen_pr_log.c:68: fprintf(prlog_fp, " extern \"C\" int replay_log(void);\n");/* Sathya */ src/gen_pr_log.c:80: fprintf(prlog_fp, "/* buffers for replay_log */\n"); src/gen_pr_log.c:1314:void gen_encode_token() src/gen_pr_log.c:1318: fprintf(prlog_fp, "/* Function:encode_token */\n"); src/gen_pr_log.c:1324: fprintf(prlog_fp, "replayCode encode_token( char *token )\n"); src/gen_pr_log.c:1345: fprintf(prlog_fp, "} /*end encode_token*/ \n\n"); src/gen_pr_log.c:1349:void gen_do_command() src/gen_pr_log.c:1353: fprintf(prlog_fp, "/* Function:do_command */\n"); src/gen_pr_log.c:1359: fprintf(prlog_fp, "int do_command( char *hcg_buffer, char *token, int idx)\n"); src/gen_pr_log.c:1377: fprintf(prlog_fp, " command = encode_token(token);\n"); src/gen_pr_log.c:1485: fprintf(prlog_fp, "} /*end do_command */ \n\n"); src/gen_pr_log.c:1569: fprintf(prlog_fp, " retval = replay_log();\n"); src/gen_pr_log.c:1632: gen_encode_token(); src/gen_pr_log.c:1635: gen_do_command(); srcMain/gen_pr_log.c:1288:gen_replay_log() srcMain/gen_pr_log.c:1292: fprintf(prlog_fp, "/* Function:replay_log */\n"); srcMain/gen_pr_log.c:1314: fprintf(prlog_fp, "int replay_log(char logfile[NAMELENGTH],int near_realtime)\n"); /* Sathya */ srcMain/gen_pr_log.c:1322: fprintf(prlog_fp, " printf(\"replay_log: warning invalid value of near_realtime %%d.\\n\",near_realtime);\n"); srcMain/gen_pr_log.c:1608: fprintf(prlog_fp, " if ((retval = replay_log(hcg_logfile,near_realtime)) != 0) {\n"); srcMain/gen_pr_log.c:1672: gen_replay_log(); saturn.cs.uml.edu(88)> ------------------`