gtpc2m43 | C/C++ Language Support User's Guide |
This function is used to return a pointer to a global field or a record's global directory entry named in c$globz.h. Use of a term not defined in c$globz.h will have unpredictable results. This function provides read-only reference to the specified global. To modify global fields, use the glob_modify, glob_update, or global function.
glob-Generate Path Name |
---|
The standard C library function glob is supported but not documented in this book; however, it is documented in OS/390 C/C++ Run-Time Library Reference. |
Format
#include <tpfglbl.h> #include <c$globz.h> void *glob(unsigned int tagname);
Normal Return
A global address. If the tagname parameter describes a global field, the address of the field is returned. If the tagname parameter describes a global record, the address of the global directory for that record is returned. A global directory address can point to either the main storage address or the file address of the record, depending on how globals are defined in your system. If the tagname describes the main storage address directory for a global record, an additional level of indirection is required to address the global record itself.
Error Return
Not applicable.
Programming Considerations
None.
Examples
In the following example, the glob function returns the address of a 4 byte global field (which will be treated as a long int).
#include <tpfglbl.h> #include <c$globz.h> long int *longglob_ptr = glob(_lfld);
In the following example, the glob function returns the address of the global directory core address field for a global record. The global record itself is a struct msgexp.
#include <tpfglbl.h> #include <c$globz.h> struct msgexp **q05met_directory_ptr = glob(_q05met); struct msgexp *q05met_ptr = *q05met_directory_ptr;
Related Information