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 e6a0334445b5755bb52a0d2209120ee4e251e7b4 authored by Joao Sollari Lopes on 13 November 2017, 18:32:56 UTC, committed by Joao Sollari Lopes on 13 November 2017, 18:32:56 UTC
First commit
0 parent
  • Files
  • Changes
  • af1b4d8
  • /
  • src
  • /
  • turnit.c
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:e6a0334445b5755bb52a0d2209120ee4e251e7b4
directory badge
swh:1:dir:a574a6b710136758a352d12c14eaa4a6f2cefb24
content badge
swh:1:cnt:5f313ebba4fd4565f99d3f726c969fb41b8c85a9

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
turnit.c
/*
	@author:	joao lopes
	@workplace: Reading University
	@date: 1th May 2009

	NBB - based on Mark’s turnit
	
	@update: - the INTFILE is used are on the same folder as turnit.exe
*/

#include "turnit.h"

/*
	Rewrite the random numbers table

	@arg - number of iterations to run
*/
int main(int argc, char *argv[])
{
	int iter,i,		//iterator
		cut,		//auxiliar to help on get the path from where turnit.exe is running
		niter,		//number of iterator
		homesize;	//size of the path from where the program is being run
	char *home;		//path where the program is being run

	//check error in arguments
	if(argc != 2)
		printerr("needs niter");
	for(iter=0 ; iter<strlen(argv[1]) ; iter++)
		if(!(isdigit(argv[1][iter])))
			printerr("argument is not a number");
	
	//get the path from where the progame is being run
	homesize = strlen(argv[0])+ 5;
	home = (char *)malloc(homesize*sizeof(char));
	strcpy(home,argv[0]);
	for(cut=-1,i=homesize-1 ; home[i]!='/' && home[i]!='\\' && i >= 0 ; cut++,i--)
	{
		home[i]='\0';
	}
	home = realloc(home,(homesize-cut)*sizeof(char));
	
	niter = atoi(argv[1]);

	//randomization
	printf("\n\n  start of randomization of INTFILE...\n");
	opengfsr(home);
	for(iter=0 ; iter < niter ; iter++)
	{
		intrand();
	}
	closegfsr(home);
	printf("\n  ...INTFILE randomized\n\n");
	
	//free stuff
	free(home);

} //end of main
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