6 * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
7 * For copying and distribution information, please see the file
12 static char *rcsid_mr_access_c = "$Header$";
15 #include <mit-copyright.h>
16 #include "mr_private.h"
21 * Check access to a named query.
23 int mr_access(char *name, int argc, char **argv)
25 char **nargv = malloc(sizeof(char *) * (argc + 1));
29 memcpy(nargv + 1, argv, sizeof(char *) * argc);
30 status = mr_access_internal(argc + 1, nargv);
36 * Check access to a named query, where the query name is argv[0]
37 * and the arguments are the rest of argv[].
39 int mr_access_internal(int argc, char **argv)
43 mr_params *params = NULL;
44 mr_params *reply = NULL;
49 params->mr_version_no = sending_version_no;
50 params->mr_procno = MR_ACCESS;
51 params->mr_argc = argc;
52 params->mr_argl = NULL;
53 params->mr_argv = argv;
55 if ((status = mr_do_call(params, &reply)) == 0)
56 status = reply->mr_status;
58 mr_destroy_reply(reply);