home *** CD-ROM | disk | FTP | other *** search
- /*
- * lemgroup.c - object group maintenance
- *
- * copyright (c) by Alan W. Paeth, 1987. All rights reserved.
- */
-
- #include "lem.h"
-
- addgroup()
- {
- int i, g;
- g = uniquegroup();
- forobjects
- {
- if (Osel) Ogroup = g;
- }
- }
-
- removegroup()
- {
- int i;
- forobjects
- {
- if (Ogroup) Ogroup = 0;
- }
- }
-
- uniquegroup()
- {
- int i, groups[256];
- for(i=0; i<256; i++) groups[i] = 0;
- for(i=1; i<lastobj; i++) groups[Ogroup]++;
- for(i=1; i<256; i++)
- {
- if (groups[i] == 0) break;
- }
- return(groups[i] == 0 ? i : 0);
- }
-