source: trunk/athena/bin/discuss/libds/test.c @ 6956

Revision 6956, 1.0 KB checked in by probe, 31 years ago (diff)
Initial revision
Line 
1/*
2 *
3 * test ()  Test out the dsname routines.
4 *
5 */
6
7#include "../include/dsname.h"
8#include <ctype.h>
9#include <stdio.h>
10
11#define NULL 0
12
13main ()
14{
15     name_blk *nb,nblk;
16     char *host, *pathname;
17     int code;
18     int num,i;
19     
20     get_mtg_location ("borax.lcs.mit.edu:34343343/usr/srz/first", &host, &pathname, &code);
21     if (code != 0)
22          printf ("get_mtg_location failed, code = %d\n", code);
23     
24     expand_mtg_set ("LCS.MIT.EDU", "srz", "*", &nb, &num);
25     if (nb == NULL)
26          printf ("expand mtg set failed.\n");
27     else {
28          for (i = 0; i < num; i++, nb++) {
29               printf ("realm= %s, user= %s, unique= %s, attend= %d, last=%d\n",
30                       nb ->realm,nb->user,nb->unique_id,nb->date_attended,nb->last);
31          }
32     }
33
34     get_mtg_unique_id ("LCS.MIT.EDU", "srz", "discuss", &nblk, &code);
35     if (code != 0) {
36          printf ("get mtg unique_id failed\n");
37     } else {
38          printf ("realm= %s, user= %s, unique= %s, attend= %d, last=%d\n",
39                  nblk.realm,nblk.user,nblk.unique_id,nblk.date_attended,nblk.last);
40     }
41     return;
42}
43
Note: See TracBrowser for help on using the repository browser.