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

  • a3483c2
  • /
  • ntrulpr761
  • /
  • m4f
  • /
  • int32_sort.c.radix
Raw File Download
Permalinks

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.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:d96ebc8f879394479a9869ab45638dfeb788df97
directory badge Iframe embedding
swh:1:dir:5f3a51315c7e41718a82b21f7948f737326c1616
Citations

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.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
int32_sort.c.radix
#include "crypto_sort.h"
#include "uint16.h"
#include "uint32.h"
#include "int32.h"


/*
#include "crypto_int32.h"
#define int32 crypto_int32
#include "crypto_uint32.h"
#define uint32 crypto_uint32
#include "crypto_uint16.h"
#define uint16 crypto_uint16
*/

#define sortsmall_LIMIT 65535LL
/* assumes 2 <= n <= sortsmall_LIMIT */
static void sortsmall(int32 *x,uint16 n)
{
  int32 y[n];
  uint16 i,t0,t1,t2,t3,c0[256],c1[256],c2[256],c3[256];
#include "int32_radix.inc"
}

#define sortmedium_LIMIT 4294967295LL
/* assumes 2 <= n <= sortmedium_LIMIT */
static void sortmedium(int32 *x,uint32 n)
{
  int32 y[n];
  uint32 i,t0,t1,t2,t3,c0[256],c1[256],c2[256],c3[256];
#include "int32_radix.inc"
}

static void sortlarge(int32 *x,long long n)
{
  int32 y[n];
  long long i,t0,t1,t2,t3,c0[256],c1[256],c2[256],c3[256];
#include "int32_radix.inc"
}

void crypto_sort(void *array,long long n)
{
  if (n > sortmedium_LIMIT)
    sortlarge(array,n);
  else if (n > sortsmall_LIMIT)
    sortmedium(array,n);
  else if (n > 1)
    //sortsmall(array,n);
    sortmedium(array,n);
}

Software Heritage — Copyright (C) 2015–2025, 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— Contact— JavaScript license information— Web API

back to top