home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / UTILITY / ASR132A.ARJ / ASR.DOC next >
Text File  |  1992-04-09  |  14KB  |  289 lines

  1. ----------------------------------------------------------------
  2.  
  3.                         ASR version 1.32
  4.                        March/April,  1992
  5.                     Written by Preston Brown
  6.              #3 @9987 WWIVnet, #2 @9191 VirtualNET
  7.  
  8. ----------------------------------------------------------------
  9.  
  10. I. What is DGROUP, and ESM?
  11.  
  12.      ASR stands for AUTOMATIC STRINGS REMOVER.  It was developed
  13. over a period of time to deal with a problem that surfaced in WWIV
  14. 4.11/4.12, and is still a threat in WWIV 4.20.  That problem is the
  15. infamous DGROUP compile error.  DGROUP is the program segment that
  16. contains the text, or "strings" for the program, as well as a few
  17. other things that don't amount to very much memory at all.  Because
  18. WWIV's memory model allows only 64 kilobytes of DGROUP space, if
  19. you start modifying your WWIV source code a lot, you will eventual-
  20. ly have too many strings in the source, and you will run into the
  21. DGROUP compile error in the linking process.
  22.      
  23.      To many people, this was a stone wall.  Various simplistic
  24. modifications had been released on modnet to deal with this
  25. problem, but all of them were just that: simplistic.  They did not
  26. do a good job, and even with them installed, the DGROUP error came
  27. back after only a few more modifications.  Thus, most people were
  28. forced to stop modifying their code, or they were forced to cut out
  29. some of their larger mods, like a non-external casino or fancy file
  30. listing system.
  31.      
  32.      Then along came Tolkien with his program, External Strings
  33. Manager, or ESM.  To many WWIV modifiers, this program was a
  34. literal lifesaver.  The small modification and the accompanying
  35. executable file enabled you to place strings into an external file,
  36. from where they were called by the modified source code.  This
  37. program is EXCELLENT, and though I have only used through version
  38. 1.04, I know that there are more current versions about.  They have
  39. more features than are needed for our purposes, but feel free to
  40. obtain them.  I believe that they cost slightly more money than the
  41. earlier releases.
  42.      
  43.      ESM was excellent, but there was still one small problem
  44. facing many modifiers: it took way too much time to remove the
  45. strings.  The summer of 1991 I can remember printing out each
  46. individual source code file, marking a string number next to each
  47. string, and then loading up the ESM editor to key them in.  Then I
  48. would have to go back into the code, remove the string, and replace
  49. it with a call to "get_string(xxx)" which was the procedure that
  50. looked in the strings file for string "xxx" and read it in.  For
  51. 100 strings, this could take at least 2 hours, if I remember
  52. correctly.  However long it took was too long.  I only did it
  53. because I had to do it to keep modifying!  Later, ver. 1.04 of ESM
  54. added the capability for the ESM editor to read in a text file with
  55. a string on each line, and this sped up things considerably, but
  56. the process was still very slow.
  57.      
  58.      Then WWIV 4.20 came out, and everyone kind of forgot about the
  59. DGROUP compile error if they switched to that version.  Wayne Bell
  60. (author of WWIV) had made some good steps in his new version, one
  61. of them being adding about 4 or so extra kilobytes of room to the
  62. DGROUP area by optimizing his code more efficiently.  However, I
  63. know from experience that the DGROUP threat is still real, because
  64. on my own WWIV BBS, we are less than 1 kilobyte away from hitting
  65. the DGROUP compile error.
  66.      
  67.      Recently, a mod claiming to give WWIV 4.20 1 meg of DGROUP space 
  68. has been released.  This modification is buggy at best, and dangerous
  69. at worst.  It requires a lot of modification to very sensitive
  70. areas of the source code that Wayne may change in his future versions
  71. of WWIV, which he might release more of now that he has a program
  72. that makes all updates a modification.  WWIV 4.21 is supposed to
  73. be released this March.  Also, the 1 meg DGROUP mod is a very
  74. difficult mod, and it does not give you the control over strings that
  75. ESM does.  When wayne himself does some sort of mod like this, we 
  76. can forget about ASR and ESM, but that's just it: HE HASN'T.
  77.      
  78.      So what was I going to do this time?  Do what I did last
  79. summer?  No, No, NO WAY.  I was not going to waste so much time
  80. doing such a paltry task of string removal again.  There had to 
  81. be a better way to get around this unfortunate thing.  And there is.      
  82.  
  83. II. ASR and its capabilities
  84.  
  85.      Enter ASR.  The Automatic Strings Remover works by actually
  86. removing the strings from the source code FOR YOU!!  The most
  87. common string output routines in the WWIV source code for WWIV
  88. 4.12/4.20 are "outstr", "pl", and "prt".  These are the ones that
  89. ESM handles most efficiently and easily, so these are the ones that
  90. ASR can remove.  ASR reads in a WWIV source code C++ file, and then
  91. it removes all the strings to an external strings text file for
  92. you.  It replaces the string in the source code file with a call to
  93. the appropriate string in the text file, all automatically!  In
  94. addition to these basic features, you can configure ASR to prompt
  95. you for each string replacement, so you can weed out removal of
  96. such strings like "NN:" and ":" which are frequently encountered
  97. when you are prompting someone in the source code.  With prompting
  98. on, you can choose not to remove these tiny strings.  
  99.      
  100.      You may also turn on commenting in the source files.  If
  101. commenting is on, once the string is removed to the text file and
  102. the call to "get_string" is inserted, the string is also placed in
  103. comment markers ("/*" and "*/") at the end of the line.  This
  104. comment will be ignored upon compile, however, when you are looking
  105. through your source code files, you can tell what each string call
  106. will produce.  I suggest that you leave this important option on at
  107. all times unless you are very nervous about space on your hard
  108. drive, because if you don't then you are likely to forget what a
  109. call to "get_string" actually brings up, and then you will be
  110. forced to check in ESM, which is a time consuming process to say
  111. the least.
  112.      
  113.      Last of all, you may enable backups of the source files and
  114. string file.  Though I have tested ASR thoroughly, it may make your
  115. conscience feel better if you know that you will have a backup of
  116. your files automatically made before anything is changed.  If
  117. backups are enabled, ASR will make a .BAK from the source code
  118. file, and a .BAK from the strings file as well.  If any .BAK's of
  119. the same name exist from previous work with ASR or even C++, ASR
  120. will write over them.  This backup option will work. However, like
  121. many mod writers urge you, I ask you to back up all your files in
  122. a ZIP or by some other method before undertaking anything as monumen-
  123. tal as string removal.  Your source code files are just too precious 
  124. to risk.
  125.  
  126. III.  How do I use ASR?
  127.      
  128.      Before you do anything, you MUST install ESM version 1.04 or
  129. later.  ASR is not a stand-alone program: it requires ESM to do
  130. anything useful!  You can probably get ESM from any local Bulletin
  131. board in your area that supports WWIV, or if you can't find it, you
  132. may call my Bulletin Board, SILICON VALLEY.  My number and network
  133. addresses are listed at the end of the documentation.  After you
  134. have installed ESM, and your source code is compiling correctly
  135. with the ESM modification, you are ready to start "de-stringing"
  136. your source code, and ELIMINATING DGROUP!
  137.      
  138.      ASR is disgustingly simple.  From the DOS command line, simply
  139. type ASR, the name of the source code file to be "de-stringed", and
  140. then the name of the file for the strings to go to.
  141.       
  142.       e.g. "ASR NEWUSER.C STRINGS.TXT"
  143.      
  144.      This will remove all the strings of the types mentioned at the
  145. beginning of the documentation from NEWUSER.C to a ESM text file
  146. called STRINGS.TXT.  Since ESM only uses STRINGS.TXT as the file
  147. that it can read in and convert to STRINGS.DAT, this will be the
  148. usual name.  However, if you are only experimenting, or for any
  149. reason you do not want the strings to go to a STRINGS.TXT file, you
  150. of course could type some other name.  Just remember that ESM will
  151. not recognize the file until it has been renamed to STRINGS.TXT.
  152.      
  153.      ASR run without any command line options will produce a small
  154. help line.  To configure ASR with the options mentioned earlier,
  155. type
  156.           
  157.           "ASR /CONFIG"
  158.      
  159.      and answer the simple questions by simply pressing "Y" or "N". 
  160. ASR will create a small file called ASR.CFG that contains your
  161. configuration information.
  162.        
  163.        ASR is smart.  If you have used ASR on previous files, or
  164. you have been manually writing strings to a STRINGS.TXT file, you
  165. can easily put this as the strings file when you start ASR and it
  166. will tack new strings onto the end of the file with no problem!
  167.      
  168.      After using ASR, make sure that the STRINGS.TXT file is in the
  169. same directory as ESM.EXE, and start up ESM.  Use the option in ESM
  170. called "read in STRINGS.TXT" or something akin to that.  It should
  171. not be hard to find.  ESM will start working, and it will count
  172. through the strings that it is processing.  When it is done, a new
  173. file called STRINGS.DAT will be created in the current directory. 
  174. Read up in the ESM documentation on what to do with this file.  Now
  175. you are ready to do some more mods, or even "de-string" some more
  176. WWIV source code files with ASR/ESM!
  177.  
  178. IV.  How fast is ASR, and is there anything I need to worry about?
  179.      
  180.      a. ASR is FAST.  I removed all the strings from a heavily
  181. modified NEWUSER.C source code file (70+ strings) in under half a
  182. minute.  Before ASR, that would have taken several hours, with
  183. commenting and all the like.
  184.      
  185.      b. ASR is SAFE.  However, there are a few things that you
  186. should know about how ASR works.  ASR looks through your source
  187. code files, and looks for calls to "pl", "prt", and "outstr". 
  188. These are the straightforward, everyday string calls.  ASR will not
  189. mess with other types of string calls, such as ones that contain
  190. variables ("%s" and the like) in the string, because ESM cannot
  191. handle such strings.  If it finds such a string, it first makes
  192. sure that it has already been converted to a call to "get_string"
  193. or not.  Here comes my warning: DO NOT, I repeat DO NOT run ASR on
  194. a source code file with invalid code in it.  Make sure that the
  195. code compiles before running it through ASR.  This is because if
  196. you have something like this:
  197.      
  198.      pl("this is a string where I forgot to put on the end quote.);
  199.      
  200.      ASR will keep going until it finds a closing quote.  This code
  201. will not compile without an error, and therefore you don't really
  202. have to worry about that ever happening.  If you did run it through
  203. ASR, you would probably end up with some very strange strings being
  204. removed!
  205.      
  206.      c. ASR can only remove one string per line of code.  Therefore,
  207. if you have a line of code like this for some odd reason:
  208.      
  209.      prt("this is kinda"); prt("weird!");
  210.     
  211.     It will compile fine because it is valid code.  However, if you
  212. only run this through ASR one time, it will only catch the first
  213. string, "this is kinda".  it won't mess with the second one.
  214.      
  215.      If you want to be sure that ASR is doing everything right,
  216. turn on prompting for string removal.  This obviously takes more
  217. time since you have to say yes or no to each question, but if it
  218. gives you a sense of security, do it.  You will probably see soon
  219. that you feel comfortable with it turned off, and you will love the
  220. speed at which it goes through your files.
  221.      
  222.      d. No program is perfect.  I have tested ASR on all the WWIV
  223. source files and it WORKS.  however, I cannot foresee all the mods
  224. that you or others may stick into the code.  Therefore, unless you
  225. are absolutely sure that everything will be easy for ASR to
  226. interpret, turn on backups, or make your own.  
  227.         
  228.         DISCLAIMER:  I hold no responsibility if ASR trashes your 
  229.         files and you didn't make backups because you were 
  230.         just plain STUPID.
  231.  
  232. V. How is ASR distributed, supported, and is it FREE?  
  233.      
  234.      ASR is FREE.  I know that if I ask people to send me money,
  235. more than likely they will send me nothing.  I know how it
  236. works...I have not registered many shareware programs, I admit.  I
  237. register the ones that I love and use very often.  But, if out of
  238. the kindness of your heart, you wish to send me any small token of
  239. thanks for writing ASR, you may send whatever you feel appropriate. 
  240. I leave that up to you.
  241.      
  242.      I DO ask that you mail me and tell me you are using ASR to
  243. "de-string" your code in addition to ESM.  It is so easy for you to
  244. drop me a generic letter saying
  245.      
  246.      "I love ASR, keep up writing super programs!"
  247.      
  248.      and then I can count you on my list of users who use my
  249. programs.  I will mail you personally through WWIVnet with any
  250. future product announcements.  This is kind of like "registration": 
  251. if you mail me, you can only get more.  If you don't, you might
  252. never learn about some of my stuff.
  253.      
  254.      You can reach me through one of these Network Addresses:
  255.      
  256.      #3 (Ellrond) @9987 (Silicon Valley WWIVnet)
  257.      #2 (Ellrond) @9191 (Silicon Valley VirtualNET)
  258.      
  259.      or just call Silicon Valley.  And here, I shamelessly plug our
  260. BBS system.
  261.  
  262.      Silicon Valley
  263.      9987 WWIVnet
  264.      9191 VirtualNET
  265.      FIDOnet and INTERnet are on the way!
  266.      HUGE compilation of WWIV mods and external programs.
  267.      Located in Winston-Salem, NC (group 5 WWIVnet)
  268.      (919) 765-8640, auto-sysop validation.
  269.      USR Dual STD. modem, v.32bis/v.42bis.
  270.  
  271.    If you wish not to make a long distance call, or you do not have
  272. access to WWIVnet (god forbid!) you can send surface mail to:
  273.  
  274.                     Preston Brown
  275.                     1110 Arbor Rd.
  276.                     Winston-Salem, NC 27104
  277.                               or
  278.                     Preston Brown
  279.                     Deerfield Academy
  280.                     Deerfield, MA 01342
  281.  
  282.      If you do send surface mail, I will mail you back a list of
  283. all my current software, and if you enclose $5, I will send you a
  284. disk with all my current software as well as a list.
  285.  
  286. see UPDATE32.DOC for revision history.
  287.  
  288. EOF
  289.