home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP10-8.ZIP / DOC.ZIP / UTIL.DOC < prev   
Text File  |  1990-09-26  |  79KB  |  2,325 lines

  1. HOW TO USE THIS FILE: This file has a table of contents and
  2. an index that refer to "pages" in this file. If your editor
  3. has a search facility, you can use it to search for the page
  4. numbers listed in either the table of contents or in the index.
  5. The phrase "Page n" (where n represents the actual page number)
  6. appears at the bottom left of the "page" it refers to. Thus, at
  7. the bottom of page 1, you'll find "Page 1" as the last item on
  8. that "page."
  9.  
  10.                            UTILITIES
  11.                        TABLE OF CONTENTS
  12. ___________________________________________________________________
  13.  
  14.  
  15. Overview                       1       The OBJXREF command-line
  16. BGIOBJ: Conversion utility for         options . . . . . . . . . 22
  17. graphics drivers and fonts . . 1         Control options . . . . 23
  18.   Adding the new .OBJ files to           Report options  . . . . 24
  19.   GRAPHICS.LIB . . . . . . . . 2     Response files  . . . . . . 26
  20.   Registering the drivers and          Free-form response
  21.   fonts  . . . . . . . . . . . 2       files . . . . . . . . . . 26
  22.     An example . . . . . . . . 3       Project files . . . . . . 26
  23.   The /F option  . . . . . . . 4       Linker response files . . 27
  24.   Advanced features  . . . . . 5     Sample OBJXREF reports  . . 28
  25.                                        Report by public names (/
  26.                                        RP) . . . . . . . . . . . 29
  27. CPP: The preprocessor                  Report by module (/RM)  . 29
  28. utility  . . . . . . . . . . . 9       Report by reference (/
  29.   CPP as a macro                       RR) . . . . . . . . . . . 30
  30.   preprocessor . . . . . . . . 9       Report by external
  31.   An example . . . . . . . .  10       references (/RX)  . . . . 30
  32. GREP: A text-search utility . 10       Report of module sizes (/
  33.   Command-line syntax  . . .  11       RS) . . . . . . . . . . . 31
  34.   GREP options . . . . . . .  11       Report by class type (/
  35.     Order of precedence  . .  13       RC) . . . . . . . . . . . 31
  36.   The search string  . . . .  14       Report of unreferenced
  37.     Operators in regular               symbol names (/RU)  . . . 32
  38.     expressions  . . . . . .  14       Verbose reporting (/RV) . 33
  39.   File specifications  . . .  16     Examples of how to use
  40.   Some GREP examples . . . .  16     OBJXREF . . . . . . . . . . 33
  41.     Example 1  . . . . . . .  16       Example 1 . . . . . . . . 33
  42.     Example 2  . . . . . . .  17       Example 2 . . . . . . . . 33
  43.     Example 3  . . . . . . .  17       Example 3 . . . . . . . . 34
  44.     Example 4  . . . . . . .  18       Example 4 . . . . . . . . 34
  45.     Example 5  . . . . . . .  18     OBJXREF error messages and
  46.     Example 6  . . . . . . .  19     warnings  . . . . . . . . . 34
  47.     Example 7  . . . . . . .  19       Error messages  . . . . . 35
  48.     Example 8  . . . . . . .  20       Warnings  . . . . . . . . 35
  49. OBJXREF: The object module         THELP   . . . . . . . . . . . 36
  50. cross-reference utility  . .  21   TRIGRAPH  . . . . . . . . . . 37
  51.   The OBJXREF command line .  21   Index                         41
  52.  
  53.  
  54. Appendix: Project conversion utilities . . . . . . . . . . . . .  A
  55. ____________________________________________________________________
  56.  
  57. OVERVIEW
  58.  
  59. Your Turbo C++ package supplies much more than just two versions of
  60. the fastest C compiler available. It also provides twelve powerful
  61. standalone utility programs that you can use with your Turbo C++
  62. files or your other modules. Of these, MAKE, TLIB, TLINK, and TOUCH
  63. are documented in the User's Guide. The rest of them, listed below,
  64. are documented in this file.
  65.  
  66. BGIOBJ converts graphics drivers and fonts
  67.  
  68. CPP is the Turbo C++ preprocessor
  69.  
  70. GREP searches files for text strings
  71.  
  72. OBJXREF is an object module cross-referencer
  73.  
  74. PRJCNVT converts Turbo C 2.0 project files to Turbo C++ format
  75.  
  76. PRJ2MAK converts Turbo C++ project files to MAKE files
  77.  
  78. THELP is the Turbo Help utility
  79.  
  80. TRIGRAPH supports character conversion
  81.  
  82. ==================================================================
  83. BGIOBJ: Conversion utility for graphics drivers and fonts
  84.  
  85. You can use BGIOBJ to convert graphics driver files and character
  86. sets (stroked font files) to object (.OBJ) files. Once they're con-
  87. verted, you can link them into your program, making them part of
  88. the executable file. This is in addition to the graphics package's
  89. dynamic loading scheme, in which your program loads graphics
  90. drivers and character sets (stroked fonts) from disk at run time.
  91.  
  92. Linking drivers and fonts directly into your program is advanta-
  93. geous because the executable file contains all (or most) of the
  94.  
  95. Page 1
  96.  
  97. BGIOBJ
  98.  
  99. drivers and/or fonts it might need, and doesn't need to access the
  100. driver and font files on disk when running. However, linking the
  101. drivers and fonts into your executable file increases its size.
  102.  
  103. To convert a driver or font file to a linkable object file, use the
  104. BGIOBJ.EXE utility. This is the simplified syntax:
  105.  
  106.   BGIOBJ  source_file
  107.  
  108. where source_file is the driver or font file to be converted to an
  109. object file. The object file created has the same file name as the
  110. source file, with the extension .OBJ; for example, EGAVGA.BGI
  111. yields EGAVGA.OBJ, SANS.CHR gives SANS.OBJ, and so on.
  112.  
  113.  
  114.   Adding the new
  115.    .OBJ files to
  116.     GRAPHICS.LIB
  117.  
  118. You should add the driver and font object modules to GRAPHICS.LIB,
  119. so the linker can locate them when it links in the graphics
  120. routines. If you don't add these new object modules to
  121. GRAPHICS.LIB, you'll have to add them to the list of files in the
  122. TC project (.PRJ) file, on the TCC command line, or on the TLINK
  123. command line. To add these object modules to GRAPHICS.LIB, invoke
  124. TLIB with the following command line:
  125.  
  126.   tlib graphics + object_file_name [+ object_file_name ...]
  127.  
  128. where object_file_name is the name of the object file created by
  129. BGIOBJ.EXE (such as CGA, EGAVGA, GOTH, and so forth). The .OBJ
  130. extension is implied, so you don't need to include it. You can add
  131. several files with one command line to save time; see the example
  132. in the following section.
  133.  
  134.  
  135.  Registering the
  136.      drivers and
  137.            fonts
  138.  
  139. After adding driver and font object modules to GRAPHICS.LIB, you
  140. have to register all the drivers and fonts that you want linked in;
  141. you do this by calling registerbgidriver and registerbgifont in
  142. your program (before calling initgraph). This informs the graphics
  143. system of the presence of those files, and ensures that they will
  144. be linked in when the executable file is created by the linker.
  145.  
  146. The registering routines each take one parameter; a symbolic name
  147. defined in graphics.h. Each registering routine returns a
  148. nonnegative value if the driver or font is successfully registered.
  149.  
  150. Page 2
  151.  
  152.                                                              BGIOBJ
  153.  
  154. The following table shows the names to be used with
  155. registerbgidriver and registerbgifont. It is a complete list of
  156. drivers and fonts included with Turbo C++.
  157. ___________________________________________________________________
  158.  
  159.  Driver file    registerbgidriver      Font file    registerbgifont
  160.  (*.BGI)        symbolic name          (*.CHR)      symbolic name
  161. ___________________________________________________________________
  162.  
  163.  CGA            CGA_driver             TRIP         triplex_font
  164.  EGAVGA         EGAVGA_driver          LITT         small_font
  165.  HERC           Herc_driver            SANS         sansserif_font
  166.  ATT            ATT_driver             GOTH         gothic_font
  167.  PC3270         PC3270_driver
  168.  IBM8514        IBM8514_driver
  169. ___________________________________________________________________
  170.  
  171.       An example
  172.  
  173. Suppose you want to convert the files for the CGA graphics driver,
  174. the gothic font, and the triplex font to object modules, then link
  175. them into your program. Here's what you do:
  176.  
  177. 1. Convert the binary files to object files using BGIOBJ.EXE, as
  178.    shown in the following separate command lines:
  179.  
  180.      bgiobj  cga
  181.      bgiobj  trip
  182.      bgiobj  goth
  183.  
  184.    This creates three files: CGA.OBJ, TRIP.OBJ, and GOTH.OBJ.
  185.  
  186. 2. You can add these object files to GRAPHICS.LIB with this TLIB
  187.    command line:
  188.  
  189.       tlib  graphics  +cga  +trip  +goth
  190.  
  191. 3. If you don't add the object files to GRAPHICS.LIB, you must add
  192.    the object file names CGA.OBJ, TRIP.OBJ, and GOTH.OBJ to your
  193.    project list (if you are using Turbo C++'s integrated
  194.    environment), or to the TCC command line. For example, the TCC
  195.    command line would look like this:
  196.  
  197.       tcc  niftgraf graphics.lib  cga.obj  trip.obj  goth.obj
  198.  
  199. 4. You register these files in your graphics program like this:
  200.  
  201. Page 3
  202.  
  203. BGIOBJ
  204.  
  205.  
  206.      If you ever get a linker error "Segment exceeds 64K" after linking
  207.      in some drivers and/or fonts, refer to the following section.
  208.      /* Header file declares CGA_driver, triplex_font & gothic_font
  209.      */
  210.      #include <graphics.h>
  211.  
  212.      /* Register and check for errors (one never knows...) */
  213.  
  214.      if (registerbgidriver(CGA_driver) < 0) exit(1);
  215.      if (registerbgifont(triplex_font) < 0) exit(1);
  216.      if (registerbgifont(gothic_font)  < 0) exit(1);
  217.  
  218.      /* ... */
  219.  
  220.      initgraph(....);     /* initgraph should be called
  221.                              after registering */
  222.  
  223.      /* ... */
  224.  
  225.  
  226.    The /F option
  227.  
  228. This section explains what steps to take if you get the linker
  229. error "Segment exceeds 64K" (or a similar error) after linking in
  230. several driver and/or font files (especially with small- and
  231. compact-model programs).
  232.  
  233. By default, the files created by BGIOBJ.EXE all use the same
  234. segment (called _TEXT). This can cause problems if your program
  235. links in many drivers and/or fonts, or when you're using the small
  236. or compact memory model.
  237.  
  238. To solve this problem, you can convert one or more of the drivers
  239. or fonts with the BGIOBJ /F option. This option directs BGIOBJ to
  240. use a segment name of the form filename_TEXT, so that the default
  241. segment is not overburdened by all the linked-in drivers and fonts
  242. (and, in small and compact model programs, all the program code).
  243. For example, the following two BGIOBJ command lines direct BGIOBJ
  244. to use segment names of the form EGAVGA_TEXT and SANS_TEXT.
  245.  
  246.   bgiobj  /F  egavga
  247.   bgiobj  /F  sans
  248.  
  249. When you select /F, BGIOBJ also appends F to the target object file
  250. name (EGAVGAF.OBJ, SANSF.OBJ, and so forth), and appends _far to
  251. the name that will be used with registerfarbgidriver and
  252. registerfarbgifont. (For example, EGAVGA_driver becomes
  253. EGAVGA_driver_far.)
  254.  
  255. For files created with /F, you must use these far registering
  256. routines instead of the regular registerbgidriver and
  257. registerbgifont. For example,
  258.  
  259. Page 4
  260.  
  261.                                                              BGIOBJ
  262.  
  263.  
  264.   if (registerfarbgidriver(EGAVGA_driver_far) < 0) exit(1);
  265.   if (registerfarbgifont(sansserif_font_far)  < 0) exit(1);
  266.  
  267.  
  268.         Advanced
  269.         features
  270.  
  271. This section explains some of BGIOBJ's advanced features, and the
  272. routines registerfarbgidriver and registerfarbgifont. Only
  273. experienced users should use these features.
  274.  
  275. This is the full syntax of the BGIOBJ.EXE command line:
  276.  
  277.    BGIOBJ  [/F] source destination public-name seg-name seg-class
  278.  
  279. This table describes each component of the BGIOBJ command line.
  280. ___________________________________________________________________
  281.  
  282. Component               Description
  283. ___________________________________________________________________
  284.  
  285. /F or -F                This option instructs BGIOBJ.EXE to use a
  286.                         segment name other than _TEXT (the
  287.                         default), and to change the public name and
  288.                         destination file name. (See page 4 for a
  289.                         detailed discussion of /F.)
  290.  
  291. source                  This is the driver or font file to be
  292.                         converted. If the file is not one of the
  293.                         driver/font files shipped with Turbo C++,
  294.                         you should specify a full file name
  295.                         (including extension).
  296.  
  297. destination             This is the name of the object file to be
  298.                         produced. The default destination file name
  299.                         is source.OBJ, or sourceF.OBJ if you use
  300.                         the /F option.
  301.  
  302. public-name             This is the name that will be used in the
  303.                         program in a call to registerbgidriver or
  304.                         registerbgifont (or their respective far
  305.                         versions) to link in the object module.
  306.  
  307.                         The public name is the external name used
  308.                         by the linker, so it should be the name
  309.                         used in the program, prefixed with an
  310.                         underscore. If your program uses Pascal
  311.                         calling conventions, use only uppercase
  312.                         letters, and do not add an underscore.
  313.  
  314. Page 5
  315.  
  316. BGIOBJ
  317.  
  318.  
  319. seg-name                This is an optional segment name; the
  320.                         default is _TEXT (or filename_TEXT if /F is
  321.                         specified)
  322.  
  323. seg-class               This is an optional segment class; the
  324.                         default is CODE.
  325. ___________________________________________________________________
  326.  
  327. All parameters except source are optional. However, if you need to
  328. specify an optional parameter, all the parameters preceding it must
  329. also be specified.
  330.  
  331. If you choose to use your own public name(s), you have to add
  332. declaration(s) to your program, using one of the following forms:
  333.  
  334.   void public_name(void);        /* if /F not used, */
  335.                                  /* default segment name used */
  336.  
  337.   extern int far public_name[];  /* if /F used, or */
  338.                                  /* segment name not _TEXT */
  339.  
  340. In these declarations, public_name matches the public-name you used
  341. when converting with BGIOBJ. The graphics.h header file contains
  342. declarations of the default driver and font public names; if you
  343. use those default public names you don't have to declare them as
  344. just described.
  345.  
  346. After these declarations, you have to register all the drivers and
  347. fonts in your program. If you don't use the /F option and don't
  348. change the default segment name, you should register drivers and
  349. fonts through registerbgidriver and registerbgifont; otherwise, use
  350. registerfarbgidriver and registerfarbgifont.
  351.  
  352. Here is an example of a program that loads a font file into memory:
  353.  
  354.   /* Example of loading a font file into memory */
  355.  
  356.   #include <graphics.h>
  357.   #include <io.h>
  358.   #include <fcntl.h>
  359.   #include <stdio.h>
  360.   #include <conio.h>
  361.   #include <stdlib.h>
  362.   #include <process.h>
  363.   #include <alloc.h>
  364.  
  365.   main()
  366.   {
  367.      void    *gothic_fontp;    /* points to font buffer in memory
  368.   */
  369.      int      handle;          /* file handle used for I/O */
  370.      unsigned fsize;           /* size of file (and buffer) */
  371.  
  372. Page 6
  373.  
  374.                                                              BGIOBJ
  375.  
  376.      int errorcode;
  377.      int graphdriver;
  378.      int graphmode;
  379.  
  380.   /* open font file */
  381.      handle = open("GOTH.CHR", O_RDONLY|O_BINARY);
  382.      if (handle == -1)
  383.      {
  384.         printf("unable to open font file 'GOTH.CHR'\n");
  385.         exit(1);
  386.      }
  387.   /* find out size of the file */
  388.      fsize = filelength(handle);
  389.   /* allocate buffer */
  390.      gothic_fontp = malloc(fsize);
  391.      if (gothic_fontp == NULL)
  392.      {
  393.        printf("unable to allocate memory for font file
  394.   'GOTH.CHR'\n");
  395.        exit(1);
  396.      }
  397.   /* read font into memory */
  398.      if (read(handle, gothic_fontp, fsize) != fsize)
  399.      {
  400.         printf("unable to read font file 'GOTH.CHR'\n");
  401.         exit(1);
  402.      }
  403.   /* close font file */
  404.      close(handle);
  405.   /* register font */
  406.      if (registerfarbgifont(gothic_fontp) != GOTHIC_FONT)
  407.      {
  408.         printf("unable to register font file 'GOTH.CHR'\n");
  409.         exit(1);
  410.      }
  411.   /* detect and initialize graphix */
  412.      graphdriver = DETECT;
  413.      initgraph(&graphdriver, &graphmode, "..");
  414.      errorcode = graphresult();
  415.      if (errorcode != grOk)
  416.      {
  417.         printf("graphics error: %s\n",grapherrormsg(errorcode));
  418.         exit(1);
  419.      }
  420.      settextjustify(CENTER_TEXT, CENTER_TEXT);
  421.      settextstyle(GOTHIC_FONT, HORIZ_DIR, 4);
  422.      outtextxy(getmaxx()/2,getmaxy()/2,
  423.                "Borland Graphics Interface (BGI)");
  424.   /* press a key to terminate */
  425.      getch();
  426.   /* shut down graphics system */
  427.      closegraph();
  428.  
  429. Page 7
  430.  
  431. BGIOBJ
  432.  
  433.  
  434.      return(0);
  435.   }
  436.  
  437.  
  438. Page 8
  439.  
  440.                                                                 CPP
  441.  
  442. CPP: The preprocessor utility
  443.  
  444. CPP produces a list (in a file) of a C source program in which
  445. include files and #define macros have been expanded. It is not
  446. needed for normal compilations of C programs.
  447. Often, when the compiler reports an error inside a macro or an
  448. include file, you can get more information about what the error is
  449. if you can see the include files or the results of the macro
  450. expansions. In many multi-pass compilers, a separate pass performs
  451. this work, and the results of the pass can be examined. Since Turbo
  452. C++ uses an integrated single-pass compiler, we provided CPP to
  453. supply the first-pass functionality found in other compilers.
  454.  
  455. You use CPP just as you would use TCC, the standalone compiler. CPP
  456. reads the same TURBOC.CFG file for default options, and accepts the
  457. same command-line options as TCC.
  458.  
  459. The TCC options that don't pertain to CPP are simply ignored by
  460. CPP. To see the list of arguments handled by CPP, type cpp at the
  461. DOS prompt.
  462.  
  463. With one exception, the file names listed on the CPP command line
  464. are treated like they are in TCC, with wildcards allowed. The
  465. exception to this is that all files are treated as C source files.
  466. There is no special treatment for .OBJ, .LIB, or .ASM files.
  467.  
  468. For each file processed by CPP, the output is written to a file in
  469. the current directory (or the output directory named by the -n
  470. option) with the same name as the source name but with an extension
  471. of .I.
  472.  
  473. This output file is a text file containing each line of the source
  474. file and any include files. Any preprocessing directive lines have
  475. been removed, along with any conditional text lines excluded from
  476. the compile. Unless you use a command-line option to specify other-
  477. wise, text lines are prefixed with the file name and line number of
  478. the source or include file the line came from. Within a text line,
  479. any macros are replaced with their expansion text.
  480.  
  481. Important!
  482. The resulting output of CPP cannot be compiled because of the file
  483. name and line number prefix attached to each source line.
  484.  
  485.  
  486.   CPP as a macro
  487.     preprocessor
  488.  
  489. The -P option to CPP tells it to prefix each line with the source
  490. file name and line number. If you give it -P* (turning this option
  491. off), CPP omits this line number information. With this option
  492.  
  493. Page 9
  494. CPP
  495.  
  496. turned off, CPP can be used as a macro preprocessor; the resulting
  497. .I file can then be compiled with TC or TCC.
  498.  
  499.  
  500.       An example
  501.  
  502. The following simple program illustrates how CPP preprocesses a
  503. file, first with -P selected, then with -P*.
  504.  
  505. Source file: HELLOJOE.C
  506.   #define NAME "Joe Smith"
  507.   #define BEGIN {
  508.   #define END   }
  509.  
  510.   main()
  511.   BEGIN
  512.      printf("%s\n", NAME);
  513.   END
  514.  
  515. Command line used to invoke CPP as a preprocessor:
  516.    cpp hellojoe.c
  517.  
  518. Output:
  519.   hellojoe.c 1:
  520.   hellojoe.c 2:
  521.   hellojoe.c 3:
  522.   hellojoe.c 4:
  523.   hellojoe.c 5: main()
  524.   hellojoe.c 6: {
  525.   hellojoe.c 7:    printf("%s\n","Joe Smith");
  526.   hellojoe.c 8: }
  527.  
  528. Command line used to invoke CPP as a macro preprocessor:
  529.    cpp -P* hellojoe.c
  530.  
  531. Output:
  532.   main()
  533.   {
  534.      printf("%s\n","Joe Smith");
  535.   }
  536.  
  537.  
  538. GREP: A text-search utility
  539.  
  540. GREP (Global Regular Expression Print) is a powerful text-search
  541. program derived from the UNIX utility of the same name. GREP
  542. searches for a text pattern in one or more files or in its standard
  543. input stream.
  544.  
  545. Page 10
  546.  
  547.                                                                GREP
  548.  
  549.  
  550. Here's a quick example of a situation where you might want to use
  551. GREP. Suppose you wanted to find out which text files in your
  552. current directory contained the string "Elisabeth." You would issue
  553. the command
  554.  
  555.    grep Elisabeth *.txt
  556.  
  557. and GREP would respond with a list of the lines in each file (if
  558. any) that contained the string "Elisabeth." The strings "elisabeth"
  559. and "ELISABETH" would not be considered matches.
  560.  
  561. GREP can do a lot more than match a single, fixed string. In the
  562. section that follows, you'll see how to make GREP search for any
  563. string that matches a particular pattern.
  564.  
  565.  
  566.     Command-line
  567.           syntax
  568.  
  569. The general command-line syntax for GREP is
  570.  
  571.   grep [options] searchstring [filespec ... ]
  572.  
  573. options consist of one or more letters, preceded by a hyphen (*),
  574. that let you change various aspects of GREP's behavior.
  575.  
  576. searchstring gives the pattern to search for.
  577.  
  578. filespec (a list of file specifications) tells GREP which files to
  579. search. (If no file is specified, GREP searches its standard input;
  580. this lets you use GREP with pipes and redirection.)
  581.  
  582. In addition, the command
  583.  
  584.    GREP ?
  585.  
  586. prints a brief help screen showing GREP's command-line options,
  587. special characters, and defaults. (See the description of the -u
  588. command-line option for information on how to change GREP's
  589. defaults.)
  590.  
  591.  
  592.     GREP options
  593.  
  594. In the command line, options are one or more single characters
  595. preceded by a hyphen (*). Each individual character is a switch
  596. that you can turn on or off: A plus symbol (+) after a character
  597. turns the option on; a hyphen (*) after the character turns the
  598. option off.
  599.  
  600. The default is on; for example, -r means the same thing as -r+. You
  601. can list multiple options individually (like this: -i -d -l), or
  602. Page 11
  603.  
  604. GREP
  605.  
  606.  
  607. you can combine them (like this: -ild or -il, -d, and so on); it's
  608. all the same to GREP.
  609.  
  610. Here are the GREP option characters and their meanings:
  611. __________________________________________________________
  612.  
  613. Option Meaning
  614. __________________________________________________________
  615.  
  616.  
  617.   -c   Count only: Prints only a count of matching lines.
  618.        For each file that contains at least one matching
  619.        line, GREP prints the file name and a count of the
  620.        number of matching lines. Matching lines are not
  621.        printed.
  622.  
  623.   -d   Directories: For each filespec specified on the
  624.        command line, GREP searches for all files that
  625.        match the file specification, both in the directory
  626.        specified and in all subdirectories below the
  627.        specified directory. If you give a filespec without
  628.        a path, GREP assumes the files are in the current
  629.        directory.
  630.  
  631.   -i   Ignore case: GREP ignores upper/lowercase
  632.        differences (case folding). GREP treats all letters
  633.        a to z as identical to the corresponding letters A
  634.        to Z in all situations.
  635.  
  636.   -l   List match files: Prints only the name of each file
  637.        containing a match. After GREP finds a match, it
  638.        prints the file name and processing immediately
  639.        moves on to the next file.
  640.  
  641.   -n   Numbers: Each matching line that GREP prints is
  642.        preceded by its line number.
  643.  
  644.   -o   UNIX output format: Changes the output format of
  645.        matching lines to support more easily the UNIX
  646.        style of command-line piping. All lines of output
  647.        are preceded by the name of the file that contained
  648.        the matching line.
  649.  
  650.   -r   Regular expression search: The text defined by
  651.        searchstring is treated as a regular expression
  652.        instead of as a literal string. This option is on
  653.        by default.
  654.  
  655.   -u   Update options: GREP will combine the options given
  656.        on the command line with its default options and
  657.        write these to the GREP.COM file as the new
  658.        defaults. (In other words, GREP is self-
  659.        configuring.) This option allows you to tailor the
  660.  
  661. Page 12
  662.  
  663.                                                                GREP
  664.  
  665.        default option settings to your own taste. If you
  666.        want to see what the defaults are in a particular
  667.        copy of GREP.COM, type
  668.  
  669.         GREP ?
  670.  
  671.        at the DOS prompt. Each option on the help screen
  672.        will be followed by a + or a - depending on its
  673.        default setting.
  674.  
  675.   -v   Nonmatch: Prints only nonmatching lines. Only lines
  676.        that do not contain the search string are
  677.        considered to be nonmatching lines.
  678.  
  679.   -w   Word search: Text found that matches the regular
  680.        expression is considered a match only if the
  681.        character immediately preceding and following
  682.        cannot be part of a word. The default word
  683.        character set includes A to Z, 0 to 9, and the
  684.        underscore ( _ ).
  685.  
  686.        An alternate form of this option lets you specify
  687.        the set of legal word characters. Its form is -
  688.        w[set], where set is any valid regular expression
  689.        set definition.
  690.  
  691.        If you define the set with alphabetic characters,
  692.        it is automatically defined to contain both the
  693.        uppercase and lowercase values for each letter in
  694.        the set (regardless of how it is typed), even if
  695.        the search is case-sensitive. If you use the -w
  696.        option in combination with the -u option, the new
  697.        set of legal characters is saved as the default
  698.        set.
  699.  
  700.   -z   Verbose: GREP prints the file name of every file
  701.        searched. Each matching line is preceded by its
  702.        line number. A count of matching lines in each file
  703.        is given, even if the count is zero._______________
  704.  
  705.  
  706.         Order of
  707.       precedence
  708.  
  709. Remember that each of GREP's options is a switch: Its state
  710. reflects the way you last set it. At any given time, each option
  711. can only be on or off. Each occurrence of a given option on the
  712. command line overrides its previous definition. Given this command
  713. line,
  714.  
  715.    grep -r -i* -d -i -r*  main( my*.c
  716.  
  717. Page 13
  718.  
  719. GREP
  720.  
  721.  
  722. GREP runs with the -d option on, the -i option on, and the -r
  723. option off.
  724.  
  725. You can install your preferred default setting for each option in
  726. GREP.COM with the -u option. For example, if you want GREP to
  727. always do a verbose search (-z on), you can install it with the
  728. following command:
  729.  
  730.    grep -u -z
  731.  
  732.  
  733.       The search
  734.           string
  735.  
  736. To use GREP well, you'll need to become proficient at writing
  737. search strings. The value of searchstring defines the pattern GREP
  738. searches for. A search string can be either a regular expression or
  739. a literal string.
  740.  
  741. In a regular expression, certain characters have special meanings:
  742. They are operators that govern the search.
  743.  
  744. In a literal string, there are no operators: Each character is
  745. treated literally.
  746.  
  747. You can enclose the search string in quotation marks to prevent
  748. spaces and tabs from being treated as delimiters. The text matched
  749. by the search string cannot cross line boundaries; that is, all the
  750. text necessary to match the pattern must be on a single line.
  751.  
  752. A regular expression is either a single character or a set of
  753. characters enclosed in brackets. A concatenation of regular
  754. expressions is a regular expression.
  755.  
  756.  
  757.     Operators in
  758.          regular
  759.      expressions
  760.  
  761. When you use the -r option (on by default), the search string is
  762. treated as a regular expression (not a literal expression). The
  763. following characters take on special meanings:
  764.  
  765. Page 14
  766.  
  767.                                                                GREP
  768.  
  769. __________________________________________________________
  770.  
  771. Option Meaning
  772. __________________________________________________________
  773.  
  774.   ^    A circumflex at the start of the expression matches
  775.        the start of a line.
  776.  
  777.   $    A dollar sign at the end of the expression matches
  778.        the end of a line.
  779.  
  780.   .    A period matches any character.
  781.  
  782.   *    An expression followed by an asterisk wildcard
  783.        matches zero or more occurrences of that
  784.        expression. For example, in to*, the * operates on
  785.        the expression o; it matches t, to, too, etc. (t
  786.        followed by zero or more os), but doesn't match ta.
  787.  
  788.   +    An expression followed by a plus sign matches one
  789.        or more occurrences of that expression: to+ matches
  790.        to, too, etc., but not t.
  791.  
  792.   [ ]  A string enclosed in brackets matches any character
  793.        in that string, but no others. If the first
  794.        character in the string is a circumflex (^), the
  795.        expression matches any character except the
  796.        characters in the string.
  797.  
  798.        For example, [xyz] matches x, y, or z, while [^xyz]
  799.        matches a and b, but not x, y, or z. You can
  800.        specify a range of characters with two characters
  801.        separated by a hyphen (*). These can be combined to
  802.        form expressions (like [a*bd*z?], which matches the
  803.        ? character and any lowercase letter except c).
  804.  
  805.   \    The backslash escape character tells GREP to search
  806.        for the literal character that follows it. For
  807.        example, \. matches a period instead of "any
  808.        character." The backslash can be used to quote
  809.        itself; that is, you can use \\ to indicate a
  810.        literal backslash character in a GREP expression.
  811. __________________________________________________________
  812.  
  813. Note
  814. Four of the "special" characters ($, ., *, and +) don't have any
  815. special meaning when used within a bracketed set. In addition, the
  816. character ^ is only treated specially if it immediately follows the
  817. beginning of the set definition (immediately after the [
  818. delimiter).
  819.  
  820. Any ordinary character not mentioned in the preceding list matches
  821. that character (> matches >, # matches #, and so on).
  822.  
  823. Page 15
  824.  
  825. GREP
  826.  
  827.  
  828.             File
  829.   specifications
  830.  
  831. filespec tells GREP which files (or groups of files) to search.
  832. filespec can be an explicit file name, or a "generic" file name
  833. incorporating the DOS ? and * wildcards. In addition, you can enter
  834. a path (drive and directory information) as part of filespec. If
  835. you give filespec without a path, GREP searches the current
  836. directory.
  837.  
  838. If you don't specify any file specifications, input to GREP must
  839. come from redirection (<) or a vertical bar (|).
  840.  
  841.  
  842.        Some GREP
  843.         examples
  844.  
  845. The following examples show how to combine GREP's features to do
  846. different kinds of searches. They assume GREP's default settings
  847. are unchanged.
  848.  
  849.  
  850.        Example 1
  851.  
  852. The search string here tells GREP to search for the word main with
  853. no preceding lowercase letters ([^a*z]), followed by zero or more
  854. occurrences of blank spaces (\ *), then a left parenthesis.
  855.  
  856. Since spaces and tabs are normally considered to be command-line
  857. delimiters, you must quote them if you want to include them as part
  858. of a regular expression. In this case, the space after main is
  859. quoted with the backslash escape character. You could also
  860. accomplish this by placing the space in double quotes.
  861.  
  862. Command line:
  863.             grep -r [^a*z]main\ *( *.c
  864.  
  865. Matches:    main(i:integer)
  866.             main(i,j:integer)
  867.             if (main  ()) halt;
  868.  
  869. Does not match:
  870.             mymain()
  871.             MAIN(i:integer);
  872.  
  873. Files searched:
  874.             *.C in current directory.
  875.  
  876.  
  877. Page 16
  878.  
  879.                                                                GREP
  880.  
  881.        Example 2
  882.  
  883. Because the backslash (\) and period (.) characters usually have
  884. special meaning in path and file names, you must place
  885. the backslash escape character immediately in front of them if
  886. you want to search for them. The -i option is used here, so
  887. the search is not case sensitive.
  888.  
  889. Command line:
  890.             grep -ri [a*c]:\\data\.fil
  891. *.c *.inc
  892.  
  893. Matches:    A:\data.fil
  894.             c:\Data.Fil
  895.             B:\DATA.FIL
  896.  
  897. Does not match:
  898.             d:\data.fil
  899.             a:data.fil
  900.  
  901. Files searched:
  902.             *.C and *.INC in current
  903. directory.
  904.  
  905.  
  906.        Example 3
  907.  
  908. This format basically defines how to search for a given word.
  909.  
  910. Command line:
  911.             grep -ri [^a*z]word[^a*z]
  912.             *.doc
  913.  
  914. Matches:    every new word must be on a new line.
  915.             MY WORD!
  916.             word--smallest unit of speech.
  917.             In the beginning there was
  918.             the WORD, and the WORD
  919.  
  920. Does not match:
  921.             Each file has at least 2000 words.
  922.             He misspells toward as toword.
  923.  
  924. Page 17
  925.  
  926. GREP
  927.  
  928. Files searched:
  929.             *.DOC in the current directory.
  930.  
  931.        Example 4
  932.  
  933. This format defines a basic "word" search.
  934.  
  935. Command line:
  936.             grep -iw word *.doc
  937.  
  938. Matches:    every new word must be on a new line. However,
  939.             MY WORD!
  940.             word: smallest unit of speech which conveys
  941.             In the beginning there was the WORD, and
  942.  
  943. Does not match:
  944.             each document contains at least 2000 words!
  945.             He seems to continually misspell "toward" as "toword."
  946.  
  947. Files searched:
  948.             *.DOC in the current directory.
  949.  
  950.  
  951.        Example 5
  952.  
  953. This is an example of how to search for a string with embedded spaces.
  954.  
  955. Command line:
  956.             grep "search string with spaces" *.doc *.c a:\work\myfile.*
  957.  
  958. Matches:    This is a search string with spaces in it.
  959.  
  960. Does not match:
  961.             THIS IS A SEARCH STRING WITH SPACES IN IT.
  962.             This search string has spaces in it, too.
  963.  
  964. Page 18
  965.  
  966.                                                                GREP
  967.  
  968.  
  969. Files searched:
  970.             *.DOC and *.C in the current directory, and MYFILE.* in a
  971.             directory called \WORK on drive A.
  972.  
  973.  
  974.        Example 6
  975.  
  976. This example searches for any one of the characters " . : ? ' and ,
  977. at the end of a line.
  978.  
  979. The double quote within the range is preceded by an escape character,
  980. so it is treated as a normal character instead of as the ending quote
  981. for the string. Also, the $ character appears outside of the quoted
  982. string. This demonstrates how regular expressions can be concatenated
  983. to form a longer expression.
  984.  
  985. Command line:
  986.             grep -rd "[ ,.:?'\"]"$ \*.doc
  987.  
  988. Matches:    He said hi to me.
  989.             Where are you going?
  990.             In anticipation of a unique situation,
  991.             Examples include the following:
  992.             "Many men smoke, but fu man chu."
  993.  
  994. Does not match:
  995.             He said "Hi" to me
  996.             Where are you going? I'm headed to the
  997.  
  998. Files searched:
  999.             *.DOC in the root directory and all its subdirectories on
  1000.             the current drive.
  1001.  
  1002.  
  1003.        Example 7
  1004.  
  1005. This example ignores case and just prints the names of any files
  1006. that contain at least one match. The three command-line examples
  1007. show different ways of specifying multiple options.
  1008.  
  1009. Page 19
  1010.  
  1011. GREP
  1012.  
  1013. Command line:
  1014.             grep -ild " the " \*.doc
  1015.             or
  1016.             grep -i -l -d " the " \*.doc
  1017.             or
  1018.             grep -il -d " the " \*.doc
  1019.  
  1020. Matches:    Anyway, this is the time we have
  1021.             do you think? The main reason we are
  1022.  
  1023. Does not match:
  1024.             He said "Hi" to me just when I
  1025.             Where are you going? I'll bet you're headed
  1026.  
  1027. Files searched:
  1028.             *.DOC in the root directory and all its subdirectories on
  1029.             the current drive.
  1030.  
  1031.  
  1032.        Example 8
  1033.  
  1034. This example redefines the current set of legal characters for a word
  1035. as the assignment operator (=) only, then does a word search. It matches
  1036. C assignment statements, which use a single equal sign (=), but not
  1037. equality tests, which use a double equal sign (==).
  1038.  
  1039. Command line:
  1040.             grep -w[=] = *.c
  1041.  
  1042. Matches:    i = 5;
  1043.             j=5;
  1044.             i += j;
  1045.  
  1046. Does not match:
  1047.             if (i == t) j++;
  1048.             /* ======================= */
  1049.  
  1050. Files searched:
  1051.             *.C in the current directory.
  1052.  
  1053.  
  1054. Page 20
  1055.  
  1056.                                                             OBJXREF
  1057.  
  1058.  
  1059. OBJXREF: The object module cross-reference utility
  1060.  
  1061. OBJXREF examines a list of object files and library files and
  1062. produces reports on their contents. One type of report lists
  1063. definitions of public names and references to them. The other type lists
  1064. the segment sizes defined by object modules.
  1065.  
  1066. There are two categories of public names: global variables and function
  1067. names. The TEST1.C and TEST2.C files in the section "Sample OBJXREF
  1068. reports" (page 28) illustrate definitions of public names and external
  1069. references to them.
  1070.  
  1071. Object modules are object (.OBJ) files produced by TC, TCC or TASM. A
  1072. library (.LIB) file contains multiple object modules. An object module
  1073. generated by TC is given the same name as the .C source file it was
  1074. compiled from. This is also true for TCC, unless a different output
  1075. file name is specifically indicated with the -o TCC command-line option.
  1076.  
  1077.  
  1078. The OBJXREF command line
  1079.  
  1080. The OBJXREF command line consists of the word OBJXREF followed by a
  1081. series of command-line options and a list of object and library file
  1082. names, separated by a space or tab character. The syntax is as
  1083. follows:
  1084.  
  1085.   OBJXREF  options   filename  filename ...
  1086.  
  1087. The command-line options determine the kind of reports that OBJXREF will
  1088. generate and the amount of detail that OBJXREF will provide. They are
  1089. discussed in more detail in the next section.
  1090.  
  1091. Each option begins with a forward slash (/) followed by a one- or
  1092. two-character option name.
  1093.  
  1094. Page 21
  1095.  
  1096. OBJXREF
  1097.  
  1098.  
  1099. Object files and library files may be specified either on the command
  1100. line or in a response file. On the command line, file names are
  1101. separated by a space or a tab. All object modules specified as .OBJ
  1102. files are included in reports. Like TLINK, however, OBJXREF includes only
  1103. those modules from .LIB files which contain a public name referenced by an
  1104. .OBJ file or by a previously included module from a .LIB file.
  1105.  
  1106. As a general rule, you should list all the .OBJ and .LIB files that
  1107. are needed if the program is to link correctly, including the startup
  1108. .OBJ file and one or more C libraries.
  1109.  
  1110. File names may include a drive and directory path. The DOS ? and * wildcard
  1111. characters may be used to identify more than one file. File names may
  1112. refer to .OBJ object files or to .LIB library files. (If you don't
  1113. give a file extension, the .OBJ extension is assumed.)
  1114.  
  1115. Options and file names may occur in any order in the command line.
  1116.  
  1117. OBJXREF reports are written to the DOS standard output. The default is the
  1118. screen. The reports can be sent to a printer (as with >LPT1:) or to a
  1119. file (as with >lstfile) with the DOS redirection character (>).
  1120.  
  1121. Entering OBJXREF with no file names or options produces a summary of
  1122. available options.
  1123.  
  1124.  
  1125.      The OBJXREF
  1126.     command-line
  1127.          options
  1128.  
  1129. OBJXREF command-line options fall into two categories: control options and
  1130. report options.
  1131.  
  1132. Page 22
  1133.  
  1134.                                                             OBJXREF
  1135.  
  1136.  
  1137.                  Control options
  1138.  
  1139. Control options modify the default behavior of OBJXREF (the default is that
  1140. none of these options are enabled).
  1141. _________________________________________
  1142.  
  1143. Option Meaning
  1144. _________________________________________
  1145.  
  1146.  
  1147.   /I   Ignore case differences in public
  1148.        names. Use this option if you use
  1149.        TLINK without the /C option (which
  1150.        makes case differences
  1151.        significant).
  1152.  
  1153.   /D   Look for .OBJ files in another
  1154.        directory. If you want OBJXREF to
  1155.        look for .OBJ files in a directory
  1156.        other than the current one,
  1157.        include the directory name on the
  1158.        command line, prefixed with /D:
  1159.  
  1160.           OBJXREF /Ddir1 [; dir2 [; dir3]]
  1161.  
  1162.        or
  1163.  
  1164.           OBJXREF /Ddir1 [/Ddir2] [/Ddir3]
  1165.  
  1166.        OBJXREF will search each of the
  1167.        directories in the specified order
  1168.        for all object and library files.
  1169.  
  1170. Important!
  1171.  
  1172.        If you don't use a /D option,
  1173.        OBJXREF will search only the
  1174.        current directory. If you do use a
  1175.        /D option, however, the current
  1176.        directory will not be searched
  1177.        unless it is included in the
  1178.        directory list. For example, if
  1179.        you wanted OBJXREF to search first
  1180.        the BORLAND directory and then the
  1181.        current directory for files, you
  1182.        would enter
  1183.  
  1184.           OBJXREF /Dborland;.
  1185.  
  1186.  
  1187. Page 23
  1188.  
  1189. OBJXREF
  1190.  
  1191.  
  1192.        The period denotes the current directory.
  1193.  
  1194.  
  1195.   /F   Include full library. All object
  1196.        modules in specified .LIB files
  1197.        are included even if they do not
  1198.        contain public names that are
  1199.        referenced by an object module
  1200.        being processed by OBJXREF. This
  1201.        provides information on the entire
  1202.        contents of a library file. (See
  1203.        example 4 in the section "OBJXREF
  1204.        examples.")
  1205.  
  1206.   /O   Allows you to specify an output
  1207.        file where OBJXREF will send any
  1208.        reports generated. Its syntax is
  1209.        as follows:
  1210.  
  1211.           OBJXREF filename.obj /report
  1212.           option /Ooutputfilename.ext
  1213.  
  1214.        By default all output is sent to
  1215.        the screen.
  1216.  
  1217.  
  1218.   /V   Verbose output. Lists names of
  1219.        files read and displays totals of
  1220.        public names, modules, segments,
  1221.        and classes.
  1222.  
  1223.   /Z   Include zero-length segment
  1224.        definitions. Object modules may
  1225.        define a segment without
  1226.        allocating any space in it.
  1227.        Listing these zero length segment
  1228.        definitions normally makes the
  1229.        module size reports harder to use
  1230.        but it can be valuable if you are
  1231.        trying to remove all definitions
  1232.        of a segment.
  1233. _________________________________________
  1234.  
  1235.                  Report options
  1236.  
  1237. Report options govern what sort of report is generated, and the
  1238. amount of detail that OBJXREF provides.
  1239.  
  1240. Page 24
  1241.  
  1242.                                                             OBJXREF
  1243. _______________________________________________________________
  1244.  
  1245. Option Report generated
  1246. _______________________________________________________________
  1247.  
  1248.   /RC  Report by class type: Module sizes ordered by class type
  1249.        of segment.
  1250.  
  1251.   /RM  Report by module: Public names ordered by defining module.
  1252.  
  1253.   /RP  Report by public names: Public names in order with
  1254.        defining module name.
  1255.  
  1256. This is the default.
  1257.  
  1258.   /RR  Report by reference: Public name definitions and
  1259.        references ordered by name.
  1260.  
  1261.   /RS  Report of module sizes: Module sizes ordered by segment name.
  1262.  
  1263.   /RU  Report of unreferenced symbol names: Unreferenced public
  1264.        names ordered by defining module.
  1265.  
  1266.   /RV  Verbose reporting: OBJXREF produces a report of every type.
  1267.  
  1268.   /RX  Report by external reference: External references ordered
  1269.        by referencing module name.
  1270. ________________________________________________________________
  1271.  
  1272. Public names defined in .C files appear in reports with a leading
  1273. underscore in the reports unless the -U* option was specified when
  1274. the file was compiled (main appears as _main).
  1275.  
  1276. You can limit the modules, segments, classes, or public names that OBJXREF
  1277. reports on by entering the appropriate name on the command line prefixed with
  1278. the /N option. For example,
  1279.  
  1280.    OBJXREF filelist /RM /NC0
  1281.  
  1282. tells OBJXREF to generate a report listing information only for the module
  1283. named C0.
  1284.  
  1285. Page 25
  1286.  
  1287. OBJXREF
  1288.  
  1289.  
  1290.   Response files
  1291.  
  1292. The command line is limited by DOS to a maximum of 128 characters. If
  1293. your list of options and file names will exceed this limit, you must
  1294. place your file names in a response file.
  1295.  
  1296. A response file is a text file that you make with a text editor. Since
  1297. you may already have prepared a list of the files that make up your
  1298. program for other Turbo C++ programs, OBJXREF recognizes several
  1299. response file types.
  1300.  
  1301. Response files are called from the command line using one of the following
  1302. options. The response file name must follow the option without an
  1303. intervening space (so, for example, you would type /Lresp, not /L resp).
  1304.  
  1305. You can specify more than one response file on the command line;
  1306. additional .OBJ and .LIB file names can precede or follow them.
  1307.  
  1308.  
  1309.        Free-form
  1310.   response files
  1311.  
  1312. You can create a free-form response file with a text editor. Just list
  1313. the names of all .OBJ and .LIB files needed to make your .EXE file.
  1314.  
  1315. Any file name listed in the response file without an extension is
  1316. assumed to be an .OBJ file. To use free-form files with OBJXREF, type
  1317. in each response file name on the command line, preceded by an @, and
  1318. separate it from other command-line entries with a space or tab:
  1319.  
  1320.    @filename  @filename ...
  1321.  
  1322.  
  1323.    Project files
  1324.  
  1325.  
  1326. Page 26
  1327.  
  1328.                                                             OBJXREF
  1329.  
  1330. You can also use project files of the type generated by Turbo C++'s
  1331. integrated environment as response files. In the command line, precede
  1332. the project file name with /P, like this:
  1333.  
  1334.    /Pfilename
  1335.  
  1336. If the file name does not include an explicit extension, a .PRJ extension
  1337. is assumed.
  1338.  
  1339. File names in the project file with a .C extension or no extension are
  1340. interpreted as specifying the corresponding .OBJ file. You need not
  1341. remove file dependencies specified inside parentheses; they are ignored
  1342. by OBJXREF.
  1343.  
  1344. Note
  1345. By itself, the list of files in a .PRJ file does not specify a complete
  1346. program--you must also specify a startup file (C0x.OBJ) and one or more
  1347. Turbo C++ library files (MATHX.LIB, EMU.LIB, and CX.LIB, for example).
  1348. In addition, you may need to use the /D option to specify the directory
  1349. where OBJXREF should look for your .OBJ files.
  1350.  
  1351.  
  1352.  Linker response
  1353.            files
  1354.  
  1355. Files in TLINK response-file format can also be used by OBJXREF. A linker
  1356. response file called from the command line is preceded by /L, like so:
  1357.  
  1358.    /Lfilename
  1359.  
  1360. To see how to use one of these files, refer to Example 2 in the section
  1361. "Examples of how to use OBJXREF."
  1362.  
  1363. Page 27
  1364.  
  1365. OBJXREF
  1366.  
  1367.  
  1368.   Sample OBJXREF
  1369.          reports
  1370.  
  1371. Suppose you have two source files in your Turbo C++ directory, and want to
  1372. generate OBJXREF reports on the object files compiled from them. The source
  1373. files are called TEST1.C and TEST2.C, and they look like this:
  1374.  
  1375.   /* test1.c */
  1376.   int i1;                       /*  defines i1 */
  1377.   extern int i2;                /* refers  to i2 */
  1378.   static int i3;                /* not a  public name */
  1379.   extern void look(void);       /* refers  to look */
  1380.  
  1381.   void main(void)               /*  defines main */
  1382.   {
  1383.      int i4;                    /* not a  public name */
  1384.  
  1385.      look();                    /* refers  to look */
  1386.   }
  1387.  
  1388.   /* test2.c */
  1389.   #include <process.h>
  1390.   extern int i1;                /* refers  to i1 */
  1391.   int i2;                       /*  defines i2 */
  1392.  
  1393.   void look(void)               /*  defines look */
  1394.   {
  1395.      exit(i1);                  /* refers  to exit... */
  1396.   }                             /* and to  i1 */
  1397.  
  1398. The object modules compiled from these source files are TEST1.OBJ and
  1399. TEST2.OBJ. You can tell OBJXREF what kind of report to generate about
  1400. these .OBJ files by entering the file names on the command line,
  1401. followed by a /R and a second letter denoting report type.
  1402.  
  1403. Page 28
  1404.  
  1405.                                                             OBJXREF
  1406.  
  1407.  
  1408. Note: The following examples show only useful parts of the output.
  1409.  
  1410.  
  1411. Report by public names (/RP)
  1412.  
  1413. A report by public names lists each of the public names defined in
  1414. the object modules being reported on, followed by the name of the
  1415. module in which it is defined.
  1416.  
  1417. If you enter this on the command line:
  1418.  
  1419.    OBJXREF  /RP  test1  test2
  1420.  
  1421. OBJXREF generates a report that looks like this:
  1422.  
  1423.   SYMBOL           DEFINED IN
  1424.   _i1              TEST1
  1425.   _i2              TEST2
  1426.   _look            TEST2
  1427.   _main            TEST1
  1428.  
  1429.  
  1430. Report by module (/RM)
  1431.  
  1432. A report by module lists each object module being reported on, followed
  1433. by a list of the public names defined in it.
  1434.  
  1435. If you enter this on the command line:
  1436.  
  1437.    OBJXREF  /RM  test1  test2
  1438.  
  1439. OBJXREF generates a report that looks like this:
  1440.  
  1441.   MODULE: TEST1 defines the following symbols:
  1442.           public: _i1
  1443.           public: _main
  1444.   MODULE: TEST2 defines the following symbols:
  1445.           public: _i2
  1446.           public: _look
  1447.  
  1448.  
  1449. Page 29
  1450.  
  1451. OBJXREF
  1452.  
  1453.  
  1454.        Report by
  1455.  reference (/RR)
  1456.  
  1457. A report by reference lists each public name with the defining module in
  1458. parentheses on the same line. Modules that refer to this public name are
  1459. listed on following lines indented from the left margin.
  1460.  
  1461. This is the default if no report option is specified.
  1462.  
  1463. If you enter this on the command line:
  1464.  
  1465.    OBJXREF  /RR  C0  test1  test2  CS.LIB
  1466.  
  1467. OBJXREF generates a report that looks like this:
  1468.  
  1469.   _exit (EXIT)
  1470.        C0
  1471.        TEST2
  1472.   _i1 (TEST1)
  1473.        TEST2
  1474.   _i2 (TEST2)
  1475.   _look (TEST2)
  1476.        TEST1
  1477.   _main (TEST1)
  1478.        C0
  1479.  
  1480.  
  1481.        Report by
  1482.         external
  1483. references (/RX)
  1484.  
  1485. A report by external references lists each module followed by a list of
  1486. external references it contains.
  1487.  
  1488. If you enter this on the command line:
  1489.  
  1490.    OBJXREF  /RX  C0  test1  test2  CS.LIB
  1491.  
  1492. OBJXREF generates a report that looks like this:
  1493.  
  1494.   MODULE: C0 references the following symbols:
  1495.           _main
  1496.   MODULE: TEST1 references the following symbols:
  1497.           _i2
  1498.           _look
  1499.  
  1500. Page 30
  1501.  
  1502.                                                             OBJXREF
  1503.  
  1504.  
  1505.   MODULE: TEST2 references the following symbols:
  1506.           _exit
  1507.           _i1
  1508.  
  1509.  
  1510. Report of module
  1511.      sizes (/RS)
  1512.  
  1513. A report by sizes lists segment names followed by a list of modules that
  1514. define the segment. Sizes in bytes are given in decimal and hexadecimal
  1515. notation. The word uninitialized appears where no initial values are
  1516. assigned to any of the symbols defined in the segment. Segments
  1517. defined at absolute addresses in a .ASM file are flagged Abs to the
  1518. left of the segment size.
  1519.  
  1520. If you enter this on the command line:
  1521.  
  1522.    OBJXREF  /RS  test1  test2
  1523.  
  1524. OBJXREF generates a report that looks like this:
  1525.  
  1526. These files were compiled using the large memory model.
  1527.  
  1528.   TEST1_TEXT
  1529.           6 (00006h)   TEST1
  1530.           6 (00006h)   total
  1531.   TEST2_TEXT
  1532.          10 (0000Ah)   TEST2
  1533.          10 (0000Ah)   total
  1534.   _BSS
  1535.           4 (00004h)   TEST1, uninitialized
  1536.           2 (00002h)   TEST2, uninitialized
  1537.           6 (00006h)   total
  1538.  
  1539.  
  1540.  Report by class
  1541.       type (/RC)
  1542.  
  1543. A report by class type lists segment size definitions by segment class.
  1544. The CODE class contains instructions, DATA class contains initialized
  1545. data and BSS class contains uninitialized data. Segments
  1546.  
  1547. Page 31
  1548.  
  1549. OBJXREF
  1550.  
  1551.  
  1552. which do not have a class type will be listed under the notation No
  1553. class type.
  1554.  
  1555. If you enter this on the command line:
  1556.  
  1557.    OBJXREF  /RC  C0  test1  test2  CS.LIB
  1558.  
  1559. OBJXREF generates a report that looks like this:
  1560.  
  1561.   BSS
  1562.          4  (00004h)   TEST1
  1563.          2  (00002h)   TEST2
  1564.        ...
  1565.        132  (00084h)   total
  1566.   CODE
  1567.          6  (00006h)   TEST1
  1568.         10  (0000Ah)   TEST2
  1569.         16  (00010h)   total
  1570.   DATA
  1571.        143  (0008Fh)   C0
  1572.        143  (0008Fh)   total
  1573.  
  1574.  
  1575.        Report of
  1576.     unreferenced
  1577.  symbol names (/
  1578.              RU)
  1579.  
  1580. A report of unreferenced symbol names lists modules that define public names
  1581. not referenced in other modules. Such a symbol is either:
  1582.  
  1583. 1. referenced only from within the defining module and does not need to be
  1584. defined as a public symbol (in that case, if the module is in C, the keyword
  1585. static should be added to the definition; if the module is in TASM, just
  1586. remove the public definition).
  1587.  
  1588. 2. never used (therefore, it can be deleted to save code or data space).
  1589.  
  1590. If you enter this on the command line:
  1591.  
  1592.    OBJXREF  /RU  test1  test2
  1593.  
  1594. OBJXREF generates a report that looks like this:
  1595.  
  1596. Page 32
  1597.  
  1598.                                                             OBJXREF
  1599.  
  1600.  
  1601.    MODULE: TEST2 defines the unreferenced symbol _i2.
  1602.  
  1603.  
  1604.          Verbose
  1605.  reporting (/RV)
  1606.  
  1607. If you enter /RV on the command line, OBJXREF generates one report of each
  1608. type.
  1609.  
  1610.  
  1611.  Examples of how
  1612.   to use OBJXREF
  1613.  
  1614. These examples assume that the application files are in the current
  1615. directory of the default drive and that the Turbo C++ startup files
  1616. (C0x.OBJ) and the library files are in the \TURBOC\LIB directory.
  1617.  
  1618.  
  1619.        Example 1
  1620.  
  1621. C>OBJXREF \turboc\lib\c0l test1 test2 \turboc\lib\cl.lib
  1622.  
  1623. In this example, the TEST1.OBJ and TEST2.OBJ files and the Turbo C++ startup
  1624. file \TURBOC\LIB\C0L.OBJ and the library file \TURBOC\LIB\CL.LIB are
  1625. specified. Since no report type is specified, the resulting report is 
  1626. the default report by reference, listing public names and the modules
  1627. that reference them.
  1628.  
  1629.  
  1630.        Example 2
  1631.  
  1632. C>OBJXREF /RV /Ltest1.arf
  1633.  
  1634. The TLINK response file TEST1.ARF contains the same list of files as the
  1635. command line in Example 1. The /RV option is specified, so a report of
  1636. every type will be generated. TEST1.ARF contains
  1637.  
  1638.   \turboc\lib\c0l
  1639.   test1 test2
  1640.   test1.exe
  1641.   test1.map
  1642.   \turboc\lib\cl
  1643.  
  1644. Page 33
  1645.  
  1646. OBJXREF
  1647.  
  1648.        Example 3
  1649.  
  1650. C>OBJXREF /RC  B:c0s  /Ptest1  @libs
  1651.  
  1652. The TC project file TEST1.PRJ specifies TEST1.OBJ and TEST2.OBJ. The response
  1653. file @libs specifies libraries on a disk in the B drive. TEST1.PRJ contains
  1654.  
  1655.   test1
  1656.   test2.c
  1657.  
  1658. The file LIBS contains
  1659.  
  1660.    b:maths.lib b:emu.lib b:cs.lib
  1661.  
  1662. The startup and library files specified depend on the memory model and
  1663. floating point options used in compilation. The /RC causes a report of
  1664. class type to be output.
  1665.  
  1666.  
  1667.        Example 4
  1668.  
  1669. C>OBJXREF /F /RV \turboc\lib\cs.lib
  1670.  
  1671. This example reports on all the modules in the Turbo C++ library file CS.LIB;
  1672. OBJXREF can produce useful reports even when the files specified do not make a
  1673. complete program. The /F causes all modules in CS.LIB file to be included in
  1674. the report.
  1675.  
  1676.  
  1677.    OBJXREF error
  1678.     messages and
  1679.         warnings
  1680.  
  1681. OBJXREF generates two sorts of diagnostic messages: error messages
  1682. and warnings.
  1683.  
  1684. Page 34
  1685.  
  1686.                                                             OBJXREF
  1687.  
  1688.  
  1689.   Error messages
  1690.  
  1691. Out of memory
  1692. OBJXREF performs its cross referencing in
  1693. RAM memory and may run out of memory even
  1694. if TLINK is able to link the same list of
  1695. files successfully. When this happens,
  1696. OBJXREF aborts. Remove memory resident
  1697. programs to get more space, or add more
  1698. RAM.
  1699.  
  1700.  
  1701.         Warnings
  1702.  
  1703. WARNING: Unable to open input file <filename>
  1704. The input file filename could not be
  1705. located or opened. OBJXREF proceeds to
  1706. the next file.
  1707.  
  1708. WARNING: Unknown option - <option>
  1709. The option name option is not recognized
  1710. by OBJXREF. OBJXREF ignores the option.
  1711.  
  1712. WARNING: Unresolved symbol <symbol> in module <module>
  1713. The public name symbol referenced in
  1714. module module is not defined in any of
  1715. the .OBJ or .LIB files specified. OBJXREF
  1716. flags the symbol in any reports it
  1717. generates as being referenced but not
  1718. defined.
  1719.  
  1720. WARNING: Invalid file specification <filename>
  1721. Some part of the file name filename is
  1722. invalid. OBJXREF proceeds to the next
  1723. file.
  1724.  
  1725. WARNING: No files matching <filename>
  1726. The file named filename listed on the
  1727. command line or in a response file could
  1728. not be located or opened. OBJXREF skips
  1729. to the next file.
  1730.  
  1731. WARNING: Symbol <symbol> defined in <module1> duplicated in <module2>
  1732. Public name symbol is defined in modules
  1733. module1 and module2. OBJXREF ignores the
  1734. second definition.
  1735.  
  1736.  
  1737. Page 35
  1738.  
  1739.                       TURBO HELP UTILITY
  1740.                       ------------------
  1741.  
  1742. This file explains how to use THELP.COM. THELP is a memory-resident
  1743. utility that provides online help for Turbo C++. If you are using
  1744. Turbo Debugger, for example, you can load THELP, then run Turbo
  1745. Debugger and get online help for Turbo C++ while you are debugging.
  1746.  
  1747.  
  1748. Table of Contents
  1749. -----------------
  1750. 1.  Starting THELP
  1751. 2.  Command-line Options Summary
  1752. 3.  Detailed Explanation of Keys Used When THELP is Active
  1753. 4.  Detailed Explanation of Command line Options
  1754.  
  1755.  
  1756. 1.  Starting THELP
  1757. ------------------
  1758.  
  1759. Load THELP at the DOS command line simply by typing THELP. Make sure
  1760. the Turbo help file is in the current directory or use the /F command
  1761. line option (described below). The INSTALL program inserts the correct
  1762. path information in THELP.
  1763.  
  1764.   Memory usage
  1765.     THELP requires about 21K bytes.
  1766.  
  1767.   Default hot key
  1768.     The default hot key is Numeric-Keypad-5 (scan code 4ch,
  1769.     shift state 00h).
  1770.  
  1771. If you are using SideKick Plus or SideKick 1.x, make sure you
  1772. load THELP before you load SideKick.
  1773.  
  1774.  
  1775. 2. Command-line Options Summary
  1776. -------------------------------
  1777.  
  1778.   USAGE:  THELP [options]
  1779.  
  1780. Here is a summary of THELP's command-line options. If you use more
  1781. than one option, you must separate them with spaces.
  1782.  
  1783.   /C#xx     Select color: #=color number, xx=hex color value
  1784.   /Fname    Full path and file name of help file
  1785.   /H,/?,?   Display this help screen
  1786.   /Kxxyy    Change hot key: xx=shift state(hex), yy=scan code(hex)
  1787.   /S+       Enable snow checking for video (useful for older CGA             adapters).
  1788.   /S-       Disable snow checking for video (for snappier displays).
  1789.   /U        Remove THELP from memory
  1790.   /W        Write options to THELP.COM and exit
  1791.  
  1792.  
  1793. 3. Detailed Explanation of Keys Used When THELP is Active
  1794. ---------------------------------------------------------
  1795.  
  1796.   Arrow keys:  Move the cursor.
  1797.   PgUp/PgDn:   Move the cursor.
  1798.  
  1799.   Shift-Arrow keys:  Move the cursor while marking a block.
  1800.  
  1801.   TAB:         Moves the cursor to the next keyword.
  1802.   Shift-TAB:   Moves the cursor to the previous keyword.
  1803.  
  1804.   HOME:        Go to the beginning of the line.
  1805.   END:         Go to the end of the line.
  1806.  
  1807.   ENTER:       Select help entry for the item highlighted in the
  1808.                current help screen.
  1809.  
  1810.   ESC:         End Help.
  1811.  
  1812.   Shift-F1:    Help Index. F1 from any help screen brings up
  1813.                the Help Index.  You can search for a specific keyword
  1814.                incrementally.  For example, you can find "printf" by
  1815.                typing p r i.  With each letter you type, the list
  1816.                jumps to the keyword that starts with p, then to pr,
  1817.                then to pri, etc.
  1818.  
  1819.   ALT-F1:      Displays in reverse order the last 20 screens you
  1820.                have reviewed.
  1821.  
  1822.   CTRL-P key:  Pastes the marked block or the example text into
  1823.                the application.
  1824.  
  1825.  
  1826.  
  1827. 4.  Detailed Explanation of Command-line Options
  1828. ------------------------------------------------
  1829.  
  1830.  
  1831. /C#xx     Select color: #=color number, xx=hex color value
  1832.  
  1833. There are twelve possible colors, described as follows:
  1834.  
  1835.   0 = Color border attribute
  1836.   1 = Monochrome border attribute
  1837.   2 = Color text attribute
  1838.   3 = Monochrome text attribute
  1839.   4 = Color keyword attribute
  1840.   5 = Monochrome keyword attribute
  1841.   6 = Color selected keyword attribute
  1842.   7 = Monochrome selected keyword attribute
  1843.   8 = Color example text attribute
  1844.   9 = Monochrome example text attribute
  1845.   A = Color marked block attribute
  1846.   B = Monochrome marked block attribute
  1847.  
  1848. The color numbers for a standard IBM-compatible Color Display are
  1849. as follows:
  1850.  
  1851. First Digit (Background)              Second Digit (Foreground)
  1852.  
  1853. 0 -- Black                            0 -- Black
  1854. 1 -- Blue                             1 -- Blue
  1855. 2 -- Green                            2 -- Green
  1856. 3 -- Cyan                             3 -- Cyan
  1857. 4 -- Red                              4 -- Red
  1858. 5 -- Magenta                          5 -- Magenta
  1859. 6 -- Brown                            6 -- Brown
  1860. 7 -- Grey                             7 -- Grey
  1861.                                       8 -- Intense Black
  1862.  ORing the color value with           9 -- Intense Blue
  1863.  Hex 80 produces a blinking           A -- Intense Green
  1864.  color unless blinking has been       B -- Intense Cyan
  1865.  disabled.                            C -- Intense Red
  1866.                                       D -- Intense Magenta
  1867.                                       E -- Intense Brown (Yellow)
  1868.                                       F -- Intense Grey (White)
  1869.  
  1870. On monochrome monitors, the attribute values can differ widely,
  1871. so some experimentation would be needed.
  1872.  
  1873.  
  1874. /Fname       Full path and name of help file
  1875.  
  1876. The name that follows the /F option should be the full
  1877. drive/directory path name of the help file to use; e.g.,
  1878.  
  1879.     THELP /FC:\TP\TURBO.HLP
  1880.     THELP /FC:\TURBOC\TCHELP.TCH
  1881.  
  1882. By default, THELP looks for the help file on the logged drive and
  1883. directory.
  1884.  
  1885.  
  1886. /H,/?,?      Display help screen
  1887.  
  1888. This option displays a summary of THELP's command-line options
  1889.  
  1890.  
  1891. /Kxxyy       Change hot key: xx=shift state, yy=scan code
  1892.  
  1893. Virtually any shift state/scan code combination may be selected. A
  1894. quick summary of some common shift-states and scan codes follows:
  1895.  
  1896.   Shift States (may be OR'ed together)
  1897.  
  1898.     right shift    01h
  1899.     left shift     02h
  1900.     control        04h
  1901.     alt            08h
  1902.  
  1903.   Scan Codes
  1904.  
  1905.     A   --- 1eh     N   --- 31h     0   --- 0bh     F1  --- 3bh
  1906.     B   --- 30h     O   --- 18h     1   --- 02h     F2  --- 3ch
  1907.     C   --- 2eh     P   --- 19h     2   --- 03h     F3  --- 3dh
  1908.     D   --- 20h     Q   --- 10h     3   --- 04h     F4  --- 3eh
  1909.     E   --- 12h     R   --- 13h     4   --- 05h     F5  --- 3fh
  1910.     F   --- 21h     S   --- 1fh     5   --- 06h     F6  --- 40h
  1911.     G   --- 22h     T   --- 14h     6   --- 07h     F7  --- 41h
  1912.     H   --- 23h     U   --- 16h     7   --- 08h     F8  --- 42h
  1913.     I   --- 17h     V   --- 2fh     8   --- 09h     F9  --- 43h
  1914.     J   --- 24h     W   --- 11h     9   --- 0ah     F10 --- 44h
  1915.     K   --- 25h     X   --- 2dh
  1916.     L   --- 26h     Y   --- 15h
  1917.     M   --- 32h     Z   --- 2ch
  1918.  
  1919.  
  1920.   Enhanced Keyboards only (may not work with all computers, keyboards)
  1921.  
  1922.     F11 --- 57h
  1923.     F12 --- 58h
  1924.  
  1925. /S           Controls snow-checking logic for video.
  1926.  
  1927. Some older CGA have a tendency to produce a "snow" effect when
  1928. software tries to write directly into their memory space.  If you see
  1929. this snow you should start up THELP with /S+ to enable the snow
  1930. checking code.  You may want to use the /W switch (see below) to make
  1931. it permanent.  Snow checking takes time and it is better to live
  1932. without it.  To disable snow checking use /S-; this is the default.
  1933.  
  1934. /U           Remove THELP from memory
  1935.  
  1936. This option removes THELP from memory. If other TSRs have been
  1937. loaded after THELP, make sure to remove them before removing
  1938. THELP.
  1939.  
  1940.  
  1941. /W           Write Options to THELP.COM and exit
  1942.  
  1943. The /W parameter creates a new version of THELP that uses the
  1944. options you desire as a default. All options may be specified
  1945. and made "permanent."
  1946.  
  1947. Page 36
  1948.  
  1949. TRIGRAPH
  1950.  
  1951. Trigraphs are three-character sequences that replace certain
  1952. characters used in C that are not available on some keyboards.
  1953. Translating trigraphs in the compiler would slow compilation down
  1954. considerably, yet trigraph support is required by ANSI C. So
  1955. Turbo C++ provides a filer named TRIGRAPH.EXE to handle trigraph
  1956. sequences when you need to. The syntax for invoking this program is
  1957.  
  1958.   TRIGRAPH [-u] <filespec> [<filespec> ...]
  1959.  
  1960. The following table shows the trigraph sequences that TRIGRAPH.EXE
  1961. recognizes:
  1962.  
  1963. ===========================
  1964.   Trigraph    Character
  1965. ===========================
  1966.  
  1967.     ??=         #
  1968.     ??(         [
  1969.     ??)         ]
  1970.     ??<         {
  1971.     ??>         }
  1972.     ??/         \
  1973.     ??'         ^
  1974.     ??!         |
  1975.     ??-         ~
  1976.  
  1977. TRIGRAPH.EXE works in two directions: It can convert all trigraphs
  1978. to their single-character representation, and it can convert single
  1979. characters to their trigraph representation. Ordinarily, TRIGRAPH.EXE
  1980. converts trigraphs to single characters. You can specify the inverse
  1981. conversion with the -u (undo) command-line option, which must come
  1982. before any file name on the command line.
  1983.  
  1984. TRIGRAPH.EXE accepts any number of file specifiers, including wildcards,
  1985. on the command line. For each file specified, it creates a backup copy
  1986. of the file with the original file name and an extension .BAK, and then
  1987. creates a new file with the original file name and the appropriate
  1988. conversions performed. For example,
  1989.  
  1990.    trigraph test.c test1.c
  1991.  
  1992. removes all trigraphs from the two files TEST.C and TEST1.C, and creates
  1993. backup files TEST.BAK and TEST1.BAK.
  1994.  
  1995. As another example, the following command inserts trigraphs into all the
  1996. files with the extension .C, and makes backup copies of all those files,
  1997. giving them the extension .BAK.
  1998.  
  1999.    trigraph -u *.c
  2000.  
  2001. Page 37
  2002.  
  2003. Page 38 through Page 40
  2004. ___________________________________________________________________
  2005.  
  2006. INDEX
  2007.  
  2008. Note: This index does not include entries for PRJCNVT, THELP, or TRIGRAPH.
  2009.  
  2010. ASCII characters                                        files
  2011.  
  2012. [ ] GREP operator 15                  files
  2013. $ GREP operator 15                      compiling 10
  2014. * GREP operator 15                    -P option (source file names
  2015. + GREP operator 15                      and line numbers) 9
  2016. . GREP operator 15                    wildcards and 9
  2017. \ GREP operator 15
  2018. ^ GREP operator 15
  2019.                                     D
  2020.                                     -d GREP option (directories) 12
  2021. B                                   /D OBJXREF option (directory)
  2022. BGIOBJ (graphics converter) 1-8       23
  2023.   advanced features 5               debugging
  2024.   command-line syntax 2, 5            include files 9
  2025.   components 5                        macros 9
  2026.   example 3                         directories
  2027.   graphics.h and 6                    CPP (preprocessor) 9
  2028.   options                             GREP option 12
  2029.     destination file 5                .OBJ files 23
  2030.     /F 5
  2031.     file name 5
  2032.     file name (/F) 4                E
  2033.     public name 5                   errors
  2034.     segment class 6                   linker
  2035.     segment name 5                      graphics drivers and fonts
  2036.     source file 5                       4
  2037.                                       OBJXREF (list) 34
  2038.                                     examples
  2039. C                                     OBJXREF 28-34
  2040. -c GREP option (count only) 12
  2041. case sensitivity
  2042.   GREP option 12                    F
  2043.                                     /F BGIOBJ option 5
  2044.                                     /F BGIOBJ option (far routines)
  2045.                                       4
  2046. command line                        /F OBJXREF option (include full
  2047.   syntax                              library) 24
  2048.     CPP 9                           files
  2049. configuration files                   destination
  2050.   CPP (preprocessor) and 9              BGIOBJ 5
  2051.   TCC file 9                          linker response, used by OBJXREF
  2052. CPP (preprocessor) 9-10                 27, 33
  2053.   command-line options and            macros
  2054.   syntax 9                              expanded 9
  2055.   directory 9                         matching
  2056.   example of use 10                     GREP option 12
  2057.  
  2058. Page 41
  2059.  
  2060. files                                                        linker
  2061.  
  2062. files
  2063.   names                                 -o (UNIX output format) 12
  2064.     printing (GREP) 13                  precedence 13
  2065.   output, generated by OBJXREF          regular expression search
  2066.     24                                  (-r) 12
  2067.   searching 10-20                       UNIX format (-o) 12
  2068.   source                                updating (-u) 12
  2069.     BGIOBJ 5                            -v 13
  2070. fonts                                   -v (nonmatching lines) 13
  2071.   adding to graphics library 2          verbose 13
  2072.   files, converting to .OBJ             word search (-w) 13
  2073.   files 2                             search strings 14
  2074.   included with Turbo C++ 3             white space in 16
  2075.   linker errors and 4                 using 11
  2076.   linking 1-8                         wildcards and 16
  2077.   registering 2, 6                  GREP.COM 14
  2078.   stroked 1-8
  2079.     linking 1
  2080.                                     H
  2081.                                     header files
  2082. G                                     graphics.h 6
  2083. graphics drivers                    help
  2084.   adding to graphics library 2        GREP (file searcher) 11
  2085.   converting to .OBJ files 2,         OBJXREF 22
  2086.   1-8
  2087.   included with Turbo C++ 3
  2088.   linker                            I
  2089.     errors and 4                    -i GREP option (case
  2090.   linking 1                           sensitivity) 12
  2091.   registering 2, 6                  /I OBJXREF option (case
  2092. graphics.h (header file)              sensitivity) 23
  2093.   BGIOBJ and 6                      include files
  2094. GRAPHICS.LIB                          debugging 9
  2095.   adding to 2
  2096. GREP (file searcher) 10-20
  2097.   examples 16                       L
  2098.   files to search 16                -l GREP option (list matching
  2099.   help 11                             files) 12
  2100.   literal character 15              /L OBJXREF command (linker
  2101.   matches 15                          response file) 27
  2102.   operators 14                      libraries
  2103.   optimizing use of 14                files 21
  2104.   options                               contents of 21
  2105.     case sensitivity (-i) 12          graphics
  2106.     count only (-c) 12                  adding driver and font
  2107.     default 12, 14                      files to 2
  2108.     discussion 11                     OBJXREF
  2109.     file names (printing) 13            including all 24
  2110.     -i (case sensitivity) 12        lines
  2111.     line numbers (-n) 12              numbering
  2112.     lines, nonmatching (-v) 13          printing (GREP) 12
  2113.     list matching files (-l) 12     linker
  2114.     -n (line numbers) 12              error: segment exceeds 64K 4
  2115.  
  2116. Page 42
  2117.  
  2118. linker                                                    OBJXREF
  2119.  
  2120. linker
  2121.   response files                      options 21
  2122.     used by OBJXREF 27, 33              /N (limit information) 25
  2123. linking                                 /RV 25
  2124.   graphics drivers 1                    /RC 31
  2125.                                         control 23
  2126.                                         directories (/D) 23
  2127. M                                       /F (include full library)
  2128. macros                                  24
  2129.   CPP (preprocessor) and 9              ignore case (/I) 23
  2130.   debugging 9                           include full library (/F)
  2131.   expanded                              24
  2132.     list of 9                           include zero-length segment
  2133.   preprocessing 9                       definitions (/Z) 24
  2134.   preprocessor 9                        list file names (/V) 24
  2135.                                         modified reports 25
  2136.                                         /O (output file) 24
  2137. N                                       reports 24
  2138. -n command-line compiler option           by class type (/RC) 25,
  2139.   CPP (preprocessor) and 9                31, 34
  2140. -n GREP option (line numbers)             by external reference (/
  2141.   12                                      RX) 25, 30
  2142. /N OBJXREF option (limit                  by module (/RM) 25, 29
  2143.   reports) 25                             by public names (/RP) 25,
  2144.                                           29
  2145.                                           by reference (/RR) 25,
  2146. O                                         30, 33
  2147. -o GREP option (UNIX format               default type 33
  2148.   output) 12                              examples 28-33
  2149. /O OBJXREF option (output file            of all types (/RV) 25
  2150.   for reports) 24                         of module sizes (/RS) 25,
  2151. .OBJ files                                31
  2152.   converting font files into 2            of unreferenced symbol
  2153.   converting graphics drivers             names (/RU) 25, 32
  2154.   files into 2                            output file (/O) 24
  2155.   defined 21                              verbose (/RV) 25, 33, 34
  2156.   directories 23                        /V (verbose output) 24
  2157.   names 21                              verbose report (/RV) 33
  2158.   response files and 26                 /Z (include zero-length
  2159. object modules                          segment definitions) 24
  2160.   defined 21                          project files
  2161.   names 21                              as response files 27
  2162. OBJXREF (object module cross-         project files (/P) 27
  2163.   referencer) 21-35                   reports 22
  2164.   directories 23                        examples 28-33
  2165.   error messages 34                     modifying 25
  2166.   examples of reports 29, 30,           output file for (/O) 24
  2167.   31, 32, 33                          response files 21, 26
  2168.   help 22                               example 33
  2169.   /L command (linker response           linker 27
  2170.   files) 27                           warnings 35
  2171.   linker files                        wildcards and 22
  2172.     as response files 27
  2173.  
  2174. Page 43
  2175.  
  2176. operators                                         /Z OBJXREF option
  2177.  
  2178. operators                           /RV OBJXREF option (reports) 25
  2179.   GREP 14                           /RX OBJXREF option (reports) 25
  2180. output file
  2181.   generated by OBJXREF 24
  2182.                                     S
  2183.                                     searches
  2184. P                                     text files 10-20
  2185. -P CPP (preprocessor) option        standalone utilities
  2186.   (source file names and line         list 1
  2187.   numbers) 10                       strings
  2188. /P OBJXREF command (project           searching for
  2189.   files) 27                             as expressions (GREP) 12
  2190. precedence                              in text files 10-20
  2191.   GREP options 13                   syntax
  2192. project files                         CPP 9
  2193.   converting Page A
  2194.   OBJXREF and 27
  2195.   used by OBJXREF 34
  2196. public names                        T
  2197.   defined 21                        text files
  2198.                                       searching 10-20
  2199.                                     TLINK (linker)
  2200. R                                     response files
  2201. -r GREP option (regular                 OBJXREF and 27
  2202.   expression search) 12             TURBOC.CFG 9
  2203. /RC OBJXREF option (report) 31
  2204. /RC OBJXREF option (reports) 25
  2205. registerbgidriver (function)        U
  2206.   BGIOBJ and 2, 6                   -u GREP option (updating) 12
  2207. registerbgifont (function)          UNIX
  2208.   BGIOBJ and 2, 6                     format (GREP) 12
  2209. registerfarbgidriver (function)
  2210.   BGIOBJ and 4, 5, 6
  2211. registerfarbgifont (function)       V
  2212.   BGIOBJ and 4, 5, 6                -v GREP option (nonmatching
  2213. response files                        lines) 13
  2214.   file-name extensions and 26       /V OBJXREF option (verbose
  2215.   formats 26                          output) 24
  2216.   free-form 26
  2217.     example 34
  2218.   linker files and 27               W
  2219.   OBJXREF and 21, 26, 27            -w GREP option (word search) 13
  2220.     example 33                      wildcards
  2221.   project files and 27                CPP (preprocessor) and 9
  2222.   TLINK, OBJXREF and 33               OBJXREF and 22
  2223. /RM OBJXREF option (reports) 25
  2224. /RP OBJXREF option (reports) 25
  2225. /RR OBJXREF option (reports) 25     Z
  2226. /RS OBJXREF option (reports) 25     -z GREP option (verbose) 13
  2227. /RU OBJXREF option (reports) 25     /Z OBJXREF option (include
  2228.                                       zero-length segment
  2229.                                       definitions) 24
  2230.  
  2231. Page 44
  2232.  
  2233. Appendix A: Project conversion utilities
  2234.  
  2235. =============================
  2236.           PRJCNVT
  2237. =============================
  2238.  
  2239. Converts Turbo C 1.0, 1.5 or 2.0 project files to Turbo C++
  2240. project files.
  2241.  
  2242.   Syntax:
  2243.  
  2244.       PRJCNVT infile[.prj] [outfile[.prj]]
  2245.          or
  2246.       PRJCNVT infile[.tc]  [outfile[.prj]]
  2247.  
  2248. If you specify a configuration file as input, it must have a
  2249. project file defined. The compiler options in the .CFG file
  2250. and the dependencies in the Turbo C 2.0 .PRJ file will be placed
  2251. into the corresponding Turbo C++ .PRJ file.
  2252.  
  2253. If you specify a project file as input, only dependencies
  2254. information will be placed into the Turbo C++ .PRJ file. All
  2255. compiler options will remain default.
  2256.  
  2257. If you don't provide an extension, .TC is assumed. If PRJCVNT
  2258. can't find a .TC file, it looks for a .PRJ file.
  2259.  
  2260. The default name of the output file is the base name of the
  2261. input file with the extension .PRJ. For example, STARS.TC will
  2262. turn into STARS.PRJ. If the input and the output name are the
  2263. same, the old file will be renamed to a .BAK file.
  2264.  
  2265. =============================
  2266.          PRJ2MAK
  2267. =============================
  2268.  
  2269. This utility converts a .PRJ file to a .MAK file (containing all
  2270. relevant switches and settings) for use with the MAKE utility.
  2271. These files can be re-used without accessing the Programmer's
  2272. Platform (the IDE).
  2273.  
  2274.   Syntax:
  2275.  
  2276.     PRJ2MAK <project-file>[.PRJ] [<makefile>[.MAK] [<config>[.CFG]]]
  2277.  
  2278. The extension for project file name is assumed to be .PRJ unless
  2279. you specify otherwise.
  2280.  
  2281. The default name for the new MAKE file is the base file name of the .PRJ
  2282. file with the extension .MAK. The default name for the new .CFG file is
  2283. the base file name of the .MAK file with the extension .CFG.
  2284.  
  2285. To change the names of the makefile and cfg files, just specify
  2286. different names on the command line.
  2287.  
  2288. Examples of valid execution:
  2289.  
  2290.     PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK TURBOC.CFG
  2291.       This execution will cause a makefile called makefile.mak to be
  2292.       created, and a config file called turboc.cfg.
  2293.  
  2294.     PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK
  2295.       This execution will cause a makefile called makefile.mak to be
  2296.       created, and a config.file called myproj.cfg.
  2297.  
  2298.     PRJ2MAK MYPROJ
  2299.       This execution will cause a makefile called myproj.mak to be
  2300.       created, and a config file called myproj.cfg.
  2301.  
  2302.       The makefile that PRJ2MAK creates will set up a redirection
  2303.       file for the linker response file, and for the .CFG file. They
  2304.       will be created when the user runs the makefile which is generated.
  2305.       The linker response file that is generated is a temporary file,
  2306.       and will be deleted. The .CFG file will be left as a file on disk.
  2307.  
  2308.       PRJ2MAK will place the following options into the .CFG file:
  2309.  
  2310.          Those that are not default to the Turbo C++ command-line compiler
  2311.          AND have been selected in the project file.
  2312.  
  2313.       PRJ2MAK will attempt to locate all of the libraries to be included,
  2314.       through the "Library Directories" path that is specified in the .PRJ
  2315.       file. A comment will be written to the screen noting any of the files
  2316.       which cannot be located. When this happens, a special make dependency
  2317.       will be generated at the top of the makefile. When the makefile is
  2318.       run, it will print out the listing of files which were not be located,
  2319.       and then the makefile will terminate. You may correct the library
  2320.       locations in the makefile and delete this "comment" dependency in
  2321.       order to continue.
  2322.  
  2323.  
  2324. Page A
  2325.