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_sms_access_c = "$Header$";
15 #include <mit-copyright.h>
16 #include "mr_private.h"
21 * Check access to a named query.
23 int mr_access(name, argc, argv)
24 char *name; /* Query name */
25 int argc; /* Arg count */
26 char **argv; /* Args */
28 register char **nargv = (char **)malloc(sizeof(char *) * (argc+1));
29 register int status = 0;
31 memcpy((char *)(nargv+1), (char *)argv, sizeof(char *) * argc);
32 status = mr_access_internal(argc+1, nargv);
37 * Check access to a named query, where the query name is argv[0]
38 * and the arguments are the rest of argv[].
40 int mr_access_internal(argc, argv)
41 int argc; /* Arg count */
42 char **argv; /* Args */
46 register mr_params *params = NULL;
47 mr_params *reply = NULL;
52 params->mr_version_no = sending_version_no;
53 params->mr_procno = MR_ACCESS;
54 params->mr_argc = argc;
55 params->mr_argl = NULL;
56 params->mr_argv = argv;
58 if ((status = mr_do_call(params, &reply)) == 0)
59 status = reply->mr_status;
61 mr_destroy_reply(reply);