Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 8ff4378c69bfc83b3af48e387721134b1413d23a authored by takehidesoh on 01 May 2023, 02:14:54 UTC, committed by takehidesoh on 01 May 2023, 02:14:54 UTC
mod README.md
1 parent 339d44a
  • Files
  • Changes
  • f713c63
  • /
  • bdd_minisat_all-1.0.2
  • /
  • my_hash.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:8ff4378c69bfc83b3af48e387721134b1413d23a
directory badge
swh:1:dir:e4b48dfb354d10699e262001c0cd6416edb3f793
content badge
swh:1:cnt:015cce06a08884adfb5652f563b8e462b3bfdacd

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
my_hash.h
/** \file     my_hash.h
 *  \brief    A chained-hash table (without delete operation)
 *  \author   Takahisa Toda
 */
#ifndef MY_HASH_H
#define MY_HASH_H

#include <stdint.h>
#include <stdbool.h>

/*---------------------------------------------------------------------------*/
/* Type declarations                                                         */
/*---------------------------------------------------------------------------*/

/** \brief    Key-value pair */
struct ht_entry {
  uintptr_t         key; 
  uintptr_t         val;
  struct  ht_entry  *nx;
};

/** \brief    Hash table (chaining)*/
typedef struct {
  uintmax_t         bucket_count;   //!< the number of buckets
  uintmax_t         entry_count;    //!< the number of hash table entries
  struct ht_entry   **table;        //!< an array of buckets
} my_hash;


/*---------------------------------------------------------------------------*/
/* Function prototypes                                                       */
/*---------------------------------------------------------------------------*/

extern my_hash    *ht_create      (uintmax_t n);
extern void       ht_destroy      (my_hash *h);
extern void       ht_insert       (uintptr_t k, uintptr_t v, my_hash *h);
extern bool       ht_search       (uintptr_t k, uintptr_t *pv, const my_hash *h);
extern void       ht_enlarge      (my_hash *h);

/** \brief    Compute a load factor.
 *  \param    h     Pointer to a hash table
 *  \return   The computed load factor
 */
static inline double ht_loadfactor(const my_hash *h)
{
  return (double)h->entry_count/h->bucket_count;
}

#endif /*MY_HASH_H*/
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API