cmsvlib.pro
4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
function cmsvlib, version=version, query=query
;+
; NAME:
; CMSVLIB
;
; AUTHOR:
; Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
; craigm@lheamail.gsfc.nasa.gov
;
; PURPOSE:
; Initialize the CMSVLIB save library
;
; CALLING SEQUENCE:
; VALUE = CMSVLIB(/QUERY, VERSION=version)
;
; DESCRIPTION:
;
; This function initializes the CMSVLIB library to read, write and
; interrogate IDL save files. Use the QUERY keyword to determine
; whether the full CMSVLIB library is present.
;
; The VERSION keyword allows the user to query the version number of
; the CMSVLIB library. The library version number will be returned
; as a string of the form "X.Y" where X is the major version number
; and Y is the minor version number. Callers can use this version
; number to decide whether this particular version of the library is
; compatible with their usage.
;
;
; The procedures in the library are:
;
; High-level
; CMSAVE - save variables to a save file
; CMRESTORE - restore variables from a save file
; CMSAVEDIR - list contents of a save file
; CMSVLIB (function) - this file
;
; Mid-level
; CMSV_OPEN - open a save file for reading or writing
; CMSVREAD - read non-pointer data from file
; CMSVWRITE - write non-pointer data to file
;
; Low-level
; CMSV_RREC - read record from save file
; CMSV_RVTYPE - read variable type information from file
; CMSV_RDATA - read variable data from file
; CMSV_WREC - write record to save file
; CMSV_WVTYPE - write variable type information to file
; CMSV_WDATA - write variable data to file
;
; Utility
; CMSV_RRAW (function) - read raw integer or string data from file
; CMSV_WRAW - write raw integer or string data to file
; CMSV_PTRSUM - create a heap data inventory
; CMSV_TEST - test the library
; TAGSIZE (function) - determine the types of all tags in a structure
; HELPFORM (function) - create HELP-like string describing a variable
;
; This procedure is part of the CMSVLIB SAVE library for IDL by
; Craig Markwardt. You must have the full CMSVLIB core package
; installed in order for this procedure to function properly.
;
;
; ==================================================================
; Research Systems, Inc. has issued a separate license intended
; to resolve any potential conflict between this software and the
; IDL End User License Agreement. The text of that license
; can be found in the file LICENSE.RSI, included with this
; software library.
; ==================================================================
;
; INPUTS:
;
; None
;
; KEYWORDS:
;
; QUERY - if set, determine whether the CMSVLIB library is
; installed. Function returns 1 upon success, 0 upon
; failure.
;
; VERSION - upon return, the VERSION keyword will be set to a string
; describing the version number of the CMSVLIB library.
;
; EXAMPLE:
;
;
; SEE ALSO:
;
; CMRESTORE, SAVE, RESTORE, CMSVLIB
;
; MODIFICATION HISTORY:
; Written, 2000
; Documented, 24 Jan 2001
; Added notification about RSI License, 13 May 2002, CM
; Documented the VERSION keyword, 22 Nov 2009, CM
;
; LIBRARY MODIFICATIONS
; 1.0 - initial release
; 1.1 - 2003-06-28 - CMSV_RREC - added NOTICE record type
; 1.2 - 2006-03-07 - CMSV_RVTYPE - avoid reserved word INHERITS
; 1.3 - 2006-03-27 - CMSV_WDATA - add support to write bytes & empty
; strings
; 1.4 - 2009-11-16 - CMSV_RREC - NEXTREC field is ULONG
; 1.5 - 2009-11-22 - CMSV_RDATA - clarify & speed some code
; 1.6 - 2010-01-11 - CMSV_RREC - read 64-bit files
; 1.7 - 2012-04-05 - CMSV_WRAW - writing strings >128 fixed
; 1.8 - 2013-04-18 - CMSV_WDATA - bug fix multi-dimensional byte array
version = '1.8' ;; NOTE: modify this when incrementing version number
;
; $Id: cmsvlib.pro,v 1.8 2013/04/18 19:14:09 cmarkwar Exp $
;
;-
; Copyright (C) 2000-2001, 2009, 2010, 2012, 2013, Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
; are included unchanged.
;-
forward_function cmsv_rraw
catch, catcherr
if catcherr EQ 0 then cmsv_open, /query
catch, /cancel
if catcherr NE 0 then $
message, 'ERROR: The complete CMSVLIB library must be in your IDL path.'
return, 1
end