source: trunk/third/moira/lib/mr_access.c @ 24250

Revision 24250, 1.1 KB checked in by broder, 15 years ago (diff)
New Moira snapshot from subversion. Sorry for the large diff - looks like all of the keywords changed in the SVN import process.
Line 
1/* $Id: mr_access.c,v 1.14 1998-02-15 17:49:00 danw Exp $
2 *
3 * Check access to a Moira query
4 *
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
6 * For copying and distribution information, please see the file
7 * <mit-copyright.h>.
8 */
9
10#include <mit-copyright.h>
11#include <moira.h>
12#include "mr_private.h"
13
14#include <errno.h>
15#include <stdlib.h>
16#include <string.h>
17
18RCSID("$Header: /afs/.athena.mit.edu/astaff/project/moiradev/repository/moira/lib/mr_access.c,v 1.14 1998-02-15 17:49:00 danw Exp $");
19
20/*
21 * Check access to a named query.
22 */
23int mr_access(char *name, int argc, char **argv)
24{
25  mr_params params, reply;
26  int status;
27
28  CHECK_CONNECTED;
29
30  params.u.mr_procno = MR_ACCESS;
31  params.mr_argc = argc + 1;
32  params.mr_argv = malloc(sizeof(char *) * (argc + 1));
33  if (!params.mr_argv)
34    return ENOMEM;
35  params.mr_argv[0] = name;
36  memcpy(params.mr_argv + 1, argv, sizeof(char *) * argc);
37  params.mr_argl = NULL;
38
39  if ((status = mr_do_call(&params, &reply)) == MR_SUCCESS)
40    status = reply.u.mr_status;
41
42  mr_destroy_reply(reply);
43  free(params.mr_argv);
44
45  return status;
46}
Note: See TracBrowser for help on using the repository browser.