]> andersk Git - moira.git/commitdiff
mr_version()
authordanw <danw>
Thu, 30 Dec 1999 17:29:24 +0000 (17:29 +0000)
committerdanw <danw>
Thu, 30 Dec 1999 17:29:24 +0000 (17:29 +0000)
lib/mr_ops.c

index 1d7f6c41ea3e0d3383b027c9f17d0f23190a45e1..50d2194cda2c85b49189e083cd670718a95a5086 100644 (file)
@@ -14,6 +14,7 @@
 #include "mr_private.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -86,3 +87,35 @@ punt:
 
   return status;
 }
+
+/* Exchange query version info with the server. */
+
+int mr_version(int version)
+{
+  int status;
+  mr_params params, reply;
+  char vbuf[10], *arg;
+
+  CHECK_CONNECTED;
+
+  sprintf(vbuf, "%d", version);
+  arg = strdup(vbuf);
+  params.u.mr_procno = MR_SETVERSION;
+  params.mr_argc = 1;
+  params.mr_argl = NULL;
+  params.mr_argv = &arg;
+
+  status = mr_do_call(&params, &reply);
+  free(arg);
+
+  if (status == MR_SUCCESS)
+    {
+      status = reply.u.mr_status;
+
+      if (status == MR_VERSION_LOW && getenv("MOIRA_LOW_VERSION_WARNING"))
+       fprintf(stderr, "Warning: This client is out of date.\n");
+    }
+  mr_destroy_reply(reply);
+
+  return status;
+}
This page took 0.038785 seconds and 5 git commands to generate.