]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
VMS adjustments by Steven M. Schweda
authorYang Tse <yangsita@gmail.com>
Thu, 31 Dec 2009 13:35:24 +0000 (13:35 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 31 Dec 2009 13:35:24 +0000 (13:35 +0000)
packages/vms/build_vms.com
src/os-specific.c

index 547db95aee4086656fbf9a278e4b24840d78212e..c175ceb844906543bb97c1549e48b36108f3f780 100755 (executable)
@@ -449,7 +449,7 @@ $ endif
 $!
 $ link 'link_qual' /executable = 'exedir'CURL.EXE -
    'objdir'curlsrc.olb /library /include = (main, curlmsg), -
-   'objdir'curllib.olb /library /include = (vms_misc) -
+   'objdir'curllib.olb /library -
    'ssl_opt' -
    'ldap_opt'
 $!
index 1fddbaeb7a98e9a7c373d0e11d9c6c138c9a0d64..664e74070eade3d50a49e93aabe6065ca4ebaeaa 100644 (file)
@@ -109,5 +109,114 @@ void vms_special_exit(int code, int vms_show)
   decc$exit(vms_code);
 }
 
+#if defined(__DECC) && !defined(__VAX) && \
+    defined(__CRTL_VER) && (__CRTL_VER >= 70301000)
+
+/*
+ * 2004-09-19 SMS.
+ *
+ * decc_init()
+ *
+ * On non-VAX systems, use LIB$INITIALIZE to set a collection of C
+ * RTL features without using the DECC$* logical name method, nor
+ * requiring the user to define the corresponding logical names.
+ */
+
+#include <unixlib.h>
+
+/* Structure to hold a DECC$* feature name and its desired value. */
+typedef struct {
+  char *name;
+  int value;
+} decc_feat_t;
+
+/* Array of DECC$* feature names and their desired values. */
+static decc_feat_t decc_feat_array[] = {
+  /* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */
+  { "DECC$ARGV_PARSE_STYLE", 1 },
+  /* Preserve case for file names on ODS5 disks. */
+  { "DECC$EFS_CASE_PRESERVE", 1 },
+  /* Enable multiple dots (and most characters) in ODS5 file names,
+     while preserving VMS-ness of ";version". */
+  { "DECC$EFS_CHARSET", 1 },
+  /* List terminator. */
+  { (char *)NULL, 0 }
+};
+
+/* Flag to sense if decc_init() was called. */
+static int decc_init_done = -1;
+
+/* LIB$INITIALIZE initialization function. */
+static void decc_init(void)
+{
+  int feat_index;
+  int feat_value;
+  int feat_value_max;
+  int feat_value_min;
+  int i;
+  int sts;
+
+  /* Set the global flag to indicate that LIB$INITIALIZE worked. */
+  decc_init_done = 1;
+
+  /* Loop through all items in the decc_feat_array[]. */
+  for(i = 0; decc_feat_array[i].name != NULL; i++) {
+
+    /* Get the feature index. */
+    feat_index = decc$feature_get_index( decc_feat_array[i].name);
+
+    if(feat_index >= 0) {
+      /* Valid item.  Collect its properties. */
+      feat_value = decc$feature_get_value( feat_index, 1);
+      feat_value_min = decc$feature_get_value( feat_index, 2);
+      feat_value_max = decc$feature_get_value( feat_index, 3);
+
+      if((decc_feat_array[i].value >= feat_value_min) &&
+         (decc_feat_array[i].value <= feat_value_max)) {
+        /* Valid value.  Set it if necessary. */
+        if(feat_value != decc_feat_array[i].value) {
+          sts = decc$feature_set_value( feat_index, 1,
+                                        decc_feat_array[i].value);
+        }
+      }
+      else {
+        /* Invalid DECC feature value. */
+        printf(" INVALID DECC FEATURE VALUE, %d: %d <= %s <= %d.\n",
+               feat_value,
+               feat_value_min, decc_feat_array[i].name, feat_value_max);
+      }
+    }
+    else {
+      /* Invalid DECC feature name. */
+      printf(" UNKNOWN DECC FEATURE: %s.\n", decc_feat_array[i].name);
+    }
+
+  }
+}
+
+/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */
+
+#pragma nostandard
+
+/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and
+   other attributes.  Note that "nopic" is significant only on VAX. */
+#pragma extern_model save
+#pragma extern_model strict_refdef "LIB$INITIALIZ" 2, nopic, nowrt
+const int spare[8] = {0};
+#pragma extern_model strict_refdef "LIB$INITIALIZE" 2, nopic, nowrt
+void (*const x_decc_init)() = decc_init;
+#pragma extern_model restore
+
+/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */
+#pragma extern_model save
+int LIB$INITIALIZE(void);
+#pragma extern_model strict_refdef
+int dmy_lib$initialize = (int) LIB$INITIALIZE;
+#pragma extern_model restore
+
+#pragma standard
+
+#endif /* __DECC && !__VAX && __CRTL_VER && __CRTL_VER >= 70301000 */
+
 #endif /* __VMS */