═══ 1. Special Notices ═══ References in this help to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM licensed program in this help is not intended to state or imply that only IBM's licensed program may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, except those expressly designated by IBM, is the user's responsibility. IBM may have patents or pending patent applications covering subject matter in this help. The furnishing of this help does not give you any license to these patents. The following terms, denoted by an asterisk (*) in this help, are trademarks of the IBM Corporation in the United States and/or other countries: IBM OS/2 Operating System/2 Presentation Manager WorkFrame/2. The following terms used in this publication are trademarks of Microsoft Corporation. They are denoted by a double asterisk (**) when they appear in the text. Microsoft Windows. This help contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. ═══ 2. Addtool - Introduction ═══ Use the Addtool utility to add tools to the WorkFrame/2 product from a command line rather than using the WorkFrame/2's interface. Adding tools from a command line is a fast way of adding your own tools or ones from a vendor. In addition, you can control where the tool appears in the Tools pulldown menu of the WorkFrame/2 interface. Warning: Do not run Addtool while the WorkFrame/2 window is open. The Addtool utility requires an initialization file. If you are familiar with initialization files, you can use the Quick Reference topic to get the information you need to create the initialization file. Then you can proceed immediately to Step 3 which tells you how to use the addtool command to add the tools. Or, if you would prefer to use a step-by-step approach to creating the initialization file, do all the following steps: o Step 1 - Create a resource script file that contains information about the tool. o Step 2 - Use the OS/2* operating system MAKEINI.EXE tool to compile the resource script file into an initialization file. o Step 3 - Use the Addtool utility to add the tools to the WorkFrame/2 product. ═══ 3. Quick Reference ═══ If you are familiar with initialization (.INI) files, you can use this panel as a reminder of what needs to be specified for the Addtool utility. The number of applications depends on the number of tools you are adding. The first application, TOOLS, has one key called COUNT. And the value of COUNT is the number of tools being added. Each of the other applications is called TOOLSn, where n is an integer from 1 (one) to the number of tools being added. The TOOLSn applications have the following keys Key Description of Value TITLE The title you want to identify the tool. PRG The path and file name of the executable file. DIR The directory to be used as the working directory of the tool. INVOKE The parameters you want to start the tool with. PROMTYPE Indicates whether or not the user should be prompted when the tool is started. Zero ('0') means no prompt and one ('1') causes a prompt to be displayed. PROMPT The text of the prompt. PRGMTYPE The type of program. Must be one of the following values: 0 Let the header of the tool's executable file control how the tool is run. 1 Run the program as an OS/2* operating system full-screen program. 2 Run the program as an OS/2* operating system text-windowed program. 3 Run the program as a Presentation Manager* program. 4 Run the program as a DOS full-screen program. 7 Run the program as a DOS text-windowed program. 256 Run the program as an OS/2* operating system command file. Let the command processor, CMD.EXE, control how it runs. 257 Run the program as an OS/2* operating system command file in a full-screen. 258 Run the program as an OS/2* operating system command file in text-windowed mode. SESSION Indicate whether or not you want the tool to run in the foreground ('0') or background ('1'). If you require more information about the keys and their values, see Step 1. ═══ 4. Step 1 - Creating a Resource Script File ═══ This section describes how to specify information about tools in a resource script file that can be used as input to the MAKEINI.EXE utility. You can use select Copy (under the Services pulldown) to create a file with the contents of the example on the right. This file can then be used as a template for your own resource script file. First, identify the number of tools being added with the line: "TOOLS" "COUNT" "Number_of_tools" Number_of_tools is replaced by a numerical value. In the example, three tools are being added so its value is 3. Throughout the rest of the string table, the tools are identified by the labels TOOLS1, TOOLS2, and TOOLS3. If more tools were being added, their labels would be TOOLS4, TOOLS5 and so on. Next, specify the characteristics described below for each tool starting with the first tool. o Specify the title with the line: "TOOLS1" "TITLE" "Title_of_the_tool" Title_of_the_tool is replaced by a character string. In the example, it is My Command Window. The title identifies the tool in window headings, messages, pulldowns, and list boxes. Therefore, make it meaningful and unique. It can be up to 100 characters long. o Specify the path and name of the executable file of the tool with the line: "TOOLS1" "PRG" "Path_and_file_name" In the example, the executable file name of the tool is d:\my_tools\my_cmd.exe. If the path is not fully specified, (for example, .\my_tool.exe) the WorkFrame/2 product searches the path specified in the PATH environment variable when the program is started. o Specify the path of the directory you want to use as the directory when the tool is run: "TOOLS1" "DIR" "Current_directory" In the example, the tool will run in the directory d:\temp. If you want to use the directory associated with the current project when the tool is invoked, use a single period (.). o Specify the parameters to be passed to the tool when it is started: "TOOLS1" "INVOKE" "Invocation_parameters" In the example, /k is the invocation parameter. You can use substitution variables. You can enter up to 100 characters. o Specify whether or not a prompt should appear before the tool is run: "TOOLS1" "PROMTYPE" "Prompt_or_no_prompt" Prompt_or_no_prompt is replaced by: 0 (zero) If no prompt is to be displayed when the tool is run. 1 (one) If a prompt is to be displayed. Having a prompt lets you enter or change the the invocation parameters just before the tool is run. o The text in the prompt is specified with the line: "TOOLS1" "PROMPT" "Text_of the_prompt" In the example, the text displayed to prompt the user is Enter in the form /k command eg /kdir . o Specify the type of program that the tool is with the line: "TOOLS1" "PRGMTYPE" "Type_of_program" Type_of_program is one of the following values: 0 Let the header of the tool's executable file control how the tool is run. 1 Run the program as an OS/2* operating system full-screen program. 2 Run the program as an OS/2* operating system text-windowed program. 3 Run the program as a Presentation Manager* program. 4 Run the program as a DOS full-screen program. 7 Run the program as a DOS text-windowed program. 256 Run the program as an OS/2* operating system command file. Let the command processor, CMD.EXE, control how it runs. 257 Run the program as an OS/2* operating system command file in a full-screen. 258 Run the program as an OS/2* operating system command file in text-windowed mode. Specify 0 (zero) to run the program as specified in the header of its executable file. By specifying another option, you can override the specification in the header of the executable file. You could, for example, start a windowed tool as a full screen tool. Do not start an application that is not a Presentation Manager* program as a Presentation Manager* program or vice versa. If the program is a Presentation Manager* program, specify 0 (zero) or 3. o Specify whether you want to run the tool in the foreground or the background: "TOOLS1" "SESSION" " Session_type" Session_type is either 0 or 1. If you select 0, the tool runs in the foreground. The tool will appear next to Sessions in the Windows pulldown. If you select 1, the tool runs as a background process. The tool will appear next to Dialogs in the Windows pulldown. A Monitor window displays showing the standard output. Only select 1 if the program does not interact with the user. Note: If the tool is a Presentation Manager* program, specify 0 to make sure the tool runs in the foreground. If the tool is a command file, it is invoked with the /K parameter if it is to run in the foreground. If it is to rund in the background, it is invoked with the /C parameter. In the example, the tool is to run in the foreground so 0 is specified. Repeat the above steps for each tool being added. When the resource script file is complete, go to Step 2. ═══ 4.1. Resource Script File - Example ═══ /*****************************************/ /* Example of a Resource Script File */ /* that can be used by MAKEINI.EXE to */ /* create an intitialization file. */ /*****************************************/ CODEPAGE 850 STRINGTABLE BEGIN "" "" "" "" "" "" "" "" "" "" "TOOLS" "COUNT" "3" "TOOLS1" "TITLE" "My Command Window" "TOOLS1" "PRG" "d:\my_tools\my_cmd.exe" "TOOLS1" "DIR" "d:\temp" "TOOLS1" "INVOKE" "/k" "TOOLS1" "PROMTYPE" "1" "TOOLS1" "PROMPT" "Enter '/k command' (eg. /k dir)" "TOOLS1" "PRGMTYPE" "2" "TOOLS1" "SESSION" "1" "TOOLS2" "TITLE" "Dialog Box Editor" "TOOLS2" "PRG" "DLGEDIT.EXE" "TOOLS2" "DIR" "." "TOOLS2" "INVOKE" "%f" "TOOLS2" "PROMTYPE" "0" "TOOLS2" "PROMPT" "" "TOOLS2" "PRGMTYPE" "3" "TOOLS2" "SESSION" "0" "TOOLS3" "TITLE" "IPF Compiler" "TOOLS3" "PRG" "IPFC.EXE" "TOOLS3" "DIR" "." "TOOLS3" "INVOKE" "%f" "TOOLS3" "PROMTYPE" "0" "TOOLS3" "PROMPT" "" "TOOLS3" "PRGMTYPE" "0" "TOOLS3" "SESSION" "1" "" "" "" END ═══ 5. Step 2 - Making An Initialization File ═══ The next step is to make an initialization file that can be used by the Addtool utility. To make an initialization file, use the OS/2 operating system utility MAKEINI.EXE to compile the resource script file (created in Step 1) into an initialization file. For example, makeini sample.ini sample.rc creates the initialization file sample.ini from the resource script file sample.rc. If any errors occur while using MAKEINI.EXE with your resource script file, correct them and try again. If you need more information, consult the OS/2* operating system online reference. When you initialization file has been successfully created, go to Step 3. ═══ 6. Step 3 - Using Addtool To Add the Tools ═══ To add the tools to the WorkFrame/2 product, enter the following command: addtool ini_file [ordinal] where ini_file Is the file name of the initialization file created in step 2. ordinal Indicates where the tools should appear in the Tools pulldown. Use: o 0 to put the tools at the top of the list o 1 to put them after the first tool already in the list o 2 to put them after the second tool already in the list and so on. If the ordinal exceeds the number of tools in the Tools pulldown or is unspecified, the new tool is added to to the end of the tools list. ═══ 6.1. Adding Tools - Example ═══ Here's an example of commands used to add two tools to the WorkFrame/2 product: addtool tool_x.ini 2 addtool tool_y.ini 99 Note: The first command places the tools specified in tool_x.ini after the second item in the Tools pulldown. The second one places the tools specified in tool_y.ini at the end of the Tools pulldown if there are less than 99 items in the pulldown. ═══ 7. Help for Messages ═══ For help on a particular message: 1. Select the plus ('+') symbol beside the Help for Messages heading in the Contents window to display a list of message identifiers. 2. Select the message identifier corresponding to the that displayed by the Addtool utility to see more information about it. ═══ 7.1. ADT0001E: Message Help ═══ Incorrect syntax. The syntax entered for the Addtool command is not valid. Recovery Ensure that the command you enter corresponds to the correct syntax: addtool ini_file [ordinal] where ini_file Is the file name of the initialization file created in step 2. ordinal Indicates where the tools should appear in the Tools pulldown. Use: o 0 to put the tools at the top of the list o 1 to put them after the first tool already in the list o 2 to put them after the second tool already in the list and so on. If the ordinal exceeds the number of tools in the Tools pulldown or is unspecified, the new tool is added to to the end of the tools list. ═══ 7.2. ADT0002E: Message Help ═══ The ordinal (insertion point) must be numeric. The ordinal entered on the command line was not numerical. Recovery Enter the command again with a numerical ordinal. ═══ 7.3. ADT0003E: Message Help ═══ Unable to open input file . The Addtool utility could not open the indicated file. Recovery Ensure that the file is not being used by another process and try again. ═══ 7.4. ADT0004E: Message Help ═══ Tool count missing from profile. The COUNT key is missing from the initialization file. Recovery Ensure that the COUNT key is specified in the initialization file. ═══ 7.5. ADT0005E: Message Help ═══ Memory allocation failure. An error occurred while trying to allocate memory. There may not be sufficient memory to complete the task. Recovery Close one or more other tasks, and retry the command. ═══ 7.6. ADT0006E: Message Help ═══ Too many tools. The new total of new_total would exceed the maximum of maximum_number_of_tools. By adding the tools specified in the file, the new total would be greater than that allowed by the WorkFrame/2 product. Recovery Remove enough unused tools from the WorkFrame/2 product so that the new additions keep the total less than 100. Then add the new tools. ═══ 7.7. ADT0007E: Message Help ═══ Addtool utility ending because of errors. One or more errors occurred before the Addtool utility finished. Recovery The errors that occurred were displayed previously to this one. Look up the errors in the Contents section and correct the problem. ═══ 7.8. ADT0008E: Message Help ═══ Addtool utility finished successfully. The tools have been added to the WorkFrame/2 product. ═══ 7.9. ADT0009E: Message Help ═══ Error loading the WorkFrame/2 profile. The Addtool utility cannot load the user profile IBMWF.INI from the installation directory. One of three conditions has occurred: 1. The installation directory of the WorkFrame/2 product could not be found by looking in OS2.INI. Use the ADDUSER.EXE utility to specify the installation directory in the OS2.INI file. 2. The profile failed to open. If the file is being held by another process, release it and try again. 3. The file has been corrupted. In the last situation, you will have to install the WorkFrame/2 again. The environment will be preserved if you specify the same home directory, but you will have to specify your preferences again. ═══ 7.10. ADT0010E: Message Help ═══ Error reading WorkFrame/2 profile, OS/2* operating system return code is . The WorkFrame/2 initialization cannot read the user profile IBMWF.INI from the installation directory. Recovery Look up the return code in the OS/2* operating system online reference for more information and correct the problem. ═══ 7.11. ADT0011E: Message Help ═══ An error occurred while writing the WorkFrame/2 profile, OS/2* operating system return code is . The Addtool utility could not update the WorkFrame/2 profile. Recovery Look up the return code in the OS/2* operating system online reference for more information and correct the problem. ═══ 7.12. ADT0012E: Message Help ═══ Profile tool string exceeded 65335 bytes when adding tool . The profile string used to hold the information about the WorkFrame/2's tools reached its limit when trying to store the information about the indicated tool. Recovery Delete tools from the WorkFrame/2 product that are no longer needed and try again. ═══ 7.13. ADT0013E: Message Help ═══ Title is missing for tool The title is missing. A title must be provided before a tool can be added or changed. Your title is missing or blank. Recovery Specify the title you want to use for this tool. ═══ 7.14. ADT0014E: Message Help ═══ Program name is missing for tool . No program name was specified for the indicated tool. Recovery Correct the resource script file so that the tool has a program name. ═══ 7.15. ADT0015E: Message Help ═══ Invocation string for tool incorrect - string terminated with a '%'. The last character was a % character. It must be followed by another character to form a recognized substitution variable. Recognized substitution variables are %%, %a, %d, %e, %f, %m, %n, %o, %r, or %z. Recovery Add the appropriate character to the end of the string to create a substitution variable or delete the % character. ═══ 7.16. ADT0016E: Message Help ═══ Invocation string for tool incorrect substitution variable found within '%a...%z' string. Only '%%', %d, or '%z' can follow '%a'. A substitution variable other than %%, %d, or %z was found following a %a. Recovery Either remove the substitution variable, change it to a %%, %d, or %z, or add a %z ahead of it. ═══ 7.17. ADT0017E: Message Help ═══ Invocation string for tool incorrect - '%z' found without '%a'. A %z substitution variable must be preceeded by a matching %a. Recovery Make sure the separator character or string that is to be used between the file names is placed inbetween %a and %z symbols. Or remove the %z substitution variable. ═══ 7.18. ADT0018E: Message Help ═══ Invocation string for tool incorrect - unrecognized substitution variable . An unrecognized substitution variable was used. Recognized substitution variables are %%, %a, %d, %e, %f, %m, %n, %o, %r, or %z. Recovery Change the substitution variable to a recognized substitution variable or remove it. ═══ 7.19. ADT0019E: Message Help ═══ Invocation string for tool incorrect - '%a' found without '%z'. A %a substitution variable must be followed by a matching %z. Recovery Make sure the separator character or string that is to be used between the file names is placed inbetween %a and %z symbols. Or remove the %a substitution variable. ═══ 7.20. ADT0020E: Message Help ═══ Prompt type for tool must be 0 (zero) or 1 (one). The "PROMPT" entry in the resource script file in neither a zero ('0') nor a one ('1'). 0 (zero) If no prompt is to be displayed when the tool is run. 1 (one) If a prompt is to be displayed. Recovery Specify either a 0 or a 1 for "PROMPT" in the resource script file. ═══ 7.21. ADT0021E: Message Help ═══ Session type for tool must be 0 (zero) or 1 (one). The "SESSION" entry in the resource script file in neither a zero ('0') nor a one ('1'). If you select 0, the tool runs in the foreground. The tool will appear next to Sessions in the Windows pulldown. If you select 1, the tool runs as a background process. The tool will appear next to Dialogs in the Windows pulldown. A Monitor window displays showing the standard output. Only select 1 if the program does not interact with the user. Note: If the tool is a Presentation Manager* program, specify 0 to make sure the tool runs in the foreground. If the tool is a command file, it is invoked with the /K parameter if it is to run in the foreground. If it is to rund in the background, it is invoked with the /C parameter. Recovery Specify either a 0 or a 1 for "SESSION" in the resource script file. ═══ 7.22. ADT0022E: Message Help ═══ Program type for tool is incorrect. It must be one of the following values: 0, 1, 2, 3, 4, 7, 256, 257, or 258. The value specified in the "PROMTYPE" line in the resource script file is not one of the valid values. Recovery Correct the value in the "PROMTYPE" line. 0 Let the header of the tool's executable file control how the tool is run. 1 Run the program as an OS/2* operating system full-screen program. 2 Run the program as an OS/2* operating system text-windowed program. 3 Run the program as a Presentation Manager* program. 4 Run the program as a DOS full-screen program. 7 Run the program as a DOS text-windowed program. 256 Run the program as an OS/2* operating system command file. Let the command processor, CMD.EXE, control how it runs. 257 Run the program as an OS/2* operating system command file in a full-screen. 258 Run the program as an OS/2* operating system command file in text-windowed mode. ═══ 7.23. ADT0023E: Message Help ═══ Prompt is missing for tool . You have selected to have a prompt provided but have not specified a value for the PROMPT key. Recovery Enter a value for the PROMPT key. ═══ 7.24. ADT0028E: Message Help ═══ Error creating backup of WorkFrame/2 profile, OS/2* operating system return code is . The Addtool utility could not make a backup of the WorkFrame/2 profile. Recovery Look up the OS/2* operating system return code in the online reference for more information and correct the problem. ═══ 7.25. ADT0029E: Message Help ═══ The for tool must be numeric. The value for the indicated string is not numeric. Recovery Specify a numeric value for the string. ═══ 7.26. ADT0030E: Message Help ═══ Tool count is not numeric. The value for the COUNT key in the initialization file is not numeric. Recovery Specify a numeric value for the COUNT key in the initialization file. ═══ 7.27. ADT0031E: Message Help ═══ Tool count is greater than the number of tools allowed. The maximum is 100. The value for the COUNT key is greater than 100. Recovery Ensure that the value is small enough so that the number of tools being added plus the number already added does not exceed 100. ═══ Current directory ═══ The current directory is the directory being used by the current project. ═══ Monitor ═══ The Monitor window displays whenever a tool is running in the background or Compile, Build, Link, or Make is selected from the Actions pulldown. Output from the action displays in the list box so you can see what is happening. While the Monitor window list box is being updated, you can only select Stop. Select Stop to halt the tools or action associated with the window. If the action is completed successfully you will hear a high-pitched beep. If the action is not successfully completed, then you will hear a low-pitched beep. Note: Some tools cannot be interrupted. The other pushbuttons are only available if: o The action has stopped on its own. o You have pressed the Stop pushbutton and the action has stopped. Once the action has stopped, you can use the: Print, Save, and Cancel pushbuttons. You can double-click on a line in the Monitor window list box to edit files if the dynamic link library of the compiler can parse the message line into a file name. Once the editor has started, it can scroll to the line indicated in the message if: o The editor supports the communication of error messages and the Send compiler errors check box (in the Configure Editor window) is selected. o The message line matches the form of the error message template specified in the Compile options dynamic link library. If you are using the default dynamic link library for the compile options, you can specify the error message template. If the dynamic link library is designed for a specific compiler, the error message template may already be built in. For example, if you are using the OS/2 Enhanced Editor editor and a compiler which can send the line number in the message, you can use the monitor window to move around the editing session. Suppose you are compiling a program and the following messages appear in the Monitor window. DAVID.C(0184):Missing ';'. DAVID.C(1318):Wrong number of parameters. DAVID.C(3679):Unexpected text identifier. You could start the editing session by clicking on the first line. The OS/2 Enhanced Editor editor would not only display the file for editing but automatically move to line 184. After inserting a ';', you could click on the next message line to move to line 1318 of the file being edited. The feature works with most text mode editors and some editors based on the Presentation Manager* program. For example, when you are fixing errors found by a compiler, just find the error in the list box and select it to edit the source file. ═══ Substitution Variables ═══ Substitution variables are symbols you can specify as invocation parameters. The WorkFrame/2 product supports the following substitution variables: %a...%z Will be replaced by all the file names selected in the corresponding listbox. The file names will be separated by the characters specified between the 'a' and the '%' of the %z substitution variable. For example, if the selected files are cat.obj, dog.obj, and bird.obj, the substitution variable %a+-%z will result in the string cat.obj+-dog.obj+-bird.obj The only substitution variable allowed within the %a...%z substitution variables are %% and %d. %d Will be replaced with the directory of the current project. Use this substitution variable to qualify the name of file as in %d\%f or %d\%n.%e. %e Will be replaced by the extension (without the period) of the first selected file. %f Will be replaced with the first file selected in the corresponding listbox. Specifying %f is the same as specifying %n.%e. %m Will be replaced by the make file name specified when the project was created. %n Will be replaced by the file name (without an extension) of the first selected file. %o Will be replaced by the target file name specified when the project was created. %r Will be replaced by the run options set for the current project. %% Will be replaced by a % symbol. ═══ 8. LIB - Introduction ═══ The IBM* Library Manager (also referred to as LIB in this reference) lets you create and maintain libraries of object code. Library files are given the extension of ".LIB" (as in MYLIB.LIB). High Performance File System (HPFS) file names are also supported as long as the file names ends with ".LIB" (as in MYLIBRARYFILE.NEW.LIB). LIB works with standard libraries and OS/2* import libraries. It does not work with Dynamic Link Libraries (DLL). Use LIB to: o Create a new library o Add, delete, or replace modules in a library o Copy object modules in a library to object files o List the contents of a library ═══ 9. Running LIB ═══ Run LIB by typing "LIB" at the operating system prompt. Parameters can be supplied by one of three methods: 1. Enter them directly on the command line. 2. Respond to prompts. 3. Put them in a text file called a response file and specify the file name after the LIB command. To enter more commands than can be conveniently entered on one line, type an ampersand (&) at the end of the line and press Enter to extend the command field to a new line. The ampersand can be used with all three input methods. You can press Ctrl+C or Ctrl+Break at any time during a LIB run to return to the operating system. Interrupting LIB before completion restores the library from the backup. Note: o When started, LIB makes a backup copy of the original library in case it is interrupted or a mistake is made. Make sure you have enough disk space for both your original library and the modified copy. o The library must end with the extension ".LIB". If an extension is not specified, the default extension, ".LIB", will be appended. HPFS file names are supported. Hence, MYLIBRARYNAME.NEW.LIB is still a valid library. Note that this implies that MYLIBRARYNAME.NEW refers to MYLIBRARYNAME.NEW.LIB. o If you enter an input library name and follow it immediately with a semicolon (;), LIB performs a consistency check on the library and takes no other action. ═══ 9.1. Using the Command Line ═══ You can specify all the input LIB needs on the command line. The syntax of the command line is: LIB [options] inlibrary [commands] [[,listfile] [, outlibrary]] [;] inlibrary The input library to be modified. options Options that affect the way LIB runs. commands Commands used to add, delete, replace, copy, and move modules within the library. listfile The name for a listing file. If you don't specify a name, no file is created. outlibrary The output library created from the input library. If you don't specify an output library, your input library is replaced with the modified version (see below). Commas are used to separate commands and options. The semicolon (;) is used to mark the end of the command line. ═══ 9.2. Using LIB Prompts ═══ If you don't provide input to LIB on the command line, LIB prompts you for the information it needs by displaying the following messages, one at a time: Prompt Enter Library name Name of the input library to be modified. Operations Commands to modify the library. If no operations are specified, the input library is unchanged. List file Name for a listing file If no listing file is specified, no listing file is created. Output library Name of the output library to be created from the input library. If no output library is specified, LIB modifies the input library. Enter the same information that you would enter when using the LIB command line. Notes o LIB waits for you to respond to each prompt before displaying the next prompt. If you notice that you have entered an incorrect response to a previous prompt, press Ctrl+C or Ctrl+Break to exit LIB and begin again. o A file name must be entered at the Library name: prompt. To choose a default response for any of the other prompts, press Enter. To choose default responses for all remaining prompts, type a semicolon (;) and press Enter. ═══ 9.3. Using a LIB Response File ═══ To provide input to LIB with a response file, type: LIB @responsefile; The field responsefile is the name of a file containing the same information that can be specified on the command line. In a sense, a response file extends the command line to include everything in the response file. To split input to LIB between the command line and a response file, put part of your input on the command line and specify a response file (preceding the response file name with the at sign (@)). The response file name can be any valid OS/2 file. To use special characters such as a space or the @ symbol, the filename must be enclosed in quotes. LIB responds to input you place in a response file just as it does to input you enter on a command line or after a prompt. Using a newline character in the response file is the equivalent of pressing the Enter key after a LIB prompt. A response file uses one text line for each prompt. To extend a LIB command to multiple lines, end each line except the last with an ampersand (&). Responses must appear in the same order as the prompts. If a response for one of the prompts does not appear, the default is used. Use a response file for: o Complex and long commands you type frequently o Strings of commands that exceed the limit for command line length. ═══ Specifying LIB Parameters - Examples ═══ This panel shows you examples of each method for specifying parameters to LIB. In the examples, the following operations create a new library, NEWLIB.LIB, and its listing file, NEWLIB.LST, from the existing MYLIB.LIB library. MYLIB.LIB is unchanged, but NEWLIB.LIB has these changes: o The contents are case-insensitive. o The module TIM is deleted. o The object file SIMON.OBJ is appended as an object module with the name SIMON. o The existing module KEHM is deleted and is replaced by a new KEHM which is appended after SIMON. o The module LAM is copied into an object file named LAM.OBJ. Command Line Method At the operating system prompt, enter the following two lines. LIB /I MYLIB, SIMON-TIM-+KEHM & *LAM, NEWLIB.LST, NEWLIB; LIB Prompts Method To have LIB prompt you for input, enter LIB with no parameters. Library name: /I MYLIB Operations: +SIMON-TIM-+KEHM & Operations: *LAM List file: NEWLIB.LST Output library: NEWLIB Response File Method First, create a response file with the following contents. /I MYLIB +SIMON-TIM-+KEHM & *LAM NEWLIB.LST NEWLIB Then, assuming the name of the response file is response.fil, invoke LIB with: LIB @RESPONSE.FIL; Note that the lines in the response file match the entries you would have made with the prompting method. Even the ampersand character (&), the continuation character, is used in the same way. ═══ 10. Creating a New Library ═══ To create a new library file, give the name of the library file you want to create in the inlibrary field on the command line (or at the Library name: prompt when using LIB prompts). Note: A library file is automatically created if the library file name you specify is immediately followed by a command, comma, or semicolon. In this case, the prompt does not appear. If the name you specify for the new library file already exists, LIB assumes that you want to modify the existing file. When you give the name of a file that does not currently exist, LIB displays the following prompt: Library does not exist. Create library? (y or n) Type y to create the file; type n to terminate the LIB run. If you specified an extension other than .LIB, LIB will try to append the .LIB extension to the entire file name. If a library name is not entered, LIB will prompt you with Library name:. ═══ 11. Modifying a Library ═══ You can use LIB to alter the contents of any object code library. For example, if you work with high level language libraries, you may want to replace a standard routine with your own version of the routine. You may also want to add a new routine to the standard library so that your routine is available along with the standard routines. To modify an existing library file, give the name of the library file you want to modify in the inlibrary field of the command line (or at the Library name: prompt when using LIB prompts). In the command field, enter one or more commands to add, delete, or replace modules in the input library. Each command consists of a command character immediately followed by the name of the module or object file. Note that the Add command can be used to combine libraries as well as to add object files to a library. See: Add Command (+) Delete Command (-) Replace Command (-+) LIB creates a backup file of the library being modified if it already exists. This backup file has the same name as the original library with ".BAK" as the extension. ═══ 12. Copying Object Modules to Object Files ═══ To copy a module from a library file to an object file, give the name of the library file in the inlibrary field on the command line (or at the Library name: prompt when using LIB prompts). The command field on the command line allows you to move or copy modules. Command Action copy (*) LIB copies the module to an object file and retains the module in the library. move (-*) LIB copies the module to an object file and deletes the module from the library. ═══ 13. Listing the Current Contents of a Library ═══ Listings give you the exact names of modules and public symbols, allowing you to inspect the contents within a library. To generate a listing file, enter the following on the command line (or at the appropriate LIB prompt): o The name of the library file in the inlibrary field o The name of the listing file in the listfile field When generating a listing file, the amount of detail can be varied. The level of detail is specified with the /Listlevel:n option, with three different levels being available. Level 1 is the default. It is the fastest to generate and contains the least amount of information. All modules are listed in order of occurrence. For each module, the level 1 option: 1. Shows the relative position and size of each module. 2. Lists all the public symbols defined in the module. 3. Lists all external symbols which must be resolved at link time. Level 2 contains all the information of level 1. In addition, for each external symbol, level 2 shows which module in the library contains the required public symbols for resolving at link time. This can be overridden if a module is linked to another module that already contains the symbol. Level 3 contains all the information of level 2. In addition, Level 3 displays the technical characteristics of the library. This option also contains a dump of the extended dictionary. This is useful to determine which modules will be implicitly linked in whenever a particular module is linked in. Note: If you are using the IBM C/C++ Tools product, the listings will show both the mangled name for each C++ function and the demangled name. Sample Cross Reference Listing LIB /LISTLEVEL:2 NEWLIB, NEWLIB.LST; The command above directs LIB to place a listing of the contents of NEWLIB.LIB into the file NEWLIB.LST. No path specification is given for NEWLIB.LST. By default, the file created is put in the current directory. ═══ Listing Example ═══ The syntax used to generate a listing file with level 3 option is: LIB /L:3 NEWLIB, NEWLIB.LST; This command generates the following listing file called NEWLIB.LST: IBM (R) Library Manager Version 2.00 Copyright (C) IBM Corporation 1991, 1992. All rights reserved. Library name : D:\TEMP\NEWLIB.LIB Listing detail level : 3 ┌───────────────────────────────────────────────────┐ ┌─┤Number of the module within the parent library. The│ │ │first module number in the listing file is 00000. │ │ └───────────────────────────────────────────────────┘ │ ┌──────────────────────────────────────┐ │ │Name of the module within the library.│ │ └──┬───────────────────────────────────┘   00000:francis(OFFSET:0x00000010, SIZE:0x000004ca):   │ ┌───────────┴─────────────────────────┐ │ │Size (in bytes) of the object module.│ │ └─────────────────────────────────────┘ ┌────────┴───────────────────────────────────────────────────┐ │Relative offset (in bytes) of the module within the library.│ └────────────────────────────────────────────────────────────┘ ┌────────────────────────────────┐ - Public Definitions:─┤Symbols defined by the module. │ francis └────────────────────────────────┘ ┌──────────────────────────────┐ │Symbols defined in a different│ - External Definitions:────┤module within the library. │ DosAllocMem └──────────────────────────────┘ _ilog2 _critlib_except _DosSelToFlat _DosFlatToSel 00001:lam (OFFSET:0x000004e0, SIZE:0x000001d1): - Public Definitions: lam - External Definitions: francis <- 00000:francis────┐ _critlib_except │ _DosSelToFlat ┌───────────────────────────────────┴────────────┐ _DosFlatToSel │Number and name of the module within the library│ │that defines the corresponding public symbol. │ └────────────────────────────────────────────────┘ 00002:hazlett (OFFSET:0x000006c0, SIZE:0x0000021a): - Public Definitions: hazlett - External Definitions: DosFreeMem _critlib_except _DosSelToFlat _DosFlatToSel _pBucketArr 00003:simon (OFFSET:0x000008e0, SIZE:0x00000428): - Public Definitions: simon - External Definitions: _ilog2 hazlett <- 00002:hazlett francis <- 00000:francis _critlib_except _DosSelToFlat _DosFlatToSel _pBucketArr 00004:kehm (OFFSET:0x00000d10, SIZE:0x00000342): - Public Definitions: _kehm - External Definitions: DosFreeMem _critlib_except _DosSelToFlat _DosFlatToSel _pBucketArr The following information describes the characteristics of the library. Page size = 16 The Flags field determines case sensitivity. 0x1 indicates case sensitivity. 0x0 indicates no case sensitivity. Flags = 0x0 Contains extended dictionary Total number of modules = 5 Total bytes for modules = 4592 Total number of symbols in dictionary = 10 Maximum number of symbols in dictionary = 74 Total number of pages for the dictionary = 2 The following is the extended dictionary information. The number in parentheses indicates the number of dependencies. It is followed by the list of modules In this case, modules 0, 2, and 4 have no dependencies, module 1 is dependent on module 0, and module 3 is dependent on modules 0 and 2. ======== Dependencies by Module ======== Module 00000 : (00000) Module 00001 : (00001) 00000 Module 00002 : (00000) Module 00003 : (00002) 00000 00002 Module 00004 : (00000) ═══ 14. Commands ═══ LIB commands are used to manipulate modules in a library. A single LIB run uses multiple commands in any order. Each command consists of a one or two character command symbol immediately followed by the name of the module or file that is the subject of the command. For example, +EFREM.OBJ adds the EFREM.OBJ object file to a library as EFREM. Command Action [+] Adds an object file or library to a library - Deletes a module from a library -+ Replaces a module in a library * Copies a module from a library to an object file -* Moves a module (copies the module and then deletes it) Notes o If you want to enter more commands than can be conveniently entered on one line, type an ampersand (&) and press Enter at the end of the line. This extends the command field to the next line. o When processing commands, LIB processes all copy commands first. LIB then processes the deletions and processes the additions last. o LIB never makes changes to your input library while it runs; it copies the library and makes changes to that copy. However, if you don't specify an output library, LIB overwrites the input library with the modified copy at the end of normal processing. See Using the LIB Command Line for more information. ═══ 14.1. Add Command (+) ═══ Use the add command to add an object module or library to a library. The add command is issued using the plus (+) sign or leaving a blank space. Adding an Object Module to a Library Type the name of the object file to be added immediately after the plus sign. The ".OBJ" extension may be omitted. LIB uses the base name of the object file as the name of the object module in the library. For example, if the object file B:\CURSOR.OBJ is added to a library file, the name of the corresponding object module is CURSOR. Object modules are always added to the end of a library file. Combining Two Libraries Give the name of the library file to be added, including the ".LIB" extension, immediately after the plus sign (+). A copy of the contents of that library is added to the library file being modified. If both libraries contain a module with the same name, LIB ignores the second module with that name. LIB adds the modules of the library to the end of the library being changed. Note that the added library still exists as an independent library because LIB copies the modules without deleting them. Examples LIB MYLIB +EFREM; The command above adds the file EFREM.OBJ to the library MYLIB.LIB. LIB NEWLIB +KAREN.LIB; The command above adds the contents of the library KAREN.LIB to the library NEWLIB.LIB. The library KAREN.LIB is unchanged after this command is executed. ═══ 14.2. Delete Command (-) ═══ Use the delete command (-) to delete an object module from a library. After the minus sign, give the name of the module to be deleted. Module names do not have path names or extensions. Example LIB MYLIB -EFREM; The command above deletes the module EFREM from the library MYLIB.LIB. ═══ 14.3. Replace Command (-+) ═══ Use the replace command (-+) to replace a module in a library. Following the symbol, give the name of the module to be replaced. To replace a module, LIB performs the following steps: 1. Deletes the existing module 2. Searches the current directory for the ".OBJ" file with the same file name as the deleted module 3. Appends to the library a copy of the object file with the original module name Example LIB MYLIB -+EFREM; The command above replaces the module EFREM in the MYLIB.LIB library with the contents of EFREM.OBJ from the current directory. The file EFREM.OBJ in the current directory is not altered. ═══ 14.4. Copy Command (*) ═══ Use the copy command (*) to copy a module from the library into an object file of the same name. The module remains in the library. When LIB copies the module to an object file, it adds the ".OBJ" extension to the module name and places the file in the current directory. If a file with this name already exists, LIB overwrites the existing ".OBJ" file. Example LIB MYLIB *EFREM; The command above copies the module EFREM from the MYLIB.LIB library to a file called EFREM.OBJ in the current directory. The module EFREM in MYLIB.LIB is not altered. ═══ 14.5. Move Command (-*) ═══ Use the move command (-*) to copy an object module from the library file to an object file. The object module is then deleted from the library file. This operation is equivalent to copying the module to an object file, then deleting the module from the library. Example LIB MYLIB -*KEELING; The command above moves the module KEELING from the MYLIB.LIB library to a file called KEELING.OBJ in the current directory. Upon completion of this process, MYLIB.LIB no longer contains the module KEELING. ═══ 15. Options ═══ Usage Notes: o Option characters are not case sensitive; /H and /h are equivalent. o The characters in brackets can be omitted; /H and /HELP are equivalent. o Unless otherwise specified, most options and commands need only the first letter of their names to be used. The following is a summary of LIB options: Option Action /? or ? or /H[ELP] Display Help /I[GNORECASE] Turn Case Sensitivity Off /NOE[XTDICTIONARY] Disable Generation of Extended Dictionary /NOI[GNORECASE] Turn Case Sensitivity On /NOL[OGO] Suppress LIB Banner /Q[UIET] Suppress LIB Banner /P[AGESIZE] Set Library Page Size /L[ISTLEVEL] List Current Contents of Library ═══ 15.1. /I Option ═══ Turn Case Sensitivity Off (/I) Syntax: /I[GNORECASE] Purpose: Turns off case sensitivity for symbols By default, case sensitivity is off. Use this option when you are combining a library that was created with case sensitivity on (using the /NOI option) with others that are not case sensitive. The resulting library is not case sensitive. ═══ 15.2. /NOE Option ═══ Disable Generation of Extended Dictionary (/NOE) Syntax: /NOE[XTDICTIONARY] Purpose: Disables generation of extended dictionary The extended dictionary is an optional part of the library that increases linking speed. However, using an extended dictionary requires more memory. The space reserved for the extended dictionary is limited to 64K, no more can be allocated. If LIB reports an out-of-memory error, you may want to use this option. As an alternative, you can split large libraries into smaller libraries to use in linking. ═══ 15.3. /NOI Option ═══ Turn Case Sensitivity On (/NOI) Syntax: /NOI[GNORECASE] Purpose: Turns on case sensitivity By default, case sensitivity is off (/I option). Using this option allows symbols that differ only in case, such as Sine and SINE, to be included as separate symbols in the same library. Note that when you create a library with the /NOI option, LIB marks the library internally to indicate that /NOI is in effect. If you combine multiple libraries, and any one of them is marked /NOI, then the output library is marked /NOI. ═══ 15.4. /P Option ═══ Set Library Page Size (/P) Syntax: /P[AGESIZE]: n Purpose: Sets library page size This option specifies the library page size of a new library or changes that of an existing library. The new page size n must be an integer value representing a power of 2 between the values 16 and 32,768. A library's page size affects the alignment of modules stored in the library. Modules are always aligned to start at a position that is a multiple of the page size (in bytes) from the beginning of the file. The default page size for a new library is 16 bytes. For an existing library, the default is its current page size. Because of LIB's indexing technique, the larger the page size, the more modules a library can hold. Each module requires an average of n/2 bytes of storage space. Therefore, you should use a small page size unless you need to put a very large number of modules in a library. Another consequence of LIB's indexing technique is that the page size limits the size of the library file to n * 65,536. For example, the option /P:16 limits the size to 1 megabyte (16 * 65,536 bytes). ═══ 15.5. / ? or ? or /H Option ═══ Display Help Syntax: /H[ELP] or /? or ? Purpose: Displays help on LIB A brief summary of LIB syntax is displayed. ═══ 15.6. /NOL or /Q Option ═══ Suppress LIB Banner Syntax: /NOL[OGO] or /Q[UIET] Purpose: Suppresses the LIB copyright notice. This option suppresses the banner message when LIB is started. It can be used in batch files. ═══ Library ═══ A library is an organized collection of object code which contains functions and data that are already assembled or compiled. Once an object file is incorporated into a library, it becomes an object module. Libraries are used to: o Support high level languages. Most compilers include libraries to perform standard operations, such as input/output and floating-point mathematics. When your program refers to a library routine, the compiler and linker combine the library routine with your program. o Perform complex and specialized activities, such as database management or advanced graphics. You can use your own libraries or specialized libraries supplied by a vendor. o Support your own work. If you have created routines that you use with a variety of programs, you may want to consolidate these routines into a library. You can then link to one library. ═══ Output Library ═══ If you specify a file in outlibrary, LIB creates a new output file with the modifications and leaves your input file intact. Otherwise, LIB replaces your input file with the modified file. In the latter case, a backup of your original input file is stored in the current directory with the file name extension ".BAK". ═══ Object File ═══ An object file is produced by a compiler or assembler from one or more source files. An object file has an extension of ".OBJ". (as in "MYPROJ.OBJ"). In LIB, HPFS file names are also supported as long as the file name ends with ".OBJ" (as in "MYOBJECTFILE.NEW.OBJ"). ═══ Object Module ═══ The object module is a self-contained unit within a library of precompiled or preassembled routines. When individual object files are combined into a single library file, they become object modules. In LIB, an object module is referred to by its name, without a file extension. For example, assume that the object file KEELING.OBJ is inserted into a library. It then becomes an object module and is simply referred to as KEELING.