home *** CD-ROM | disk | FTP | other *** search
-
- NonVolatile.library Test Programs
- Release 1.3
- 20 Apr 1993
- J.W. Lockhart
-
- Program Version
- ============= =======
- StoreNV 1.7
- DeleteNV 1.3
- GetNVList 1.21
- GetCopyNV 1.3
- GetNVInfo 1.4
- SetNVProtection 1.6
- StuffNV 1.3
- WipeNV 1.2
-
-
- Usages
- ===========================================================================
- WipeNV
-
- Purpose
- Delete all items in NV-storage. No error checking
- or args; be certain before you use it!
- Inputs
- None
- Notes
- Reports each item just before it tries to nuke it.
- Will un-protect any protected items.
- Example
- WipeNV
- *poof!*
-
-
- ===========================================================================
- StuffNV NAME/K, ITEMS/K/N, BYTES=BYTESPERITEM/K/N, NOPROTECT/S, OVERRUN/S
-
- Purpose
- Fill up (or overflow) NV-storage
-
- Inputs
- NAME - Application name to use; default is AppName(1|2).
- ITEMS - How many items to use. Default: as many as possible.
- BYTES - How many bytes per item. Default: 10.
- NOPROTECT - Don't protect each item after creating it
- OVERRRUN - Intentionally try to create one more item than should fit.
-
- Notes
- - Always tries to use two application names.
- - Defaults should be sufficient for most purposes.
- - Doesn't currently take into account the amount of space
- needed to store the appname.
- - Items are full of binary gibberish (buffer is filled with
- item number...not ascii value of item number, either).
-
- Example
- StuffNV
-
- ===========================================================================
-
- StoreNV NAME=APPNAME/K, ITEM=ITEMNAME/K, DATA/K, FILE=DATAFILE/K,
- BUFSIZE/K/N, BUFFILL/N, NULL=NULLTEST/S, ZERO=ZEROTEST/S, KILLREQ/S,
- BETRUE/S, NOLIE/S
-
- Purpose
- Save data into nonvolatile area.
-
- Inputs
- NAME - name of application which is storing the info. Default: NVTest.
- ITEM - name of item being stored. Default: Test01.
- ** only one of the following three may be selected: **
- DATA - a string which will be used as the data to be stored
- FILE - an existing file which will be used as the data to be stored
- BUFSIZE - the size of a buffer which will be allocated and used for
- data to be stored.
- BUFFILL - a number to fill the buffer with. Only works if BUFSIZE
- specified.
- NULL - pass NULL for data to be stored
- ZERO - pass 0 for size of data to be stored. All other sizes are
- calculated automagically.
- KILLREQ - turns off requesters
- BETRUE - Do not round memory allocations up to the nearest number
- evenly divisible by 10; use actual needed size instead.
- (I.e., use "true allocations".)
- NOLIE - Feed StoreNV() the actual bytecount, not 10's of bytes as
- required by the autodoc.
-
- Notes
- You must specify one of the following:
- NULL, DATA, FILE, BUFSIZE
- You may only specify one of the following three:
- DATA, FILE, BUFSIZE
-
- One of the quirks of this function is that it asks you to provide a size
- to the nearest 10 bytes, rounded up, for your data. StoreNV will
- (by default) provide a size and allocation larger than the actual data,
- if necessary. [A quirk? Well, 10 is a strange number. Also, most
- system functions (eg, AllocMem()) will do roundoffs for you, so it's
- not a consideration.]
-
- StoreNV expects its buffersize in real numbers. That is, if you
- want a 1000-byte buffer, say "BufSize=1000".
-
- Examples
- storenv data "This is a test"
- storenv file s:startup-sequence
- storenv name "Foo" item "Bar" bufsize 107 buffill 65 killreq
-
- =============================================================================
- DeleteNV NAME=APPNAME/K, ITEM=ITEMNAME/K, KILLREQ/S
-
- Purpose
- Delete data from nonvolatile area.
-
- Inputs
- NAME - name of application which owns the info. Default: NVTest.
- ITEM - name of item being deleted. Default: Test01.
- KILLREQ - turns off requesters
-
- =============================================================================
- GetNVList NAME=APPNAME/K,NULL=NULLTEST/S,NOBREAK/S, KILLREQ/S
-
- Purpose
- Get list of stored nonvolatile items owned by an application,
- with info on each entry.
-
- Inputs
- NAME - application name to search for.
- NULL - pass NULL for application name
- NOBREAK - stop only when NVEntry->nve_Node.mln_Succ is NULL.
- KILLREQ - turns off requesters
-
- History
- Many revisions to make a pretty and succinct output format.
-
- =============================================================================
- GetCopyNV LENGTH/A/N, NAME=APPNAME/K, ITEM=ITEMNAME/K, NN=NULLNAME/S,
- NI=NULLITEM/S, HEX=HEXDUMP/S, KILLREQ/S
-
- Purpose
- Get a copy of data stored in nonvolatile area. Use GetNVList to
- determine the length of this data.
-
- Inputs
-
- LENGTH - length of data to obtain
- NAME - name of application which owns the data
- ITEM - name of item to fetch
- NULLNAME - use NULL application name
- NULLITEM - use NULL data item
- HEX - do hex dump rather than ascii dump on any returned data
- KILLREQ - turns off requesters
-
- Notes
- Length means the real length: if you want 1000 bytes, ask for
- 1000 bytes. Any size values returned from GetNVList must be
- multiplied by 10. (Of course, if GetNVList says there are 5
- storage units, and there are only 47 meaningful bytes, you'll get
- 3 garbage bytes if you ask for 50 bytes...)
-
- =============================================================================
- GetNVInfo KILLREQ/S
-
- Show information about nonvolatile area.
-
- KILLREQ - turns off requesters
-
- =============================================================================
- SetNVProtection NAME=APPNAME/K, ITEM=ITEMNAME/K, FLAGS=HEXFLAGS/K, DELETE/S,
- NN=NULLNAME/S, NI=NULLITEM/S, KILLREQ/S
-
- Purpose
- Set protection on previously saved nonvolatile data
-
- Inputs
- NAME - name of application which owns the data
- ITEM - name of data item to be affected.
- FLAGS - raw hex flags to set
- DELETE - the only legitimate flag to set (NVEF_DELETE)
- NULLNAME - use NULL for application name
- NULLITEM - use NULL for name of data item
- KILLREQ - turns off requesters
-
- Notes
- Flags=0x01 means to write-protect the data
- Flags=0x00 means to write-enable the data.
- Flags=anything_else should make the function fail, but it should
- no longer crash. (Nonvolatile.library was intentionally
- doing a divide-by-zero in this case.)
-