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