📄 wlbmain.gml
字号:
.*
.*
.section The &libname Command Line
.*
.np
The following describes the &libname command line.
.ix '&libcmdup ' 'command line format'
.ix 'command line format ' '&libcmdup'
.mbigbox
.if '&target' eq 'QNX' .do begin
&libcmdup [options_1] lib_file [cmd_list]
.do end
.el .do begin
&libcmdup [options_1] lib_file [options_2] [cmd_list]
.do end
.embigbox
.pc
The square brackets "[]" denote items which are optional.
.begnote
.note lib_file
is the file specification for the library file to be processed.
If no file extension is specified, a file extension of "lib" is assumed.
.note options_1
is a list of valid options.
.if '&cmpcmd' eq 'wcexp' .do begin
Options may be specified in any order and are preceded by a "/" or
"~-" character.
.do end
.el .do begin
Options may be specified in any order.
.if '&target' eq 'QNX' .do begin
Options are preceded by a "~-" character.
.do end
.el .do begin
If you are using a DOS, OS/2 or Windows-hosted version of the
&libname, options are preceded by a "/" or "~-" character.
If you are using a UNIX-hosted version of the &libname,
options are preceded by a "~-" character.
.do end
.do end
.if '&target' ne 'QNX' .do begin
.note options_2
is a list of valid options.
These options
.if '&cmpcmd' ne 'wcexp' .do begin
are only permitted if you are running a DOS, OS/2 or Windows-hosted
version of the &libname and
.do end
must be preceded by a "/" character.
The "~-" character cannot be used as an option delimiter for options
following the library file name since it will be interpreted as a
delete command.
.do end
.note cmd_list
is a list of commands to the &libname specifying what operations are
to be performed.
Each command in
.sy cmd_list
is separated by a space.
.endnote
.np
The following is a summary of valid options.
Items enclosed in square brackets "[]" are optional.
Items separated by an or-bar "|" and enclosed in parentheses "()"
indicate that one of the items must be specified.
Items enclosed in angle brackets "<>" are to be replaced with a
user-supplied name or value (the "<>" are not included in what you
specify).
.begnote $break $compact
.note ?
display the usage message
.note b
suppress creation of backup file
.note c
perform case sensitive comparison
.note d=<output_directory>
directory in which extracted object modules will be placed
.note fa
output AR format library
.note fm
output MLIB format library
.note fo
output OMF format library
.note h
display the usage message
.note ia
generate AXP import records
.note ii
generate X86 import records
.note ip
generate PPC import records
.note ie
generate ELF import records
.note ic
generate COFF import records
.note io
generate OMF import records
.note i(r|n)(n|o)
imports for the resident/non-resident names table are to be imported by
name/ordinal.
.note l[=<list_file>]
create a listing file
.note m
display C++ mangled names
.note n
always create a new library
.note o=<output_file>
set output file name for library
.note p=<record_size>
set library page size
(supported for "OMF" library format only)
.note q
suppress identification banner
.note s
strip line number records from object files
(supported for "OMF" library format only)
.note t
remove path information from module name specified in THEADR records
(supported for "OMF" library format only)
.note v
do not suppress identification banner
.note x
extract all object modules from library
.note zld
strip file dependency info from object files
(supported for "OMF" library format only)
.endnote
.np
The following sections describe the operations that can be performed on
a library file.
Note that before making a change to a library file, the &libname
makes a backup copy of the original library file unless the "o" option
is used to specify an output library file whose name is
different than the original library file, or the "b" option is used to
suppress the creation of the backup file.
The backup copy has the same file name as the original library file
but has a file extension of "bak".
Hence,
.bd lib_file
should not have a file extension of "bak".
.ix '&libcmdup ' 'operations'
.*
.section &libname Module Commands
.*
.np
The following is a summary of basic &libname module manipulation commands:
.begnote $break $compact
.note +
add module to a library
.note -
remove module from a library
.note * or :
extract module from a library (
.bd :
is used with a UNIX-hosted version of the &libname, otherwise
.bd *
is used)
.note ++
add import library entry
.endnote
.*
.section Adding Modules to a Library File
.*
.np
.ix 'library file ' 'adding to a'
An object file can be added to a library file by specifying a
.bd +obj_file
command where
.bd obj_file
is the file specification for an object file.
.if '&cmpcmd' eq 'wcexp' .do begin
A file extension of "obj" is assumed if none is specified.
.do end
.el .do begin
.if '&target' eq 'QNX' .do begin
A file extension of "o" is assumed if none is specified.
.do end
.el .do begin
If you are using a DOS, OS/2 or Windows-hosted version of the
&libname, a file extension of "obj" is assumed if none is specified.
If you are using a UNIX-hosted version of the &libname,
a file extension of "o" is assumed if none is specified.
.do end
.do end
If the library file does not exist, a warning message will be issued
and the library file will be created.
.exam begin
&libcmd mylib +myobj
.exam end
.pc
In the above example, the object file "myobj" is added to the
library file "mylib.lib".
.np
When a module is added to a library, the &libname will issue a warning
if a symbol redefinition occurs.
This will occur
if a symbol in the module being added is already defined
in another module that already exists in the library file.
Note that the module will be added to the library in any case.
.np
It is also possible to combine two library files together.
The following example adds all modules in the library "newlib.lib"
to the library "mylib.lib".
.exam begin
&libcmd mylib +newlib.lib
.exam end
.pc
Note that you must specify the "lib" file extension.
Otherwise, the &libname will assume you are adding an object file.
.*
.section Deleting Modules from a Library File
.*
.np
.ix 'library file ' 'deleting from a'
A module can be deleted from a library file by specifying a
.bd -mod_name
command where
.bd mod_name
is the file name of the object file when it was added to the library
with the directory and file extension removed.
.exam begin
&libcmd mylib -myobj
.exam end
.pc
In the above example, the &libname is instructed to delete the module
"myobj" from the library file "mylib.lib".
.np
It is also possible to specify a library file instead of a module name.
.exam begin
&libcmd mylib -oldlib.lib
.exam end
.pc
In the above example, all modules in the library file "oldlib.lib" are
removed from the library file "mylib.lib".
Note that you must specify the "lib" file extension.
Otherwise, the &libname will assume you are removing an object module.
.*
.section Replacing Modules in a Library File
.*
.np
.ix 'library file ' 'replacing a module in a'
A module can be replaced by specifying a
.bd -+mod_name
or
.bd +-mod_name
command.
The module
.bd mod_name
is deleted from the library.
The object file "mod_name" is then added to the library.
.exam begin
&libcmd mylib -+myobj
.exam end
.pc
In the above example, the module "myobj" is replaced by the object
file "myobj".
.np
It is also possible to merge two library files.
.exam begin
&libcmd mylib -+updlib.lib
.exam end
.pc
In the above example, all modules in the library file "updlib.lib" replace
the corresponding modules in the library file "mylib.lib".
Any module in the library "updlib.lib" not in library "mylib.lib" is
added to the library "mylib.lib".
Note that you must specify the "lib" file extension.
Otherwise, the &libname will assume you are replacing an object module.
.*
.section Extracting a Module from a Library File
.*
.np
.ix 'library file ' 'extracting from a'
A module can be extracted from a library file by specifying a
.if '&target' eq 'QNX' .do begin
.bd :mod_name
[=file_name] command.
.do end
.el .do begin
.bd *mod_name
[=file_name] command for a DOS, OS/2 or Windows-hosted version of the &libname
or a
.bd :mod_name
[=file_name] command for a UNIX-hosted version of the &libname..
.do end
The module
.bd mod_name
is not deleted but is copied to a disk file.
If
.bd mod_name
is preceded by a path specification, the output file will be placed in the
directory identified by the path specification.
If
.bd mod_name
is followed by a file extension, the output file will contain the
specified file extension.
.*
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd mylib :myobj
.do end
.el .do begin
&libcmd mylib *myobj DOS, OS/2 or Windows-hosted
or
&libcmd mylib :myobj UNIX-hosted
.do end
.exam end
.pc
In the above example, the module "myobj" is copied to a disk file.
The disk file will be an object file with file name "myobj".
.if '&target' eq 'QNX' .do begin
A file extension of "o" will be used.
.do end
.el .do begin
If you are running a DOS, OS/2 or Windows-hosted version of the
&libname, a file extension of "obj" will be used.
If you are running a UNIX-hosted version of the &libname, a file
extension of "o" will be used.
.do end
.*
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd mylib :myobj.out
.do end
.el .do begin
&libcmd mylib *myobj.out DOS, OS/2 or Windows-hosted
or
&libcmd mylib :myobj.out UNIX-hosted
.do end
.exam end
.pc
In the above example, the module "myobj" will be extracted from the
library file "mylib.lib" and placed in the file "myobj.out"
.np
The following form of the extract command can be used if the module name
is not the same as the output file name.
.np
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd mylib :myobj=newmyobj.out
.do end
.el .do begin
&libcmd mylib *myobj=newmyobj.out DOS, OS/2 or Windows-hosted
or
&libcmd mylib :myobj=newmyobj.out UNIX-hosted
.do end
.exam end
.np
You can extract a module from a file and have that module deleted from
the library file by specifying a
.if '&target' eq 'QNX' .do begin
.bd :-mod_name
command.
.do end
.el .do begin
.bd *-mod_name
command for a DOS, OS/2 or Windows-hosted version of the &libname
or a
.bd :-mod_name
command for a UNIX-hosted version of the &libname..
.do end
The following example performs the same operations as in the previous
example but, in addition, the module is deleted from the library file.
.*
.exam begin
.if '&target' eq 'QNX' .do begin
&libcmd mylib :-myobj.out
.do end
.el .do begin
&libcmd mylib *-myobj.out DOS, OS/2 or Windows-hosted
or
&libcmd mylib :-myobj.out UNIX-hosted
.do end
.exam end
.pc
Note that the same result is achieved if the delete operator precedes the
extract operator.
.if '&cmpcmd' ne 'wcexp' .do begin
.*
.section Creating Import Libraries
.*
.np
.ix 'Dynamic Link Library' 'imports'
.ix 'import library'
The &libname can also be used to create import libraries from Dynamic
Link Libraries.
Import libraries are used when linking
.if '&prodname' = 'WATFOR-77' .do begin
OS/2 applications.
.do end
.el .do begin
OS/2, Win16 or Win32 applications.
.do end
.exam begin
&libcmd implib +dynamic.dll
.exam end
.np
In the above example, the following actions are performed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -