]> andersk Git - moira.git/blob - lib/mr_access.c
Initial revision
[moira.git] / lib / mr_access.c
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *
8  *      $Log$
9  *      Revision 1.1  1987-06-23 16:13:00  wesommer
10  *      Initial revision
11  *
12  */
13
14 #ifndef lint
15 static char *rcsid_sms_access_c = "$Header$";
16 #endif lint
17
18 #include "sms_private.h"
19
20 /*
21  * Check access to a named query.
22  */
23 int sms_access(name, argc, argv)
24     char *name;                 /* Query name */
25     int argc;                   /* Arg count */
26     char **argv;                /* Args */
27 {
28     register char **nargv = (char **)malloc(sizeof(char *) * (argc+1));
29     register int status = 0;
30     nargv[0] = name;
31     bcopy((char *)argv, (char *)(nargv+1), sizeof(char *) * argc);
32     status = sms_access_internal(argc+1, nargv);
33     free(nargv);
34     return status;
35 }
36 /*
37  * Check access to a named query, where the query name is argv[0]
38  * and the arguments are the rest of argv[].
39  */
40 int sms_access_internal(argc, argv)
41     int argc;                   /* Arg count */
42     char **argv;                /* Args */
43 {
44     int status;
45     sms_params params_st;
46     register sms_params *params = NULL;
47     sms_params *reply = NULL;
48     
49     CHECK_CONNECTED;
50
51     params = &params_st;
52     params->sms_procno = SMS_ACCESS;
53     params->sms_argc = argc;
54     params->sms_argl = NULL;
55     params->sms_argv = argv;
56         
57     if ((status = sms_do_call(params, &reply)))
58         status = reply->sms_status;
59
60     sms_destroy_reply(reply);
61
62     return status;
63 }
64
65 /*
66  * Local Variables:
67  * mode: c
68  * c-indent-level: 4
69  * c-continued-statement-offset: 4
70  * c-brace-offset: -4
71  * c-argdecl-indent: 4
72  * c-label-offset: -4
73  * End:
74  */
This page took 0.087914 seconds and 5 git commands to generate.