|
8 | 8 |
|
9 | 9 |
|
10 | 10 | This API is designed with perspective that the calling/client code is in charge |
11 | | - of managing memory. The only exception is hec_dss_open(const char* filename, |
12 | | - dss_file** dss). hec_dss_open allocates one internal structure that must be |
13 | | - freed by calling hec_dss_close; |
| 11 | + of managing memory. The only exceptions are hec_dss_open(const char* filename, |
| 12 | + dss_file** dss) and hec_dss_open_ex(const char* filename, dss_file** dss, |
| 13 | + int readonly). Each allocates one internal structure that must be freed by |
| 14 | + calling hec_dss_close; |
14 | 15 |
|
15 | 16 | For reading data: The client passes in pre-allocated arrays, with the size, |
16 | 17 | then the API copies data into those arrays |
@@ -73,12 +74,26 @@ HECDSS_API int hec_dss_CONSTANT_MAX_PATH_SIZE(); |
73 | 74 |
|
74 | 75 | /// <summary> |
75 | 76 | /// use hec_dss_open to connect to a DSS file. |
| 77 | +/// Equivalent to hec_dss_open_ex(filename, dss, 0). |
76 | 78 | /// </summary> |
77 | 79 | /// <param name="filename">input: filename to open or create</param> |
78 | 80 | /// <param name="dss">output: pointer to dss_file</param> |
79 | 81 | /// <returns>zero if successful</returns> |
80 | 82 | HECDSS_API int hec_dss_open(const char *filename, dss_file **dss); |
81 | 83 |
|
| 84 | +/// <summary> |
| 85 | +/// use hec_dss_open_ex to connect to a DSS file, access. |
| 86 | +/// |
| 87 | +/// </summary> |
| 88 | +/// <param name="filename">input: filename to open; also created if readonly is |
| 89 | +/// zero and the file does not exist</param> |
| 90 | +/// <param name="dss">output: pointer to dss_file</param> |
| 91 | +/// <param name="access">input: zero to open with read/write access |
| 92 | +/// (identical to hec_dss_open), non-zero to open read-only</param> |
| 93 | +/// <returns>zero if successful</returns> |
| 94 | +HECDSS_API int hec_dss_open_ex(const char *filename, dss_file **dss, |
| 95 | + int access); |
| 96 | + |
82 | 97 | /// <summary> |
83 | 98 | /// use hec_dss_close to close the connection to a DSS file. |
84 | 99 | /// This must be called when a program is done using a DSS file. |
|
0 commit comments