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

Revision 12350, 1.2 KB checked in by ghudson, 26 years ago (diff)
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
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 * $Id: set.c,v 1.6 1999-01-22 23:09:34 ghudson Exp $
13 *
14 */
15
16#ifndef lint
17static char rcsid_discuss_c[] =
18    "$Id: set.c,v 1.6 1999-01-22 23:09:34 ghudson Exp $";
19#endif /* lint */
20
21#include <stdio.h>
22#include <string.h>
23
24int set_seen();
25
26static struct set_req {
27     char *name;                                /* Name of request */
28     int (*routine)();                          /* Routine to call */
29} sr[] = {"seen", set_seen};
30
31#define NUM_SET_REQUESTS (sizeof (sr) / sizeof (struct set_req))
32
33set_cmd(argc, argv)
34     int argc;
35     char **argv;
36{
37     int code,i;
38
39     if (argc == 1)
40          goto usage;
41
42     for (i = 0; i < NUM_SET_REQUESTS; i++) {
43          if (!strcmp (argv[1], sr[i].name)) {
44               (*(sr[i].routine))(--argc,++argv);
45               return;
46          }
47     }
48
49     printf("Possible set requests are:\n");
50     for (i = 0; i < NUM_SET_REQUESTS; i++) {
51          printf("set %s\n", sr[i].name);
52     }
53
54     return;
55
56usage:
57     fprintf(stderr, "Usage:  %s <option>\n", argv[0]);
58}
Note: See TracBrowser for help on using the repository browser.