source: trunk/athena/bin/discuss/client/set.c @ 1927

Revision 1927, 1.4 KB checked in by srz, 35 years ago (diff)
Added standard copyright notice.
Line 
1/*
2 *
3 *      Copyright (C) 1989 by the Massachusetts Institute of Technology
4 *      Developed by the MIT Student Information Processing Board (SIPB).
5 *      For copying information, see the file mit-copyright.h in this release.
6 *
7 */
8/*
9 *
10 * set request for Discuss
11 *
12 * $Header: /afs/dev.mit.edu/source/repository/athena/bin/discuss/client/set.c,v 1.5 1989-06-02 23:38:47 srz Exp $
13 * $Source: /afs/dev.mit.edu/source/repository/athena/bin/discuss/client/set.c,v $
14 * $Locker:  $
15 *
16 */
17
18#ifndef lint
19static char rcsid_discuss_c[] =
20    "$Header: /afs/dev.mit.edu/source/repository/athena/bin/discuss/client/set.c,v 1.5 1989-06-02 23:38:47 srz Exp $";
21#endif /* lint */
22
23#include <stdio.h>
24#include <string.h>
25
26int set_seen();
27
28static struct set_req {
29     char *name;                                /* Name of request */
30     int (*routine)();                          /* Routine to call */
31} sr[] = {"seen", set_seen};
32
33#define NUM_SET_REQUESTS (sizeof (sr) / sizeof (struct set_req))
34
35set_cmd(argc, argv)
36     int argc;
37     char **argv;
38{
39     int code,i;
40
41     if (argc == 1)
42          goto usage;
43
44     for (i = 0; i < NUM_SET_REQUESTS; i++) {
45          if (!strcmp (argv[1], sr[i].name)) {
46               (*(sr[i].routine))(--argc,++argv);
47               return;
48          }
49     }
50
51     printf("Possible set requests are:\n");
52     for (i = 0; i < NUM_SET_REQUESTS; i++) {
53          printf("set %s\n", sr[i].name);
54     }
55
56     return;
57
58usage:
59     fprintf(stderr, "Usage:  %s <option>\n", argv[0]);
60}
Note: See TracBrowser for help on using the repository browser.