noft Manual (G06.26+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction
- 2 noft Utility
- 3 noft Options
- Break Key
- ! (Exclamation Point)
- CD
- COMMENT
- DUMPADDRESS or DA
- DUMPOFFSET or DO
- DUMPPROC or DP
- DYNSTR2
- ENV
- EXIT or E
- FC
- FILE or F
- HELP or ?
- HISTORY or H
- LAYOUT
- LIBLIST
- LISTATTRIBUTE or LA
- LISTCOMPILERS or LC
- LISTOPTIMIZE or LO
- LISTPROC or LP
- LISTSOURCE or LS
- LISTSRLEXPORTS or LLE
- LISTSRLFIXUPS or LLF
- LISTSRLINFO or LLI
- LISTUNREFERENCED or LUR
- LISTUNRESOLVED or LU
- LOG
- OBEY
- OUT
- QUIT or Q
- RESET
- SET
- SHOW
- SYSTEM or VOLUME
- XREFPROC or XP
- 4 noft Diagnostic Messages
- 5 ar Utility
- 6 ar Diagnostic Messages
- A Sample nld and noft Session
- B Converting From Binder to noft
- C Native Object File Structure
- Glossary
- Index

Sample nld and noft Session
noft Manual—528273-001
A-6
User Library UTILC
User Library UTILC
The user library UTILC contains the seed_random_number function. This function
gets the current time, converts it to a time structure, and multiplies the minutes by the
seconds to seed the random number generator.
Compilation Commands
Compile the source modules MAINC, MODULE1C, and MODULE2C with these
commands:
NMC /IN MAINC, OUT MAINL / MAINO; OPTIMIZE 0, SYMBOLS
NMC /IN MODULE1C, OUT MODULE1L/ MODULE1O;OPTIMIZE 0, SYMBOLS
NMC /IN MODULE2C, OUT MODULE2L/ MODULE2O;OPTIMIZE 0, SYMBOLS
Compile the user library UTILC with this command:
NMC /IN UTILC, OUT UTILL / UTILO; OPTIMIZE 0, SYMBOLS, SRL
The only difference for compiling the user library is the inclusion of the pragma SRL.
Example A-8. User Library UTILC With Edit Line Numbers
1 #pragma nolist
1.1 #include <stdlibh>
2 #include <timeh>
3 #pragma list
3.1 #include "util.h"
4
5 void seed_random_number(void)
5.001 /*
5.01 * Increase randomness of rand() by setting
5.02 * srand(seed) with values from time.
5.1 */
6 {
7 time_t now;
9 struct tm *time_ptr;
10
11 now = time(NULL);
12 time_ptr = localtime(&now);
13 srand(time_ptr->tm_sec * time_ptr->tm_min);
18 } /* seed_random_number */