]> andersk Git - moira.git/blob - db/class.qc
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / db / class.qc
1 /* $Header$
2  *
3  *  Counts how many member of each class exist in the database.
4  *
5  *  (c) Copyright 1988 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
13
14 main()
15 {
16 ##  char class[9], *c;
17 ##  int n;
18     struct save_queue *sq, *sq_create();
19
20     sq = sq_create();
21
22 ##  ingres sms
23
24 ##  range of u is users
25 ##  retrieve unique (class = trim(u.mit_year)) {
26         sq_save_data(sq, strsave(class));
27 ##  }
28
29     while (sq_get_data(sq, &c)) {
30 ##      repeat retrieve (n = count(u.login where u.mit_year = @c))
31         printf("%8s: %4d\n", c, n);
32     }
33
34 ##  exit
35 }
This page took 0.275682 seconds and 5 git commands to generate.