-/*
- * $Source$
- * $Author$
- * $Header$
+/* $Id$
+ *
+ * Do RPC
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
+ * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*
*/
-#ifndef lint
-static char *rcsid_mr_scall_c = "$Header$";
-#endif lint
-
#include <mit-copyright.h>
-#include <sys/types.h>
+#include "mr_server.h"
+#include "query.h"
+
#include <sys/stat.h>
-#include <sys/file.h>
-#include <fcntl.h>
-#include <string.h>
-#include <netinet/in.h>
+#include <sys/types.h>
+
#include <arpa/inet.h>
-#include <krb.h>
+#include <netinet/in.h>
+
#include <errno.h>
-#include "mr_server.h"
-#include "query.h"
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+RCSID("$Header$");
+
extern char buf1[];
extern int nclients;
extern char *whoami;
-extern int errno;
-extern void clist_delete(), do_auth(), do_shutdown();
-void do_call();
extern int dbms_errno, mr_errcode;
static int row_count;
+void do_call(client *cl);
+void free_rtn_tuples(client *cp);
+int retr_callback(int argc, char **argv, void *p_cp);
+int list_users(int (*callbk)(int, char **, void *), char *callarg);
+void do_retr(client *cl);
+void do_access(client *cl);
+void get_motd(client *cl);
+
/* Put this in a variable so that we can patch it if necessary */
int max_row_count = 4096;
return;
case MR_DO_UPDATE:
- trigger_dcm(0, 0, cl);
+ trigger_dcm(NULL, NULL, cl);
return;
case MR_MOTD:
}
}
-free_rtn_tuples(client *cp)
+void free_rtn_tuples(client *cp)
{
returned_tuples *temp;
for (temp = cp->first; temp && OP_DONE(temp->op); )
cp->first = temp;
}
-retr_callback(int argc, char **argv, char *p_cp)
+int retr_callback(int argc, char **argv, void *p_cp)
{
- client *cp = (client *)p_cp;
+ client *cp = p_cp;
mr_params *arg_tmp;
returned_tuples *tp;
OPERATION op_tmp;
if (row_count++ >= max_row_count)
{
dbms_errno = mr_errcode = MR_NO_MEM;
- return;
+ return MR_ABORT;
}
/*
* This takes too much advantage of the fact that
* serialization of the data happens during the queue operation.
*/
- arg_tmp = db_alloc(sizeof(mr_params));
- tp = db_alloc(sizeof(returned_tuples));
+ arg_tmp = malloc(sizeof(mr_params));
+ tp = malloc(sizeof(returned_tuples));
nargv = malloc(argc * sizeof(char *));
op_tmp = create_operation();
reset_operation(op_tmp);
initialize_operation(op_tmp, mr_start_send, (char *)arg_tmp, NULL);
queue_operation(cp->con, CON_OUTPUT, op_tmp);
+ return MR_CONT;
}
-int list_users(int (*callbk)(), char *callarg)
+int list_users(int (*callbk)(int, char **, void *), char *callarg)
{
char *argv[6];
char buf[30];
int i;
extern client **clients;
char *cp;
- char *ctime();
for (i = 0; i < nclients; i++)
{
return 0;
}
-do_retr(client *cl)
+void do_retr(client *cl)
{
char *queryname;
cl->reply.mr_status = mr_process_query(cl, queryname,
cl->args->mr_argc - 1,
cl->args->mr_argv + 1,
- retr_callback, (char *)cl);
+ retr_callback, cl);
}
if (row_count >= max_row_count)
{
com_err(whoami, 0, "Query complete.");
}
-do_access(client *cl)
+void do_access(client *cl)
{
if (cl->args->mr_argc < 1)
{
"tdcm",
};
-int trigger_dcm(int dummy0, int dummy1, client *cl)
+int trigger_dcm(struct query *q, char *argv[], client *cl)
{
int pid;
char prog[128];
}
-get_motd(client *cl)
+void get_motd(client *cl)
{
int motd, len;
char buffer[1024];