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