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