]> andersk Git - moira.git/blobdiff - gen/hesiod.qc
declare index()
[moira.git] / gen / hesiod.qc
index c1b3fbbaf6e95616d1c2615bf68f2c9a8a41e629..57cae3c8def84bda2bc0bf5dbbb384d3ed0f2910 100644 (file)
@@ -53,6 +53,7 @@ char **argv;
     }
 
     IIseterr(ingerr);
+    initialize_sms_error_table ();
 
 ##  ingres sms
 ##  set lockmode session where level = table
@@ -250,7 +251,7 @@ do_groups()
 ##     retrieve (flag2 = int4(interval("min", tblstats.modtime - filetime)))
 ##         where tblstats.table = "list"
 ##     retrieve (flag3 = int4(interval("min", tblstats.modtime - filetime)))
-##         where tblstats.table = "members"
+##         where tblstats.table = "imembers"
        if (flag1 < 0 && flag2 < 0 && flag3 < 0) {
            fprintf(stderr, "Files gid.db, group.db and grplist.db do not need to be rebuilt.\n");
            return(0);
@@ -283,6 +284,7 @@ do_groups()
 
     /* retrieve simple groups */
 ##  range of l is list
+##  range of m is imembers
 ##  begin transaction
     /* get lock records */
 ##  retrieve (name = l.modtime) where l.list_id = 0
@@ -301,41 +303,6 @@ do_groups()
     fflush(iout);
     fflush(gout);
 
-    /* get special cases: lists that aren't groups themselves but are
-     * members of groups. */
-    sq = sq_create();
-##  range of m is members
-##  retrieve (name = list.#name, gid = list.#gid, lid = l.list_id)
-##     where l.active != 0 and list.active != 0 and m.member_type = "LIST" and
-##             m.member_id = l.list_id and m.list_id = list.list_id and
-##             list.group != 0 {
-       strtrim(name);
-       if (l = hash_lookup(groups, lid)) {
-           sprintf(buf, "%s:%s:%d", l, name, gid);
-           free(l);
-       } else {
-           sprintf(buf, "%s:%d", name, gid);
-       }
-       hash_store(groups, lid, strsave(buf));
-       sq_save_unique_data(sq, lid);
-##  }
-
-    while (sq_get_data(sq, &id)) {
-##     repeat retrieve (lid = l.list_id) where m.member_type = "LIST" and
-##             m.list_id = @id and m.member_id = l.list_id and l.active != 0 {
-           if (l = hash_lookup(groups, lid)) {
-               sprintf(buf, "%s:%s", l, hash_lookup(groups, id));
-               free(l);
-               l = strsave(buf);
-           } else {
-               l = hash_lookup(groups, id);
-           }
-           hash_store(groups, lid, l);
-           sq_save_unique_data(sq, lid);
-##     }
-    }
-    sq_destroy(sq);
-
     /* now do grplists */
     if (users == NULL) {
        users = create_hash(10000);
@@ -373,10 +340,6 @@ do_groups()
                    strcat(buf, ":");
              }
            strcat(buf, "\"\n");
-           /* Do duplicate detection here */
-           if (i > 1) {
-               remove_duplicate_groups(buf);
-           }
            if (i > 0)
                fputs(buf, lout);
        }
@@ -408,39 +371,6 @@ do_groups()
 ##}
 
 
-#define MAXGROUPS 256
-
-remove_duplicate_groups(p)
-register char *p;
-{
-    register char *pp;
-    char *index();
-    register int *mp;
-    int memory[MAXGROUPS], i, *mg = &memory[MAXGROUPS-1];
-
-    bzero(memory, MAXGROUPS * sizeof(int));
-    while (p = index(p, ':')) {
-       i = atoi(++p);
-       for (mp = memory; *mp && mp < mg; mp++)
-         if (*mp == i) {
-             if (p = index(p, ':'))
-               strcpy(pp, ++p);
-             else {
-                 strcpy(--pp, "\"\n");
-             }
-             p = pp;
-             break;
-         }
-       if (*mp == i)
-         continue;
-       *mp = i;
-       if (!(p = index(p, ':')))
-         return;
-       pp = ++p;
-    }
-}
-
-
 do_filsys()
 ##{
     FILE *out;
@@ -452,6 +382,7 @@ do_filsys()
 ##  char name[33], type[9], loc[81], access[2], mount[33], trans[257];
 ##  char *filetime, comments[65];
 ##  int flag1, flag2, flag3, flag4, id, fid;
+    char *index();
 
     sprintf(outf, "%s/filsys.db", HESIOD_DIR);
 
This page took 0.056089 seconds and 4 git commands to generate.