]> andersk Git - moira.git/blobdiff - lib/mr_ops.c
Diane Delgado's changes for a fixed table-locking order
[moira.git] / lib / mr_ops.c
index f5ef57957bba92591dfe86971c1e810625170633..25ea85970abd7c7d1f292c2695ad8dabf9d367b7 100644 (file)
@@ -3,13 +3,14 @@
  *     $Author$
  *     $Header$
  *
- *     Copyright (C) 1987, 1989 by the Massachusetts Institute of Technology
+ *     Copyright (C) 1987, 1989, 1990 by the Massachusetts Institute of
+ *     Technology
  *     For copying and distribution information, please see the file
  *     <mit-copyright.h>.
  *     
  *     This routine is part of the client library.  It handles
  *     the protocol operations: invoking an update and getting the
- *     SMS message of the day.
+ *     MR message of the day.
  */
 
 #ifndef lint
@@ -17,83 +18,84 @@ static char *rcsid_sms_do_update_c = "$Header$";
 #endif lint
 
 #include <mit-copyright.h>
-#include "sms_private.h"
+#include <string.h>
+#include "mr_private.h"
 
 
 /* Invoke a DCM update. */
 
-int sms_do_update()
+int mr_do_update()
 {
     int status;
-    sms_params param_st;
-    struct sms_params *params = NULL;
-    struct sms_params *reply = NULL;
+    mr_params param_st;
+    struct mr_params *params = NULL;
+    struct mr_params *reply = NULL;
 
     CHECK_CONNECTED;
     params = &param_st;
-    params->sms_version_no = sending_version_no;
-    params->sms_procno = SMS_DO_UPDATE;
-    params->sms_argc = 0;
-    params->sms_argl = NULL;
-    params->sms_argv = NULL;
+    params->mr_version_no = sending_version_no;
+    params->mr_procno = MR_DO_UPDATE;
+    params->mr_argc = 0;
+    params->mr_argl = NULL;
+    params->mr_argv = NULL;
        
-    if ((status = sms_do_call(params, &reply)) == 0)
-       status = reply->sms_status;
+    if ((status = mr_do_call(params, &reply)) == 0)
+       status = reply->mr_status;
        
-    sms_destroy_reply(reply);
+    mr_destroy_reply(reply);
 
     return status;
 }
 
 
-/* Get the SMS motd.  This returns an SMS status, and motd will either
+/* Get the MR motd.  This returns an MR status, and motd will either
  * point to NULL or the motd in a static buffer.
  */
 
-int sms_motd(motd)
+int mr_motd(motd)
 char **motd;
 {
     int status;
-    sms_params param_st;
-    struct sms_params *params = NULL;
-    struct sms_params *reply = NULL;
+    mr_params param_st;
+    struct mr_params *params = NULL;
+    struct mr_params *reply = NULL;
     static char buffer[1024];
 
     *motd = NULL;
     CHECK_CONNECTED;
     params = &param_st;
-    params->sms_version_no = sending_version_no;
-    params->sms_procno = SMS_MOTD;
-    params->sms_argc = 0;
-    params->sms_argl = NULL;
-    params->sms_argv = NULL;
+    params->mr_version_no = sending_version_no;
+    params->mr_procno = MR_MOTD;
+    params->mr_argc = 0;
+    params->mr_argl = NULL;
+    params->mr_argv = NULL;
        
-    if ((status = sms_do_call(params, &reply)))
+    if ((status = mr_do_call(params, &reply)))
       goto punt;
 
-    while ((status = reply->sms_status) == SMS_MORE_DATA) {
-       if (reply->sms_argc > 0) {
-           strncpy(buffer, reply->sms_argv[0], sizeof(buffer));
+    while ((status = reply->mr_status) == MR_MORE_DATA) {
+       if (reply->mr_argc > 0) {
+           strncpy(buffer, reply->mr_argv[0], sizeof(buffer));
            *motd = buffer;
        }
-       sms_destroy_reply(reply);
+       mr_destroy_reply(reply);
        reply = NULL;
 
-       initialize_operation(_sms_recv_op, sms_start_recv, &reply,
+       initialize_operation(_mr_recv_op, mr_start_recv, &reply,
                             (int (*)())NULL);
-       queue_operation(_sms_conn, CON_INPUT, _sms_recv_op);
+       queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
 
-       sms_complete_operation(_sms_recv_op);
-       if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) {
-           sms_disconnect();
-           status = SMS_ABORTED;
+       mr_complete_operation(_mr_recv_op);
+       if (OP_STATUS(_mr_recv_op) != OP_COMPLETE) {
+           mr_disconnect();
+           status = MR_ABORTED;
            return(status);
        }
     }  
  punt:
-    sms_destroy_reply(reply);
+    mr_destroy_reply(reply);
     /* for backwards compatability */
-    if (status == SMS_UNKNOWN_PROC)
+    if (status == MR_UNKNOWN_PROC)
       return(0);
     else
       return(status);
@@ -103,7 +105,7 @@ char **motd;
 /* Tell the library to take care of another input source while it is
  * processing a query.  For instance, an X toolkit application would
  * do something like
- *    sms_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput);
+ *    mr_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput);
  * where doxinput is defined as:
  *    doxinput() {
  *     extern Widget toplevel;
@@ -116,18 +118,18 @@ char **motd;
  *    }
  */
 
-static int sms_alternate_input = 0;
-static int (*sms_alternate_handler)();
+static int mr_alternate_input = 0;
+static int (*mr_alternate_handler)();
 
-int sms_set_alternate_input(fd, proc)
+int mr_set_alternate_input(fd, proc)
 int fd;
 int (*proc)();
 {
-    if (sms_alternate_input != 0)
-      return(SMS_ALREADY_CONNECTED);
-    sms_alternate_input = fd;
-    sms_alternate_handler = proc;
-    return(SMS_SUCCESS);
+    if (mr_alternate_input != 0)
+      return(MR_ALREADY_CONNECTED);
+    mr_alternate_input = fd;
+    mr_alternate_handler = proc;
+    return(MR_SUCCESS);
 }
 
 
@@ -135,7 +137,7 @@ int (*proc)();
  * handles alternate input streams (such as X) as well.
  */
 
-sms_complete_operation(op)
+mr_complete_operation(op)
 OPERATION op;
 {
     long infd, outfd, exfd;
@@ -143,17 +145,17 @@ OPERATION op;
  
     gdb_progress();            /* try for an immediate completion */
 
-    if (sms_alternate_input == 0)
+    if (mr_alternate_input == 0)
       return(complete_operation(op));
 
-    infd = (1<<sms_alternate_input);
+    infd = (1<<mr_alternate_input);
     outfd = exfd = 0;
 
     while(op->status != OP_COMPLETE && op->status != OP_CANCELLED) {
-       rc = con_select(sms_alternate_input, (fd_set *)&infd, (fd_set *)&outfd,
+       rc = con_select(mr_alternate_input, (fd_set *)&infd, (fd_set *)&outfd,
                          (fd_set *)&exfd, (struct timeval *)NULL);
-       if (rc > 0 && sms_alternate_handler) {
-           (*sms_alternate_handler)();
+       if (rc > 0 && mr_alternate_handler) {
+           (*mr_alternate_handler)();
        }
     }
     return(op->status);
This page took 0.046473 seconds and 4 git commands to generate.