Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ranhash(3x) — 4D1 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)



     RANHASH(3X)                                           RANHASH(3X)



     NAME
          ranhashinit, ranhash, ranlookup - access routine for the
          symbol table definition file in archives

     SYNOPSIS
          #include <ar.h>

          int ranhashinit(pran, pstr, size)
          struct ranlib *pran;
          char *pstr;
          int size;

          ranhash(name)
          char *name;

          struct ranlib *ranhash(name)
          char *name;

     DESCRIPTION
          Ranhashinit initializes static information for future use by
          ranhash and ranlookup.  Pran points to an array of ranlib
          structures.  Pstr points to the corresponding ranlib string
          table (these are only used by ranlookup).  Size is the size
          of the hash table and should be a power of 2. If the size
          isn't a power of 2, a 1 is returned; otherwise, a 0 is
          returned.

          Ranhash returns a hash number given a name. It uses a
          multiplicative hashing algorithm and the size argument to
          ranhashinit.

          Ranlookup looks up name in the ranlib table specified by
          ranhashinit.  It uses the ranhash routine as a starting
          point. Then, it does a rehash from there.  This routine
          returns a pointer to a valid ranlib entry on a match. If no
          matches are found (the "emptiness" can be inferred if the
          ran_off field is zero), the empty ranlib structure hash
          table should be sparse.  This routine does not expect to run
          out of places to look in the table.  For example, if you
          collide on all entries in the table, an error is printed
          tostderr and a zero is returned.

     AUTHOR
          Mark I. Himelstein

     SEE ALSO
          ar(1).

     ORIGIN
          MIPS Computer Systems





     Page 1                                        (last mod. 8/20/87)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026