109
109
decc$exit(vms_code);
112
#if defined(__DECC) && !defined(__VAX) && \
113
defined(__CRTL_VER) && (__CRTL_VER >= 70301000)
120
* On non-VAX systems, use LIB$INITIALIZE to set a collection of C
121
* RTL features without using the DECC$* logical name method, nor
122
* requiring the user to define the corresponding logical names.
127
/* Structure to hold a DECC$* feature name and its desired value. */
133
/* Array of DECC$* feature names and their desired values. */
134
static decc_feat_t decc_feat_array[] = {
135
/* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
136
{ "DECC$ARGV_PARSE_STYLE", 1 },
137
/* Preserve case for file names on ODS5 disks. */
138
{ "DECC$EFS_CASE_PRESERVE", 1 },
139
/* Enable multiple dots (and most characters) in ODS5 file names,
140
while preserving VMS-ness of ";version". */
141
{ "DECC$EFS_CHARSET", 1 },
142
/* List terminator. */
146
/* Flag to sense if decc_init() was called. */
147
static int decc_init_done = -1;
149
/* LIB$INITIALIZE initialization function. */
150
static void decc_init(void)
159
/* Set the global flag to indicate that LIB$INITIALIZE worked. */
162
/* Loop through all items in the decc_feat_array[]. */
163
for(i = 0; decc_feat_array[i].name != NULL; i++) {
165
/* Get the feature index. */
166
feat_index = decc$feature_get_index( decc_feat_array[i].name);
168
if(feat_index >= 0) {
169
/* Valid item. Collect its properties. */
170
feat_value = decc$feature_get_value( feat_index, 1);
171
feat_value_min = decc$feature_get_value( feat_index, 2);
172
feat_value_max = decc$feature_get_value( feat_index, 3);
174
if((decc_feat_array[i].value >= feat_value_min) &&
175
(decc_feat_array[i].value <= feat_value_max)) {
176
/* Valid value. Set it if necessary. */
177
if(feat_value != decc_feat_array[i].value) {
178
sts = decc$feature_set_value( feat_index, 1,
179
decc_feat_array[i].value);
183
/* Invalid DECC feature value. */
184
printf(" INVALID DECC FEATURE VALUE, %d: %d <= %s <= %d.\n",
186
feat_value_min, decc_feat_array[i].name, feat_value_max);
190
/* Invalid DECC feature name. */
191
printf(" UNKNOWN DECC FEATURE: %s.\n", decc_feat_array[i].name);
197
/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */
201
/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and
202
other attributes. Note that "nopic" is significant only on VAX. */
203
#pragma extern_model save
204
#pragma extern_model strict_refdef "LIB$INITIALIZ" 2, nopic, nowrt
205
const int spare[8] = {0};
206
#pragma extern_model strict_refdef "LIB$INITIALIZE" 2, nopic, nowrt
207
void (*const x_decc_init)() = decc_init;
208
#pragma extern_model restore
210
/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */
211
#pragma extern_model save
212
int LIB$INITIALIZE(void);
213
#pragma extern_model strict_refdef
214
int dmy_lib$initialize = (int) LIB$INITIALIZE;
215
#pragma extern_model restore
219
#endif /* __DECC && !__VAX && __CRTL_VER && __CRTL_VER >= 70301000 */
112
221
#endif /* __VMS */