Chapter Contents |
Previous |
Next |
addsrch |
Portability: | SAS/C extension |
SYNOPSIS | |
DESCRIPTION | |
CMS Argument Values | |
RETURN VALUE | |
CAUTION | |
USAGE NOTES | |
EXAMPLE |
SYNOPSIS |
#include <dynam.h> SEARCH_P addsrch(int type, const char *loc, const char *prefix);
DESCRIPTION |
addsrch
adds a "location" to the list of "locations" from which modules
can be loaded. This list controls the search order for load modules loaded
via a call to
loadm
. The
search order can be described additionally by the third argument,
prefix
.
The first argument
type
must be a module type defined in
<dynam.h>
. The module type defines what type of module is
loaded
and varies from operating system to operating system. The character string
specified by the second argument
loc
names the location. The format of this string depends on the module
type. The third argument
prefix
is a character string of no more than eight characters.
addsrch
is of interest primarily to CMS users and to OS/390 users writing programs
portable to CMS. The remainder of this discussion, therefore, focuses on
the use of
addsrch
under
CMS.
CMS Argument Values |
Under CMS, the defined module types for the first argument are the following:
loadm
is called.
loadm
is called.
The module type also controls the format of the second
argument
loc
, which names
the location to be searched by
loadm
. If the module type is
""
.
All location strings may have leading and trailing blanks.
The characters are uppercased.
addsrch
does not verify the existence of the location.
The third argument is a character string of no more
than eight characters. It may be
""
. If it is not null, then it specifies that the location indicated
is searched only if the load module name (as specified by the first argument
to
loadm
) begins with the
same character or characters specified in the third argument.
At C program initialization, a default location, defined by the following call, is in effect:
sp = addsrch(CMS_LDLB, "DYNAMC *","");
RETURN VALUE |
addsrch
returns a value that can be passed to
delsrch
to delete the input source. Under CMS, this specifically means
a value of the defined type
SEARCH_P
, which can be passed to
delsrch
to remove the location from the search order. If an error
occurs, a value of
0
is returned.
CAUTION |
The above arguments to
addsrch
are defined only under CMS. The use
of
addsrch
under OS/390 with
a CMS module type has no effect.
USAGE NOTES |
addsrch
does not verify that a location exists (DYNAMC LOADLIB, for
example) or that load modules may be loaded from that location. The
loadm
function searches in the
location only if the load module cannot be loaded from a location higher in
the search order.
addsrch
fails only if its parameters are ill-formed.
EXAMPLE |
#include <dynam.h> SEARCH_P mylib; . . . /* Search for modules in a CMS LOADLIB. */ mylib = addsrch(CMS_LDLB, "PRIVATE *", "");
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.