home *** CD-ROM | disk | FTP | other *** search
- # include "BlobMgr.h"
-
-
- /*
- * Get the handle of the (i)th blob in the list. The first
- * blob is numbered 0.
- */
-
- pascal BlobHandle
- GetBlobHandle (BlobSetHandle bSet, short i)
- {
- BlobHandle b;
-
- for (b = FirstBlob (bSet); b != nil; b = NextBlob (b))
- {
- --i;
- if (i < 0) break; /* found it */
- }
- return (b);
- }
-
-
- /*
- * Get the index of the given blob in the list, given its handle.
- * The blob is assumed to be in the set. Returns a number from
- * 0 to BlobSetSize (bSet)-1.
- */
-
- pascal short
- GetBlobIndex (BlobSetHandle bSet, BlobHandle b)
- {
- BlobHandle b2;
- short i;
-
- i = 0;
- for (b2 = FirstBlob (bSet); b2 != nil; b2 = NextBlob (b2))
- {
- if (b == b2) break; /* found it */
- ++i;
- }
- return (i);
- }
-
-
- pascal short
- BlobSetSize (BlobSetHandle bSet)
- {
- BlobHandle b;
- short i;
-
- for (i = 0, b = FirstBlob (bSet); b != nil; b = NextBlob (b))
- {
- ++i;
- }
- return (i);
- }