asp.net.utiliti

download asp.net.utiliti

of 86

Transcript of asp.net.utiliti

  • 7/29/2019 asp.net.utiliti

    1/86

    CONTENTS___________________________________________________________________________

    Linker response files . . . . 28HOW TO USE THIS FILE . . . . . . . 1 Sample OBJXREF reports . . . . 28BGIOBJ: Converting graphics drivers Report by public namesand fonts . . . . . . . . . . . . 2 (/RP) . . . . . . . . . . . . 29Adding the new .OBJ files to Report by module (/RM) . . . 29GRAPHICS.LIB . . . . . . . . . . 3 Report by reference (/RR) . . 30Registering the drivers and Report by external referencesfonts . . . . . . . . . . . . . 3 (/RX) . . . . . . . . . . . . 30

    An example . . . . . . . . . . 4 Report of module sizesThe /F option . . . . . . . . . 5 (/RS) . . . . . . . . . . . . 31Advanced features . . . . . . . 6 Report by class type (/RC) . 31

    CPP: The preprocessor . . . . . 10 Report of unreferenced symbol

    CPP as a macro preprocessor . 11 names (/RU) . . . . . . . . . 32An example . . . . . . . . . . 11 Verbose reporting (/RV) . . . 32GREP: A text-search utility . . 12 Examples of how to useCommand-line syntax . . . . . 13 OBJXREF . . . . . . . . . . . . 32GREP options . . . . . . . . . 13 Example 1 . . . . . . . . . . 32

    Order of precedence . . . . 16 Example 2 . . . . . . . . . . 33The search string . . . . . . 16 Example 3 . . . . . . . . . . 33

    Operators in regular Example 4 . . . . . . . . . . 33expressions . . . . . . . . 17 OBJXREF error messages and

    File specifications . . . . . 18 warnings . . . . . . . . . . . 34Some GREP examples . . . . . . 18 Error messages . . . . . . . 34

    Example 1 . . . . . . . . . 18 Warnings . . . . . . . . . . 34Example 2 . . . . . . . . . 19 PRJCFG: Configuration file

    Example 3 . . . . . . . . . 19 utility . . . . . . . . . . . . . 35Example 4 . . . . . . . . . 20 PRJCNVT: Old projects for new . . 35Example 5 . . . . . . . . . 20 PRJ2MAK: From project file to MAKEExample 6 . . . . . . . . . 21 file . . . . . . . . . . . . . . 36Example 7 . . . . . . . . . 21 THELP: The Turbo Help utility . . 37Example 8 . . . . . . . . . 22 Loading and invoking THELP . . 37

    OBJXREF: The object module cross- Navigating THELP . . . . . . . 38reference utility . . . . . . . 22 THELP options . . . . . . . . . 39The OBJXREF command line . . . 23 /C#xx (select color) . . . . 40

    The OBJXREF command-line /Fname (full path and name foroptions . . . . . . . . . . 24 help file) . . . . . . . . . 41Control options . . . . . 24 /H, /?, and ? (display helpReport options . . . . . . 25 screen) . . . . . . . . . . . 42

    Response files . . . . . . . . 27 /Kxxyy (reassign hot key) . . 42Free-form response files . . 27 /U (remove THELP fromProject files . . . . . . . 27 memory) . . . . . . . . . . . 43

    i

  • 7/29/2019 asp.net.utiliti

    2/86

    /Wx,y,w,h (set the window size TRANCOPY: A project transfer itemand location) . . . . . . . 43 utility . . . . . . . . . . . . . 52

    TLIB . . . . . . . . . . . . . . 43 TRIGRAPH: A character-conversionWhy use object module utility . . . . . . . . . . . . . 53libraries? . . . . . . . . . . 44 Transfer macros . . . . . . . . . 54The TLIB command line . . . . 44 State macros . . . . . . . 54

    The operation list . . . . . 46 File name macros . . . . . 54File and module names . . 46 Instruction macros . . . . 55TLIB operations . . . . . 46 Running DOS commands . . . . . 59

    Using response files . . . . . 48 Transfer memory settings . . . 59Creating an extended dictionary: Turbo Editor macros . . . . . . . 60The /E option . . . . . . . . 49 TEMC command line . . . . . . . . 60Setting the page size: The /P Syntax . . . . . . . . . . . . . 61option . . . . . . . . . . . . 49 Key codes . . . . . . . . . . . . 62Advanced operation: The /C Named keys . . . . . . . . . . 63option . . . . . . . . . . . . 50 Predefined editor commands . . . 64Examples . . . . . . . . . . . 51

    TOUCH . . . . . . . . . . . . . 51 Index 77

    ii

  • 7/29/2019 asp.net.utiliti

    3/86

    TABLES___________________________________________________________________________

    1.1: Summary of THELP command-line 1.3: TLIB action symbols . . . . 47options . . . . . . . . . . .39 1.4: TEMC editor commands . . . . 64

    1.2: TLIB options . . . . . . . .45

    iii

  • 7/29/2019 asp.net.utiliti

    4/86

    Online document___________________________________________________________________________

    Other utilities

    ===========================================================================HOW TO USE THIS FILE===========================================================================

    This file has a table of contents and an index thatrefer to "pages" in this file. If your editor has a

    search facility, you can use it to search for the pagenumbers listed in either the table of contents or inthe index. The text "- n -" (where n represents theactual page number) appears at the bottom left of the"page" it refers to. Thus, at the bottom of page 1,you'll find "- 1 -" as the last item on that "page."

    Turbo C++ comes with a host of standalone utilitiesthat you can use with your Turbo C++ files or othermodules. Several are documented in the User's Guide;others are documented here.

    -------------------------------------------------------Name Description-------------------------------------------------------

    Documented in the User's Guide

    MAKE Standalone program managerTLINK Turbo Linker

    Documented in this file

    BGIOBJ Conversion utility for graphics drivers andfonts

    - 1 -

  • 7/29/2019 asp.net.utiliti

    5/86

    CPP PreprocessorGREP File-search utilityOBJXREF Object module cross-referencerPRJCFG Updates options in a project file from a

    configuration file, or converts a projectfile to a configuration file

    PRJCNVT Converts Turbo C project files to the TurboC++ format

    PRJ2MAK Converts Turbo C++ project files to MAKEfiles

    THELP Turbo Help utilityTLIB Turbo LibrarianTOUCH Updates file date and timeTRANCOPY Copies transfer items from one project to

    anotherTRIGRAPH Character-conversion utilityTEML/TEMC Turbo Editor Macro Language and Compiler

    -------------------------------------------------------

    This file explains what each utility is andillustrates, with code and command-line examples, howto use them.

    ===========================================================================BGIOBJ: Converting graphics drivers and fonts===========================================================================

    You can use BGIOBJ to convert graphics driver files andcharacter sets (stroked font files) to object (.OBJ)files. Once they're converted, you can link them intoyour program, making them part of the executable file.This is in addition to the graphics package's dynamicloading scheme, in which your program loads graphics

    drivers and character sets (stroked fonts) from disk atrun time.

    Linking drivers and fonts directly into your program isadvantageous because the executable file contains all(or most) of the drivers and/or fonts it might need,and doesn't need to access the driver and font files ondisk when running. However, linking the drivers andfonts into your executable file increases its size.

    - 2 -

  • 7/29/2019 asp.net.utiliti

    6/86

    To convert a driver or font file to a linkable objectfile, use the BGIOBJ.EXE utility. This is thesimplified syntax:

    BGIOBJ source_file

    where source_file is the driver or font file to beconverted to an object file. The object file createdhas the same file name as the source file, with theextension .OBJ; for example, EGAVGA.BGI yieldsEGAVGA.OBJ, SANS.CHR gives SANS.OBJ, and so on.

    Adding the new =======================================================.OBJ files toGRAPHICS.LIB You should add the driver and font object modules to

    GRAPHICS.LIB, so the linker can locate them when itlinks in the graphics routines. If you don't add thesenew object modules to GRAPHICS.LIB, you'll have to addthem to the list of files in the project (.PRJ) file,on the TCC command line, or on the TLINK command line.To add these object modules to GRAPHICS.LIB, invokeTLIB with the following command line:

    tlib graphics + object_file_name [+ object_file_name...]

    where object_file_name is the name of the object filecreated by BGIOBJ.EXE (such as CGA, EGAVGA, GOTH, andso forth). The .OBJ extension is implied, so you don'tneed to include it. You can add several files with onecommand line to save time; see the example in thefollowing section.

    Registering the =======================================================drivers and fonts

    After adding driver and font object modules toGRAPHICS.LIB, you have to register all the drivers andfonts that you want linked in; you do this by callingregisterbgidriver and registerbgifont in your program(before calling initgraph). This informs the graphicssystem of the presence of those files, and ensures thatthey will be linked in when the executable file iscreated by the linker.

    The registering routines each take one parameter; asymbolic name defined in graphics.h. Each registering

    - 3 -

    routine returns a nonnegative value if the driver or

  • 7/29/2019 asp.net.utiliti

    7/86

    font is successfully registered.

    The following table shows the names to be used withregisterbgidriver and registerbgifont. It is a completelist of drivers and fonts included with Turbo C++.

    ---------------------------------------------------------------------------Driver file registerbgidriver Font file registerbgifont(*.BGI) symbolic name (*.CHR) symbolic name---------------------------------------------------------------------------

    CGA CGA_driver TRIP triplex_fontEGAVGA EGAVGA_driver LITT small_fontHERC Herc_driver SANS sansserif_fontATT ATT_driver GOTH gothic_fontPC3270 PC3270_driverIBM8514 IBM8514_driver

    ---------------------------------------------------------------------------

    ------------------ Suppose you want to convert the files for the CGAAn example graphics driver, the gothic font, and the triplex font

    ------------------ to object modules, then link them into your program.Here's what you do:

    1. Convert the binary files to object files usingBGIOBJ.EXE, as shown in the following separate com-mand lines:

    bgiobj cgabgiobj tripbgiobj goth

    This creates three files: CGA.OBJ, TRIP.OBJ, andGOTH.OBJ.

    2. You can add these object files to GRAPHICS.LIB withthis TLIB command line:

    tlib graphics +cga +trip +goth

    3. If you don't add the object files to GRAPHICS.LIB,you must add the object file names CGA.OBJ,TRIP.OBJ, and GOTH.OBJ to your project list (if youare using Turbo C++'s integrated environment), or to

    - 4 -

    the TCC command line. For example, the TCC commandline would look like this:

  • 7/29/2019 asp.net.utiliti

    8/86

    TCC niftgraf graphics.lib cga.obj trip.objgoth.obj

    4. You register these files in your graphics programlike this:

    If you ever get a /* Header file declares CGA_driver, triplex_font &linker error gothic_font */

    Segment exceeds #include 64K after linking

    in some drivers /* Register and check for errors (one neverand/or fonts, knows...) */refer to the

    following section. if (registerbgidriver(CGA_driver) < 0) exit(1);if (registerbgifont(triplex_font) < 0) exit(1);if (registerbgifont(gothic_font) < 0) exit(1);

    /* ... */

    initgraph(....); /* initgraph should be calledafter registering */

    /* ... */

    The /F option =======================================================

    This section explains what steps to take if you get thelinker error Segment exceeds 64K (or a similar error)after linking in several driver and/or font files(especially with small- and compact-model programs).

    By default, the files created by BGIOBJ.EXE all use thesame segment (called _TEXT). This can cause problems ifyour program links in many drivers and/or fonts, orwhen you're using the small or compact memory model.

    To solve this problem, you can convert one or more ofthe drivers or fonts with the BGIOBJ /F option. Thisoption directs BGIOBJ to use a segment name of the formfilename_TEXT, so that the default segment is notoverburdened by all the linked-in drivers and fonts(and, in small and compact model programs, all the pro-gram code). For example, the following two BGIOBJ com-

    - 5 -

    mand lines direct BGIOBJ to use segment names of theform EGAVGA_TEXT and SANS_TEXT.

  • 7/29/2019 asp.net.utiliti

    9/86

    bgiobj /F egavgabgiobj /F sans

    When you select /F, BGIOBJ also appends F to the targetobject file name (EGAVGAF.OBJ, SANSF.OBJ, and soforth), and appends _far to the name that will be usedwith registerfarbgidriver and registerfarbgifont. (Forexample, EGAVGA_driver becomes EGAVGA_driver_far.)

    For files created with /F, you must use these farregistering routines instead of the regularregisterbgidriver and registerbgifont. For example,

    if (registerfarbgidriver(EGAVGA_driver_far) < 0)exit(1);if (registerfarbgifont(sansserif_font_far) < 0)exit(1);

    Advanced features =======================================================

    This section explains some of BGIOBJ's advancedfeatures, and the routines registerfarbgidriver andregisterfarbgifont. Only experienced users should use

    these features.

    This is the full syntax of the BGIOBJ.EXE command line:

    BGIOBJ [/F] source destination public-name seg-nameseg-class

    This table describes each component of the BGIOBJ com-mand line.

    -------------------------------------------------------Component Description

    -------------------------------------------------------

    /F or -F This option instructs BGIOBJ.EXEto use a segment name other than_TEXT (the default), and tochange the public name anddestination file name. (See page

    - 6 -

    5 for a detailed discussion of/F.)

    source This is the driver or font file

  • 7/29/2019 asp.net.utiliti

    10/86

    to be converted. If the file isnot one of the driver/font filesshipped with Turbo C++, youshould specify a full file name(including extension).

    destination This is the name of the objectfile to be produced. The defaultdestination file name issource.OBJ, or sourceF.OBJ ifyou use the /F option.

    public-name This is the name that will beused in the program in a call toregisterbgidriver orregisterbgifont (or theirrespective far versions) to linkin the object module.

    The public name is the externalname used by the linker, so itshould be the name used in theprogram, prefixed with anunderscore. If your program uses

    Pascal calling conventions, useonly uppercase letters, and donot add an underscore.

    seg-name This is an optional segmentname; the default is _TEXT (orfilename_TEXT if /F isspecified)

    seg-class This is an optional segmentclass; the default is CODE.

    -------------------------------------------------------

    All parameters except source are optional. However, ifyou need to specify an optional parameter, all theparameters preceding it must also be specified.

    - 7 -

    If you choose to use your own public name(s), you haveto add declaration(s) to your program, using one of thefollowing forms:

    void public_name(void); /* if /F not used, */

  • 7/29/2019 asp.net.utiliti

    11/86

    /* default segment nameused */

    extern int far public_name[]; /* if /F used, or *//* segment name not

    _TEXT */

    In these declarations, public_name matches the public-name you used when converting with BGIOBJ. Thegraphics.h header file contains declarations of thedefault driver and font public names; if you use thosedefault public names you don't have to declare them asjust described.

    After these declarations, you have to register all thedrivers and fonts in your program. If you don't use the/F option and don't change the default segment name,you should register drivers and fonts throughregisterbgidriver and registerbgifont; otherwise, useregisterfarbgidriver and registerfarbgifont.

    Here is an example of a program that loads a font fileinto memory:

    /* Example of loading a font file into memory */

    #include #include #include #include #include #include #include #include

    main(){

    void *gothic_fontp; /* points to font bufferin memory */int handle; /* file handle used for

    I/O */unsigned fsize; /* size of file (and

    buffer) */

    - 8 -

    int errorcode;int graphdriver;int graphmode;

    /* open font file */handle = open("GOTH.CHR", O_RDONLY|O_BINARY);

  • 7/29/2019 asp.net.utiliti

    12/86

  • 7/29/2019 asp.net.utiliti

    13/86

    return(0);}

    ===========================================================================CPP: The preprocessor===========================================================================

    CPP produces a Often, when the compiler reports an error inside alist (in a file) macro or an include file, you can get more information

    of a C source about what the error is if you can see the includeprogram in which files or the results of the macro expansions. In many

    include files and multi-pass compilers, a separate pass performs this#define macros work, and the results of the pass can be examined.

    have been Since Turbo C++ uses an integrated single-pass compil-expanded. It is er, we provided CPP to supply the first-passnot needed for functionality found in other compilers.normal compil-

    ations of C You use CPP just as you would use TCC, the standaloneprograms. compiler. CPP reads the same TURBOC.CFG file for

    default options, and accepts the same command-lineoptions as TCC.

    The TCC options that don't pertain to CPP are simplyignored by CPP. To see the list of arguments handled byCPP, type cpp at the DOS prompt. To see how thosearguments work, see Chapter 5 in the Programmer'sGuide.

    With one exception, the file names listed on the CPPcommand line are treated like they are in TCC, withwildcards allowed. The exception to this is that allfiles are treated as C source files. There is nospecial treatment for .OBJ, .LIB, or .ASM files.

    For each file processed by CPP, the output is written

    to a file in the current directory (or the outputdirectory named by the -n option) with the same name asthe source name but with an extension of .I.

    - 10 -

    This output file is a text file containing each line ofthe source file and any include files. Any preproces-sing directive lines have been removed, along with anyconditional text lines excluded from the compile.Unless you use a command-line option to specify other-wise, text lines are prefixed with the file name andline number of the source or include file the line camefrom. Within a text line, any macros are replaced with

  • 7/29/2019 asp.net.utiliti

    14/86

    their expansion text.

    Important! The resulting output of CPP cannot be compiled becauseof the file name and line number prefix attached toeach source line.

    CPP as a macro =======================================================preprocessor

    The -P option to CPP tells it to prefix each line withthe source file name and line number. If you give it -P- (turning this option off), CPP omits this linenumber information. With this option turned off, CPPcan be used as a macro preprocessor; the resulting .Ifile can then be compiled with TC or TCC.

    An example =======================================================

    The following simple program illustrates how CPPpreprocesses a file, first with -P selected, then with-P-.

    Source file: HELLOAJ.C

    #define NAME "H.R. Floyd"#define BEGIN {#define END }

    main()BEGIN

    printf("%s\n", NAME);END

    Command line used to invoke CPP as a preprocessor:CPP HELLOAJ.C

    Output:

    HELLOAJ.c 1:HELLOAJ.c 2:HELLOAJ.c 3:

    - 11 -

    HELLOAJ.c 4:HELLOAJ.c 5: main()HELLOAJ.c 6: {HELLOAJ.c 7: printf("%s\n","H.R. Floyd");HELLOAJ.c 8: }

    Command line used to invoke CPP as a macropreprocessor:

    CPP -P- HELLOAJ.C

  • 7/29/2019 asp.net.utiliti

    15/86

    Output:main(){

    printf("%s\n","H.R. Floyd");}

    ===========================================================================GREP: A text-search utility===========================================================================

    GREP (Global Regular Expression Print) is a powerfultext-search program derived from the UNIX utility ofthe same name. GREP searches for a text pattern in oneor more files or in its standard input stream.

    Here's a quick example of a situation where you mightwant to use GREP. Suppose you wanted to find out whichtext files in your current directory contained thestring "Bob". You would issue the command

    grep Bob *.txt

    and GREP would respond with a list of the lines in eachfile (if any) that contained the string "Bob". Becausethe default for GREP is to ignore case, the strings"bob" and "BoB" would also be considered matches. Youcan use options to make your search case sensitive.

    GREP can do a lot more than match a single, fixedstring. In the section that follows, you'll see how tomake GREP search for any string that matches aparticular pattern.

    - 12 -

    Command-line =======================================================syntax

    The general command-line syntax for GREP is

    grep [options] searchstring [file(s) ... ]

    options consist of one or more letters, preceded by ahyphen (-), that let you change various aspects ofGREP's behavior.

  • 7/29/2019 asp.net.utiliti

    16/86

    searchstring gives the pattern to search for.

    file(s) tells GREP which files to search. (If you don'tspecify a file, GREP searches its standard input; thislets you use GREP with pipes and redirection.) If youfind that the results of your GREP are longer than onescreen, you can redirect the output to a file. Forexample, you could use this command

    GREP "Bob" *.txt >gfile

    which searches all files in the current directory thatend with .TXT, then places the results in a file calledGFILE. (You can name this file anything you like.)Then, use your word processor (or Turbo C++'s editor)to access GFILE to read the results of the search.

    The command

    GREP ?

    prints a brief help screen showing GREP's command-lineoptions, special characters, and defaults. (See thedescription of the -u command-line option for

    information on how to change GREP's defaults.)

    GREP options =======================================================

    In the command line, options are one or more singlecharacters preceded by a hyphen (-). Each individualcharacter is a switch that you can turn on or off: Aplus symbol (+) after a character turns the option on;a hyphen (-) after the character turns the option off.The + sign is optional; for example, -r means the samething as -r+. You can list multiple options

    - 13 -

    individually (like this: -i -d -l), or you can combine

    them (like this: -ild or -il, -d, and so on); it's allthe same to GREP.

    Here are the GREP option characters and their meanings:

    ------------------------------------------------------------------------------Option Meaning------------------------------------------------------------------------------

  • 7/29/2019 asp.net.utiliti

    17/86

    -c Match Count only: Prints only a count of matching lines. For each filethat contains at least one matching line, GREP prints the file name anda count of the number of matching lines. Matching lines are notprinted. This option is off by default.

    -d Search subdirectories: For each file specified on the command line,GREP searches for all files that match the file specification, both inthe directory specified and in all subdirectories below the specifieddirectory. If you give a file without a path, GREP assumes the filesare in the current directory. This option is off by default.

    -i Ignore case: GREP ignores upper/lowercase differences (case folding).When this option is on, GREP treats all letters a to z as identical tothe corresponding letters A to Z in all situations. This option is onby default.

    -l List file names only: Prints only the name of each file containing amatch. After GREP finds a match, it prints the file name and processingimmediately moves on to the next file. This option is off by default.

    -n Line Numbers: Each matching line that GREP prints is preceded by itsline number. This option is off by default.

    -o UNIX output format: Changes the output format of matching lines tosupport more easily the UNIX style of command-line piping. All lines ofoutput are preceded by the name of the file that contained the matchingline. This option is off by default.

    -r Regular expression search: The text defined by searchstring is treatedas a regular expression instead of as a literal string. This option ison by default. This option is on by default.

    A regular expression is one or more occurrences of one or morecharacters optionally enclosed in quotes. The following symbols aretreated specially:^ start of line $ end of line

    - 14 -

    . any character \ quote next character* match zero or more + match one or more

    [aeiou0-9] match a, e, i, o, u, and 0 thru 9[^aeiou0-9] match anything but a, e, i, o, u, and 0 thru 9

    -u Update options: GREP will combine the options given on the command linewith its default options and write these to the GREP.COM file as thenew defaults. (In other words, GREP is self-configuring.) This optionallows you to tailor the default option settings to your own taste. Ifyou want to see what the defaults are in a particular copy of GREP.COM,type

  • 7/29/2019 asp.net.utiliti

    18/86

    GREP ?

    at the DOS prompt. Each option on the help screen will be followed by a+ or a - depending on its default setting. This option is off bydefault.

    -v Nonmatch: Prints only nonmatching lines. Only lines that do not containthe search string are considered to be nonmatching lines. This optionis off by default.

    -w Word search: Text found that matches the regular expression isconsidered a match only if the character immediately preceding andfollowing cannot be part of a word. The default word character setincludes A to Z, 0 to 9, and the underscore ( _ ). This option is offby default.

    An alternate form of this option lets you specify the set of legal wordcharacters. Its form is -w[set], where set is any valid regularexpression set definition.

    If you define the set with alphabetic characters, it is automaticallydefined to contain both the uppercase and lowercase values for eachletter in the set (regardless of how it is typed), even if the search

    is case-sensitive. If you use the -w option in combination with the -uoption, the new set of legal characters is saved as the default set.

    -z Verbose: GREP prints the file name of every file searched. Eachmatching line is preceded by its line number. A count of matching linesin each file is given, even if the count is zero. This option is off bydefault.

    ------------------------------------------------------------------------------

    - 15 -

    ------------------ Remember that each of GREP's options is a switch: ItsOrder of state reflects the way you last set it. At any given time,

    precedence each option can only be on or off. Each occurrence of a

    ------------------ given option on the command line overrides its previousdefinition. Given this command line,

    grep -r -i - -d -i -r - main( my*.c

    GREP runs with the -d option on, the -i option on, and the-r option off.

    You can install your preferred default setting for eachoption in GREP.COM with the -u option. For example, if you

  • 7/29/2019 asp.net.utiliti

    19/86

    want GREP to always do a verbose search (-z on), you caninstall it with the following command:

    grep -u -z

    The search string ==========================================================

    To use GREP well, you'll need to become proficient atwriting search strings. The value of searchstring definesthe pattern GREP searches for. A search string can beeither a regular expression or a literal string.

    o In a regular expression, certain characters have specialmeanings: They are operators that govern the search.

    o In a literal string, there are no operators: Eachcharacter is treated literally.

    You can enclose the search string in quotation marks toprevent spaces and tabs from being treated as delimiters.The text matched by the search string cannot cross lineboundaries; that is, all the text necessary to match thepattern must be on a single line.

    A regular expression is either a single character or a setof characters enclosed in brackets. A concatenation ofregular expressions is a regular expression.

    - 16 -

    ------------------ When you use the -r option (on by default), the searchOperators in string is treated as a regular expression (not a literal

    regular expression). The following characters take on specialexpressions meanings:

    ------------------

    ---------------------------------------------------------------------------Option Meaning---------------------------------------------------------------------------

    ^ A circumflex at the start of the expression matches the start of aline.

  • 7/29/2019 asp.net.utiliti

    20/86

    $ A dollar sign at the end of the expression matches the end of aline.

    . A period matches any character.

    * An expression followed by an asterisk wildcard matches zero or moreoccurrences of that expression. For example, in to*, the * operateson the expression o; it matches t, to, too, etc. (t followed by zeroor more os), but doesn't match ta.

    + An expression followed by a plus sign matches one or moreoccurrences of that expression: to+ matches to, too, etc., but nott.

    [ ] A string enclosed in brackets matches any character in that string,but no others. If the first character in the string is a circumflex(^), the expression matches any character except the characters inthe string.

    For example, [xyz] matches x, y, or z, while [^xyz] matches a and b,but not x, y, or z. You can specify a range of characters with twocharacters separated by a hyphen (-). These can be combined to formexpressions (like [a-bd-z?], which matches the ? character and anylowercase letter except c).

    \ The backslash escape character tells GREP to search for the literalcharacter that follows it. For example, \. matches a period insteadof "any character." The backslash can be used to quote itself; thatis, you can use \\ to indicate a literal backslash character in aGREP expression.

    ---------------------------------------------------------------------------

    - 17 -

    Note Four of the "special" characters ($, ., *, and +) don'thave any special meaning when used within a bracketedset. In addition, the character ^ is only treatedspecially if it immediately follows the beginning ofthe set definition (immediately after the [ delimiter).

    Any ordinary character not mentioned in the precedinglist matches that character. For example, the greaterthan sign, >, matches the greater than sign (>), #matches #, and so on.

    File =======================================================specifications

    file(s) tells GREP which files (or groups of files) to

  • 7/29/2019 asp.net.utiliti

    21/86

    search. file(s) can be an explicit file name, or a"generic" file name incorporating the DOS ? and *wildcards. In addition, you can enter a path (drive anddirectory information) as part of file(s). If you givefile(s) without a path, GREP searches the currentdirectory.

    If you don't specify any files, input to GREP must comefrom redirection (

  • 7/29/2019 asp.net.utiliti

    22/86

    The -i option is used here, so the search is not casesensitive.

    Command line:grep -ri [a-c]:\\data\.fil *.c *.inc

    Matches: A:\data.filc:\Data.FilB:\DATA.FIL

    Does not match:d:\data.fila:data.fil

    Files searched:*.C and *.INC in current directory.

    ------------------ This format defines how to search for a given word.Example 3

    ------------------ Command line:grep -ri [^a-z]word[^a-z] *.doc

    Matches: every new word must be on a new line.

    MY WORD!word--smallest unit of speech.In the beginning there was the WORD, andthe WORD

    Does not match:Each file has at least 2000 words.He misspells toward as toword.

    - 19 -

    Files searched:*.DOC in the current directory.

    ------------------ This format defines another, even more basic single-Example 4 word search.

    ------------------

    Command line:grep -iw word *.doc

    Matches: every new word must be on a new lineHowever,MY WORD!word: smallest unit of speech which conveysIn the beginning there was the WORD, and

    Does not match:

  • 7/29/2019 asp.net.utiliti

    23/86

    each document contains at least 2000 words!He seems to continually misspell "toward"as "toword."

    Files searched:*.DOC in the current directory.

    ------------------ This is an example of how to search for a string withExample 5 embedded spaces.

    ------------------Command line:

    grep "search string with spaces" *.doc *.ca:\work\myfile.*

    Matches: This is a search string with spaces in it.

    Does not match:This search string has spaces in it.

    Files searched:*.DOC and *.C in the current directory, andMYFILE.* in a directory called \WORK ondrive A.

    - 20 -

    ------------------ This example searches for any one of the charactersExample 6 " . : ? ' and , at the end of a line.

    ------------------The double quote within the range is preceded by anescape character so it is treated as a normal characterinstead of as the ending quote for the string. Also,the $ character appears outside of the quoted string.This demonstrates how regular expressions can be

    concatenated to form a longer expression.

    Command line:grep -rd "[ ,.:?'\"]"$ \*.doc

    Matches: He said hi to me.Where are you going?In anticipation of a unique situation,Examples include the following:"Many men smoke, but fu man chu."

  • 7/29/2019 asp.net.utiliti

    24/86

    Does not match:He said "Hi" to meWhere are you going? I'm headed to the

    Files searched:*.DOC in the root directory and all itssubdirectories on the current drive.

    ------------------ This example ignores case and just prints the names ofExample 7 any files that contain at least one match. The three

    ------------------ command-line examples show different ways of specifyingmultiple options.

    Command line:grep -ild " the " \*.docorgrep -i -l -d " the " \*.docorgrep -il -d " the " \*.doc

    Matches: Anyway, this is the time we havedo you think? The main reason we are

    Does not match:He said "Hi" to me just when IWhere are you going? I'll bet you're headed

    - 21 -

    Files searched:*.DOC in the root directory and all itssubdirectories on the current drive.

    ------------------ This example redefines the current set of legalExample 8 characters for a word as the assignment operator (=)

    ------------------ only, then does a word search. It matches C assignmentstatements, which use a single equal sign (=), but not

    equality tests, which use a double equal sign (==).

    Command line:grep -w[=] = *.c

    Matches: i = 5;j=5;i += j;

    Does not match:

  • 7/29/2019 asp.net.utiliti

    25/86

    if (i == t) j++;/* ======================= */

    Files searched:*.C in the current directory.

    ===========================================================================OBJXREF: The object module cross-reference utility===========================================================================

    OBJXREF examines a list of object files and libraryfiles and produces reports on their contents. One typeof report lists definitions of public names andreferences to them. The other type lists the segmentsizes defined by object modules.

    There are two categories of public names: globalvariables and function names. The TEST1.C and TEST2.Cfiles in the section "Sample OBJXREF reports" (page 28)illustrate definitions of public names and externalreferences to them.

    Object modules are object (.OBJ) files produced by TC,TCC or TASM. A library (.LIB) file contains multipleobject modules. An object module generated by TC isgiven the same name as the .C source file it was com-piled from. This is also true for TCC, unless a

    - 22 -

    different output file name is specifically indicatedwith the -o TCC command-line option.

    The OBJXREF com- =======================================================mand line

    The OBJXREF command line consists of the word OBJXREFfollowed by a series of command-line options and a listof object and library file names, separated by a spaceor tab character. The syntax is as follows:

    OBJXREF options filename filename ...

    The command-line options determine the kind of reportsthat OBJXREF will generate and the amount of detailthat OBJXREF will provide. They are discussed in moredetail in the next section.

    Each option begins with a forward slash (/) followed bya one- or two-character option name.

  • 7/29/2019 asp.net.utiliti

    26/86

    Object files and library files may be specified eitheron the command line or in a response file. On the com-mand line, file names are separated by a space or atab. All object modules specified as .OBJ files areincluded in reports. Like TLINK, however, OBJXREFincludes only those modules from .LIB files whichcontain a public name referenced by an .OBJ file or bya previously included module from a .LIB file.

    As a general rule, you should list all the .OBJ and.LIB files that are needed if the program is to linkcorrectly, including the startup .OBJ file and one ormore C libraries.

    File names may include a drive and directory path. TheDOS ? and * wildcard characters may be used to identifymore than one file. File names may refer to .OBJ objectfiles or to .LIB library files. (If you don't give afile extension, the .OBJ extension is assumed.)

    Options and file names may occur in any order in thecommand line.

    OBJXREF reports are written to the DOS standard output.The default is the screen. The reports can be sent to aprinter (as with >LPT1:) or to a file (as with>lstfile) with the DOS redirection character (>).

    - 23 -

    Entering OBJXREF with no file names or options producesa summary of available options.

    ------------------ OBJXREF command-line options fall into two categories:The OBJXREF control options and report options.

    command-lineoptions

    ------------------ Control options=======================================================

    Control options modify the default behavior of OBJXREF(the default is that none of these options areenabled).

    -------------------------------------------------------Option Meaning-------------------------------------------------------

  • 7/29/2019 asp.net.utiliti

    27/86

    /I Ignore case differences in public names. Usethis option if you use TLINK without the /Coption (which makes case differencessignificant).

    /D Look for .OBJ files in another directory. If youwant OBJXREF to look for .OBJ files in adirectory other than the current one, includethe directory name on the command line, prefixedwith /D:

    OBJXREF /Ddir1 [; dir2 [; dir3]]

    or

    OBJXREF /Ddir1 [/Ddir2] [/Ddir3]

    OBJXREF will search each of the directories inthe specified order for all object and libraryfiles.

    Important! If you don't use a /D option, OBJXREF willsearch only the current directory. If you do usea /D option, however, the current directory will

    not be searched unless it is included in thedirectory list. For example, if you wantedOBJXREF to search first the BORLAND directory

    - 24 -

    and then the current directory for files, youwould enter

    OBJXREF /Dborland;.

    The period denotes the current directory.

    /F Include full library. All object modules inspecified .LIB files are included even if theydo not contain public names that are referencedby an object module being processed by OBJXREF.

    This provides information on the entire contentsof a library file. (See example 4 in the section"OBJXREF examples.")

    /O Allows you to specify an output file whereOBJXREF will send any reports generated. Itssyntax is as follows:

    OBJXREF filename.obj /report option/Ooutputfilename.ext

  • 7/29/2019 asp.net.utiliti

    28/86

    By default all output is sent to the screen.

    /V Verbose output. Lists names of files read anddisplays totals of public names, modules,segments, and classes.

    /Z Include zero-length segment definitions. Objectmodules may define a segment without allocatingany space in it. Listing these zero lengthsegment definitions normally makes the modulesize reports harder to use but it can bevaluable if you are trying to remove all defini-tions of a segment.

    -------------------------------------------------------

    Report options=======================================================

    Report options govern what sort of report is generated,and the amount of detail that OBJXREF provides.

    - 25 -

    -------------------------------------------------------Option Report generated--------------------------------------------------

    /RC Report by class type: Module sizes orderedby class type of segment.

    /RM Report by module: Public names ordered bydefining module.

    /RP Report by public names: Public names inorder with defining module name.

    This is the /RR Report by reference: Public name defini-default. tions and references ordered by name.

    /RS Report of module sizes: Module sizesordered by segment name.

    /RU Report of unreferenced symbol names:Unreferenced public names ordered bydefining module.

  • 7/29/2019 asp.net.utiliti

    29/86

    /RV Verbose reporting: OBJXREF produces areport of every type.

    /RX Report by external reference: Externalreferences ordered by referencing modulename.

    --------------------------------------------------

    Public names defined in .C files appear in reports witha leading underscore in the reports unless the -U-option was specified when the file was compiled (mainappears as _main).

    You can limit the modules, segments, classes, or publicnames that OBJXREF reports on by entering theappropriate name on the command line prefixed with the/N option. For example,

    OBJXREF filelist /RM /NC0

    tells OBJXREF to generate a report listing informationonly for the module named C0.

    - 26 -

    Response files =======================================================

    The command line is limited by DOS to a maximum of 128characters. If your list of options and file names willexceed this limit, you must place your file names in aresponse file.

    A response file is a text file that you make with atext editor. Since you may already have prepared a listof the files that make up your program for other TurboC++ programs, OBJXREF recognizes several response filetypes.

    Response files are called from the command line using

    one of the following options. The response file namemust follow the option without an intervening space(so, for example, you would type /Lresp, not /L resp).

    You can specify more than one response file on the com-mand line; additional .OBJ and .LIB file names canprecede or follow them.

    ------------------ You can create a free-form response file with a text

  • 7/29/2019 asp.net.utiliti

    30/86

    Free-form response editor. Just list the names of all .OBJ and .LIB filesfiles needed to make your .EXE file.

    ------------------Any file name To use free-form files with OBJXREF, type in eachlisted in the response file name on the command line, preceded by anresponse file @, and separate it from other command-line entries with

    without an exten- a space or tab:sion is assumed tobe an .OBJ file. @filename @filename ...

    ------------------ You can also use project files of the type generated byProject files Turbo C++'s integrated environment as response files.

    ------------------ In the command line, precede the project file name with/P, like this:

    /Pfilename

    If the file name does not include an explicit exten-sion, a .PRJ extension is assumed.

    - 27 -

    File names in the project file with a .C extension orno extension are interpreted as specifying the

    corresponding .OBJ file. You need not remove filedependencies specified inside parentheses; they areignored by OBJXREF.

    Note By itself, the list of files in a .PRJ file does notspecify a complete program--you must also specify astartup file (C0x.OBJ) and one or more Turbo C++library files (MATHX.LIB, EMU.LIB, and CX.LIB, forexample). In addition, you may need to use the /Doption to specify the directory where OBJXREF shouldlook for your .OBJ files.

    ------------------ Files in TLINK response-file format can also be used byLinker response OBJXREF. A linker response file called from the command

    files line is preceded by /L, like so:------------------

    /Lfilename

    To see how to use one of these files, refer to Example2 in the section "Examples of how to use OBJXREF."

  • 7/29/2019 asp.net.utiliti

    31/86

    Sample OBJXREF =======================================================reports

    Suppose you have two source files in your Turbo C++directory, and want to generate OBJXREF reports on theobject files compiled from them. The source files arecalled TEST1.C and TEST2.C, and they look like this:

    /* test1.c */int i1; /* defines i1 */extern int i2; /* refers to i2 */static int i3; /* not a public name */extern void look(void); /* refers to look */

    void main(void) /* defines main */{

    int i4; /* not a public name */

    look(); /* refers to look */}

    /* test2.c */#include extern int i1; /* refers to i1 */

    - 28 -

    int i2; /* defines i2 */

    void look(void) /* defines look */

    { exit(i1); /* refers to exit... */} /* and to i1 */

    The object modules compiled from these source files areTEST1.OBJ and TEST2.OBJ. You can tell OBJXREF what kindof report to generate about these .OBJ files byentering the file names on the command line, followedby a /R and a second letter denoting report type.

    Note The following examples show only useful parts of theoutput.

    ------------------ A report by public names lists each of the public namesReport by public defined in the object modules being reported on,

    names (/RP) followed by the name of the module in which it is------------------ defined.

    If you enter this on the command line:

    OBJXREF /RP test1 test2

  • 7/29/2019 asp.net.utiliti

    32/86

    OBJXREF generates a report that looks like this:

    SYMBOL DEFINED IN_i1 TEST1_i2 TEST2_look TEST2_main TEST1

    ------------------ A report by module lists each object module beingReport by module reported on, followed by a list of the public names

    (/RM) defined in it.------------------

    If you enter this on the command line:

    OBJXREF /RM test1 test2

    OBJXREF generates a report that looks like this:

    MODULE: TEST1 defines the following symbols:public: _i1public: _main

    - 29 -

    MODULE: TEST2 defines the following symbols:public: _i2public: _look

    ------------------ A report by reference lists each public name with theReport by defining module in parentheses on the same line.

    reference (/RR) Modules that refer to this public name are listed on------------------ following lines indented from the left margin.

    This is the If you enter this on the command line:default if no

    report option is OBJXREF /RR C0 test1 test2 CS.LIBspecified.

    OBJXREF generates a report that looks like this:

    _exit (EXIT)

    C0TEST2

    _i1 (TEST1)TEST2

    _i2 (TEST2)_look (TEST2)

    TEST1_main (TEST1)

    C0

  • 7/29/2019 asp.net.utiliti

    33/86

    ------------------ A report by external references lists each moduleReport by external followed by a list of external references it contains.references (/RX)

    ------------------ If you enter this on the command line:

    OBJXREF /RX C0 test1 test2 CS.LIB

    OBJXREF generates a report that looks like this:

    MODULE: C0 references the following symbols:_main

    MODULE: TEST1 references the following symbols:_i2_look

    MODULE: TEST2 references the following symbols:_exit_i1

    - 30 -

    ------------------ A report by sizes lists segment names followed by aReport of module list of modules that define the segment. Sizes in bytes

    sizes (/RS) are given in decimal and hexadecimal notation. The word------------------ uninitialized appears where no initial values are

    assigned to any of the symbols defined in the segment.

    Segments defined at absolute addresses in a .ASM fileare flagged Abs to the left of the segment size.

    If you enter this on the command line:

    OBJXREF /RS test1 test2

    OBJXREF generates a report that looks like this:

    These files were TEST1_TEXTcompiled using the 6 (00006h) TEST1

    large memory 6 (00006h) totalmodel. TEST2_TEXT

    10 (0000Ah) TEST210 (0000Ah) total

    _BSS4 (00004h) TEST1, uninitialized2 (00002h) TEST2, uninitialized6 (00006h) total

    ------------------ A report by class type lists segment size definitionsReport by class by segment class. The CODE class contains instructions,

  • 7/29/2019 asp.net.utiliti

    34/86

    type (/RC) DATA class contains initialized data and BSS class------------------ contains uninitialized data. Segments which do not have

    a class type will be listed under the notation No classtype.

    If you enter this on the command line:

    OBJXREF /RC C0 test1 test2 CS.LIB

    OBJXREF generates a report that looks like this:

    BSS4 (00004h) TEST12 (00002h) TEST2

    ...132 (00084h) total

    CODE6 (00006h) TEST1

    - 31 -

    10 (0000Ah) TEST216 (00010h) total

    DATA143 (0008Fh) C0143 (0008Fh) total

    ------------------ A report of unreferenced symbol names lists modulesReport of that define public names not referenced in other

    unreferenced modules. Such a symbol is either:symbol names (/RU)------------------ o referenced only from within the defining module and

    does not need to be defined as a public symbol (inthat case, if the module is in C, the keyword staticshould be added to the definition; if the module isin TASM, just remove the public definition).

    o never used (therefore, it can be deleted to save codeor data space).

    If you enter this on the command line:

    OBJXREF /RU test1 test2

    OBJXREF generates a report that looks like this:

    MODULE: TEST2 defines the unreferenced symbol _i2.

  • 7/29/2019 asp.net.utiliti

    35/86

    ------------------ If you enter /RV on the command line, OBJXREF generatesVerbose reporting one report of each type.

    (/RV)------------------Examples of how to =======================================================

    use OBJXREFThese examples assume that the application files are inthe current directory of the default drive and that theTurbo C++ startup files (C0x.OBJ) and the library filesare in the \TC\LIB directory.

    ------------------ C>OBJXREF \TC\lib\c0l test1 test2 \TC\lib\cl.libExample 1

    ------------------ In this example, the TEST1.OBJ and TEST2.OBJ files andthe Turbo C++ startup file \TC\LIB\C0L.OBJ and thelibrary file \TC\LIB\CL.LIB are specified. Since noreport type is specified, the resulting report is the

    - 32 -

    default report by reference, listing public names andthe modules that reference them.

    ------------------ C>OBJXREF /RV /Ltest1.arfExample 2

    ------------------ The TLINK response file TEST1.ARF contains the same

    list of files as the command line in Example 1. The /RVoption is specified, so a report of every type will begenerated. TEST1.ARF contains

    \TC\lib\c0ltest1 test2test1.exetest1.map\TC\lib\cl

    ------------------ C>OBJXREF /RC B:c0s /Ptest1 @libsExample 3

    ------------------ The Turbo C++ project file TEST1.PRJ specifiesTEST1.OBJ and TEST2.OBJ. The response file @libsspecifies libraries on a disk in the B drive. TEST1.PRJcontains

    test1test2.c

    The file LIBS contains

  • 7/29/2019 asp.net.utiliti

    36/86

    b:maths.lib b:emu.lib b:cs.lib

    The startup and library files specified depend on thememory model and floating point options used in compil-ation. The /RC causes a report of class type to beoutput.

    ------------------ C>OBJXREF /F /RV \TC\lib\cs.libExample 4

    ------------------ This example reports on all the modules in the TurboC++ library file CS.LIB; OBJXREF can produce usefulreports even when the files specified do not make acomplete program. The /F causes all modules in CS.LIBfile to be included in the report.

    - 33 -

    OBJXREF error =======================================================messages and

    warnings OBJXREF generates two sorts of diagnostic messages:error messages and warnings.

    ------------------ Out of memoryError messages OBJXREF performs its cross referencing in RAM memory

    ------------------ and may run out of memory even if TLINK is able to linkthe same list of files successfully. When this happens,OBJXREF aborts. Remove memory resident programs to getmore space, or add more RAM.

    ------------------ WARNING: Unable to open input file Warnings The input file filename could not be located or opened.

    ------------------ OBJXREF proceeds to the next file.

    WARNING: Unknown option - The option name option is not recognized by OBJXREF.OBJXREF ignores the option.

    WARNING: Unresolved symbol in module The public name symbol referenced in module module isnot defined in any of the .OBJ or .LIB files specified.OBJXREF flags the symbol in any reports it generates asbeing referenced but not defined.

    WARNING: Invalid file specification Some part of the file name filename is invalid. OBJXREFproceeds to the next file.

  • 7/29/2019 asp.net.utiliti

    37/86

    WARNING: No files matching The file named filename listed on the command line orin a response file could not be located or opened.OBJXREF skips to the next file.

    WARNING: Symbol defined in duplicated in Public name symbol is defined in modules module1 andmodule2. OBJXREF ignores the second definition.

    - 34 -

    ===========================================================================PRJCFG: Configuration file utility===========================================================================

    Creates the command-line configuration file from aproject file. You can also use it to create or update aproject file from a configuration file.

    The command-line compiler looks for a defaultconfiguration file named TURBOC.CFG, but you canspecify a different file with +pathname option. To usePRJCFG to create a TCC configuration file from aproject file, you would type the following:

    PRJCFG ProjFile.PRJ ConfigFile.CFG

    To make a project file from a configuration file, type

    PRJCFG ConfigFile.CFG ProjFile.PRJ

    ===========================================================================PRJCNVT: Old projects for new===========================================================================

    This utility converts Turbo C 1.0, 1.5, and 2.0 projectfiles to Turbo C++ project files. The syntax for it is

    PRJCNVT infile[.PRJ] [outfile[.PRJ]]

  • 7/29/2019 asp.net.utiliti

    38/86

    or

    PRJCNVT infile[.TC] [outfile[.PRJ]]

    If you specify a configuration file as input, it musthave a project file defined. The compiler options inthe .CFG file and the dependencies in the Turbo C 2.0.PRJ file will be placed into the corresponding TurboC++ .PRJ file.

    If you specify a project file as input, onlydependencies information will be placed into the TurboC++ .PRJ file. All compiler options will remaindefault.

    - 35 -

    If you don't provide an extension, .TC is assumed. IfPRJCVNT can't find a .TC file, it looks for a .PRJfile.

    The default name of the output file is the base name ofthe input file with the extension .PRJ. For example,STARS.TC will turn into STARS.PRJ. If the input and theoutput name are the same, the old file will be renamedto a .BAK file.

    ===========================================================================PRJ2MAK: From project file to MAKE file===========================================================================

    This utility converts a .PRJ file to a .MAK file(containing all relevant switches and settings) for usewith the MAKE utility. These files can be re-usedwithout accessing the IDE. The syntax for PRJ2MAK is

    PRJ2MAK projectfile[.PRJ] [makefile[.MAK][config[.CFG]]]

    The extension for the project file name is assumed tobe .PRJ unless you specify otherwise.

    The default name for the new MAKE file is the base filename of the .PRJ file with the extension .MAK. Thedefault name for the new .CFG file is the base filename of the .MAK file with the extension .CFG.

    To change the names of the makefile and configuration

  • 7/29/2019 asp.net.utiliti

    39/86

    files, just specify different names on the commandline.

    Examples of valid execution:

    PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK TURBOC.CFG

    This execution creates a makefile called MAKEFILE.MAKwith a configuration file called TURBOC.CFG.

    PRJ2MAK MYPROJ.PRJ MAKEFILE.MAK

    This execution creates a makefile called MAKEFILE.MAKwith a configuration file called MYPROJ.CFG.

    PRJ2MAK MYPROJ

    - 36 -

    This execution creates a makefile called MYPROJ.MAK anda configuration file called MYPROJ.CFG.

    The makefile that PRJ2MAK creates will set up aredirection file for the linker response file and forthe .CFG file. They will be created when you run themakefile that was generated. The linker response fileis a temporary file and will be deleted. The .CFG filewill be left as a file on disk.

    PRJ2MAK places options that meet the following

    requirements into the .CFG file: Those that are notdefault to the Turbo C++ command-line compiler and havebeen selected in the project file.

    PRJ2MAK will use the library search path as a commandlink option to TLINK, so that TLINK can search thatpath for the startup module and for libraries.

    ===========================================================================THELP: The Turbo Help utility===========================================================================

    THELP.COM is a RAM-resident (TSR) utility that accessesTurbo C++'s online Help information for you when youaren't using the IDE (that is, if you are using aneditor other than the one in the IDE, or you are usingthe command-line version of Turbo C++, or if you areusing another product, such as Turbo Debugger). THELPrequires about 21K bytes of memory.

  • 7/29/2019 asp.net.utiliti

    40/86

    Loading and =======================================================invoking THELP

    - 37 -

    You need to first load THELP in order to use it fromwithin another program (or from the command line). Makesure that TCHELP.TCH, the text file containing theTurbo C++ online help information, is in the current

    Warning! If you directory. (If you want to keep TCHELP.TCH in anotherare going to have directory, THELP has a special /F command-line optionTHELP resident in that will enable THELP to find it; the INSTALL programmemory at the same inserts the correct path information into THELP.)time as SideKick1.x or SideKick To load THELP, just typePlus, make sureyou load THELP THELP [options]

    before you loadSideKick. at the DOS command line before you go into yourapplication. This needs to be done only once, when youfirst boot up.

    Once you are in the other application, you can activateTHELP at any time. Just position the cursor under theitem you want information on, then press the THELP hotkey. The default hot key is 5 on the numeric keypad(scan code 4ch, shift state 00h).

    Navigating THELP =======================================================

    Use the following keys to navigate through the Helpscreens that THELP displays on your monitor:

    ----------------------------------------------------------------------Key What it does----------------------------------------------------------------------

  • 7/29/2019 asp.net.utiliti

    41/86

    Up Down Left RightMove the highlight from keyword to keyword within the currentHelp screen.

    Shift-ArrowMoves the cursor while marking a block.

    Home and EndMove to the beginning and end of a line, respectively.

    Tab and Shift-TabMoves to the next or previous keyword.

    - 38 -

    PgUp/PgDnMoves from screen to screen if additional screens areavailable.

    Enter Selects a Help entry for the item highlighted in the currentHelp screen.

    Esc Ends Help session.

    F1 Displays the Help Table of Contents screen.

    Shift-F1 Displays the Help Index. You can search for a specifickeyword incrementally. For example, you can find printf by

    typing p r i. With each letter you type, the list jumps tothe keyword that starts with p, then to pr, then to pri, andso on.

    Alt-F1 Pressing Alt-F1 repeatedly takes you in reverse order throughthe last 20 screens you have reviewed.

    Alt-F Selects a new Help file (if you have specified more than onehelp file in the THELP.CFG file or on thecommand-line).

    Ctrl-P Pastes the marked block or example text into your currentapplication.

    ----------------------------------------------------------------------

    THELP options =======================================================

    Here is a summary of the THELP command-line options. Ifyou use more than one option, you must separate themwith spaces.

  • 7/29/2019 asp.net.utiliti

    42/86

    The command-line options can be placed in aconfiguration file (called THELP.CFG) for convenience.THELP.CFG must be located in the same directory asTHELP.COM and each option in the configuration filemust be placed on its own line and begin in theleftmost column.

    -------------------------------------------------------Summary of THELP Option Specifies

    command-line -------------------------------------------------------options

    - 39 -

    Table 1.1: Summary of THELP command-line options

    (continued)____________________________________________

    /C#xx Select color:# = color numberxx = hex color values

    /Fname Full path and file name of Help file

    /H, /?, ? Display help screen

    /Kxxyy Change hot key:xx = shift state (hex)yy = scan code (hex)

    /U Remove THELP from memory

    /Wx,y,w,h Sets the window size and location.

    -------------------------------------------------------

    ------------------ This option lets you customize the background and/C#xx (select foreground colors of various elements in a help screen.

    color) The /C option is followed by the number of the color------------------ you want and the hex color values for background and

    foreground, respectively.

    There are twelve possible colors, numbered as follows:

    -------------------------------------------------------Number Element

    -------------------------------------------------------

    0 Color border attribute

  • 7/29/2019 asp.net.utiliti

    43/86

    1 Monochrome border attribute2 Color text attribute3 Monochrome text attribute4 Color keyword attribute5 Monochrome keyword attribute6 Color selected keyword word attribute7 Monochrome selected keyword word attribute8 Color example text attribute9 Monochrome example text attributeA Color marked block attributeB Monochrome marked block attribute

    - 40 -

    -------------------------------------------------------

    The color values for a standard IBM-compatible colordisplay are as follows:

    -------------------------------------------------------First digit (background) Second digit (foreground)

    -------------------------------------------------------

    0 Black 0 Black1 Blue 1 Blue2 Green 2 Green3 Cyan 3 Cyan

    4 Red 4 Red5 Magenta 5 Magenta6 Brown 6 Brown7 Gray 7 Gray

    8 Intense blackORing the color value 9 Intense bluewith 0x80 produces a A Intense greenblinking color unless B Intense cyanblinking has been C Intense reddisabled. D Intense magenta

    E Intense brown (yellow)F Intense gray (white)

    -------------------------------------------------------

    On monochrome monitors, the attribute values can differwidely, so you may need to experiment.

    ------------------ The name that follows the /F option should be the full/Fname (full path drive/directory path name of the help file to use; forand name for help example,

    file)

  • 7/29/2019 asp.net.utiliti

    44/86

    ------------------ THELP /FC:\TC\OWLHELP.TCHTHELP /FC:\TC\TCHELP.TCH

    You can specify multiple help files on the command-lineor in the THELP.CFG file. THELP supports up to eighthelp files.

    - 41 -

    ------------------ Any of these options displays a summary of THELP's com-/H, /?, and ? mand-line options.(display help

    screen)------------------ This option allows you to reassign a function to a new/Kxxyy (reassign hot key. The option must be followed by the shift state

    hot key) (xx) and the scan code (yy) of the new key. Virtually------------------ any shift state/scan code combination may be selected.

    Here's a quick summary of some common shift states andscan codes:

    -------------------------------------------------------Shift states (can be OR'ed together):

    Right Shift 01h

    Left Shift 02hCtrl 04hAlt 08h

    Scan codes:

    A 1eh N 31h 0 0bh F1 3bhB 30h O 18h 1 02h F2 3chC 2eh P 19h 2 03h F3 3dhD 20h Q 10h 3 04h F4 3ehE 12h R 13h 4 05h F5 3fhF 21h S 1fh 5 06h F6 40hG 22h T 14h 6 07h F7 41h

    H 23h U 16h 7 08h F8 42hI 17h V 2fh 8 09h F9 43hJ 24h W 11h 9 0ah F10 44hK 25h X 2dhL 26h Y 15hM 32h Z 2ch

    Enhanced keyboards only (may not work with allcomputers or keyboards):

  • 7/29/2019 asp.net.utiliti

    45/86

    F11 57hF12 58h

    -------------------------------------------------------

    - 42 -

    ------------------ This option removes THELP from memory. If other TSRs/U (remove THELP have been loaded after THELP, make sure to remove them

    from memory) before removing THELP.------------------

    ------------------ Where:/Wx,y,w,h (set the x = window column location (zero based)

    window size and y = window row locationlocation) w = window width

    ------------------ h = window height

    For example, to create a full-screen help window use:

    /W0,0,80,25

    ===========================================================================TLIB===========================================================================

    TLIB is a utility that manages libraries of individual.OBJ (object module) files. A library is a convenienttool for dealing with a collection of object modules asa single unit.

    When it modifies The libraries included with Turbo C++ were built withan existing TLIB. You can use TLIB to build your own libraries, or

    library, TLIB to modify the Turbo C++ libraries, your own libraries,always creates a libraries furnished by other programmers, or commercial

    copy of the libraries you've purchased. You can use TLIB tooriginal library

    with a .BAK exten- o create a new library from a group of object modulession. Better safe

    than sorry! o add object modules or other libraries to an existinglibrary

    o remove object modules from an existing library

    o replace object modules from an existing library

  • 7/29/2019 asp.net.utiliti

    46/86

    o extract object modules from an existing library

    o list the contents of a new or existing library

    - 43 -

    See the section on TLIB can also create (and include in the library file)the /E option an Extended Dictionary, which may be used to speed up(page 49) for linking.

    details.Although TLIB is not essential for creating executable

    programs with Turbo C++, it is a useful programmingproductivity tool. You will find TLIB indispensable forlarge development projects. If you work with objectmodule libraries developed by others, you can use TLIBto maintain those libraries when necessary.

    Why use object =======================================================module libraries?

    When you program in C and C++, you often create acollection of useful functions and classes. Because ofC and C++'s modularity, you are likely to split thosefunctions into many separately compiled source files.

    You use only a subset of functions from the entirecollection in any particular program. It can becomequite tedious, however, to figure out exactly whichfiles you are using. On the other hand, if you alwaysinclude all the source files, your program becomesextremely large and unwieldy.

    An object module library solves the problem of managinga collection of functions and classes. When you linkyour program with a library, the linker scans thelibrary and automatically selects only those modulesneeded for the current program.

    The TLIB command =======================================================line

    To get a summary The TLIB command line takes the following general form,of TLIB's usage, where items listed in square brackets ([like this]) are

    just type TLIB and optional:press Enter.

    tlib [/C] [/E] [/Psize] libname [operations] [,listfile]

  • 7/29/2019 asp.net.utiliti

    47/86

    - 44 -

    Table 1.2: TLIB options

    ---------------------------------------------------------------------------Option Description---------------------------------------------------------------------------

    libname The DOS path name of the library you want to create ormanage. Every TLIB command must be given a libname.Wildcards are not allowed. TLIB assumes an extension of .LIBif none is given. We recommend that you do not use an exten-sion other than .LIB, since both TCC and TC's project-makefacility require the .LIB extension in order to recognizelibrary files. Note: If the named library does not exist andthere are add operations, TLIB creates the library.

    /C The case-sensitive flag. This option is not normally used;see page 50 for a detailed explanation.

    /E Creates Extended Dictionary; see page 49 for a detailedexplanation.

    /Psize Sets the library page size to size; see page 49 for adetailed explanation.

    operations The list of operations TLIB performs. Operations may appearin any order. If you only want to examine the contents ofthe library, don't give any operations.

    listfile The name of the file listing library contents. The listfilename (if given) must be preceded by a comma. No listing isproduced if you don't give a file name. The listing is an

    alphabetical list of each module. The entry for each modulecontains an alphabetical list of each public symbol definedin that module. The default extension for the listfile is.LST. You can direct the listing to the screen by using thelistfile name CON, or to the printer by using the name PRN.

    ---------------------------------------------------------------------------

    This section summarizes each of these command-line com-ponents; the following sections provide details about

  • 7/29/2019 asp.net.utiliti

    48/86

    using TLIB. For TLIB examples, refer to the "Examples"section on page 51.

    - 45 -

    ------------------ The operation list describes what actions you want TLIBThe operation list to do. It consists of a sequence of operations given------------------ one after the other. Each operation consists of a one-

    or two-character action symbol followed by a file ormodule name. You can put whitespace around either theaction symbol or the file or module name, but not inthe middle of a two-character action or in a name.

    You can put as many operations as you like on the com-mand line, up to DOS's COMMAND.COM-imposed line-lengthlimit of 127 characters. The order of the operations isnot important. TLIB always applies the operations in aspecific order:

    1. All extract operations are done first.

    2. All remove operations are done next.

    3. All add operations are done last.

    You can replace a module by first removing it, thenadding the replacement module.

    File and module names=======================================================

    TLIB finds the name of a module by taking the givenfile name and stripping any drive, path, and extensioninformation from it. (Typically, drive, path, andextension are not given.)

    Note that TLIB always assumes reasonable defaults. For

    example, to add a module that has an .OBJ extensionfrom the current directory, you only need to supply themodule name, not the path and .OBJ extension.

    Wildcards are never allowed in file or module names.

    TLIB operations=======================================================

  • 7/29/2019 asp.net.utiliti

    49/86

    TLIB recognizes three action symbols (*, +, *), whichyou can use singly or combined in pairs for a total offive distinct operations. The order of the characters

    - 46 -

    is not important for operations that use a pair ofcharacters. The action symbols and what they do arelisted here:

    -------------------------------------------------------TLIB action Action

    symbols symbol Name Description

    -------------------------------------------------------

    To create a + Add TLIB adds the named file tolibrary, add the library. If the file hasmodules to a no extension given, TLIB

    library that does assumes an extension of .OBJ.not yet exist. If the file is itself a

    library (with a .LIB exten-sion), then the operation addsall of the modules in thenamed library to the targetlibrary.

    If a module being addedalready exists, TLIB displaysa message and does not add thenew module.

    - Remove TLIB removes the named modulefrom the library. If themodule does not exist in thelibrary, TLIB displays amessage.

    A remove operation only needsa module name. TLIB allows you

    to enter a full path name withdrive and extension included,but ignores everything exceptthe module name.

    * Extract TLIB creates the named file bycopying the correspondingmodule from the library to thefile. If the module does notexist, TLIB displays a message

  • 7/29/2019 asp.net.utiliti

    50/86

    and does not create a file. Ifthe named file already exists,it is overwritten.

    - 47 -

    Table 1.3: TLIB action symbols (continued)_____________

    You can't directly -* Extract & TLIB copies the named modulerename modules in *- Remove to the corresponding file name

    a library. To and then removes it from therename a module, library. This is just

    extract and remove shorthand for an extractit, rename the followed by a remove

    file just created, operation.

    then add it backinto the library. -+ Replace TLIB replaces the named module+- with the corresponding file.

    This is just shorthand for aremove followed by an addoperation.

    -------------------------------------------------------

    Using response =======================================================files

    When you are dealing with a large number of operations,

    or if you find yourself repeating certain sets ofoperations over and over, you will probably want tostart using response files. A response file is simplyan ASCII text file (which can be created with the TurboC++ editor) that contains all or part of a TLIB com-mand. Using response files, you can build TLIB commandslarger than would fit on one DOS command line.

    See "Examples" for To use a response file pathname, specify @pathname ata sample response any position on the TLIB command line.

    file and a TLIBcommand line o More than one line of text can make up a response

    incorporating it. file; you use the "and" character (&) at the end of a

    line to indicate that another line follows.

    o You don't need to put the entire TLIB command in theresponse file; the file can provide a portion of theTLIB command line, and you can type in the rest.

    o You can use more than one response file in a singleTLIB command line.

  • 7/29/2019 asp.net.utiliti

    51/86

    - 48 -

    Creating an =======================================================extended

    dictionary: The /E To speed up linking with large library files (such asoption the standard Cx.LIB library), you can direct TLIB to

    create an extended dictionary and append it to thelibrary file. This dictionary contains, in a verycompact form, information that is not included in thestandard library dictionary. This information enablesTLINK to process library files faster.

    To create an extended dictionary for a library that isbeing modified, use the /E option when you invoke TLIBto add, remove, or replace modules in the library. Tocreate an extended dictionary for an existing librarythat you don't want to modify, use the /E option andask TLIB to remove a nonexistent module from thelibrary. TLIB will display a warning that the specifiedmodule was not found in the library, but it will alsocreate an extended dictionary for the specifiedlibrary. For example, if you enter

    tlib /E mylib -bogus

    TLINK will ignore the debugging information in alibrary that has an extended dictionary, unless the /eoption is used on the TLINK command line.

    Setting the page =======================================================size: The /P

    option Every DOS library file contains a dictionary (whichappears at the end of the .LIB file, following all ofthe object modules). For each module in the library,this dictionary contains a 16-bit address of thatparticular module within the .LIB file; this address isgiven in terms of the library page size (it defaults to

    16 bytes).

    The library page size determines the maximum combinedsize of all object modules in the library--it cannotexceed 65,536 pages. The default (and minimum) pagesize of 16 bytes allows a library of about 1 MB insize. To create a larger library, the page size must beincreased using the /P option; the page size must be a

  • 7/29/2019 asp.net.utiliti

    52/86

    - 49 -

    power of 2, and it may not be smaller than 16 or largerthan 32,768.

    All modules in the library must start on a pageboundary. For example, in a library with a page size of32 (the lowest possible page size higher than thedefault 16), on the average 16 bytes will be lost perobject module in padding. If you attempt to create alibrary that is too large for the given page size, TLIBwill issue an error message and suggest that you use /Pwith the next available higher page size.

    Advanced =======================================================operation: The /C

    option When you add a module to a library, TLIB maintains adictionary of all public symbols defined in the modulesof the library. All symbols in the library must bedistinct. If you try to add a module to the librarythat would cause a duplicate symbol, TLIB displays amessage and won't add the module.

    Normally, when TLIB checks for duplicate symbols in thelibrary, uppercase and lowercase letters are not

    considered as distinct. For example, the symbols lookupand LOOKUP are treated as duplicates. Since C and C++do treat uppercase and lowercase letters as distinct,use the /C option to add a module to a library thatincludes a symbol differing only in case from onealready in the library. The /C option tells TLIB toaccept a module with symbols in it that differ only incase from symbols already in the library.

    If you want to use It may seem odd that, without the /C option, TLIBthe library with rejects symbols that differ only in case, especially

    other linkers (or since C and C++ are case-sensitive languages. Theallow other people reason is that some linkers fail to distinguish between

    to use the library symbols in a library that differ only in case. Suchwith other linkers, for example, will treat stars, Stars, and

    linkers), for your STARS as the same identifier. TLINK, on the other hand,own protection you has no problem distinguishing uppercase and lowercaseshould not use the symbols, and it will properly accept a library contain-

    /C option. ing symbols that differ only in case. In this example,then, Turbo C++ would treat stars, Stars, and STARS asthree separate identifiers. As long as you use thelibrary only with TLINK, you can use the TLIB /C optionwithout any problems.

  • 7/29/2019 asp.net.utiliti

    53/86

    - 50 -

    Examples =======================================================

    Here are some simple examples demonstrating thedifferent things you can do with TLIB.

    1. To create a library named MYLIB.LIB with modulesX.OBJ, Y.OBJ, and Z.OBJ, typetlib mylib +x +y +z

    2. To create a library as in #1 and get a listing inMYLIB.LST too, typetlib mylib +x +y +z, mylib.lst

    3. To get a listing in CS.LST of an existing libraryCS.LIB, typetlib cs, cs.lst

    4. To replace module X.OBJ with a new copy, add A.OBJand delete Z.OBJ from MYLIB.LIB, typetlib mylib -+x +a -z

    5. To extract module Y.OBJ from MYLIB.LIB and get alisting in MYLIB.LST, typetlib mylib *y, mylib.lst

    6. To create a new library named ALPHA, with modulesA.OBJ, B.OBJ, ..., G.OBJ using a response file:

    First create a text file, ALPHA.RSP, with+a.obj +b.obj +c.obj &

    +d.obj +e.obj +f.obj &+g.obj

    Then use the TLIB command, which produces a listingfile named ALPHA.LST:tlib alpha @alpha.rsp, alpha.lst

    ===========================================================================TOUCH===========================================================================

    There are times when you want to force a particulartarget file to be recompiled or rebuilt, even though nochanges have been made to its sources. One way to do

  • 7/29/2019 asp.net.utiliti

    54/86

    - 51 -

    this is to use the TOUCH utility. TOUCH changes thedate and time of one or more files to the current dateand time, making it "newer" than the files that dependon it.

    You can force MAKE to rebuild a target file by touchingone of the files that target depends on. To touch afile (or files), type

    You can use the touch filename [filename ...]DOS wildcards *

    and ? with TOUCH. at the DOS prompt. TOUCH will then update the file'screation date(s). Once you do this, you can invoke MAKE

    to rebuild the touched target file(s).

    Important! Before you use the TOUCH utility, it's vitallyimportant to set your system's internal clock to theproper date and time. If you're using an IBM PC, XT, orcompatible that doesn't have a battery-powered clock,don't forget to set the time and date using the DOSTIME and DATE commands. Failing to do this will keepboth TOUCH and MAKE from working properly.

    ===========================================================================

    TRANCOPY: A project transfer item utility===========================================================================

    TRANCOPY copies transfer items from one project toanother. The syntax is

    TRANCOPY [-r] Source[.PRJ] Dest[.PRJ]

    TRANCOPY merges the transfer items in Source with thetransfer in Dest; Dest gets the new transfer items.

    If the -r option is used, the set of the transfer itemsin Dest is replaced by the set of transfer items in

    Source.

  • 7/29/2019 asp.net.utiliti

    55/86

    - 52 -

    ===========================================================================TRIGRAPH: A character-conversion utility===========================================================================

    Trigraphs are three-character sequences that replacecertain characters used in the C language that are notavailable on some keyboards. Translating trigraphs inthe compiler would slow compilation down considerably,so Turbo C++ provides a filter named TRIGRAPH.EXE tohandle trigraph sequences when you need to. The syntaxfor invoking this program is as follows:

    TRIGRAPH [-u] file(s) [file(s) ...]

    The following table shows the trigraph sequences thatTRIGRAPH.EXE recognizes:

    -------------------------------------------------------Trigraph Character

    -------------------------------------------------------

    ??= #??( [??/ \??) ]

    ??' ^??< {??! |??> }??- ~

    -------------------------------------------------------

    TRIGRAPH.EXE works in two directions: It can convertall trigraphs to their single-character representation,and it can convert single characters to their trigraphrepresentation. Ordinarily, TRIGRAPH.EXE convertstrigraphs to single characters. You can specify the

    inverse conversion with the -u (UNDO) command-lineoption, which must come before any file names on thecommand line.

    TRIGRAPH.EXE takes any number of file specifiers,including wildcards, on the command line. For each filespecified, it creates a backup copy of the file withthe original file name and an extension of .BAK, and

  • 7/29/2019 asp.net.utiliti

    56/86

    - 53 -

    creates a new file with the original file name and theappropriate conversions performed. For example,

    trigraph test.c test1.c

    removes all trigraphs from the two files TEST.C andTEST1.C, creating backup files TEST.BAK and TEST1.BAK.

    As another example, the following command insertstrigraphs into all the files with the extension .C, andmakes backup copies of all those files, giving them theextension .BAK.

    trigraph -u *.c

    ===========================================================================Transfer macros===========================================================================

    The IDE recognizes certain strings of characters calledtransfer macros in the parameter string of theModify/New Transfer Item dialog box. There are threekinds of macros: state, file name, and instruction.

    The transfer State macros

    macros are listed =======================================================alphabetically anddescribed in more State macros are expanded according to the state of thedetail starting on IDE. The state macros are

    page 55.$COL $ERRNAME$CONFIG $INC$DEF $LIB$ERRCOL $LINE$ERRLINE $PRJNAME

    File name macros

    =======================================================

    File name macros are actually functions that take filenames as arguments and return various parts of the filename. They allow you to build up new file namespecifications from existing file names. For example,you can pass TDUMP a macro like this:

  • 7/29/2019 asp.net.utiliti

    57/86

    - 54 -

    $DIR($EXENAME)$NAME($EDNAME).OBJ

    This macro gives you the output directory path, thefile name only in the active Edit window, and anexplicit extension. If your current directory isC:\WORK, your output directory is TEST, and the activeeditor contains MYPROG.C, then TDUMP receives theparameter

    C:\WORK\TEST\MYPROG.OBJ

    The file name macros are

    $DIR $EXT()$DRIVE() $NAME()$EDNAME $OUTNAME

    $EXENAME

    Instruction macros=======================================================

    Instruction macros tell the IDE to perform some actionor make some setting. The instruction macros are

    $CAP EDIT $PROMPT$CAP MSG(filter) $SAVE ALL$DEP() $SAVE CUR$MEM(kb to reserve) $SAVE PROMPT

    $NOSWAP $TASM

    $CAP EDIT: This macro tells the IDE to redirect programoutput into a standard file. After the transfer programis completed, a new editor window is created, and thecaptured output is displayed. The captured outputresides in a special Edit window titled TransferOutput.

    For $CAP EDIT to work correctly, the transfer programmust write to DOS standard output.

    - 55 -

  • 7/29/2019 asp.net.utiliti

    58/86

    You can use any $CAP MSG(filter): Captures program output into theprogram that has Message window, using filter as a DOS filter for

    line-oriented converting program output into Message window format.messages output(file and line We've provided several filters for this macro:

    number) with this GREP2MSG.EXE for GREP and TASM2MSG.EXE for Turbomacro. Assembler (TASM). We've included the source code for

    these filters so you can write your own filters forother transfer programs